Skip to content

Commit 878686f

Browse files
pedjakclaude
andcommitted
Use wait --for=delete on pods instead of jsonpath on deployment
Kubernetes omits .status.replicas entirely when it reaches 0 rather than setting it to 0, so the jsonpath condition never matches and the wait times out. Wait for the actual pods to be deleted instead, which directly confirms the Go processes have exited and flushed coverage data. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent de609c6 commit 878686f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hack/test/e2e-coverage.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ rm -rf ${COVERAGE_DIR} && mkdir -p ${COVERAGE_DIR}
2222
kubectl -n "$OPERATOR_CONTROLLER_NAMESPACE" scale deployment/"$OPERATOR_CONTROLLER_MANAGER_DEPLOYMENT_NAME" --replicas=0
2323
kubectl -n "$CATALOGD_NAMESPACE" scale deployment/"$CATALOGD_MANAGER_DEPLOYMENT_NAME" --replicas=0
2424

25-
# Wait for deployments to scale down so coverage data is flushed to the PVC
26-
kubectl -n "$OPERATOR_CONTROLLER_NAMESPACE" wait --for=jsonpath='{.status.replicas}'=0 deployment/"$OPERATOR_CONTROLLER_MANAGER_DEPLOYMENT_NAME" --timeout=60s
27-
kubectl -n "$CATALOGD_NAMESPACE" wait --for=jsonpath='{.status.replicas}'=0 deployment/"$CATALOGD_MANAGER_DEPLOYMENT_NAME" --timeout=60s
25+
# Wait for manager pods to terminate so coverage data is flushed to the PVC
26+
kubectl -n "$OPERATOR_CONTROLLER_NAMESPACE" wait --for=delete pods -l control-plane="$OPERATOR_CONTROLLER_MANAGER_DEPLOYMENT_NAME" --timeout=60s
27+
kubectl -n "$CATALOGD_NAMESPACE" wait --for=delete pods -l control-plane="$CATALOGD_MANAGER_DEPLOYMENT_NAME" --timeout=60s
2828

2929
# Copy the coverage data from the temporary pod
3030
kubectl -n "$OPERATOR_CONTROLLER_NAMESPACE" cp "$COPY_POD_NAME":/e2e-coverage/ "$COVERAGE_DIR"

0 commit comments

Comments
 (0)