Skip to content

Commit 1167d4e

Browse files
authored
fix(install-script): Wait until Kaniko Job is effectively active before proceeding (#2082)
1 parent 80b4e02 commit 1167d4e

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

.rhdh/scripts/install-rhdh-catalog-source.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,8 @@ metadata:
539539
spec:
540540
backoffLimit: 0
541541
ttlSecondsAfterFinished: 3600
542+
parallelism: 1
543+
completions: 1
542544
template:
543545
spec:
544546
containers:
@@ -574,6 +576,12 @@ spec:
574576
path: config.json
575577
EOF
576578

579+
# RHDHBUGS-2478: the job pod might not be scheduled right away after job creation
580+
if ! invoke_cluster_cli -n "${namespace}" wait "job/${kanikoJobName}" --for=jsonpath='{.status.active}'=1 --timeout=300s >&2; then
581+
errorf "unable to get Kaniko job active. Something might be preventing Jobs from being scheduled properly in this cluster"
582+
invoke_cluster_cli -n "${namespace}" describe job "${kanikoJobName}" >&2
583+
return 1
584+
fi
577585
kanikoPod=$(invoke_cluster_cli -n "${namespace}" get pods --selector=job-name="${kanikoJobName}" -o jsonpath='{.items[0].metadata.name}')
578586
if [ -z "$kanikoPod" ]; then
579587
errorf "unable to determine the Kaniko Pod"

0 commit comments

Comments
 (0)