-
Notifications
You must be signed in to change notification settings - Fork 474
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
Revert common cfgmap func and protect against failure #6791
base: master
Are you sure you want to change the base?
Conversation
This reverts the callers of IstioConfigMapName back to using `cfg.external_services.istio.config_map_name` directly. It now logs failures in GetMesh to auto-detect the configmap instead of returning an error. Nothing is currently using that configuration so an error shouldn't be returned there. Related to: kiali#6669.
cc @yohanb if you want to take a look. Basically this change does 2 things:
Another option is to just rip out fetching the guessed configmap entirely. I kept it since it will be used for in progress future work for #6035 but really it doesn't need to be there until it is being used directly. |
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.
I say keep a common function unless there is a reason you think ripping it back out is better.
@@ -103,7 +103,7 @@ func (ics *IstioCertsService) getCertificateFromSecret(secretName, certName stri | |||
func (ics *IstioCertsService) getCertsConfigFromIstioConfigMap() ([]certConfig, error) { | |||
cfg := config.Get() | |||
|
|||
istioConfigMap, err := ics.k8s.GetConfigMap(cfg.IstioNamespace, IstioConfigMapName(*cfg, "")) | |||
istioConfigMap, err := ics.k8s.GetConfigMap(cfg.IstioNamespace, cfg.ExternalServices.Istio.ConfigMapName) |
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.
Why wouldn't we want to keep this common function here and in the common function just return cfg.ExternalServices.Istio.ConfigMapName
... in the future, if anything needs to change (like trying to get the name automagically) you only have to change this function and everywhere the name needs to be obtained will just work.
With this revert, if we ever have to change this, we need to go through all these places again and change it back to calling a common function.
I would leave the common function here - and for now just have it simply return config.Get().ExternalServices.Istio.ConfigMapName
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.
Why wouldn't we want to keep this common function here and in the common function just return cfg.ExternalServices.Istio.ConfigMapName... in the future, if anything needs to change (like trying to get the name automagically) you only have to change this function and everywhere the name needs to be obtained will just work.
In the future, I would expect callers to call GetMesh
to get the config info from there instead of fetching and unmarshaling the configmap every the config is needed.
removing the common function - just rely on the config name and hope we don't have to refactor this again :)
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.
i think the ci error is a flake, so approving in case you want this in for the release
This reverts the callers of
IstioConfigMapName
back to usingcfg.external_services.istio.config_map_name
directly. It now logs failures inGetMesh
to auto-detect the configmap instead of returning an error. Nothing is currently using that configuration so an error shouldn't be returned there. Related to: #6669.