From ebc8d111c80d964e4c84fda6723dd3ed942015c4 Mon Sep 17 00:00:00 2001 From: Israel Blancas Date: Thu, 18 Aug 2022 12:06:04 +0200 Subject: [PATCH] Add test for custom container images (#2035) Signed-off-by: Israel Blancas Signed-off-by: Israel Blancas Co-authored-by: Ben B --- tests/e2e/miscellaneous/render.sh | 8 ++++++++ .../set-custom-img/03-check-image.yaml | 5 +++++ .../e2e/miscellaneous/set-custom-img/README.md | 4 ++++ .../set-custom-img/check-collector-img.sh | 17 +++++++++++++++++ 4 files changed, 34 insertions(+) create mode 100644 tests/e2e/miscellaneous/set-custom-img/03-check-image.yaml create mode 100644 tests/e2e/miscellaneous/set-custom-img/README.md create mode 100755 tests/e2e/miscellaneous/set-custom-img/check-collector-img.sh diff --git a/tests/e2e/miscellaneous/render.sh b/tests/e2e/miscellaneous/render.sh index 2d8275141..29ca085f1 100755 --- a/tests/e2e/miscellaneous/render.sh +++ b/tests/e2e/miscellaneous/render.sh @@ -105,3 +105,11 @@ else render_install_jaeger "$jaeger_name" "production" "01" $GOMPLATE -f ./03-check-collector.yaml.template -o 03-check-collector.yaml fi + + +start_test "set-custom-img" +jaeger_name="my-jaeger" +render_install_elasticsearch "upstream" "00" +render_install_jaeger "$jaeger_name" "production" "01" +cp ./01-install.yaml ./02-install.yaml +$YQ e -i '.spec.collector.image="test"' ./02-install.yaml diff --git a/tests/e2e/miscellaneous/set-custom-img/03-check-image.yaml b/tests/e2e/miscellaneous/set-custom-img/03-check-image.yaml new file mode 100644 index 000000000..5c4b17f45 --- /dev/null +++ b/tests/e2e/miscellaneous/set-custom-img/03-check-image.yaml @@ -0,0 +1,5 @@ +# Install Elasticsearch +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: "./check-collector-img.sh" diff --git a/tests/e2e/miscellaneous/set-custom-img/README.md b/tests/e2e/miscellaneous/set-custom-img/README.md new file mode 100644 index 000000000..3474fae3b --- /dev/null +++ b/tests/e2e/miscellaneous/set-custom-img/README.md @@ -0,0 +1,4 @@ +# Set custom img +## What is this test case testing? + +This test checks if setting a custom container image works for the Jaeger Collector. diff --git a/tests/e2e/miscellaneous/set-custom-img/check-collector-img.sh b/tests/e2e/miscellaneous/set-custom-img/check-collector-img.sh new file mode 100755 index 000000000..73706de20 --- /dev/null +++ b/tests/e2e/miscellaneous/set-custom-img/check-collector-img.sh @@ -0,0 +1,17 @@ +#!/bin/bash + + +function check_image(){ + export IMG=$(kubectl get deployment my-jaeger-collector -n $NAMESPACE -o jsonpath='{.spec.template.spec.containers[0].image}') +} + + +check_image +while [ "$IMG" != "test" ] +do + echo "Collector image missmatch. Expected: test. Has: $IMG" + sleep 5 + check_image +done + +echo "Collector image asserted properly!" \ No newline at end of file