Skip to content

Commit

Permalink
Merge pull request openshift#1896 from openshift-cherrypick-robot/che…
Browse files Browse the repository at this point in the history
…rry-pick-1892-to-release-4.14

[release-4.14] [hack] Change imagePullPolicy for olm.sh
  • Loading branch information
openshift-ci[bot] committed Oct 13, 2023
2 parents 79aba8d + bd81305 commit 652db80
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions hack/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ run_WMCO() {
fi

transform_csv REPLACE_IMAGE $OPERATOR_IMAGE
transform_csv "imagePullPolicy: IfNotPresent" "imagePullPolicy: Always"

# Validate the operator bundle manifests
$OSDK bundle validate $MANIFEST_LOC
Expand Down Expand Up @@ -279,10 +280,10 @@ cleanup_WMCO() {

# Cleanup the operator and revert changes made to the csv
if ! OSDK_WMCO_management cleanup $OSDK; then
transform_csv $OPERATOR_IMAGE REPLACE_IMAGE
revert_csv
error-exit "operator cleanup failed"
fi
transform_csv $OPERATOR_IMAGE REPLACE_IMAGE
revert_csv

# Remove the declared namespace
oc delete ns $WMCO_DEPLOY_NAMESPACE
Expand All @@ -297,7 +298,13 @@ transform_csv() {
echo incorrect parameter count for replace_csv_value $#
return 1
fi
sed -i "s|"$1"|"$2"|g" $MANIFEST_LOC/manifests/windows-machine-config-operator.clusterserviceversion.yaml
sed -i "s|$1|$2|g" $MANIFEST_LOC/manifests/windows-machine-config-operator.clusterserviceversion.yaml
}

# Revert the CSV back to it's original form
revert_csv() {
transform_csv $OPERATOR_IMAGE REPLACE_IMAGE
transform_csv "imagePullPolicy: Always" "imagePullPolicy: IfNotPresent"
}

# creates the `windows-instances` ConfigMap
Expand Down

0 comments on commit 652db80

Please sign in to comment.