diff --git a/tests/templates/kuttl/authentication/11-create-authentication-classes.yaml b/tests/templates/kuttl/authentication/11-create-authentication-classes.yaml index 90d7622d..4185b141 100644 --- a/tests/templates/kuttl/authentication/11-create-authentication-classes.yaml +++ b/tests/templates/kuttl/authentication/11-create-authentication-classes.yaml @@ -5,4 +5,6 @@ metadata: name: create-ldap-user commands: # We need to replace $NAMESPACE (by KUTTL) in the create-authentication-classes.yaml(.j2) - - script: eval "echo \"$(cat create-authentication-classes.yaml)\"" | kubectl apply -f - + - script: > + envsubst '$NAMESPACE' < create-authentication-classes.yaml | + kubectl apply --filename=- diff --git a/tests/templates/kuttl/authentication/30-hot-reloading-add-user.yaml b/tests/templates/kuttl/authentication/30-hot-reloading-add-user.yaml index e4aa018b..f057d465 100644 --- a/tests/templates/kuttl/authentication/30-hot-reloading-add-user.yaml +++ b/tests/templates/kuttl/authentication/30-hot-reloading-add-user.yaml @@ -3,4 +3,6 @@ apiVersion: kuttl.dev/v1beta1 kind: TestStep commands: # We need to replace $NAMESPACE (by KUTTL) in the add_user.yaml(.j2) - - script: eval "echo \"$(cat add_user.yaml)\"" | kubectl replace -f - + - script: > + envsubst '$NAMESPACE' < add_user.yaml | + kubectl replace --filename=- diff --git a/tests/templates/kuttl/authentication/32-hot-reloading-remove-user.yaml b/tests/templates/kuttl/authentication/32-hot-reloading-remove-user.yaml index 1dd355ac..5601face 100644 --- a/tests/templates/kuttl/authentication/32-hot-reloading-remove-user.yaml +++ b/tests/templates/kuttl/authentication/32-hot-reloading-remove-user.yaml @@ -3,4 +3,6 @@ apiVersion: kuttl.dev/v1beta1 kind: TestStep commands: # We need to replace $NAMESPACE (by KUTTL) in the remove_user.yaml(.j2) - - script: eval "echo \"$(cat remove_user.yaml)\"" | kubectl replace -f - + - script: > + envsubst '$NAMESPACE' < remove_user.yaml | + kubectl replace --filename=- diff --git a/tests/templates/kuttl/authentication/33-assert.yaml b/tests/templates/kuttl/authentication/33-assert.yaml index f8c36c72..1ced76eb 100644 --- a/tests/templates/kuttl/authentication/33-assert.yaml +++ b/tests/templates/kuttl/authentication/33-assert.yaml @@ -5,4 +5,12 @@ timeout: 600 commands: # We use the check-active-workers script for the login. Since we do want to wait until we cannot log in anymore # we flip the return value in the end. - - script: kubectl exec -n $NAMESPACE trino-test-helper-0 -- python /tmp/check-active-workers.py -u hot_reloaded -p hot_reloaded -c trino-coordinator-default-headless.$NAMESPACE.svc.cluster.local -w 1; if [ $? -eq 0 ]; then exit 1; fi + - script: | + set +e + kubectl exec -n $NAMESPACE trino-test-helper-0 -- \ + python /tmp/check-active-workers.py -u hot_reloaded -p hot_reloaded -c trino-coordinator-default-headless.$NAMESPACE.svc.cluster.local -w 1 + if [ $? -eq 1 ]; then + exit 0 + else + exit 1 + fi diff --git a/tests/templates/kuttl/authentication/add_user.yaml.j2 b/tests/templates/kuttl/authentication/add_user.yaml.j2 index d799a491..8b59548e 100644 --- a/tests/templates/kuttl/authentication/add_user.yaml.j2 +++ b/tests/templates/kuttl/authentication/add_user.yaml.j2 @@ -4,6 +4,8 @@ kind: Secret metadata: name: password-file-users namespace: $NAMESPACE + annotations: + restarter.stackable.tech/ignore: "true" stringData: test_user_1: test_user_1 test_user_2: test_user_2 diff --git a/tests/templates/kuttl/authentication/create-authentication-classes.yaml.j2 b/tests/templates/kuttl/authentication/create-authentication-classes.yaml.j2 index 2c90ac43..b225d2ac 100644 --- a/tests/templates/kuttl/authentication/create-authentication-classes.yaml.j2 +++ b/tests/templates/kuttl/authentication/create-authentication-classes.yaml.j2 @@ -43,6 +43,8 @@ kind: Secret metadata: name: password-file-users namespace: $NAMESPACE + annotations: + restarter.stackable.tech/ignore: "true" stringData: test_user_1: test_user_1 test_user_2: test_user_2 diff --git a/tests/templates/kuttl/authentication/remove_user.yaml.j2 b/tests/templates/kuttl/authentication/remove_user.yaml.j2 index 9c7ab6c7..bb9c7a60 100644 --- a/tests/templates/kuttl/authentication/remove_user.yaml.j2 +++ b/tests/templates/kuttl/authentication/remove_user.yaml.j2 @@ -4,6 +4,8 @@ kind: Secret metadata: name: password-file-users namespace: $NAMESPACE + annotations: + restarter.stackable.tech/ignore: "true" stringData: test_user_1: test_user_1 test_user_2: test_user_2