Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,11 @@ spec:
cat > /tmp/clusterversion.json <<EOF
${CLUSTER_VERSION_JSON}
EOF
oc get ns openshift-config &> /dev/null || oc create ns openshift-config
oc get ns openshift-config-managed &> /dev/null || oc create ns openshift-config-managed
oc apply -f /var/payload/manifests/0000_00_cluster-version-operator_01_clusterversions*
oc apply -f /tmp/clusterversion.json
while true; do
echo 'Deciding whether bootstrap resources need to be applied...'
ls -l $(grep -rl 'include.release.openshift.io/bootstrap-cluster-version-operator: .*hypershift' /var/payload/manifests) /tmp/clusterversion.json
while test -z "$(oc get -o jsonpath='{.status.history[0].version}' clusterversions.config.openshift.io version)"; do
echo "Applying CVO bootstrap manifests..."
if oc apply -f /var/payload/manifests; then
if oc apply $(grep -rl 'include.release.openshift.io/bootstrap-cluster-version-operator: .*hypershift' /var/payload/manifests | sed 's/^/-f /') -f /tmp/clusterversion.json; then
echo "Bootstrap manifests applied successfully."
break
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,6 @@ func preparePayloadScript(platformType hyperv1.PlatformType, oauthEnabled bool,
fmt.Sprintf("cp -R /release-manifests %s/", payloadDir),
)

// NOTE: We would need to leverage part of the manifest.Include logic (https://github.com/openshift/library-go/blob/0064ad7bd060b9fd52f7840972c1d3e72186d0f0/pkg/manifest/manifest.go#L190-L196)
// to properly evaluate which CVO manifests to select based on featureset.
// We only have access to bash, so we must filter based on the feature-set annotation in the manifests manually.
// Any file that has a feature-set annotation must have a value that matches the current feature set else it is removed.
// Files that do not have a feature-set annotation are included unconditionally.
stmts = append(stmts, fmt.Sprintf(`for file in $(find %s/manifests/ -name "*.yaml"); do
IFS=',' read -ra feature_sets <<< "$(cat $file | grep "release.openshift.io/feature-set:" | awk '{print $2}')"
if [[ "${#feature_sets[@]}" -gt 0 ]] && ! [[ " ${feature_sets[*]} " =~ "%s" ]]; then
rm -vf $file
fi
done`, payloadDir, featureSet))

for _, manifest := range manifestsToOmit {
if platformType == hyperv1.IBMCloudPlatform || platformType == hyperv1.PowerVSPlatform {
if manifest == "0000_50_cluster-storage-operator_10_deployment-ibm-cloud-managed.yaml" || manifest == "0000_50_cluster-csi-snapshot-controller-operator_07_deployment-ibm-cloud-managed.yaml" {
Expand Down