Project: Operator Framework (App Definition and Development / Application Definition & Image Build)
File: v1.21.0.md

title: v1.21.0 weight: 998979000 In the suite test files, replace `cfg, err := testEnv.Start()` with: ```go var err error // cfg is defined in this file globally. cfg, err = testEnv.Start() ``` Note: You can find suite test files scaffold for the APIs created for your project such as `api/webhooksuitetest.go` directory as for your controllers in `controllers/suitetest.go`. See for more details. If you are using the declarative/v1 plugin for your scaffolds, then following the steps to update the Dockerfile. a) After `COPY controllers/ controllers/` add: ```sh COPY channels/ /channels/ RUN chmod -R a+rx /channels/ ``` b) After the `COPY --from=builder /workspace/manager .`" add: ```sh COPY --from=builder /channels /channels ``` See for more details. Update your go.mod by replacing `sigs.k8s.io/controller-runtime v0.11.0` with `sigs.k8s.io/controller-runtime v0.11.2` and run `go mod tidy` to update the K8s dependencies. See for more details. Update the tag version used for the image `gcr.io/kubebuilder/kube-rbac-proxy` in the file config/default/managerauthproxy_patch.yaml. Replace `gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0` with `gcr.io/kubebuilder/kube-rbac-proxy:v0.11.0` See for more details. The targets kustomize, controller-gen and envtest were changed. Update the Makefile replacing: ```sh CONTROLLER_GEN = $(shell pwd)/bin/controller-gen .PHONY: controller-gen controller-gen: ## Download controller-gen locally if necessary. $(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.8.0) KUSTOMIZE = $(shell pwd)/bin/kustomize .PHONY: kustomize kustomize: ## Download kustomize locally if necessary. $(call go-get-tool,$(KUSTOMIZE),sigs.k8s.io/kustomize/kustomize/v3@v3.8.7) ENVTEST = $(shell pwd)/bin/setup-envtest .PHONY: envtest envtest: ## Download envtest-setup locally if necessary. $(call go-get-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest) PROJECTDIR := $(shell dirname $(abspath $(lastword $(MAKEFILELIST)))) define go-get-tool @[ -f $(1) ] || { \ set -e ;\ TMP_DIR=$$(mktemp -d) ;\ cd $$TMP_DIR ;\ go mod init tmp ;\ echo "Downloading $(2)" ;\ GOBIN=$(PROJECT_DIR)/bin go get $(2) ;\ rm -rf $$TMP_DIR ;\ } endef ``` With: ```sh LOCALBIN ?= $(shell pwd)/bin $(LOCALBIN): mkdir -p $(LOCALBIN) KUSTOMIZE ?= $(LOCALBIN)/kustomize CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen ENVTEST ?= $(LOCALBIN)/setup-envtest KUSTOMIZE_VERSION ?= v3.8.7 CONTROLLERTOOLSVERSION ?= v0.8.0 KUSTOMIZEINSTALLSCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" .PHONY: kustomize kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. $(KUSTOMIZE): $(LOCALBIN) curl -s $(KUSTOMIZEINSTALLSCRIPT) | bash -s -- $(subst v,,$(KUSTOMIZE_VERSION)) $(LOCALBIN) .PHONY: controller-gen controller-gen: $(CONTROLLER_GEN) ## Download controller-gen locally if necessary. $(CONTROLLER_GEN): $(LOCALBIN) GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLERTOOLSVERSION) .PHONY: envtest envtest: $(ENVTEST) ## Download envtest-setup locally if necessary. $(ENVTEST): $(LOCALBIN) GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest ``` See for more details.