Skip to content
Permalink
Browse files

πŸ›  fix prow presubmits

  • Loading branch information
alexeldeib committed Nov 14, 2019
1 parent 0742025 commit d2c8166ef88d316a042f455506a68b2ab75c9360
Showing with 17 additions and 5 deletions.
  1. +0 βˆ’1 .travis.yml
  2. +12 βˆ’1 common.sh
  3. +1 βˆ’2 scripts/setup.sh
  4. +4 βˆ’1 test_e2e.sh
@@ -40,7 +40,6 @@ services:

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

before_script:

@@ -156,7 +156,7 @@ function install_dep_by_git {
DEP_LATEST=$(git describe --abbrev=0 --tags)
git checkout $DEP_LATEST
mkdir bin
go build -ldflags="-X main.version=$DEP_LATEST" -o bin/dep ./cmd/dep
GO111MODULE=off go build -ldflags="-X main.version=$DEP_LATEST" -o bin/dep ./cmd/dep
popd
fi
}
@@ -170,6 +170,17 @@ function install_go_dep {
fi
}

function install_kind {
header_text "Checking for kind"
if ! is_installed kind ; then
header_text "Installing kind"
KIND_DIR=$(mktemp -d)
pushd $KIND_DIR
GO111MODULE=on go get sigs.k8s.io/kind@v0.6.0
popd
fi
}

function is_installed {
if command -v $1 &>/dev/null; then
return 0
@@ -19,10 +19,9 @@ K8S_VERSION=$1
export GO111MODULE=on

# setup go module to create the cluster
go get sigs.k8s.io/kind@v0.5.1

# 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
kind create cluster --config test/kind-config.yaml --image=kindest/node:$K8S_VERSION
kind create cluster -v 4 --retain --wait=1m --config test/kind-config.yaml --image=kindest/node:$K8S_VERSION

# setup the go modules required
go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.2.2
@@ -23,11 +23,14 @@ export TRACE=1
export GO111MODULE=on

fetch_tools
install_go_dep
# This test is used by prow and if the dep not be installed by git then it will face the GOBIN issue.
install_dep_by_git
install_kind
build_kb

setup_envs

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

0 comments on commit d2c8166

Please sign in to comment.
You can’t perform that action at this time.