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 double revision in istio configmap name #6675
Conversation
@jmazzitelli please take a look at this when you get a chance |
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.
This code change makes sense. We need to make the call to this new IstioConfigMap name in all the places where we need the name.
These places: https://github.com/search?q=repo%3Akiali%2Fkiali+%2FGetConfigMap.*ExternalServices.Istio.ConfigMapName%2F&type=code
Here's the files that probably need to be changed in this PR:
$ grep -R 'GetConfig.*ExternalServices.Istio.ConfigMapName'
business/istio_certs.go: istioConfigMap, err := ics.k8s.GetConfigMap(cfg.IstioNamespace, cfg.ExternalServices.Istio.ConfigMapName)
business/istio_certs.go: istioConfigMap, err := ics.k8s.GetConfigMap(cfg.IstioNamespace, cfg.ExternalServices.Istio.ConfigMapName)
business/namespaces.go: if icm, err := in.kialiCache.GetConfigMap(in.conf.IstioNamespace, in.conf.ExternalServices.Istio.ConfigMapName); err == nil {
business/tls.go: istioConfig, err := kubeCache.GetConfigMap(cfg.IstioNamespace, cfg.ExternalServices.Istio.ConfigMapName)
business/istio_validations.go: istioConfig, err = kialiCache.GetConfigMap(cfg.IstioNamespace, cfg.ExternalServices.Istio.ConfigMapName)
business/istio_validations.go: istioConfig, err = userClient.GetConfigMap(cfg.IstioNamespace, cfg.ExternalServices.Istio.ConfigMapName)
business/mesh.go: istioConfig, err := in.kialiCache.GetConfigMap(in.conf.IstioNamespace, in.conf.ExternalServices.Istio.ConfigMapName)
Note that this PR directly addresses this issue too - so we can close this issue when this PR is merged.
@nrfox thanks for this PR! We just ran into this issue and traced it back to the same faulty code. |
Awesome, thanks so much 👍 |
@jmazzitelli it seemed like the e2e tests were failing because of the tracing flakes. I rebased with main to pickup the latest fix. I also added some additional test coverage to the area that was causing this error to be logged which was in gateway validations. |
if revLabel := istiod.Labels[IstioRevisionLabel]; revLabel != "default" && revLabel != "" { | ||
configMapName = configMapName + "-" + revLabel | ||
} | ||
configMapName := IstioConfigMapName(in.conf, controlPlane.Revision) |
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.
the thing I don't see explained anywhere here is why does this pass in the Revision but everywhere else it passes in empty string for revision. How does this work when sometimes you need the revision but other times that is not required to get the configmap?
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.
Because basically this is the only place that is handling there being multiple controlplanes. Everywhere else just assumes there's one. When set config.external_services.istio.config_map_name
, IstioConfigMapName
will always return what you've set there regardless of what revision you pass in. It's a bit of a hack to get around the fact that, right now we expect users to set this manually when using control plane revisions.
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.
this does the refactor so everywhere in the code gets the configmap name using the common function. I have a feeling our support for canary upgrades still isn't seamless but we can worry about that later.
Yes this change doesn't make the support for canary upgrades any better but it at least gets rid of the error log when you've set |
good to see this get merged, what's the ETA for new helm chart release? thanks for the hard work! |
probably removing the logic to append the revision all together would be a more cohesive solution. I think we can simply expect users to provide the correct values through |
I'm OK doing either suggestion. if Kiali users like @yohanb think it would be simpler and expected of users to set the correct value in the Kiali config, then let's do that. cc @nrfox |
That sounds good to me. The only place that is currently using the offending code from |
we need to backport this to the 1.73 branch. |
(cherry picked from commit edc574d)
Uses:
conf.ExternalServices.Istio.ConfigMapName
without adding the rev tag when it is set and not the defaultistio
.Fixes #6669