Skip to content

Commit

Permalink
Set kube envtest
Browse files Browse the repository at this point in the history
  • Loading branch information
workingloong committed Sep 14, 2022
1 parent 4e7fbbd commit c3e859c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docker/ci.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ RUN /install-protobuf.bash && rm /install-protobuf.bash

# Install Pre-commit
RUN pip install pre-commit pytest -i https://mirrors.aliyun.com/pypi/simple/

# Configure envtest for integration tests of kubebuilder
ENV KUBEBUILDER_CONTROLPLANE_START_TIMEOUT 60s
COPY docker/scripts/install-kube-envtest.sh /
RUN /install-kube-envtest.sh 1.19.2 && rm /install-kube-envtest.sh
1 change: 1 addition & 0 deletions docker/scripts/install-go.bash
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ go install golang.org/x/tools/cmd/goyacc@latest > /dev/null
go install golang.org/x/tools/cmd/cover@latest > /dev/null
go install github.com/mattn/goveralls@latest > /dev/null
go install github.com/rakyll/gotest@latest > /dev/null
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest

cp "$GOPATH"/bin/* /usr/local/bin/
10 changes: 10 additions & 0 deletions docker/scripts/install-kube-envtest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -e

K8S_VERSION=$1
curl -sSLo envtest-bins.tar.gz "https://go.kubebuilder.io/\
test-tools/${K8S_VERSION}/$(go env GOOS)/$(go env GOARCH)"

mkdir /usr/local/kubebuilder
tar -C /usr/local/kubebuilder --strip-components=1 -zvxf envtest-bins.tar.gz

0 comments on commit c3e859c

Please sign in to comment.