Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OC login copy commands #48

Merged
merged 1 commit into from
Apr 20, 2023
Merged

Conversation

evidolob
Copy link
Contributor

Demo:

Screen.Recording.2023-04-18.at.10.39.21.mov

PR also fixes #46

Note: Copy* commands are shown only for OpenShift preset as MicroShift doesn’t provide necessary information

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
@evidolob evidolob requested a review from gbraad April 18, 2023 07:51
@cfergeau
Copy link

Fwiw, the ingress certificate error from oc should be fixed in https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/candidate-4.12/

I don't know if we should expose oc login in the UI, or oc config set-context, the latter seems more in line with what podman desktop is doing ( https://podman-desktop.io/docs/kubernetes/kind/creating-a-kind-cluster - « In the Podman Desktop tray, open the Kubernetes menu, you can set the context to your Kind cluster: kind-. » )

@@ -46,7 +47,7 @@ export async function activate(extensionContext: extensionApi.ExtensionContext):

if (crcVersion) {
status = 'installed';
connectToCrc();
await connectToCrc();
Copy link
Contributor

@gbraad gbraad Apr 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

import { commander } from './daemon-commander';
import { isWindows } from './util';

let occommand = 'oc';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might need these commandnames somewhere less too, but for now, just leave them.

commandManager.addCommand({
id: 'crc.copy.login.admin',
label: 'Copy OC login command (admin)',
isEnabled: status => status.CrcStatus === 'Running',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@gbraad
Copy link
Contributor

gbraad commented Apr 20, 2023

I don't know if we should expose oc login in the UI,

You would suggest not to have these clipboard options?

« In the Podman Desktop tray, open the Kubernetes menu, you can set the context to your Kind cluster: kind-. » )

That would be the better option...

... however, we also try to stay close to the current tray we are offering. When functionality is more rounded and complete, we could decide to drop these options, although a 'copy password' to clipboard might take the place for use in the console.

provider: extensionApi.Provider,
extensionContext: extensionApi.ExtensionContext,
): Promise<void> {
const status = () => crcStatus.getConnectionStatus();
const apiURL = 'https://api.crc.testing:6443';
const kubernetesProviderConnection: extensionApi.KubernetesProviderConnection = {
name: 'OpenShift',
name,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this now is recognized as 'OpenShift Local', right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@evidolob evidolob merged commit aa3b6c5 into crc-org:main Apr 20, 2023
@evidolob evidolob deleted the add-login-copy-cmd branch April 20, 2023 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Identifier of the connection for OpenShift Local
3 participants