Skip to content

Commit

Permalink
Change imagePullPolicy for olm.sh
Browse files Browse the repository at this point in the history
Change the imagePullPolicy for "olm.sh run" to Always. This is needed to
ensure that the latest image is always pulled. Revert to IfNotPresent
on "olm.sh cleanup".
Remove the extra quotes from the sed command which was mangling the
strings.
  • Loading branch information
aravindhp authored and openshift-cherrypick-robot committed Oct 13, 2023
1 parent 79aba8d commit bd81305
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 bd81305

Please sign in to comment.