Skip to content

Commit ec5bedc

Browse files
committed
add container registry check and patch for OCPv
1 parent 6492436 commit ec5bedc

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

9.0.x/pipeline.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,27 @@ spec:
163163
# get and echo the pipeline the mas installer created
164164
oc patch configmap/pipeline-output -p '{"data":{"Status":"Deployment Pipeline completed to install mas core."}}'
165165
tasks:
166+
- name: check-container-registry
167+
taskSpec:
168+
steps:
169+
- name: check-registry
170+
image: quay.io/openshift/origin-cli:4.10
171+
script: |
172+
#!/usr/bin/env bash
173+
174+
# Get the status of the ImageRegistry resource
175+
status=$(oc get config cluster -o jsonpath='{.items[0].status.conditions[?(@.type=="Available")].Reason}')
176+
177+
if [[ "$status" == "Ready" ]]; then
178+
echo "OpenShift Container Registry is ready"
179+
exit 0
180+
else
181+
echo "OpenShift Container Registry is not ready. Reason: $status"
182+
oc patch config.imageregistry.operator.openshift.io/cluster --type=merge -p '{"spec":{"storage":{"emptyDir":{}}}}'
183+
oc patch config.imageregistry.operator.openshift.io/cluster --type=merge -p '{"spec":{"managementState":"Managed"}}'
184+
fi
185+
186+
exit 0
166187
- name: get-ibm-entitlement-key
167188
when:
168189
- input: "$(params.ibm-entitlement-key)"
@@ -316,6 +337,7 @@ spec:
316337
timeout: "12h"
317338
runAfter:
318339
- get-tls-certs
340+
- check-container-registry
319341
workspaces:
320342
- name: ws
321343
params:

0 commit comments

Comments
 (0)