Skip to content

Commit 6dd53f9

Browse files
committed
Check for empty pull-secrets
1 parent 8cc0ad1 commit 6dd53f9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hack/lib/catalogsource.bash

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ EOF
116116
# to be linked with the right pull secret before creating the Pod. This is to prevent race conditions.
117117
timeout 120 "[[ \$(oc -n $OLM_NAMESPACE get pods -l olm.catalogSource=serverless-operator --no-headers | wc -l) != 1 ]]"
118118
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+
# shellcheck disable=SC2266
120+
if oc -n "$OLM_NAMESPACE" get "$index_pod" -ojsonpath='{.spec.imagePullSecrets}' | [ -t 0 ]; then
121+
# pull secrets are present, see: https://unix.stackexchange.com/a/388462
122+
# wait until they have dockercfg one
120123
timeout 120 "[[ \$(oc -n $OLM_NAMESPACE get sa serverless-operator -ojsonpath='{.imagePullSecrets}' | grep -c dockercfg) == 0 ]]"
121124
oc -n "$OLM_NAMESPACE" delete pods -l olm.catalogSource=serverless-operator
122125
fi

0 commit comments

Comments
 (0)