From 776c2421be538c7372591309a8b256d2c4b1da94 Mon Sep 17 00:00:00 2001 From: deshpandevlab Date: Mon, 21 Oct 2024 15:31:25 -0400 Subject: [PATCH] pgupgrade: add init container to delay startup of old deployment (PROJQUAY-8092) (#984) waits for existing postgresql pod to scale down before the old pod is up Co-authored-by: Shubhra Deshpande --- .../clairpgupgrade/base/clair-pg-old.deployment.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kustomize/components/clairpgupgrade/base/clair-pg-old.deployment.yaml b/kustomize/components/clairpgupgrade/base/clair-pg-old.deployment.yaml index 50b4626b0..46aa2da32 100644 --- a/kustomize/components/clairpgupgrade/base/clair-pg-old.deployment.yaml +++ b/kustomize/components/clairpgupgrade/base/clair-pg-old.deployment.yaml @@ -27,6 +27,15 @@ spec: - name: postgres-data persistentVolumeClaim: claimName: clair-postgres-13 + initContainers: + - name: check-postgres-scale-down + image: quay.io/sclorg/postgresql-13-c9s:latest + command: + - /bin/sh + - -c + - | + echo "Waiting for 30 seconds before starting the main container..." + sleep 30 containers: - name: postgres image: quay.io/sclorg/postgresql-13-c9s:latest