Skip to content

Commit 5515640

Browse files
authored
install kind as GO module (zalando#742)
* install kind as GO modules * no need to set KIND_PATH
1 parent a3b34f1 commit 5515640

File tree

5 files changed

+171
-66
lines changed

5 files changed

+171
-66
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ coverage.xml
8686
.hypothesis/
8787
.pytest_cache/
8888

89+
# e2e tests
90+
e2e/manifests
91+
8992
# Translations
9093
*.mo
9194
*.pot

e2e/Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ ifndef GOPATH
2323
GOPATH := $(HOME)/go
2424
endif
2525

26-
KIND_PATH := $(GOPATH)/bin
2726
PATH := $(GOPATH)/bin:$(PATH)
2827

2928
default: tools
@@ -43,10 +42,7 @@ push: docker
4342

4443
tools: docker
4544
# install pinned version of 'kind'
46-
# leave the name as is to avoid overwriting official binary named `kind`
47-
wget https://github.com/kubernetes-sigs/kind/releases/download/v0.5.1/kind-linux-amd64
48-
chmod +x kind-linux-amd64
49-
mv kind-linux-amd64 $(KIND_PATH)
45+
GO111MODULE=on go get sigs.k8s.io/[email protected]
5046

5147
test:
5248
./run.sh

e2e/run.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ function pull_images(){
3030
function start_kind(){
3131

3232
# avoid interference with previous test runs
33-
if [[ $(kind-linux-amd64 get clusters | grep "^${cluster_name}*") != "" ]]
33+
if [[ $(kind get clusters | grep "^${cluster_name}*") != "" ]]
3434
then
35-
kind-linux-amd64 delete cluster --name ${cluster_name}
35+
kind delete cluster --name ${cluster_name}
3636
fi
3737

38-
kind-linux-amd64 create cluster --name ${cluster_name} --config kind-cluster-postgres-operator-e2e-tests.yaml
39-
kind-linux-amd64 load docker-image "${operator_image}" --name ${cluster_name}
40-
kind-linux-amd64 load docker-image "${e2e_test_image}" --name ${cluster_name}
41-
KUBECONFIG="$(kind-linux-amd64 get kubeconfig-path --name=${cluster_name})"
38+
kind create cluster --name ${cluster_name} --config kind-cluster-postgres-operator-e2e-tests.yaml
39+
kind load docker-image "${operator_image}" --name ${cluster_name}
40+
kind load docker-image "${e2e_test_image}" --name ${cluster_name}
41+
KUBECONFIG="$(kind get kubeconfig-path --name=${cluster_name})"
4242
export KUBECONFIG
4343
}
4444

@@ -58,7 +58,7 @@ function run_tests(){
5858

5959
function clean_up(){
6060
unset KUBECONFIG
61-
kind-linux-amd64 delete cluster --name ${cluster_name}
61+
kind delete cluster --name ${cluster_name}
6262
rm -rf ${kubeconfig_path}
6363
}
6464

go.mod

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,22 @@ go 1.12
44

55
require (
66
github.com/aws/aws-sdk-go v1.25.1
7+
github.com/emicklei/go-restful v2.9.6+incompatible // indirect
8+
github.com/evanphx/json-patch v4.5.0+incompatible // indirect
9+
github.com/googleapis/gnostic v0.3.0 // indirect
710
github.com/imdario/mergo v0.3.7 // indirect
811
github.com/lib/pq v1.2.0
912
github.com/motomux/pretty v0.0.0-20161209205251-b2aad2c9a95d
1013
github.com/sirupsen/logrus v1.4.2
11-
gopkg.in/yaml.v2 v2.2.2
12-
k8s.io/api v0.0.0-20190927115716-5d581ce610b0
13-
k8s.io/apiextensions-apiserver v0.0.0-20190927042040-728319705b32
14-
k8s.io/apimachinery v0.0.0-20190927035529-0104e33c351d
15-
k8s.io/client-go v0.0.0-20190926235751-95884bf844a9
16-
k8s.io/code-generator v0.0.0-20190927075303-016f2b3d74d0
14+
golang.org/x/crypto v0.0.0-20191122220453-ac88ee75c92c // indirect
15+
golang.org/x/net v0.0.0-20191126235420-ef20fe5d7933 // indirect
16+
golang.org/x/sys v0.0.0-20191128015809-6d18c012aee9 // indirect
17+
golang.org/x/tools v0.0.0-20191127201027-ecd32218bd7f // indirect
18+
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
19+
gopkg.in/yaml.v2 v2.2.5
20+
k8s.io/api v0.0.0-20191121015604-11707872ac1c
21+
k8s.io/apiextensions-apiserver v0.0.0-20191121021419-88daf26ec3b8
22+
k8s.io/apimachinery v0.0.0-20191121015412-41065c7a8c2a
23+
k8s.io/client-go v11.0.0+incompatible
24+
k8s.io/code-generator v0.0.0-20191121015212-c4c8f8345c7e
1725
)

0 commit comments

Comments
 (0)