Skip to content

Commit 4a12b08

Browse files
committed
Move webhook code to internal/webhook
Remove webhook code from the api{,-hub} packages to avoid depending on controller-runtime there. Implement the new admission.CustomValidator interface as the old webhook.Validator is now deprecated. Bump controller-gen to v0.14.0.
1 parent c50978c commit 4a12b08

19 files changed

+2698
-2837
lines changed

Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ help: ## Display this help.
100100
.PHONY: manifests
101101
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
102102
$(CONTROLLER_GEN) crd paths="./api/..." output:crd:artifacts:config=config/crd/bases
103-
$(CONTROLLER_GEN) webhook paths="./api/..." paths="./internal/webhook/..." output:webhook:artifacts:config=config/webhook
103+
$(CONTROLLER_GEN) webhook paths="./internal/webhook" output:webhook:artifacts:config=config/webhook
104104
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/controllers" output:rbac:artifacts:config=config/rbac
105105
# Hub
106106
$(CONTROLLER_GEN) crd paths="./api-hub/..." output:crd:artifacts:config=config/crd-hub/bases
107-
$(CONTROLLER_GEN) webhook paths="./api-hub/..." output:webhook:artifacts:config=config/webhook-hub
107+
$(CONTROLLER_GEN) webhook paths="./internal/webhook/hub" output:webhook:artifacts:config=config/webhook-hub
108108
$(CONTROLLER_GEN) rbac:roleName=manager-role paths="./internal/controllers/hub" output:rbac:artifacts:config=config/rbac-hub
109109

110110
.PHONY: generate
@@ -227,7 +227,7 @@ undeploy-hub: undeploy-kmm-hub undeploy-cert-manager ## Undeploy controller from
227227
CONTROLLER_GEN = $(shell pwd)/bin/controller-gen
228228
.PHONY: controller-gen
229229
controller-gen: ## Download controller-gen locally if necessary.
230-
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.13.0)
230+
$(call go-get-tool,$(CONTROLLER_GEN),sigs.k8s.io/controller-tools/cmd/controller-gen@v0.14.0)
231231

232232
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
233233
.PHONY: golangci-lint

api-hub/v1beta1/managedclustermodule_webhook.go

-70
This file was deleted.

api-hub/v1beta1/zz_generated.deepcopy.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)