Skip to content

Commit

Permalink
Pass CLUSTER_PROFILE env var to CVO render
Browse files Browse the repository at this point in the history
Signed-off-by: Ravid Brown <ravid@redhat.com>
  • Loading branch information
Ravid Brown committed Dec 2, 2020
1 parent 4d10fe6 commit 2be57b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions data/data/bootstrap/files/usr/local/bin/bootkube.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ MDNS_PUBLISHER_IMAGE=$(image_for mdns-publisher)
HAPROXY_IMAGE=$(image_for haproxy-router)
BAREMETAL_RUNTIMECFG_IMAGE=$(image_for baremetal-runtimecfg)


mkdir --parents ./{bootstrap-manifests,manifests}

if [ ! -f openshift-manifests.done ]
Expand All @@ -55,6 +56,7 @@ then

bootkube_podman_run \
--volume "$PWD:/assets:z" \
--env CLUSTER_PROFILE="{{.ClusterProfile}}" \
"${RELEASE_IMAGE_DIGEST}" \
render \
--output-dir=/assets/cvo-bootstrap \
Expand Down
9 changes: 9 additions & 0 deletions pkg/asset/ignition/bootstrap/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ type bootstrapTemplateData struct {
EtcdCluster string
PullSecret string
ReleaseImage string
ClusterProfile string
Proxy *configv1.ProxyStatus
Registries []sysregistriesv2.Registry
BootImage string
Expand Down Expand Up @@ -259,6 +260,13 @@ func (a *Bootstrap) getTemplateData(installConfig *types.InstallConfig, releaseI
platformData.VSphere = vsphere.GetTemplateData(installConfig.Platform.VSphere)
}

// Set cluster profile
clusterProfile := "self-managed-high-availability"
if cp, ok := os.LookupEnv("OPENSHIFT_INSTALL_CLUSTER_PROFILE_OVERRIDE"); ok && cp != "" {
logrus.Warn("Found override for Cluster Profile. Please be warned,")
clusterProfile = cp
}

return &bootstrapTemplateData{
AdditionalTrustBundle: installConfig.AdditionalTrustBundle,
FIPS: installConfig.FIPS,
Expand All @@ -269,6 +277,7 @@ func (a *Bootstrap) getTemplateData(installConfig *types.InstallConfig, releaseI
Registries: registries,
BootImage: string(*rhcosImage),
PlatformData: platformData,
ClusterProfile: clusterProfile,
}, nil
}

Expand Down

0 comments on commit 2be57b9

Please sign in to comment.