Skip to content

Commit

Permalink
Add test for custom container images (#2035)
Browse files Browse the repository at this point in the history
Signed-off-by: Israel Blancas <[email protected]>

Signed-off-by: Israel Blancas <[email protected]>
Co-authored-by: Ben B <[email protected]>
  • Loading branch information
iblancasa and frzifus authored Aug 18, 2022
1 parent 7c3bf54 commit ebc8d11
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/e2e/miscellaneous/render.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 5 additions & 0 deletions tests/e2e/miscellaneous/set-custom-img/03-check-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Install Elasticsearch
apiVersion: kuttl.dev/v1beta1
kind: TestStep
commands:
- script: "./check-collector-img.sh"
4 changes: 4 additions & 0 deletions tests/e2e/miscellaneous/set-custom-img/README.md
Original file line number Diff line number Diff line change
@@ -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.
17 changes: 17 additions & 0 deletions tests/e2e/miscellaneous/set-custom-img/check-collector-img.sh
Original file line number Diff line number Diff line change
@@ -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!"

0 comments on commit ebc8d11

Please sign in to comment.