From f41faff9cdf94309a4ccb3082a6b2bb0d74ba174 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Fri, 29 Nov 2024 16:08:00 +0100 Subject: [PATCH] added tests for requested secret lifetime --- tests/templates/kuttl/kerberos/20-assert.yaml | 8 ++++++++ tests/templates/kuttl/kerberos/20-install-hdfs.txt.j2 | 3 +++ 2 files changed, 11 insertions(+) diff --git a/tests/templates/kuttl/kerberos/20-assert.yaml b/tests/templates/kuttl/kerberos/20-assert.yaml index 47260144..ace5b5ca 100644 --- a/tests/templates/kuttl/kerberos/20-assert.yaml +++ b/tests/templates/kuttl/kerberos/20-assert.yaml @@ -26,3 +26,11 @@ metadata: status: readyReplicas: 2 replicas: 2 +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +timeout: 600 +commands: + - script: kubectl -n $NAMESPACE get sts/hdfs-namenode-default -o yaml | yq -e '.spec.template.spec.volumes.[] | select(.name == "tls" and .ephemeral.volumeClaimTemplate.metadata.annotations."secrets.stackable.tech/backend.autotls.cert.lifetime" == "7d")' + - script: kubectl -n $NAMESPACE get sts/hdfs-datanode-default -o yaml | yq -e '.spec.template.spec.volumes.[] | select(.name == "tls" and .ephemeral.volumeClaimTemplate.metadata.annotations."secrets.stackable.tech/backend.autotls.cert.lifetime" == "1d")' + - script: kubectl -n $NAMESPACE get sts/hdfs-journalnode-default -o yaml | yq -e '.spec.template.spec.volumes.[] | select(.name == "tls" and .ephemeral.volumeClaimTemplate.metadata.annotations."secrets.stackable.tech/backend.autotls.cert.lifetime" == "2d")' diff --git a/tests/templates/kuttl/kerberos/20-install-hdfs.txt.j2 b/tests/templates/kuttl/kerberos/20-install-hdfs.txt.j2 index f26491f5..6f09314d 100644 --- a/tests/templates/kuttl/kerberos/20-install-hdfs.txt.j2 +++ b/tests/templates/kuttl/kerberos/20-install-hdfs.txt.j2 @@ -44,6 +44,7 @@ spec: replicas: 2 dataNodes: config: + requestedSecretLifetime: 1d logging: enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} roleGroups: @@ -56,3 +57,5 @@ spec: roleGroups: default: replicas: 3 + config: + requestedSecretLifetime: 2d