Skip to content

Commit

Permalink
Check the deployed version of local components
Browse files Browse the repository at this point in the history
In projects building deployed components, declaring LOCAL_COMPONENTS
allows deploy.sh to check that the deployed version used in tests
matches the expected version.

Signed-off-by: Stephen Kitt <[email protected]>
  • Loading branch information
skitt committed Jan 13, 2025
1 parent f97ed8c commit 675f7c5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
BASE_BRANCH ?= devel
OCM_BASE_BRANCH ?= main
IMAGES ?= shipyard-dapper-base shipyard-linting nettest
LOCAL_COMPONENTS := submariner-metrics-proxy
MULTIARCH_IMAGES ?= nettest
EXTRA_PRELOAD_IMAGES := $(PRELOAD_IMAGES)
PLATFORMS ?= linux/amd64,linux/arm64
NON_DAPPER_GOALS += images multiarch-images
PLUGIN ?=

export LOCAL_COMPONENTS

export BASE_BRANCH OCM_BASE_BRANCH

ifneq (,$(DAPPER_HOST_ARCH))
Expand Down
2 changes: 1 addition & 1 deletion Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ upgrade-e2e: deploy-latest deploy e2e
# This uses make deploy, but forcefully ignores images so that images
# are *not* rebuilt (we want to deploy the published images only)
deploy-latest:
$(MAKE) -o images -o preload-images deploy SUBCTL_VERSION=latest IMAGE_TAG=subctl using=$(using)
$(MAKE) -o images -o preload-images deploy SUBCTL_VERSION=latest IMAGE_TAG=subctl LOCAL_COMPONENTS= using=$(using)

##### MISC TARGETS #####
.PHONY: backport post-mortem unit
Expand Down
13 changes: 13 additions & 0 deletions scripts/shared/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,16 @@ run_if_defined post_deploy
# Print installed versions for manual validation of CI
subctl show versions
print_clusters_message

# If there are any local components, check that the deployed versions are the newly-built versions
if [ -n "$LOCAL_COMPONENTS" ]; then
for component in $LOCAL_COMPONENTS; do
for version in $(subctl show versions | awk "/$component/ { print \$4 }"); do
# shellcheck disable=SC2153 # VERSION is provided externally
if [ "$version" != "$VERSION" ]; then
printf "Expected version %s of component %s, but got %s.\n" "$VERSION" "$component" "$version"
exit 1
fi
done
done
fi

0 comments on commit 675f7c5

Please sign in to comment.