Skip to content

Commit

Permalink
Install setup-envtest from controller-runtime release
Browse files Browse the repository at this point in the history
This commit changes the way to install setup-envtest from controller-runtime release directly instead of downloading it from go modules
Signed-off-by: Kashif Khan <[email protected]>
  • Loading branch information
kashifest committed Aug 28, 2024
1 parent 1b47b39 commit bdb46d4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 419 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ KUSTOMIZE_BIN := kustomize
KUSTOMIZE := $(TOOLS_BIN_DIR)/$(KUSTOMIZE_BIN)
ENVSUBST_BIN := envsubst
ENVSUBST := $(TOOLS_BIN_DIR)/$(ENVSUBST_BIN)-drone
SETUP_ENVTEST = $(TOOLS_BIN_DIR)/setup-envtest
SETUP_ENVTEST_BIN := setup-envtest
SETUP_ENVTEST = $(abspath $(TOOLS_BIN_DIR)/$(SETUP_ENVTEST_BIN))
SETUP_ENVTEST_VER := release-0.19
SETUP_ENVTEST_PKG := sigs.k8s.io/controller-runtime/tools/setup-envtest
GINKGO_BIN := ginkgo
GINKGO := $(TOOLS_BIN_DIR)/$(GINKGO_BIN)
GINKGO_PKG := github.com/onsi/ginkgo/v2/ginkgo
Expand Down Expand Up @@ -281,9 +284,8 @@ $(CONVERSION_GEN): $(TOOLS_DIR)/go.mod
$(KUBEBUILDER): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR) && ./install_kubebuilder.sh

$(SETUP_ENVTEST): $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR) && \
$(GO) build -tags=tools -o $(BIN_DIR)/setup-envtest sigs.k8s.io/controller-runtime/tools/setup-envtest
$(SETUP_ENVTEST):
GOBIN=$(TOOLS_BIN_DIR) $(GO) install $(SETUP_ENVTEST_PKG)@$(SETUP_ENVTEST_VER)

.PHONY: $(GINKGO_BIN)
$(GINKGO_BIN): $(GINKGO) ## Build a local copy of ginkgo.
Expand Down
6 changes: 0 additions & 6 deletions hack/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ require (
github.com/golang/mock v1.6.0
github.com/jteeuwen/go-bindata v3.0.7+incompatible
k8s.io/code-generator v0.30.4
sigs.k8s.io/controller-runtime/tools/setup-envtest v0.0.0-20230510161459-7571f4b9a942
sigs.k8s.io/controller-tools v0.13.0
sigs.k8s.io/kustomize/kustomize/v5 v5.4.3
sigs.k8s.io/testing_frameworks v0.1.2
Expand All @@ -19,7 +18,6 @@ require (
github.com/fatih/color v1.15.0 // indirect
github.com/go-errors/errors v1.4.2 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/zapr v1.2.3 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
Expand All @@ -42,14 +40,10 @@ require (
github.com/onsi/gomega v1.31.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/spf13/afero v1.8.2 // indirect
github.com/spf13/cobra v1.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/xlab/treeprint v1.2.0 // indirect
go.starlark.net v0.0.0-20200306205701-8dd3e2ee1dd5 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/mod v0.15.0 // indirect
golang.org/x/net v0.24.0 // indirect
golang.org/x/sys v0.19.0 // indirect
Expand Down
Loading

0 comments on commit bdb46d4

Please sign in to comment.