From 7556d430cb230a486052ac53fa15e7753e252f82 Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Tue, 5 Nov 2019 18:17:30 +0100 Subject: [PATCH] Make the image compariso future-proof --- test/e2e/12_sync.bats | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/e2e/12_sync.bats b/test/e2e/12_sync.bats index 9472acc7d2..281cbe3eb3 100644 --- a/test/e2e/12_sync.bats +++ b/test/e2e/12_sync.bats @@ -57,6 +57,7 @@ function setup() { sync_tag_hash=$(git rev-list -n 1 flux) head_hash=$(git rev-list -n 1 HEAD) [ "$sync_tag_hash" = "$head_hash" ] + podinfo_image=$(kubectl get pod -n demo -l app=podinfo -o"jsonpath={['items'][0]['spec']['containers'][0]['image']}") # Bump the image of podinfo, duplicate the resource definition (to cause a sync failure) # and make sure the sync doesn't go through @@ -68,9 +69,9 @@ function setup() { # Wait until we find the duplicate failure in the logs poll_until_true "duplicate resource in Flux logs" "kubectl logs -n $FLUX_NAMESPACE -l name=flux | grep -q \"duplicate definition of 'demo:deployment/podinfo'\"" # Make sure that the version of podinfo wasn't bumped - local podinfo_image - podinfo_image=$(kubectl get pod -n demo -l app=podinfo -o"jsonpath={['items'][0]['spec']['containers'][0]['image']}") - [ "$podinfo_image" = "stefanprodan/podinfo:2.1.0" ] + local podinfo_image_now + podinfo_image_now=$(kubectl get pod -n demo -l app=podinfo -o"jsonpath={['items'][0]['spec']['containers'][0]['image']}") + [ "$podinfo_image" = "$podinfo_image_now" ] # Make sure that the Flux sync tag remains untouched git pull -f --tags sync_tag_hash=$(git rev-list -n 1 flux)