From a660963897dbf9cf7097acfade26e45fd8276154 Mon Sep 17 00:00:00 2001 From: crozzy Date: Fri, 8 Jul 2022 11:17:01 -0700 Subject: [PATCH] contrib: First wipe anything that might be left before starting clair indexers We have observed that the postStart command is not consistently wiping the /tmp dir as it appears like there is a race condition as the PVC is not guaranteed to be mounted when it is run. Signed-off-by: crozzy --- contrib/openshift/manifests/manifests.yaml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/contrib/openshift/manifests/manifests.yaml b/contrib/openshift/manifests/manifests.yaml index f607d8f4c0..a59315ecaf 100644 --- a/contrib/openshift/manifests/manifests.yaml +++ b/contrib/openshift/manifests/manifests.yaml @@ -53,11 +53,10 @@ objects: requests: cpu: ${{INDEXER_CPU_REQS}} memory: ${{INDEXER_MEM_REQS}} - lifecycle: - postStart: - exec: - command: ['sh', '-c', 'rm -rf /tmp/sha* /tmp/fetch.*'] - command: ['clair'] + command: + - sh + - '-c' + - rm -rf /tmp/sha* /tmp/fetch.* && exec clair env: - name: CLAIR_CONF value: '/etc/clair/config.yaml'