Skip to content

Commit 94874d8

Browse files
author
Mladen Rusev
committed
instead of killing pod scale down deployment
1 parent 554a451 commit 94874d8

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

hack/e2e/test.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,10 @@ getCertificate() {
250250
# Wait 5 minutes for the certificate to appear.
251251
for ((i=0;;i++)); do if getCertificate; then exit 0; fi; sleep 30; done | timeout -v -- 5m cat
252252

253-
echo "Identifying the agent pod to terminate..."
254-
export AGENT_POD_NAME=$(kubectl get pods -n venafi -l app.kubernetes.io/name=venafi-kubernetes-agent -o jsonpath="{.items[0].metadata.name}")
255-
256-
echo "Gracefully deleting agent pod '${AGENT_POD_NAME}' to flush coverage to the PVC..."
257-
kubectl delete pod -n venafi "${AGENT_POD_NAME}" --grace-period=30
253+
echo "Scaling down agent deployment to kill pod and flush coverage to the PVC..."
254+
kubectl scale deployment venafi-kubernetes-agent -n venafi --replicas=0
258255
echo "Waiting for agent pod to terminate..."
259-
kubectl wait --for=delete pod/${AGENT_POD_NAME} -n venafi --timeout=90s
256+
kubectl wait deployment venafi-kubernetes-agent -n venafi --for=condition=scaled --timeout=60s
260257

261258
kubectl apply -n venafi -f - <<EOF
262259
apiVersion: v1

0 commit comments

Comments
 (0)