Skip to content

Commit dd2dbef

Browse files
committed
Only run the templating test by default
To avoid pipeline issues until we make the missing-property-finder better, just don't run it unless explicitly requested with `./test.sh properties`.
1 parent 1fc3237 commit dd2dbef

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

charts/rabbitmq/test.sh

+18-15
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,26 @@
1111
set -e
1212
set -o pipefail
1313

14-
if ! yq --version | grep -q 'yq version 3'; then
15-
echo "Please install https://github.com/mikefarah/yq v3"
16-
exit 1
17-
fi
18-
19-
for p in $(kubectl eg rabbitmqclusters.rabbitmq.com | yq d - spec.resources | yq d - spec.tolerations | yq d - spec.override | yq d - spec.affinity | yq r - spec | grep -v ' - ' | awk -F: '{ print $1 }'); do
20-
grep -q "$p " templates/rabbitmq.yaml
21-
if [[ $? != 0 ]]; then
22-
echo "FAIL: Property $p not exposed in the helm chart"
23-
exit 1
24-
fi
25-
done
26-
echo "Seems like all CRD properties are exposed in the helm chart"
27-
28-
chart=$(helm package . | helm package . | awk '{print $NF}')
14+
chart=$(helm package . | awk '{print $NF}')
2915

3016
helm template $chart -f example-configurations.yaml > template-output
3117

3218
# it should be updated if we add any new configurations and when we modify plans/example-configurations.yaml
3319
diff -u template-output expected-template-output && echo "Successfully rendered the template"
20+
21+
22+
if [[ "$1" == "properties" ]]; then
23+
if ! yq --version | grep -q 'yq version 3'; then
24+
echo "Please install https://github.com/mikefarah/yq v3"
25+
exit 1
26+
fi
27+
28+
for p in $(kubectl eg rabbitmqclusters.rabbitmq.com | yq d - spec.resources | yq d - spec.tolerations | yq d - spec.override | yq d - spec.affinity | yq r - spec | grep -v ' - ' | awk -F: '{ print $1 }'); do
29+
grep -q "$p " templates/rabbitmq.yaml
30+
if [[ $? != 0 ]]; then
31+
echo "FAIL: Property $p not exposed in the helm chart"
32+
exit 1
33+
fi
34+
done
35+
echo "Seems like all CRD properties are exposed in the helm chart"
36+
fi

0 commit comments

Comments
 (0)