From 372f4e91a67fa57cefe5e45c3b603608ce8fe660 Mon Sep 17 00:00:00 2001 From: Mike Kolesnik Date: Thu, 1 Sep 2022 11:57:08 +0300 Subject: [PATCH] Fix system tests after latest Shipyard changes Shipyard now overrides only specific images, adjust the tests and the general behavior to only preload the operator image, and only look for it to be actually deployed from source. Signed-off-by: Mike Kolesnik --- Makefile | 2 +- scripts/test/system.sh | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 5e152c125..a1bba5163 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,7 @@ dockertogoarch = $(patsubst arm/v7,arm,$(1)) PLATFORMS ?= linux/amd64,linux/arm64 IMAGES = submariner-operator submariner-operator-index -PRELOAD_IMAGES := submariner-operator submariner-gateway submariner-globalnet submariner-route-agent lighthouse-agent lighthouse-coredns +PRELOAD_IMAGES := submariner-operator MULTIARCH_IMAGES := submariner-operator ifneq (,$(filter ovn,$(USING))) diff --git a/scripts/test/system.sh b/scripts/test/system.sh index 711d87ade..3753a424c 100755 --- a/scripts/test/system.sh +++ b/scripts/test/system.sh @@ -28,8 +28,9 @@ function create_subm_vars() { declare_cidrs natEnabled=false - subm_gateway_image_repo="localhost:5000" - subm_gateway_image_tag=local + # The version is set in api/v1alpha1/versions.go but `subctl` overrides it to the base branch + subm_gateway_image_tag=${BASE_BRANCH} + subm_gateway_image_repo=$(git grep DefaultRepo api/v1alpha1/versions.go | cut -f2 -d'"') # FIXME: Actually act on this size request in controller subm_gateway_size=3 @@ -229,6 +230,12 @@ function verify_subm_op_pod() { kubectl logs $subm_operator_pod_name --namespace=$subm_ns # TODO: Verify logs? + + json_file=/tmp/${subm_operator_pod_name}.${cluster}.json + kubectl get pod $subm_operator_pod_name --namespace=$subm_ns -o json | tee $json_file + + validate_pod_container_equals 'image' "localhost:5000/submariner-operator:local" + validate_pod_container_has 'command' 'submariner-operator' } function validate_pod_container_equals() { @@ -255,7 +262,7 @@ function verify_subm_gateway_pod() { json_file=/tmp/${subm_gateway_pod_name}.${cluster}.json kubectl get pod $subm_gateway_pod_name --namespace=$subm_ns -o json | tee $json_file - validate_pod_container_equals 'image' "${subm_gateway_image_repo}/submariner-gateway:local" + validate_pod_container_equals 'image' "${subm_gateway_image_repo}/submariner-gateway:${subm_gateway_image_tag}" validate_pod_container_has 'securityContext.capabilities.add' 'net_admin' validate_pod_container_equals 'securityContext.allowPrivilegeEscalation' 'true' validate_pod_container_equals 'securityContext.privileged' 'true'