Skip to content

Commit

Permalink
Fixing replace tinkerbell action images with registry endpoint (#7885)
Browse files Browse the repository at this point in the history
  • Loading branch information
pokearu authored Mar 22, 2024
1 parent 5f7b94d commit 12f8b6b
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 @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 12f8b6b

Please sign in to comment.