@@ -52,8 +52,8 @@ TOOLS_BIN_DIR := $(abspath $(TOOLS_DIR)/bin)
5252GOLANGCI_LINT := $(abspath $(TOOLS_BIN_DIR ) /golangci-lint)
5353GO_APIDIFF := $(TOOLS_BIN_DIR ) /go-apidiff
5454CONTROLLER_GEN := $(TOOLS_BIN_DIR ) /controller-gen
55- ENVTEST_DIR := $(abspath tools/setup-envtest )
56- SCRATCH_ENV_DIR := $(abspath examples/scratch-env )
55+ EXAMPLES_KIND_DIR := $(abspath examples/kind )
56+ PROVIDERS_KIND_DIR := $(abspath providers/kind )
5757GO_INSTALL := ./hack/go-install.sh
5858
5959# The help will print out all targets with their descriptions organized bellow their categories. The categories are represented by `##@` and the target descriptions by `##`.
@@ -73,8 +73,7 @@ test: test-tools ## Run the script check-everything.sh which will check all.
7373 TRACE=1 ./hack/check-everything.sh
7474
7575.PHONY : test-tools
76- test-tools : # # tests the tools codebase (setup-envtest)
77- cd tools/setup-envtest && go test ./...
76+ test-tools :
7877
7978# # --------------------------------------
8079# # Binaries
@@ -118,7 +117,8 @@ $(GO_MOD_CHECK): # Build gomodcheck
118117.PHONY : lint
119118lint : $(GOLANGCI_LINT ) # # Lint codebase
120119 $(GOLANGCI_LINT ) run -v $(GOLANGCI_LINT_EXTRA_ARGS )
121- cd tools/setup-envtest; $(GOLANGCI_LINT ) run -v $(GOLANGCI_LINT_EXTRA_ARGS )
120+ cd examples/kind; $(GOLANGCI_LINT ) run -v $(GOLANGCI_LINT_EXTRA_ARGS )
121+ cd proviers/kind; $(GOLANGCI_LINT ) run -v $(GOLANGCI_LINT_EXTRA_ARGS )
122122
123123.PHONY : lint-fix
124124lint-fix : $(GOLANGCI_LINT ) # # Lint the codebase and run auto-fixers if supported by the linter.
@@ -132,50 +132,8 @@ lint-fix: $(GOLANGCI_LINT) ## Lint the codebase and run auto-fixers if supported
132132modules : # # Runs go mod to ensure modules are up to date.
133133 go mod tidy
134134 cd $(TOOLS_DIR ) ; go mod tidy
135- cd $(ENVTEST_DIR ) ; go mod tidy
136- cd $(SCRATCH_ENV_DIR ) ; go mod tidy
137-
138- # # --------------------------------------
139- # # Release
140- # # --------------------------------------
141-
142- RELEASE_DIR := tools/setup-envtest/out
143-
144- .PHONY : $(RELEASE_DIR )
145- $(RELEASE_DIR ) :
146- mkdir -p $(RELEASE_DIR ) /
147-
148- .PHONY : release
149- release : clean-release $(RELEASE_DIR ) # # Build release.
150- @if ! [ -z " $$ (git status --porcelain)" ]; then echo " Your local git repository contains uncommitted changes, use git clean before proceeding." ; exit 1; fi
151-
152- # Build binaries first.
153- $(MAKE) release-binaries
154-
155- .PHONY : release-binaries
156- release-binaries : # # Build release binaries.
157- RELEASE_BINARY=setup-envtest-linux-amd64 GOOS=linux GOARCH=amd64 $(MAKE ) release-binary
158- RELEASE_BINARY=setup-envtest-linux-arm64 GOOS=linux GOARCH=arm64 $(MAKE ) release-binary
159- RELEASE_BINARY=setup-envtest-linux-ppc64le GOOS=linux GOARCH=ppc64le $(MAKE ) release-binary
160- RELEASE_BINARY=setup-envtest-linux-s390x GOOS=linux GOARCH=s390x $(MAKE ) release-binary
161- RELEASE_BINARY=setup-envtest-darwin-amd64 GOOS=darwin GOARCH=amd64 $(MAKE ) release-binary
162- RELEASE_BINARY=setup-envtest-darwin-arm64 GOOS=darwin GOARCH=arm64 $(MAKE ) release-binary
163- RELEASE_BINARY=setup-envtest-windows-amd64.exe GOOS=windows GOARCH=amd64 $(MAKE ) release-binary
164-
165- .PHONY : release-binary
166- release-binary : $(RELEASE_DIR )
167- docker run \
168- --rm \
169- -e CGO_ENABLED=0 \
170- -e GOOS=$(GOOS ) \
171- -e GOARCH=$(GOARCH ) \
172- -e GOCACHE=/tmp/ \
173- --user $$(id -u ) :$$(id -g ) \
174- -v " $$ (pwd):/workspace$( DOCKER_VOL_OPTS) " \
175- -w /workspace/tools/setup-envtest \
176- golang:$(GO_VERSION ) \
177- go build -a -trimpath -ldflags " -extldflags '-static'" \
178- -o ./out/$(RELEASE_BINARY ) ./
135+ cd $(EXAMPLES_KIND_DIR ) ; go mod tidy
136+ cd $(PROVIDERS_KIND_DIR ) ; go mod tidy
179137
180138# # --------------------------------------
181139# # Cleanup / Verification
@@ -196,7 +154,7 @@ clean-release: ## Remove the release folder
196154
197155.PHONY : verify-modules
198156verify-modules : modules $(GO_MOD_CHECK ) # # Verify go modules are up to date
199- @if ! (git diff --quiet HEAD -- go.sum go.mod $( TOOLS_DIR) /go.mod $( TOOLS_DIR) /go.sum $( ENVTEST_DIR ) /go.mod $( ENVTEST_DIR ) /go.sum $( SCRATCH_ENV_DIR ) /go.sum); then \
157+ @if ! (git diff --quiet HEAD -- go.sum go.mod $( TOOLS_DIR) /go.mod $( TOOLS_DIR) /go.sum $( EXAMPLES_KIND_DIR ) /go.mod $( EXAMPLES_KIND_DIR ) /go.sum $( PROVIDERS_KIND_DIR ) /go.mod $( PROVIDERS_KIND_DIR ) /go.sum); then \
200158 git diff; \
201159 echo " go module files are out of date, please run 'make modules'" ; exit 1; \
202160 fi
0 commit comments