1
1
#! /usr/bin/env bash
2
2
3
- tmp_root=/tmp
4
- tmp_sdk_root=$tmp_root /operator-sdk
5
-
6
- function log() { printf ' %s\n' " $* " ; }
7
- function error() { error_text " ERROR:" $* >&2 ; }
8
- function fatal() { error " $@ " ; exit 1; }
9
-
3
+ # Skip fetching and untaring the tools by setting the SKIP_FETCH_TOOLS variable
4
+ # in your environment to any value:
5
+ #
6
+ # $ SKIP_FETCH_TOOLS=1 ./test.sh
7
+ #
8
+ # If you skip fetching tools, this script will use the tools already on your
9
+ # machine, but rebuild the operator-sdk binary.
10
+ SKIP_FETCH_TOOLS=${SKIP_FETCH_TOOLS:- " " }
11
+ # Current version of the 'kind' binary. Update this when a new breaking release
12
+ # is made for a docker.io/kindest/node:${K8S_VERSION} image.
13
+ KIND_VERSION=" v0.8.1"
14
+ # ENVTEST_TOOLS_VERSION is the version of k8s server tarballs used for envtest.
15
+ # TODO: use K8S_VERSION once we start building our own server binary tarballs.
16
+ ENVTEST_TOOLS_VERSION=" 1.16.4"
10
17
# Turn colors in this script off by setting the NO_COLOR variable in your
11
18
# environment to any value:
12
19
NO_COLOR=${NO_COLOR:- " " }
20
27
reset_color=' '
21
28
fi
22
29
30
+ # Roots used by tests.
31
+ tmp_root=/tmp
32
+ tmp_sdk_root=$tmp_root /operator-sdk
33
+
34
+ function log() { printf ' %s\n' " $* " ; }
35
+ function error() { error_text " ERROR:" $* >&2 ; }
36
+ function fatal() { error " $@ " ; exit 1; }
37
+
23
38
function header_text {
24
39
echo " $header_color $* $reset_color "
25
40
}
@@ -41,15 +56,6 @@ function install_service_monitor_crd {
41
56
kubectl apply -f https://raw.githubusercontent.com/coreos/prometheus-operator/release-0.35/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
42
57
}
43
58
44
- # Skip fetching and untaring the tools by setting the SKIP_FETCH_TOOLS variable
45
- # in your environment to any value:
46
- #
47
- # $ SKIP_FETCH_TOOLS=1 ./test.sh
48
- #
49
- # If you skip fetching tools, this script will use the tools already on your
50
- # machine, but rebuild the operator-sdk binary.
51
- SKIP_FETCH_TOOLS=${SKIP_FETCH_TOOLS:- " " }
52
-
53
59
# prepare the e2e test staging dir, containing test tools (SKIP_FETCH_TOOLS aware).
54
60
function prepare_staging_dir {
55
61
@@ -83,7 +89,7 @@ function fetch_envtest_tools {
83
89
# curl -fL --retry 3 --keepalive-time 2 "${url}" -o "${tmp_sdk_root}/${server_tar}"
84
90
# tar -zxvf "${tmp_sdk_root}/${server_tar}"
85
91
86
- local tools_archive_name=" kubebuilder-tools-1.16.4 -$( go env GOOS) -$( go env GOARCH) .tar.gz"
92
+ local tools_archive_name=" kubebuilder-tools-${ENVTEST_TOOLS_VERSION} -$( go env GOOS) -$( go env GOARCH) .tar.gz"
87
93
local tools_download_url=" https://storage.googleapis.com/kubebuilder-tools/$tools_archive_name "
88
94
89
95
local tools_archive_path=" $1 /$tools_archive_name "
@@ -114,10 +120,6 @@ function build_sdk {
114
120
mv ./build/operator-sdk " $1 " /bin/operator-sdk
115
121
}
116
122
117
- # Current version of the 'kind' binary. Update this when a new breaking release
118
- # is made for a docker.io/kindest/node:${K8S_VERSION} image.
119
- KIND_VERSION=" v0.8.1"
120
-
121
123
# Install the 'kind' binary at version $KIND_VERSION.
122
124
function install_kind {
123
125
0 commit comments