Skip to content

Commit

Permalink
Fix system tests after latest Shipyard changes
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mkolesnik authored and tpantelis committed Sep 1, 2022
1 parent ee22694 commit 372f4e9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
13 changes: 10 additions & 3 deletions scripts/test/system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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() {
Expand All @@ -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'
Expand Down

0 comments on commit 372f4e9

Please sign in to comment.