Skip to content

Commit

Permalink
Add preload-images target
Browse files Browse the repository at this point in the history
This target preloads all the necessary images for deploying the project
in KIND

Signed-off-by: Mike Kolesnik <[email protected]>
  • Loading branch information
mkolesnik authored and mangelajo committed Mar 1, 2021
1 parent a7514e3 commit 6b1c4df
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
18 changes: 16 additions & 2 deletions Makefile.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
, := ,
_using = $(subst $(,), ,$(using))
PRELOAD_IMAGES ?= submariner-gateway submariner-operator submariner-route-agent

include $(SHIPYARD_DIR)/Makefile.images
include $(SHIPYARD_DIR)/Makefile.versions
Expand All @@ -19,6 +20,7 @@ ifneq (,$(filter globalnet,$(_using)))
override CLUSTERS_ARGS += --globalnet
override DEPLOY_ARGS += --globalnet
override E2E_ARGS += --globalnet
PRELOAD_IMAGES += submariner-globalnet
endif

ifneq (,$(filter helm,$(_using)))
Expand All @@ -33,6 +35,10 @@ ifneq (,$(filter prometheus,$(_using)))
override CLUSTERS_ARGS += --prometheus
endif

ifneq (,$(filter ovn,$(_using)))
PRELOAD_IMAGES += submariner-networkplugin-syncer
endif

# Shipyard provided targets

cleanup:
Expand All @@ -41,7 +47,15 @@ cleanup:
clusters:
$(SCRIPTS_DIR)/clusters.sh $(CLUSTERS_ARGS)

deploy: clusters
preload-images:
set -e;\
. $(SCRIPTS_DIR)/lib/deploy_funcs;\
. $(SCRIPTS_DIR)/lib/debug_functions;\
for image in $(PRELOAD_IMAGES); do\
import_image quay.io/submariner/$${image};\
done

deploy: clusters preload-images
$(SCRIPTS_DIR)/deploy.sh $(DEPLOY_ARGS)

# Will call `deploy` if it detects no submariner running on a cluster
Expand All @@ -55,7 +69,7 @@ upgrade-e2e: deploy-latest deploy e2e
# are *not* rebuilt (we want to deploy the published images only)
deploy-latest:
curl -L get.submariner.io | VERSION=latest bash
$(MAKE) -o images deploy SUBCTL=~/.local/bin/subctl DEV_VERSION=latest CUTTING_EDGE=latest VERSION=latest DEPLOY_ARGS="$(DEPLOY_ARGS) --image_tag=subctl" using=$(using)
$(MAKE) -o images -o preload-images deploy SUBCTL=~/.local/bin/subctl DEV_VERSION=latest CUTTING_EDGE=latest VERSION=latest DEPLOY_ARGS="$(DEPLOY_ARGS) --image_tag=subctl" using=$(using)

gitlint:
gitlint --commits origin/devel..HEAD
Expand Down
8 changes: 0 additions & 8 deletions scripts/shared/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,6 @@ declare_kubeconfig
# Always get subctl since we're using moving versions, and having it in the image results in a stale cached one
bash -c "curl -Ls https://get.submariner.io | VERSION=${CUTTING_EDGE} DESTDIR=/go/bin bash"

# nettest is always referred to using :local
import_image quay.io/submariner/nettest
import_image quay.io/submariner/submariner-operator ${image_tag}
import_image quay.io/submariner/submariner ${image_tag}
import_image quay.io/submariner/submariner-route-agent ${image_tag}
[[ $globalnet != "true" ]] || import_image quay.io/submariner/submariner-globalnet ${image_tag}
[[ "${cluster_cni[$cluster]}" != "ovn" ]] || import_image quay.io/submariner/submariner-networkplugin-syncer ${image_tag}

load_deploytool $deploytool
deploytool_prereqs

Expand Down
1 change: 1 addition & 0 deletions scripts/shared/lib/deploy_funcs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ function test_connection() {

function connectivity_tests() {
target_cluster="$1"
import_image quay.io/submariner/nettest
deploy_resource "${RESOURCES_DIR}/netshoot.yaml"
with_context "$target_cluster" deploy_resource "${RESOURCES_DIR}/nginx-demo.yaml"

Expand Down
2 changes: 0 additions & 2 deletions scripts/shared/lib/deploy_operator
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ readonly SUBCTL=${SUBCTL:-subctl}
function deploytool_prereqs() {
command -v subctl > /dev/null 2>&1
"${SUBCTL}" version
# shellcheck disable=SC2086 # image_tag should expand to nothing if empty
import_image quay.io/submariner/submariner-operator ${image_tag}
}

function setup_broker() {
Expand Down

0 comments on commit 6b1c4df

Please sign in to comment.