-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix minikube addons list
output for default addons
#15762
Conversation
Hi @shubhbapna. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
Can one of the admins verify this patch? |
Co-authored-by: Steven Powell <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @shubhbapna, this works great for the existing addons, however if we were to add a new addon that is enabled by default this still outputs the addon as enabled even if it isn't.
$ minikube start --install-addons=false
# remove storage-provisioner from config.json to simulate new default addon being added
$ sed -i.bak 's/"storage-provisioner": false,//g' ~/.minikube/profiles/minikube/config.json
# storage-provisoner listed as enabled when it isn't
$ minikube addons list
|-----------------------------|----------|--------------|--------------------------------|
| ADDON NAME | PROFILE | STATUS | MAINTAINER |
|-----------------------------|----------|--------------|--------------------------------|
| ambassador | minikube | disabled | 3rd party (Ambassador) |
| auto-pause | minikube | disabled | Google |
| cloud-spanner | minikube | disabled | Google |
| csi-hostpath-driver | minikube | disabled | Kubernetes |
| dashboard | minikube | disabled | Kubernetes |
| default-storageclass | minikube | disabled | Kubernetes |
| efk | minikube | disabled | 3rd party (Elastic) |
| freshpod | minikube | disabled | Google |
| gcp-auth | minikube | disabled | Google |
| gvisor | minikube | disabled | Google |
| headlamp | minikube | disabled | 3rd party (kinvolk.io) |
| helm-tiller | minikube | disabled | 3rd party (Helm) |
| inaccel | minikube | disabled | 3rd party (InAccel |
| | | | [[email protected]]) |
| ingress | minikube | disabled | Kubernetes |
| ingress-dns | minikube | disabled | Google |
| istio | minikube | disabled | 3rd party (Istio) |
| istio-provisioner | minikube | disabled | 3rd party (Istio) |
| kong | minikube | disabled | 3rd party (Kong HQ) |
| kubevirt | minikube | disabled | 3rd party (KubeVirt) |
| logviewer | minikube | disabled | 3rd party (unknown) |
| metallb | minikube | disabled | 3rd party (MetalLB) |
| metrics-server | minikube | disabled | Kubernetes |
| nvidia-driver-installer | minikube | disabled | Google |
| nvidia-gpu-device-plugin | minikube | disabled | 3rd party (Nvidia) |
| olm | minikube | disabled | 3rd party (Operator Framework) |
| pod-security-policy | minikube | disabled | 3rd party (unknown) |
| portainer | minikube | disabled | 3rd party (Portainer.io) |
| registry | minikube | disabled | Google |
| registry-aliases | minikube | disabled | 3rd party (unknown) |
| registry-creds | minikube | disabled | 3rd party (UPMC Enterprises) |
| storage-provisioner | minikube | enabled ✅ | Google |
| storage-provisioner-gluster | minikube | disabled | 3rd party (Gluster) |
| volumesnapshots | minikube | disabled | Kubernetes |
|-----------------------------|----------|--------------|--------------------------------|
The cause of this whole issue is that if the addon is not found in the config list that it defaults to outputting it's state as it's default state instead of false.
minikube/pkg/minikube/assets/addons.go
Lines 77 to 85 in c80c885
func (a *Addon) IsEnabled(cc *config.ClusterConfig) bool { | |
status, ok := cc.Addons[a.Name()] | |
if ok { | |
return status | |
} | |
// Return the default unconfigured state of the addon | |
return a.enabled | |
} |
@spowelljr sorry could you elaborate more on this case? (I haven't worked with addons before) IMO adding a new addon would have already happened before we start minikube. I tried the same set of commands in this order and the state of addons is still correctly shown
|
If users are starting minikube for the first time it's fine, but many minikube users have their clusters existing for extended periods of time. For example the user starts minikube with v1.26.0, they upgrade their minikube binary to v1.29.0, but because the cluster was created with v1.26.0 the cluster is missing the new addon added in v1.29.0. That's what the |
I see in that case I think we will have to persist the fact that minikube was started with |
@spowelljr I am persisting whether |
I don't think saving We can ignore my previous case of if a new default addon is added in the future as the chance of this is likely 0. But this will still display wrong if a user started their cluster with an older version of minikube with The cause of this problem is the use and implementation of the minikube/pkg/minikube/assets/addons.go Lines 77 to 85 in c80c885
This also stems from the Addon struct minikube/pkg/minikube/assets/addons.go Lines 37 to 49 in cde517c
The This takes us to the The fix should be changing the fallback for Lines 538 to 543 in cde517c
We rely on What I think we really need is a new function like Lines 538 to 543 in cde517c
Can we updated to use the new |
/ok-to-test |
kvm2 driver with docker runtime
Times for minikube start: 54.9s 54.0s 56.1s 51.2s 56.7s Times for minikube ingress: 25.2s 25.8s 25.2s 28.7s 24.7s docker driver with docker runtime
Times for minikube start: 27.6s 26.5s 25.8s 26.2s 29.2s Times for minikube ingress: 81.6s 20.1s 23.1s 21.1s 21.6s docker driver with containerd runtime
Times for minikube start: 21.5s 22.2s 21.6s 22.4s 23.2s Times for minikube (PR 15762) ingress: 79.6s 48.6s 31.6s 47.6s 31.6s |
These are the flake rates of all failed tests.
Too many tests failed - See test logs for more details. To see the flake rates of all tests by environment, click here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks for the PR!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: shubhbapna, spowelljr The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fixes #15710
The cause of the issue was in pkg/node/start.go where it only updated the config if there were any existing addons defined which was not the case when
install-addons
was set to false.It seems to working locally. Adding output here: