From 24f77f710ceb9b9fc6806a287cfa3b1a1a4f7125 Mon Sep 17 00:00:00 2001 From: maskarb Date: Fri, 3 Nov 2023 10:50:36 -0400 Subject: [PATCH] add more lifecycle related tests --- .../kuttl/test-lifecycle-hook/01-assert.yaml | 34 +++++++++++++++++++ tests/kuttl/test-lifecycle-hook/01-pods.yaml | 12 +++++++ 2 files changed, 46 insertions(+) diff --git a/tests/kuttl/test-lifecycle-hook/01-assert.yaml b/tests/kuttl/test-lifecycle-hook/01-assert.yaml index 3118e5e8b..213603619 100644 --- a/tests/kuttl/test-lifecycle-hook/01-assert.yaml +++ b/tests/kuttl/test-lifecycle-hook/01-assert.yaml @@ -23,3 +23,37 @@ spec: port: 8000 scheme: HTTP terminationGracePeriodSeconds: 500 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: lifecycle-processor-no-termination-period + namespace: test-lifecycle-hook +spec: + template: + spec: + serviceAccountName: lifecycle-processor-no-termination-period + containers: + - name: lifecycle-processor-no-termination-period + image: quay.io/psav/clowder-hello + lifecycle: + preStop: + httpGet: + path: /healthz + port: 8000 + scheme: HTTP + terminationGracePeriodSeconds: 30 +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: lifecycle-processor-only-termination-period + namespace: test-lifecycle-hook +spec: + template: + spec: + serviceAccountName: lifecycle-processor-only-termination-period + containers: + - name: lifecycle-processor-only-termination-period + image: quay.io/psav/clowder-hello + terminationGracePeriodSeconds: 29 diff --git a/tests/kuttl/test-lifecycle-hook/01-pods.yaml b/tests/kuttl/test-lifecycle-hook/01-pods.yaml index 3fc01a59a..0ae3bfe20 100644 --- a/tests/kuttl/test-lifecycle-hook/01-pods.yaml +++ b/tests/kuttl/test-lifecycle-hook/01-pods.yaml @@ -53,3 +53,15 @@ spec: port: 8000 path: /healthz terminationGracePeriodSeconds: 500 + - name: processor-no-termination-period + podSpec: + image: quay.io/psav/clowder-hello + lifecycle: + preStop: + httpGet: + port: 8000 + path: /healthz + - name: processor-only-termination-period + podSpec: + image: quay.io/psav/clowder-hello + terminationGracePeriodSeconds: 29