add concise first line to comment block

pull/14690/head
Steven Powell 2022-08-10 16:35:38 -07:00
parent d130ed8e2b
commit 071193d21d
1 changed files with 1 additions and 1 deletions

View File

@ -902,11 +902,11 @@ func GenerateTemplateData(addon *Addon, cc *config.ClusterConfig, netInfo Networ
opts.Registries[name] = "" // Avoid nil access when rendering
}
// tl;dr If the user specified a custom image remove the default registry
// Without the line below, if you try to overwrite an image the default registry is still used in the templating
// Example - image name: MetricsScraper, default registry: docker.io, default image: kubernetesui/metrics-scraper
// Passed on addon enable: --images=MetricsScraper=k8s.gcr.io/echoserver:1.4
// Without this line the resulting image would be docker.io/k8s.gcr.io/echoserver:1.4
// Therefore, if the user specified a custom image remove the default registry
if _, ok := cc.CustomAddonImages[name]; ok {
opts.Registries[name] = ""
}