Skip to content

Commit 74f69d6

Browse files
authored
Merge pull request #1201 from alexeldeib/ace/gobin
🏃 🛠 fix prow presubmits
2 parents d127406 + d2c8166 commit 74f69d6

File tree

4 files changed

+17
-5
lines changed

4 files changed

+17
-5
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ services:
4040

4141
before_install:
4242
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then mkdir -p /Users/travis/gopath/bin; fi
43-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then scripts/setup.sh $KIND_K8S_VERSION; fi
4443

4544
before_script:
4645

common.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ function install_dep_by_git {
156156
DEP_LATEST=$(git describe --abbrev=0 --tags)
157157
git checkout $DEP_LATEST
158158
mkdir bin
159-
go build -ldflags="-X main.version=$DEP_LATEST" -o bin/dep ./cmd/dep
159+
GO111MODULE=off go build -ldflags="-X main.version=$DEP_LATEST" -o bin/dep ./cmd/dep
160160
popd
161161
fi
162162
}
@@ -170,6 +170,17 @@ function install_go_dep {
170170
fi
171171
}
172172

173+
function install_kind {
174+
header_text "Checking for kind"
175+
if ! is_installed kind ; then
176+
header_text "Installing kind"
177+
KIND_DIR=$(mktemp -d)
178+
pushd $KIND_DIR
179+
GO111MODULE=on go get sigs.k8s.io/[email protected]
180+
popd
181+
fi
182+
}
183+
173184
function is_installed {
174185
if command -v $1 &>/dev/null; then
175186
return 0

scripts/setup.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ K8S_VERSION=$1
1919
export GO111MODULE=on
2020

2121
# setup go module to create the cluster
22-
go get sigs.k8s.io/[email protected]
2322

2423
# You can use --image flag to specify the cluster version you want, e.g --image=kindest/node:v1.13.6, the supported version are listed at https://hub.docker.com/r/kindest/node/tags
25-
kind create cluster --config test/kind-config.yaml --image=kindest/node:$K8S_VERSION
24+
kind create cluster -v 4 --retain --wait=1m --config test/kind-config.yaml --image=kindest/node:$K8S_VERSION
2625

2726
# setup the go modules required
2827
go get sigs.k8s.io/controller-tools/cmd/[email protected]

test_e2e.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ export TRACE=1
2323
export GO111MODULE=on
2424

2525
fetch_tools
26-
install_go_dep
26+
# This test is used by prow and if the dep not be installed by git then it will face the GOBIN issue.
27+
install_dep_by_git
28+
install_kind
2729
build_kb
2830

2931
setup_envs
3032

33+
source "$(pwd)/scripts/setup.sh" ${KIND_K8S_VERSION}
3134
docker pull gcr.io/kubebuilder/kube-rbac-proxy:v0.4.1
3235
kind load docker-image gcr.io/kubebuilder/kube-rbac-proxy:v0.4.1
3336

0 commit comments

Comments
 (0)