Skip to content

Commit

Permalink
Bump to kubernetes 1.22 (#102)
Browse files Browse the repository at this point in the history
Also update the Makefile to use controller-tools's setup-envtest binary
and to keep the envtest version in sync with the kubernetes/client-go.

Co-authored-by: Varsha <varshaprasad96@gmail.com>
  • Loading branch information
joelanford and varshaprasad96 authored Aug 31, 2021
1 parent ae66564 commit f47861f
Show file tree
Hide file tree
Showing 5 changed files with 159 additions and 56 deletions.
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,17 @@ all: test lint build

# Run tests
.PHONY: test
export KUBEBUILDER_ASSETS := $(TOOLS_BIN_DIR)
# Use envtest based on the version of kubernetes/client-go configured in the go.mod file.
# If this version of envtest is not available yet, submit a PR similar to
# https://github.com/kubernetes-sigs/kubebuilder/pull/2287 targeting the kubebuilder
# "tools-releases" branch. Make sure to look up the appropriate etcd version in the
# kubernetes release notes for the minor version you're building tools for.
ENVTEST_VERSION = $(shell go list -m k8s.io/client-go | cut -d" " -f2 | sed 's/^v0\.\([[:digit:]]\+\)\.[[:digit:]]\+$$/1.\1.x/')
TESTPKG ?= ./...
# TODO: Modify this to use setup-envtest binary
test:
fetch envtest 0.8.3 && go test -race -covermode atomic -coverprofile cover.out $(TESTPKG)
go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
source <(setup-envtest use -p env $(ENVTEST_VERSION)) && go test -race -covermode atomic -coverprofile cover.out $(TESTPKG)

# Build manager binary
.PHONY: build
Expand Down
16 changes: 8 additions & 8 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/iancoleman/strcase v0.1.2
github.com/kr/text v0.2.0
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.13.0
github.com/onsi/gomega v1.14.0
github.com/operator-framework/operator-lib v0.3.0
github.com/prometheus/client_golang v1.11.0
github.com/sirupsen/logrus v1.8.1
Expand All @@ -18,13 +18,13 @@ require (
github.com/stretchr/testify v1.7.0
gomodules.xyz/jsonpatch/v2 v2.2.0
helm.sh/helm/v3 v3.6.2
k8s.io/api v0.21.2
k8s.io/apiextensions-apiserver v0.21.2
k8s.io/apimachinery v0.21.2
k8s.io/cli-runtime v0.21.0
k8s.io/client-go v0.21.2
k8s.io/kubectl v0.21.0
sigs.k8s.io/controller-runtime v0.9.2
k8s.io/api v0.22.1
k8s.io/apiextensions-apiserver v0.22.1
k8s.io/apimachinery v0.22.1
k8s.io/cli-runtime v0.22.1
k8s.io/client-go v0.22.1
k8s.io/kubectl v0.22.1
sigs.k8s.io/controller-runtime v0.9.6
sigs.k8s.io/kubebuilder/v3 v3.0.0-alpha.0.0.20210716121009-fde793f20067
sigs.k8s.io/yaml v1.2.0
)
Expand Down
Loading

0 comments on commit f47861f

Please sign in to comment.