File tree Expand file tree Collapse file tree 2 files changed +24
-14
lines changed Expand file tree Collapse file tree 2 files changed +24
-14
lines changed Original file line number Diff line number Diff line change @@ -32,14 +32,15 @@ kb_root_dir=$tmp_root/kubebuilder
32
32
# machine, but rebuild the kubebuilder and kubebuilder-bin binaries.
33
33
SKIP_FETCH_TOOLS=${SKIP_FETCH_TOOLS:- " " }
34
34
35
+ ENVTEST_K8S_VERSION=${ENVTEST_K8S_VERSION:- " 1.16.4" }
35
36
36
37
if [ -z " $SKIP_FETCH_TOOLS " ]; then
37
- header_text " fetching envtest tools"
38
+ header_text " fetching envtest tools@ ${ENVTEST_K8S_VERSION} "
38
39
fetch_envtest_tools " $kb_root_dir "
39
40
fetch_envtest_tools " ${hack_dir} /../pkg/internal/testing/integration/assets"
40
41
fi
41
42
42
- header_text " setting up envtest environment "
43
+ header_text " setting up envtest@ ${ENVTEST_K8S_VERSION} "
43
44
setup_envtest_env " $kb_root_dir "
44
45
45
46
${hack_dir} /verify.sh
Original file line number Diff line number Diff line change 14
14
# See the License for the specific language governing permissions and
15
15
# limitations under the License.
16
16
17
- set -e
17
+ set -o errexit
18
+ set -o nounset
19
+ set -o pipefail
18
20
19
21
function setup_envtest_env {
20
22
# Setup env vars
23
+ KUBEBUILDER_ASSETS=${KUBEBUILDER_ASSETS:- " " }
21
24
if [[ -z " ${KUBEBUILDER_ASSETS} " ]]; then
22
25
export KUBEBUILDER_ASSETS=$1 /bin
23
26
fi
24
27
}
25
28
26
29
# fetch k8s API gen tools and make it available under envtest_root_dir/bin.
30
+ #
31
+ # Skip fetching and untaring the tools by setting the SKIP_FETCH_TOOLS variable
32
+ # in your environment to any value:
33
+ #
34
+ # $ SKIP_FETCH_TOOLS=1 ./check-everything.sh
35
+ #
36
+ # If you skip fetching tools, this script will use the tools already on your
37
+ # machine.
27
38
function fetch_envtest_tools {
39
+ if [ -n " $SKIP_FETCH_TOOLS " ]; then
40
+ return 0
41
+ fi
42
+
28
43
tmp_root=/tmp
29
44
envtest_root_dir=$tmp_root /envtest
30
45
31
- k8s_version=1.16.4
32
- goarch=amd64
33
- goos=" unknown"
34
-
35
- if [[ " $OSTYPE " == " linux-gnu" ]]; then
36
- goos=" linux"
37
- elif [[ " $OSTYPE " == " darwin" * ]]; then
38
- goos=" darwin"
39
- fi
46
+ k8s_version=" ${ENVTEST_K8S_VERSION:- 1.16.4} "
47
+ goarch=" $( go env GOARCH) "
48
+ goos=" $( go env GOOS) "
40
49
41
- if [[ " $goos " = = " unknown " ]]; then
42
- echo " OS '$OSTYPE ' not supported. Aborting." >&2
50
+ if [[ " $goos " != " linux " && " $goos " ! = " darwin " ]]; then
51
+ echo " OS '$goos ' not supported. Aborting." >&2
43
52
return 1
44
53
fi
45
54
You can’t perform that action at this time.
0 commit comments