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

Incorrect Value for current profile. #16604

Closed
Shubham82 opened this issue May 31, 2023 · 28 comments
Closed

Incorrect Value for current profile. #16604

Shubham82 opened this issue May 31, 2023 · 28 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@Shubham82
Copy link

What Happened?

The Value for the Current profile is showing wrong under the Active column when running the command minikube profile list.

Please find the observation below:

Created 2 minikube profile i.e minikube and minikube2

First minikube profile:

$ minikube start
😄  minikube v1.30.1 on Ubuntu 20.04
✨  Automatically selected the docker driver. Other choices: virtualbox, ssh, none
📌  Using Docker driver with root privileges
👍  Starting control plane node minikube in cluster minikube
🚜  Pulling base image ...
💾  Downloading Kubernetes v1.26.3 preload ...
    > preloaded-images-k8s-v18-v1...:  397.02 MiB / 397.02 MiB  100.00% 4.89 Mi
🔥  Creating docker container (CPUs=2, Memory=7900MB) ...
🐳  Preparing Kubernetes v1.26.3 on Docker 23.0.2 ...
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
🔗  Configuring bridge CNI (Container Networking Interface) ...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🔎  Verifying Kubernetes components...
🌟  Enabled addons: default-storageclass, storage-provisioner
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

$ kubectl config current-context
minikube

$ minikube profile list
|----------|-----------|---------|--------------|------|---------|---------|-------|--------|
| Profile  | VM Driver | Runtime |      IP      | Port | Version | Status  | Nodes | Active |
|----------|-----------|---------|--------------|------|---------|---------|-------|--------|
| minikube | docker    | docker  | 192.168.49.2 | 8443 | v1.26.3 | Running |     1 | *      |
|----------|-----------|---------|--------------|------|---------|---------|-------|--------|

Second minikube profile:

$ minikube start -p minikube2
😄  [minikube2] minikube v1.30.1 on Ubuntu 20.04
✨  Automatically selected the docker driver. Other choices: virtualbox, ssh
📌  Using Docker driver with root privileges
👍  Starting control plane node minikube2 in cluster minikube2
🚜  Pulling base image ...
🔥  Creating docker container (CPUs=2, Memory=7900MB) ...
🐳  Preparing Kubernetes v1.26.3 on Docker 23.0.2 ...
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
🔗  Configuring bridge CNI (Container Networking Interface) ...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🔎  Verifying Kubernetes components...
🌟  Enabled addons: storage-provisioner, default-storageclass
🏄  Done! kubectl is now configured to use "minikube2" cluster and "default" namespace by default

$ kubectl config current-context
minikube2

$ minikube profile list
|-----------|-----------|---------|--------------|------|---------|---------|-------|--------|
|  Profile  | VM Driver | Runtime |      IP      | Port | Version | Status  | Nodes | Active |
|-----------|-----------|---------|--------------|------|---------|---------|-------|--------|
| minikube  | docker    | docker  | 192.168.49.2 | 8443 | v1.26.3 | Running |     1 | *      |
| minikube2 | docker    | docker  | 192.168.58.2 | 8443 | v1.26.3 | Running |     1 |        |
|-----------|-----------|---------|--------------|------|---------|---------|-------|--------|

As you see above the current profile is shown as minikube not minikube2 while the correct value for the current profile is minikube2 (see kubectl config command above).

Attach the log file

None.

Operating System

Ubuntu

Driver

Docker

@Shubham82
Copy link
Author

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label May 31, 2023
@Shubham82
Copy link
Author

Using Following minikube version:

$ minikube version
minikube version: v1.30.1
commit: 08896fd1dc362c097c925146c4a0d0dac715ace0

@Shubham82
Copy link
Author

cc @kubernetes/minikube-maintainers
PTAL!

@medyagh
Copy link
Member

medyagh commented Jun 5, 2023

here the Active means the active minikube profile, which means,
for example if you run "minikube stop" without a "-p" minikube will assume that profile, and has nothing to do with the active kube context ... Maybe one way to make this less confusing would be a new column for active kubecontext but that would be maybe too many columns !

@Shubham82
Copy link
Author

here the Active means the active minikube profile, which means,
for example if you run "minikube stop" without a "-p" minikube will assume that profile, and has nothing to do with the active kube context

Thanks @medyagh for the above information.

Maybe one way to make this less confusing would be a new column for active kubecontext but that would be maybe too many columns !

I agree with your above point, IMO we can Update the Column name for Active, instead of active we can use some meaningful name so that it will be useful to the users also we mention this thing somewhere in the docs, so the readers know about each column.

@Shubham82
Copy link
Author

Shubham82 commented Jun 6, 2023

I think We can also update the following comment:

// ClusterFlagValue returns the current cluster name based on flags

because here it is mentioned the current cluster name which means the current cluster is in use and causes confusion while understanding the code.

More Info:

ClusterFlagValue() function is used to get the profile name which is further used to get the value(*) for the Active column.

@Shubham82
Copy link
Author

@medyagh
WDYT?

@Shubham82
Copy link
Author

Hi, @medyagh
What do you think about the above workaround?

PTAL!

@Shubham82
Copy link
Author

@medyagh, Could you please take a look?

@Shubham82
Copy link
Author

cc @kubernetes/minikube-maintainers
anyone from the maintainers, could you please take a look?

@Shubham82
Copy link
Author

@medyagh, PTAL!

@Shubham82
Copy link
Author

cc @kubernetes/minikube-maintainers
Please take a look at this issue

@Shubham82
Copy link
Author

@kubernetes/minikube-maintainers and @medyagh
could you please give your thoughts, so that this issue will resolved?
Any help would be appreciated.

@Skalador
Copy link
Contributor

Skalador commented Dec 4, 2023

Hi folks,

here the Active means the active minikube profile, which means, for example if you run "minikube stop" without a "-p" minikube will assume that profile, and has nothing to do with the active kube context ... Maybe one way to make this less confusing would be a new column for active kubecontext but that would be maybe too many columns !

I was not aware about the fact that the minikube profile is different from the active kubecontext. That being said, I would like to highlight both information in the minikube profile list and I came up with this idea:

minikube profile list
|-----------|-----------|---------|--------------|------|---------|---------|-------|--------------------|
|  Profile  | VM Driver | Runtime |      IP      | Port | Version | Status  | Nodes | Active Kubecontext |
|-----------|-----------|---------|--------------|------|---------|---------|-------|--------------------|
| *minikube | docker    | docker  | 192.168.49.2 | 8443 | v1.28.4 | Running |     1 |                    |
| minikube2 | docker    | docker  | 192.168.58.2 | 8443 | v1.28.4 | Running |     1 | *                  |
|-----------|-----------|---------|--------------|------|---------|---------|-------|--------------------|

This would highlight the active profile in the Profile Column with * (this symbol can be changed, if needed). Additionally the active kubecontext could be seen in the last column.

The current implementation looks like this:

minikube profile list
|-----------|-----------|---------|--------------|------|---------|---------|-------|--------------------|
|  Profile  | VM Driver | Runtime |      IP      | Port | Version | Status  | Nodes | Active             |
|-----------|-----------|---------|--------------|------|---------|---------|-------|--------------------|
| minikube  | docker    | docker  | 192.168.49.2 | 8443 | v1.28.4 | Running |     1 |                    |
| minikube2 | docker    | docker  | 192.168.58.2 | 8443 | v1.28.4 | Running |     1 | *                  |
|-----------|-----------|---------|--------------|------|---------|---------|-------|--------------------|

I will open a PR following this comment. Please let me know, what you think about this idea @medyagh. If you are fine with it, I will update the test cases and the documentation.
PS: I am new to contributing to this project. I would love to finish this contribution on my own with some guidance if something would not work out as expected.

@medyagh
Copy link
Member

medyagh commented Dec 4, 2023

uld highlight the active profile in the Profile Column with * (this symbol can be
@Shubham82 sorry for the delay in the response

@Skalador I think that is a great idea ! I agree that we need to note both Active Profile and Active Context,
however we should do it in a way that the Previous users who rely on getting Active Profile dont be broken
(in the json format)
minikube profile list --output=json

@medyagh medyagh added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Dec 4, 2023
@coderrick
Copy link
Contributor

@Skalador Hi I've been looking into this as well. If you have time today or this week maybe we can connect and discuss the implementation?

@Skalador
Copy link
Contributor

Skalador commented Dec 5, 2023

Hi,

uld highlight the active profile in the Profile Column with * (this symbol can be
@Shubham82 sorry for the delay in the response

@Skalador I think that is a great idea ! I agree that we need to note both Active Profile and Active Context, however we should do it in a way that the Previous users who rely on getting Active Profile dont be broken (in the json format) minikube profile list --output=json

@medyagh thanks for supporting my proposal. I think I have not changed anything w.r.t the JSON data, as just the CLI output is changed. But I will confirm the changes with respect to the json data and possible impacts. I wanted to get your confirmation before digging deeper into this idea.

@Skalador Hi I've been looking into this as well. If you have time today or this week maybe we can connect and discuss the implementation?

@coderrick sure we can work together on this feature, as this is my first contribution to this project and I am sure it will help getting started. Is there some slack/discord channel or something similar for minikube?

@Skalador
Copy link
Contributor

Skalador commented Dec 5, 2023

Hi @medyagh again,

I have extended the type Profile which tracks the active kubecontext, consequently users which rely on the Active field can still use it. Additionally now they have access to an ActiveKubeContext field. The table representation is still as above. As I got more familiar with the codebase, I have closed #17723 and created #17735. I've included for you the detailed output in the #17735. Please let me know if more changes are needed to get this feature merged. Thanks again for your input regarding the JSON data!

@Shubham82
Copy link
Author

@Shubham82 sorry for the delay in the response
No problem @medyagh

@Shubham82
Copy link
Author

Thanks, @Skalador for taking this.
It is a long-awaited bug to resolve.

@Shubham82
Copy link
Author

/triage accepted

@k8s-ci-robot k8s-ci-robot added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Dec 11, 2023
@Shubham82
Copy link
Author

Fixed by the following PR: #17735

@Skalador
Copy link
Contributor

Thanks, @Skalador for taking this. It is a long-awaited bug to resolve.

You are welcome :)

@k8s-triage-robot
Copy link

This issue is labeled with priority/important-soon but has not been updated in over 90 days, and should be re-triaged.
Important-soon issues must be staffed and worked on either currently, or very soon, ideally in time for the next release.

You can:

  • Confirm that this issue is still relevant with /triage accepted (org members only)
  • Deprioritize it with /priority important-longterm or /priority backlog
  • Close this issue with /close

For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/

/remove-triage accepted

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Mar 22, 2024
@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Mar 22, 2024
@k8s-ci-robot
Copy link
Contributor

@Shubham82: Those labels are not set on the issue: priority/important-longterm

In response to this:

/remove-priority important-longterm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot removed the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Mar 27, 2024
@Shubham82
Copy link
Author

Shubham82 commented Mar 27, 2024

/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Mar 27, 2024
@Shubham82
Copy link
Author

/triage accepted

@k8s-ci-robot k8s-ci-robot added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Mar 27, 2024
@Shubham82
Copy link
Author

Closing this issue, as it is resolved by PR #17735

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

6 participants