@@ -91,7 +91,8 @@ function install_catalogsource {
91
91
# updating machine config pools takes a while.
92
92
create_image_content_source_policy " $index_image " " $registry_redhat_io " " $registry_quay " " $tmpfile "
93
93
[ -n " $OPENSHIFT_CI " ] && cat " $tmpfile "
94
- if oc apply -f " $tmpfile " ; then
94
+ # See: https://github.com/kubernetes/kubernetes/issues/52577#issuecomment-2516606002
95
+ if LANG=C oc apply -f " $tmpfile " | grep -v unchanged; then
95
96
echo " Wait for machineconfigpool update to start"
96
97
timeout 120 " [[ True != \$ (oc get machineconfigpool --no-headers=true '-o=custom-columns=UPDATING:.status.conditions[?(@.type==\" Updating\" )].status' | uniq) ]]"
97
98
echo " Wait until all machineconfigpools are updated"
115
116
# Ensure the Index pod is created with the right pull secret. The Pod's service account needs
116
117
# to be linked with the right pull secret before creating the Pod. This is to prevent race conditions.
117
118
timeout 120 " [[ \$ (oc -n $OLM_NAMESPACE get pods -l olm.catalogSource=serverless-operator --no-headers | wc -l) != 1 ]]"
118
- index_pod=$( oc -n " $OLM_NAMESPACE " get pods -l olm.catalogSource=serverless-operator -oname)
119
- if ! oc -n " $OLM_NAMESPACE " get " $index_pod " -ojsonpath=' {.spec.imagePullSecrets}' | grep dockercfg & > /dev/null; then
119
+
120
+ # check if pull secrets are present, see: https://unix.stackexchange.com/a/388462
121
+ # shellcheck disable=SC2266
122
+ if oc -n " $OLM_NAMESPACE " get pod -l olm.catalogSource=serverless-operator -ojsonpath=' {.items[].spec.imagePullSecrets}' | [ ! -t 0 ]; then
123
+ # wait until they have dockercfg one
120
124
timeout 120 " [[ \$ (oc -n $OLM_NAMESPACE get sa serverless-operator -ojsonpath='{.imagePullSecrets}' | grep -c dockercfg) == 0 ]]"
121
125
oc -n " $OLM_NAMESPACE " delete pods -l olm.catalogSource=serverless-operator
122
126
fi
0 commit comments