-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dependencies to match Kubernetes 1.25 (#576)
- Loading branch information
Showing
14 changed files
with
634 additions
and
707 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2) | ||
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2) | ||
VERSION ?= 1.2.2 | ||
OPERATOR_SDK_RELEASE_VERSION ?= v1.24.0 | ||
OPERATOR_SDK_RELEASE_VERSION ?= v1.27.0 | ||
|
||
# CHANNELS define the bundle channels used in the bundle. | ||
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "preview,fast,stable") | ||
|
@@ -141,22 +141,32 @@ LOCALBIN ?= $(shell pwd)/bin | |
$(LOCALBIN): | ||
mkdir -p $(LOCALBIN) | ||
|
||
## Tool Binaries | ||
KUSTOMIZE ?= $(LOCALBIN)/kustomize | ||
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen | ||
# find or download controller-gen | ||
# download controller-gen if necessary | ||
.PHONY: controller-gen | ||
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. | ||
$(CONTROLLER_GEN): $(LOCALBIN) | ||
test -s $(LOCALBIN)/controller-gen || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/[email protected] | ||
ENVTEST ?= $(LOCALBIN)/setup-envtest | ||
|
||
KUSTOMIZE ?= $(LOCALBIN)/kustomize | ||
## Tool Versions | ||
KUSTOMIZE_VERSION ?= 4.5.5 | ||
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/kustomize/v${KUSTOMIZE_VERSION}/hack/install_kustomize.sh" | ||
.PHONY: kustomize | ||
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. | ||
$(KUSTOMIZE): $(LOCALBIN) | ||
test -s $(LOCALBIN)/kustomize || curl -s $(KUSTOMIZE_INSTALL_SCRIPT) | bash -s $(KUSTOMIZE_VERSION) $(LOCALBIN) | ||
|
||
CONTROLLER_TOOLS_VERSION ?= 0.10.0 | ||
.PHONY: controller-gen | ||
controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. | ||
$(CONTROLLER_GEN): $(LOCALBIN) | ||
test -s $(LOCALBIN)/controller-gen || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@v$(CONTROLLER_TOOLS_VERSION) | ||
|
||
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. | ||
ENVTEST_K8S_VERSION = 1.25 | ||
.PHONY: envtest | ||
envtest: $(ENVTEST) ## Download envtest-setup locally if necessary. | ||
$(ENVTEST): $(LOCALBIN) | ||
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest | ||
|
||
.PHONY: setup | ||
setup: ## Ensure Operator SDK is installed. | ||
./scripts/installers/install-operator-sdk.sh ${OPERATOR_SDK_RELEASE_VERSION} | ||
|
@@ -225,12 +235,9 @@ fmt: ## Run go fmt against code. | |
vet: ## Run go vet against code. | ||
go vet ./... | ||
|
||
ENVTEST_ASSETS_DIR=$(shell pwd)/testbin | ||
.PHONY: test | ||
test: manifests generate fmt vet ## Run tests. | ||
mkdir -p ${ENVTEST_ASSETS_DIR} | ||
test -f ${ENVTEST_ASSETS_DIR}/setup-envtest.sh || curl -sSLo ${ENVTEST_ASSETS_DIR}/setup-envtest.sh https://raw.githubusercontent.com/kubernetes-sigs/controller-runtime/v0.7.2/hack/setup-envtest.sh | ||
source ${ENVTEST_ASSETS_DIR}/setup-envtest.sh; fetch_envtest_tools $(ENVTEST_ASSETS_DIR); setup_envtest_env $(ENVTEST_ASSETS_DIR); go test ./... -coverprofile cover.out | ||
test: manifests generate fmt vet envtest ## Run tests. | ||
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) -p path)" go test ./... -coverprofile cover.out | ||
|
||
.PHONY: unit-test | ||
unit-test: ## Run unit tests | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.