File tree 2 files changed +38
-3
lines changed
tests/templates/kuttl/smoke
2 files changed +38
-3
lines changed Original file line number Diff line number Diff line change 39
39
config:
40
40
logging:
41
41
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
42
+ configOverrides:
43
+ superset_config.py:
44
+ EXPERIMENTAL_FILE_HEADER: |
45
+ COMMON_HEADER_VAR = "role-value"
46
+ ROLE_HEADER_VAR = "role-value"
47
+ EXPERIMENTAL_FILE_FOOTER: |
48
+ ROLE_FOOTER_VAR = "role-value"
42
49
roleGroups:
43
50
default:
44
51
replicas: 1
52
+ configOverrides:
53
+ superset_config.py:
54
+ EXPERIMENTAL_FILE_HEADER: |
55
+ COMMON_HEADER_VAR = "group-value"
45
56
envOverrides:
46
57
COMMON_VAR: group-value # overrides role value
47
58
GROUP_VAR: group-value # only defined here at group level
Original file line number Diff line number Diff line change @@ -7,6 +7,30 @@ commands:
7
7
# Test envOverrides
8
8
#
9
9
- script : |
10
- kubectl -n $NAMESPACE get sts superset-node-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "superset") | .env[] | select (.name == "COMMON_VAR" and .value == "group-value")'
11
- kubectl -n $NAMESPACE get sts superset-node-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "superset") | .env[] | select (.name == "GROUP_VAR" and .value == "group-value")'
12
- kubectl -n $NAMESPACE get sts superset-node-default -o yaml | yq -e '.spec.template.spec.containers[] | select (.name == "superset") | .env[] | select (.name == "ROLE_VAR" and .value == "role-value")'
10
+ #!/usr/bin/env bash
11
+ set -euo pipefail
12
+
13
+ # Config Test Data
14
+ SUPERSET_CONFIG=$(
15
+ kubectl -n "$NAMESPACE" get cm superset-node-default -o yaml \
16
+ | yq -e '.data["superset_config.py"]'
17
+ )
18
+
19
+ # Config Test Assertions
20
+ echo "$SUPERSET_CONFIG" | grep 'COMMON_HEADER_VAR = "group-value"'
21
+ echo "$SUPERSET_CONFIG" | grep 'ROLE_FOOTER_VAR = "role-value"'
22
+ echo "$SUPERSET_CONFIG" | grep -v 'ROLE_HEADER_VAR = "role-value"'
23
+
24
+ # STS Spec Test Data
25
+ SUPERSET_NODE_DEFAULT_STS=$(kubectl -n "$NAMESPACE" get sts superset-node-default -o yaml)
26
+ YQ_FILTER='
27
+ .spec.template.spec.containers[]
28
+ | select(.name == "superset")
29
+ | .env[]
30
+ | select(.name == strenv(KEY) and .value == strenv(VALUE))
31
+ '
32
+
33
+ # STS Spec Test Assertions
34
+ echo "$SUPERSET_NODE_DEFAULT_STS" | KEY="COMMON_VAR" VALUE="group-value" yq -e "$YQ_FILTER"
35
+ echo "$SUPERSET_NODE_DEFAULT_STS" | KEY="GROUP_VAR" VALUE="group-value" yq -e "$YQ_FILTER"
36
+ echo "$SUPERSET_NODE_DEFAULT_STS" | KEY="ROLE_VAR" VALUE="role-value" yq -e "$YQ_FILTER"
You can’t perform that action at this time.
0 commit comments