Skip to content

Commit b6399c5

Browse files
committed
Fix webhook rename
The renaming of the webhook from the generic "webhook-service" to a concrete name for our operator was incomplete. More changes are needed to rename the webhook service and point all required resource to the new name.
1 parent 37f0307 commit b6399c5

18 files changed

+75
-64
lines changed

Makefile

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ uninstall: manifests
142142
.PHONY: deploy-manager
143143
deploy-manager: cmctl
144144
$(CMCTL) check api --wait=2m
145-
kustomize build config/default/overlays/cert-manager/ | kubectl apply -f -
145+
kustomize build config/default/overlays/cert-manager/ \
146+
| ytt -f config/ytt_overlays/change_svc_name_webhooks.yml -f- \
147+
| kubectl apply -f -
146148

147149
# Generate manifests e.g. CRD, RBAC etc.
148150
manifests: install-tools
@@ -241,22 +243,31 @@ deploy-dev: cmctl docker-build-dev manifests deploy-rbac docker-registry-secret
241243
$(call check_defined, DOCKER_REGISTRY_SECRET, Name of Kubernetes secret in which to store the Docker registry username and password)
242244
$(call check_defined, DOCKER_REGISTRY_SERVER, URL of docker registry containing the Operator image (e.g. registry.my-company.com))
243245
$(CMCTL) check api --wait=2m
244-
kustomize build config/default/overlays/dev | sed 's@((operator_docker_image))@"$(DOCKER_REGISTRY_SERVER)/$(OPERATOR_IMAGE):$(GIT_COMMIT)"@' | kubectl apply -f -
246+
kustomize build config/default/overlays/dev \
247+
| ytt -f config/ytt_overlays/change_svc_name_webhooks.yml -f- \
248+
| sed 's@((operator_docker_image))@"$(DOCKER_REGISTRY_SERVER)/$(OPERATOR_IMAGE):$(GIT_COMMIT)"@' \
249+
| kubectl apply -f -
245250

246251
# Load operator image and deploy operator into current KinD cluster
247252
.PHONY: deploy-kind
248253
deploy-kind: manifests cmctl deploy-rbac
249254
$(BUILD_KIT) buildx build --build-arg=GIT_COMMIT=$(GIT_COMMIT) -t $(DOCKER_REGISTRY_SERVER)/$(OPERATOR_IMAGE):$(GIT_COMMIT) .
250255
kind load docker-image $(DOCKER_REGISTRY_SERVER)/$(OPERATOR_IMAGE):$(GIT_COMMIT)
251256
$(CMCTL) check api --wait=2m
252-
kustomize build config/default/overlays/kind | sed 's@((operator_docker_image))@"$(DOCKER_REGISTRY_SERVER)/$(OPERATOR_IMAGE):$(GIT_COMMIT)"@' | kubectl apply -f -
257+
kustomize build config/default/overlays/kind \
258+
| ytt -f config/ytt_overlays/change_svc_name_webhooks.yml -f- \
259+
| sed 's@((operator_docker_image))@"$(DOCKER_REGISTRY_SERVER)/$(OPERATOR_IMAGE):$(GIT_COMMIT)"@' \
260+
| kubectl apply -f -
253261

254262
.PHONY: deploy-local
255263
deploy-local: cmctl deploy-rbac $(YTT)
256264
$(CMCTL) check api --wait=2m
257-
kustomize build config/default/overlays/cert-manager | $(YTT) -f- -f config/ytt_overlays/change_deployment_image.yml \
258-
--data-value operator_image="localhost/topology-operator:$(GIT_COMMIT)" \
259-
-f config/ytt_overlays/never_pull.yml | kubectl apply -f-
265+
kustomize build config/default/overlays/cert-manager \
266+
| $(YTT) -f- -f config/ytt_overlays/change_deployment_image.yml \
267+
--data-value operator_image="localhost/topology-operator:$(GIT_COMMIT)" \
268+
-f config/ytt_overlays/never_pull.yml \
269+
-f config/ytt_overlays/change_svc_name_webhooks.yml \
270+
| kubectl apply -f-
260271

261272
.PHONY: deploy-rbac
262273
deploy-rbac:

config/crd/kustomization.yaml

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,39 @@
11
# This kustomization.yaml is not intended to be run by itself,
22
# since it depends on service name and namespace that are out of this kustomize package.
33
# It should be run by config/default
4+
apiVersion: kustomize.config.k8s.io/v1beta1
5+
kind: Kustomization
6+
#patches:
7+
# - path: patches/webhook_in_bindings.yaml
8+
# - path: patches/webhook_in_queues.yaml
9+
# - path: patches/webhook_in_exchanges.yaml
10+
# - path: patches/webhook_in_vhosts.yaml
11+
# - path: patches/webhook_in_policies.yaml
12+
# - path: patches/webhook_in_operatorpolicies.yaml
13+
# - path: patches/webhook_in_users.yaml
14+
# - path: patches/webhook_in_permissions.yaml
15+
# - path: patches/webhook_in_schemareplications.yaml
16+
# - path: patches/webhook_in_federations.yaml
17+
# - path: patches/webhook_in_shovels.yaml
18+
# - path: patches/webhook_in_superstreams.yaml
19+
# - path: patches/webhook_in_topicpermissions.yaml
20+
# +kubebuilder:scaffold:crdkustomizewebhookpatch
21+
22+
# - path: patches/cainjection_in_bindings.yaml
23+
# - path: patches/cainjection_in_queues.yaml
24+
# - path: patches/cainjection_in_exchanges.yaml
25+
# - path: patches/cainjection_in_vhosts.yaml
26+
# - path: patches/cainjection_in_policies.yaml
27+
# - path: patches/cainjection_in_operatorpolicies.yaml
28+
# - path: patches/cainjection_in_users.yaml
29+
# - path: patches/cainjection_in_permissions.yaml
30+
# - path: patches/cainjection_in_schemareplications.yaml
31+
# - path: patches/cainjection_in_federations.yaml
32+
# - path: patches/cainjection_in_shovels.yaml
33+
# - path: patches/cainjection_in_superstreams.yaml
34+
# - path: patches/cainjection_in_topicpermissions.yaml
35+
# +kubebuilder:scaffold:crdkustomizecainjectionpatch
36+
437
resources:
538
- bases/rabbitmq.com_queues.yaml
639
- bases/rabbitmq.com_exchanges.yaml
@@ -17,36 +50,5 @@ resources:
1750
- bases/rabbitmq.com_topicpermissions.yaml
1851
# +kubebuilder:scaffold:crdkustomizeresource
1952

20-
#patchesStrategicMerge:
21-
#- patches/webhook_in_bindings.yaml
22-
#- patches/webhook_in_queues.yaml
23-
#- patches/webhook_in_exchanges.yaml
24-
#- patches/webhook_in_vhosts.yaml
25-
#- patches/webhook_in_policies.yaml
26-
#- patches/webhook_in_operatorpolicies.yaml
27-
#- patches/webhook_in_users.yaml
28-
#- patches/webhook_in_permissions.yaml
29-
#- patches/webhook_in_schemareplications.yaml
30-
#- patches/webhook_in_federations.yaml
31-
#- patches/webhook_in_shovels.yaml
32-
#- patches/webhook_in_superstreams.yaml
33-
#- patches/webhook_in_topicpermissions.yaml
34-
# +kubebuilder:scaffold:crdkustomizewebhookpatch
35-
36-
#- patches/cainjection_in_bindings.yaml
37-
#- patches/cainjection_in_queues.yaml
38-
#- patches/cainjection_in_exchanges.yaml
39-
#- patches/cainjection_in_vhosts.yaml
40-
#- patches/cainjection_in_policies.yaml
41-
#- patches/cainjection_in_operatorpolicies.yaml
42-
#- patches/cainjection_in_users.yaml
43-
#- patches/cainjection_in_permissions.yaml
44-
#- patches/cainjection_in_schemareplications.yaml
45-
#- patches/cainjection_in_federations.yaml
46-
#- patches/cainjection_in_shovels.yaml
47-
#- patches/cainjection_in_superstreams.yaml
48-
#- patches/cainjection_in_topicpermissions.yaml
49-
# +kubebuilder:scaffold:crdkustomizecainjectionpatch
50-
5153
configurations:
5254
- kustomizeconfig.yaml

config/crd/patches/cainjection_in_shovels.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# The following patch adds a directive for certmanager to inject CA into the CRD
2-
apiVersion: apiextensions.k8s.io
1+
apiVersion: apiextensions.k8s.io/v1
32
kind: CustomResourceDefinition
43
metadata:
54
annotations:

config/crd/patches/webhook_in_bindings.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ spec:
1010
webhook:
1111
conversionReviewVersions: ["v1", "v1beta1"]
1212
clientConfig:
13-
caBundle: Cg==
1413
service:
1514
namespace: system
16-
name: webhook-service
15+
name: messaging-topology-operator-webhook
1716
path: /convert

config/crd/patches/webhook_in_exchanges.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ spec:
1010
webhook:
1111
conversionReviewVersions: ["v1", "v1beta1"]
1212
clientConfig:
13-
caBundle: Cg==
1413
service:
1514
namespace: system
16-
name: webhook-service
15+
name: messaging-topology-operator-webhook
1716
path: /convert

config/crd/patches/webhook_in_federations.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ spec:
88
webhook:
99
conversionReviewVersions: ["v1", "v1beta1"]
1010
clientConfig:
11-
caBundle: Cg==
1211
service:
1312
namespace: system
14-
name: webhook-service
13+
name: messaging-topology-operator-webhook
1514
path: /convert

config/crd/patches/webhook_in_operatorpolicies.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ spec:
1010
webhook:
1111
conversionReviewVersions: ["v1", "v1beta1"]
1212
clientConfig:
13-
caBundle: Cg==
1413
service:
1514
namespace: system
16-
name: webhook-service
15+
name: messaging-topology-operator-webhook
1716
path: /convert

config/crd/patches/webhook_in_permissions.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ spec:
1010
webhook:
1111
conversionReviewVersions: ["v1", "v1beta1"]
1212
clientConfig:
13-
caBundle: Cg==
1413
service:
1514
namespace: system
16-
name: webhook-service
15+
name: messaging-topology-operator-webhook
1716
path: /convert

config/crd/patches/webhook_in_policies.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ spec:
1010
webhook:
1111
conversionReviewVersions: ["v1", "v1beta1"]
1212
clientConfig:
13-
caBundle: Cg==
1413
service:
1514
namespace: system
16-
name: webhook-service
15+
name: messaging-topology-operator-webhook
1716
path: /convert

config/crd/patches/webhook_in_queues.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ spec:
88
webhook:
99
conversionReviewVersions: ["v1", "v1beta1"]
1010
clientConfig:
11-
caBundle: Cg==
1211
service:
1312
namespace: system
14-
name: webhook-service
13+
name: messaging-topology-operator-webhook
1514
path: /convert

0 commit comments

Comments
 (0)