diff --git a/pkg/providers/tinkerbell/template.go b/pkg/providers/tinkerbell/template.go index d829723d8f66..3a6c14309028 100644 --- a/pkg/providers/tinkerbell/template.go +++ b/pkg/providers/tinkerbell/template.go @@ -454,9 +454,11 @@ func buildTemplateMapCP( } // Replace public.ecr.aws endpoint with the endpoint given in the cluster config file - localRegistry := values["publicMirror"].(string) - cpTemplateOverride = strings.ReplaceAll(cpTemplateOverride, defaultRegistry, localRegistry) - etcdTemplateOverride = strings.ReplaceAll(etcdTemplateOverride, defaultRegistry, localRegistry) + localRegistry := values["coreEKSAMirror"].(string) + if localRegistry != "" { + cpTemplateOverride = strings.ReplaceAll(cpTemplateOverride, defaultRegistry, localRegistry) + etcdTemplateOverride = strings.ReplaceAll(etcdTemplateOverride, defaultRegistry, localRegistry) + } } if clusterSpec.Cluster.Spec.ProxyConfiguration != nil { @@ -553,8 +555,10 @@ func buildTemplateMapMD( } // Replace public.ecr.aws endpoint with the endpoint given in the cluster config file - localRegistry := values["publicMirror"].(string) - workerTemplateOverride = strings.ReplaceAll(workerTemplateOverride, defaultRegistry, localRegistry) + localRegistry := values["coreEKSAMirror"].(string) + if localRegistry != "" { + workerTemplateOverride = strings.ReplaceAll(workerTemplateOverride, defaultRegistry, localRegistry) + } } if clusterSpec.Cluster.Spec.ProxyConfiguration != nil { @@ -624,6 +628,8 @@ func populateRegistryMirrorValues(clusterSpec *cluster.Spec, values map[string]i values["mirrorBase"] = registryMirror.BaseRegistry values["insecureSkip"] = registryMirror.InsecureSkipVerify values["publicMirror"] = containerd.ToAPIEndpoint(registryMirror.CoreEKSAMirror()) + values["coreEKSAMirror"] = registryMirror.CoreEKSAMirror() + if len(registryMirror.CACertContent) > 0 { values["registryCACert"] = registryMirror.CACertContent }