Skip to content

Commit

Permalink
Fixing replace tinkerbell action images with registry endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
pokearu authored and eks-distro-pr-bot committed Mar 22, 2024
1 parent 962e68c commit 6054d52
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions pkg/providers/tinkerbell/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,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 {
Expand Down Expand Up @@ -558,8 +560,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 {
Expand Down Expand Up @@ -629,6 +633,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
}
Expand Down

0 comments on commit 6054d52

Please sign in to comment.