diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml index 3a947623e6666..ef59c9b822ddf 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml @@ -427,17 +427,35 @@ objects: terraform apply -auto-approve -var 'bootstrap_complete=true' -no-color & wait "$!" + function approve_csrs() { + while true; do + if [[ ! -f /tmp/install-complete ]]; then + oc get csr -ojson | jq -r '.items[] | select(.status == {} ) | .metadata.name' | xargs --no-run-if-empty oc adm certificate approve + sleep 15 & wait + continue + else + break + fi + done + } + + function update_image_registry() { + while true; do + sleep 10; + oc get configs.imageregistry.operator.openshift.io/cluster > /dev/null && break + done + oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"storage":{"emptyDir":{}}}}' + } + echo "Approving pending CSRs" export KUBECONFIG=/tmp/artifacts/installer/auth/kubeconfig - oc get csr -ojson | jq -r '.items[] | select(.status == {} ) | .metadata.name' | xargs oc adm certificate approve - - echo "Set registry storage to emptyDir" - while true; do oc get configs.imageregistry.operator.openshift.io/cluster && break; done - oc patch configs.imageregistry.operator.openshift.io cluster --type merge --patch '{"spec":{"storage":{"emptyDir":{}}}}' + approve_csrs & + update_image_registry & echo "Completing UPI setup" openshift-install --dir=/tmp/artifacts/installer wait-for install-complete & wait "$!" + touch /tmp/install-complete # Performs cleanup of all created resources - name: teardown