Skip to content

Commit 0d76248

Browse files
authored
Merge pull request kubernetes-sigs#1669 from shiftstack/kustomize
🌱Fix various issues with CRD generation
2 parents 08bfcfc + 74e96b0 commit 0d76248

18 files changed

+140
-417
lines changed

api/v1alpha5/zz_generated.deepcopy.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1alpha6/zz_generated.deepcopy.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1alpha7/zz_generated.deepcopy.go

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclusters.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.10.0
7-
creationTimestamp: null
6+
controller-gen.kubebuilder.io/version: v0.13.0
87
name: openstackclusters.infrastructure.cluster.x-k8s.io
98
spec:
109
group: infrastructure.cluster.x-k8s.io

config/crd/bases/infrastructure.cluster.x-k8s.io_openstackclustertemplates.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.10.0
7-
creationTimestamp: null
6+
controller-gen.kubebuilder.io/version: v0.13.0
87
name: openstackclustertemplates.infrastructure.cluster.x-k8s.io
98
spec:
109
group: infrastructure.cluster.x-k8s.io

config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachines.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.10.0
7-
creationTimestamp: null
6+
controller-gen.kubebuilder.io/version: v0.13.0
87
name: openstackmachines.infrastructure.cluster.x-k8s.io
98
spec:
109
group: infrastructure.cluster.x-k8s.io

config/crd/bases/infrastructure.cluster.x-k8s.io_openstackmachinetemplates.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.10.0
7-
creationTimestamp: null
6+
controller-gen.kubebuilder.io/version: v0.13.0
87
name: openstackmachinetemplates.infrastructure.cluster.x-k8s.io
98
spec:
109
group: infrastructure.cluster.x-k8s.io

config/crd/kustomization.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ resources:
1111
- bases/infrastructure.cluster.x-k8s.io_openstackclustertemplates.yaml
1212
# +kubebuilder:scaffold:crdkustomizeresource
1313

14-
patchesStrategicMerge:
14+
patches:
1515
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
1616
# patches here are for enabling the conversion webhook for each CRD
17-
- patches/webhook_in_openstackclusters.yaml
18-
- patches/webhook_in_openstackmachines.yaml
19-
- patches/webhook_in_openstackmachinetemplates.yaml
20-
- patches/webhook_in_openstackclustertemplates.yaml
17+
- path: patches/webhook_in_openstackclusters.yaml
18+
- path: patches/webhook_in_openstackmachines.yaml
19+
- path: patches/webhook_in_openstackmachinetemplates.yaml
20+
- path: patches/webhook_in_openstackclustertemplates.yaml
2121
# +kubebuilder:scaffold:crdkustomizewebhookpatch
2222

2323
# [CERTMANAGER] To enable webhook, uncomment all the sections with [CERTMANAGER] prefix.
2424
# patches here are for enabling the CA injection for each CRD
25-
- patches/cainjection_in_openstackclusters.yaml
26-
- patches/cainjection_in_openstackmachines.yaml
27-
- patches/cainjection_in_openstackmachinetemplates.yaml
28-
- patches/cainjection_in_openstackclustertemplates.yaml
25+
- path: patches/cainjection_in_openstackclusters.yaml
26+
- path: patches/cainjection_in_openstackmachines.yaml
27+
- path: patches/cainjection_in_openstackmachinetemplates.yaml
28+
- path: patches/cainjection_in_openstackclustertemplates.yaml
2929
# +kubebuilder:scaffold:crdkustomizecainjectionpatch
3030

3131
# the following config is for teaching kustomize how to do kustomization for CRDs.

config/default/cainjection_patch.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- op: add
2+
path: "/metadata/annotations/cert-manager.io~1inject-ca-from"
3+
value: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)

config/default/kustomization.yaml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,31 @@ commonLabels:
77

88
resources:
99
- namespace.yaml
10-
11-
bases:
1210
- ../crd
1311
- ../rbac
1412
- ../manager
1513
- ../webhook
1614
- ../certmanager
1715

18-
patchesStrategicMerge:
16+
patches:
1917
# Provide customizable hook for make targets.
20-
- manager_image_patch.yaml
21-
- manager_pull_policy.yaml
18+
- path: manager_image_patch.yaml
19+
- path: manager_pull_policy.yaml
2220
# Enable webhook.
23-
- manager_webhook_patch.yaml
21+
- path: manager_webhook_patch.yaml
2422
# Inject certificate in the webhook definition.
25-
- webhookcainjection_patch.yaml
23+
- target:
24+
group: admissionregistration.k8s.io
25+
version: v1
26+
kind: MutatingWebhookConfiguration
27+
name: mutating-webhook-configuration
28+
path: cainjection_patch.yaml
29+
- target:
30+
group: admissionregistration.k8s.io
31+
version: v1
32+
kind: ValidatingWebhookConfiguration
33+
name: validating-webhook-configuration
34+
path: cainjection_patch.yaml
2635

2736
vars:
2837
- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR

0 commit comments

Comments
 (0)