File tree Expand file tree Collapse file tree 6 files changed +25
-5
lines changed Expand file tree Collapse file tree 6 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -147,8 +147,7 @@ upgrade-e2e: deploy-latest deploy e2e
147
147
# This uses make deploy, but forcefully ignores images so that images
148
148
# are *not* rebuilt (we want to deploy the published images only)
149
149
deploy-latest :
150
- curl -L get.submariner.io | VERSION=latest bash
151
- $(MAKE ) -o images -o preload-images deploy SUBCTL=~ /.local/bin/subctl IMAGE_TAG=subctl using=$(using )
150
+ $(MAKE ) -o images -o preload-images deploy SUBCTL_VERSION=latest IMAGE_TAG=subctl using=$(using )
152
151
153
152
# #### LINTING TARGETS #####
154
153
.PHONY : gitlint golangci-lint markdownlint packagedoc-lint shellcheck yamllint
Original file line number Diff line number Diff line change @@ -79,6 +79,9 @@ RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/i
79
79
find /go/bin /usr/local/libexec/docker/cli-plugins -type f -executable -newercc /proc \( -execdir upx ${UPX_LEVEL} {} \; -o -true \) && \
80
80
go clean -cache -modcache
81
81
82
+ # Link get-subctl script so it can be easily run inside a shell
83
+ RUN ln -s $SCRIPTS_DIR/get-subctl.sh /root/.local/bin/subctl
84
+
82
85
# Copy kubecfg to always run on the shell
83
86
COPY scripts/shared/lib/kubecfg /etc/profile.d/kubecfg.sh
84
87
Original file line number Diff line number Diff line change
1
+ Added a centralized script for getting `subctl`. It now impersonates `subctl` so that users who run `make shell` will have it downloaded the first time they try to use it.
2
+ To influence the version being installed, the `SUBCTL_VERSION` variable can be set.
Original file line number Diff line number Diff line change @@ -137,8 +137,7 @@ declare_cidrs
137
137
declare_kubeconfig
138
138
139
139
# Always get subctl since we're using moving versions, and having it in the image results in a stale cached one
140
- bash -c " curl -Ls https://get.submariner.io | VERSION=${CUTTING_EDGE} DESTDIR=/go/bin bash" ||
141
- bash -c " curl -Ls https://get.submariner.io | VERSION=devel DESTDIR=/go/bin bash"
140
+ " ${SCRIPTS_DIR} /get-subctl.sh"
142
141
143
142
load_deploytool " ${DEPLOYTOOL} "
144
143
deploytool_prereqs
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -e
4
+
5
+ # In case we're pretending to be `subctl`
6
+ if [[ " ${0##*/ } " = subctl ]] && [[ -L " $0 " ]]; then
7
+ run_subctl=true
8
+
9
+ # Delete ourselves to ensure we don't run into issues with the new subctl
10
+ rm -f " $0 "
11
+ fi
12
+
13
+ # Default to devel if we don't know what base branch were on
14
+ curl -Ls --retry 3 https://get.submariner.io | VERSION=" ${SUBCTL_VERSION:- ${BASE_BRANCH:- devel} } " bash
15
+
16
+ # If we're pretending to be subctl, run subctl with any given arguments
17
+ [[ -z " ${run_subctl} " ]] || subctl " $@ "
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ function post_analyze() {
65
65
# ## Main ###
66
66
67
67
declare_kubeconfig
68
- bash -c " curl -Ls https://get.submariner.io | VERSION= ${CUTTING_EDGE} DESTDIR=/go/bin bash "
68
+ " ${SCRIPTS_DIR} /get-subctl.sh "
69
69
for cluster in $( kind get clusters) ; do
70
70
post_analyze
71
71
done
You can’t perform that action at this time.
0 commit comments