Skip to content

Commit 3492d05

Browse files
authored
Fix failing of kuttl test (#801)
Signed-off-by: Rizwana777 <[email protected]>
1 parent 4690e5b commit 3492d05

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

test/openshift/e2e/sequential/1-034_validate_custom_roles/06-revert-patch.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,19 @@ commands:
1010
else
1111
oc patch subscription/openshift-gitops-operator -n openshift-gitops-operator --type json --patch='[ { "op": "remove", "path": "/spec/config" } ]'
1212
fi
13-
- script: sleep 10
13+
- script: |
14+
# Loop to wait until SERVER_CLUSTER_ROLE is removed from the Argo CD server Deployment
15+
for i in {1..30}; do
16+
if oc get deployment openshift-gitops-argocd-server -n openshift-gitops -o jsonpath='{.spec.template.spec.containers[0].env}' | grep -q 'SERVER_CLUSTER_ROLE=custom-argocd-role'; then
17+
echo "Waiting for SERVER_CLUSTER_ROLE to be removed..."
18+
sleep 5
19+
else
20+
echo "SERVER_CLUSTER_ROLE has been removed."
21+
break
22+
fi
23+
done
24+
# If after the loop the variable is still set, fail the step
25+
if oc get deployment openshift-gitops-argocd-server -n openshift-gitops -o jsonpath='{.spec.template.spec.containers[0].env}' | grep -q 'SERVER_CLUSTER_ROLE=custom-argocd-role'; then
26+
echo "ERROR: SERVER_CLUSTER_ROLE was not removed after waiting."
27+
exit 1
28+
fi

0 commit comments

Comments
 (0)