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 f38fe98
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
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
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 f38fe98

Please sign in to comment.