Skip to content

Commit 8b48119

Browse files
committed
add SA assert
1 parent 971afa5 commit 8b48119

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/templates/kuttl/overrides/11-assert.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ commands:
1313
POD=$(kubectl -n $NAMESPACE get pod -l app.kubernetes.io/instance=spark-pi-s3-1 -o name | head -n 1 | sed -e 's#pod/##')
1414
kubectl -n $NAMESPACE get pod $POD -o yaml | yq '.spec.containers[0].env[] | select (.name == "TEST_SPARK_VAR_0").value' | grep 'REPLACED'
1515
kubectl -n $NAMESPACE get pod $POD -o yaml | yq '.spec.containers[0].env[] | select (.name == "TEST_SPARK_VAR_1").value' | grep 'DONOTREPLACE'
16+
- script: |
17+
for POD_SA_NAME in $(kubectl get pods -n kuttl-test-flowing-reindeer -l app.kubernetes.io/instance=spark-pi-s3-1 -o=jsonpath='{.items[*].spec.serviceAccountName}'); do
18+
if [ "$POD_SA_NAME" != "override_sa" ]; then
19+
echo "Expected Pod service account [override_sa], but got [$POD_SA_NAME]"
20+
exit 1
21+
fi
22+
done
1623
---
1724
apiVersion: v1
1825
kind: ConfigMap

0 commit comments

Comments
 (0)