-
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 image related bugs when enabling addons #15984
Conversation
/ok-to-test |
kvm2 driver with docker runtime
Times for minikube start: 51.6s 54.9s 56.9s 56.3s 54.2s Times for minikube ingress: 24.8s 29.8s 25.8s 28.8s 28.3s docker driver with docker runtime
Times for minikube start: 25.6s 26.2s 27.4s 25.8s 27.7s Times for minikube ingress: 22.6s 23.1s 23.1s 22.1s 21.1s docker driver with containerd runtime
Times for minikube (PR 15984) start: 22.8s 23.5s 23.0s 24.2s 24.1s Times for minikube ingress: 32.6s 31.6s 31.7s 32.6s 47.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. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: medyagh, 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 |
Bug 1
In
SelectAndPersistImages
we haveif viper.IsSet(config.AddonImages)
andif viper.IsSet(config.AddonRegistries)
. However, in cmd we haveviper.Set(config.AddonImages, images)
andviper.Set(config.AddonRegistries, registries)
soviper.IsSet
is always true and more advanced logic is being performed when not needed. To resolve this I wrapped theviper.Set
lines withif <var> != "" {
as it doesn't make sense to set the variable if it's empty.Bug 2
In
SelectAndPersistImages
if an addon image was passed via flag but the image isn't used in the addon we're enabling we would output the messageIgnoring unknown custom image {{.name}}
but we didn't strip it from the map, so it was actually getting saved to the cluster config even though we said we were ignoring it. Resolved this by removing the image from the map if we encounter this.Bug 3
Saved custom images were being ignored if a different image was being passed via flag. Example, image1 one is saved to the cluster config already, addon is enabled and image2 is passed a custom image via flag, image1 custom image will be ignored and and will use default image while image2 use the custom image as expected. This was resolved by replacing
images = overrideDefaults(addonDefaultImages, newImages)
withimages = overrideDefaults(images, newImages)
.Bug 4
Existing custom registries saved to the cluster config were getting stripped when a new custom registry was passed via flag while
SelectAndPersistImages
was returning the existing custom registry. Resolved this so now the existing custom registry is not being stripped and what's being returned fromSelectAndPersistImages
matches what is stored in the cluster config.Also added in-depth tests for
SelectAndPersistImages
.