Skip to content

Commit cc2a4cb

Browse files
authored
Merge pull request #934 from mengqiy/makefilekustomize
✨ use kustomize to apply CRDs
2 parents 3b35bcb + 65162ac commit cc2a4cb

File tree

6 files changed

+7
-9
lines changed

6 files changed

+7
-9
lines changed

docs/book/src/cronjob-tutorial/testdata/project/config/crd/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ resources:
55
- bases/batch.tutorial.kubebuilder.io_cronjobs.yaml
66
# +kubebuilder:scaffold:kustomizeresource
77

8-
patches:
8+
patchesStrategicMerge:
99
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
1010
# patches here are for enabling the conversion webhook for each CRD
1111
#- patches/webhook_in_cronjobs.yaml

docs/book/src/cronjob-tutorial/testdata/project/config/default/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ bases:
2121
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required.
2222
- ../certmanager
2323

24-
patches:
24+
patchesStrategicMerge:
2525
- manager_image_patch.yaml
2626
# Protect the /metrics endpoint by putting it behind auth.
2727
# Only one of manager_auth_proxy_patch.yaml and

docs/book/src/multiversion-tutorial/testdata/project/config/crd/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ resources:
55
- bases/batch.tutorial.kubebuilder.io_cronjobs.yaml
66
# +kubebuilder:scaffold:kustomizeresource
77

8-
patches:
8+
patchesStrategicMerge:
99
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
1010
# patches here are for enabling the conversion webhook for each CRD
1111
- patches/webhook_in_cronjobs.yaml
1212
# +kubebuilder:scaffold:kustomizepatch
1313

1414
# [CERTMANAGER] To enable webhook, uncomment all the sections with [CERTMANAGER] prefix.
1515
# patches here are for enabling the CA injection for each CRD
16-
- patches/cainjection_in_cronjobs.yaml
16+
#- patches/cainjection_in_cronjobs.yaml
1717
# +kubebuilder:scaffold:crdkustomizecainjectionpatch
1818

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

docs/book/src/multiversion-tutorial/testdata/project/config/default/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ bases:
2121
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required.
2222
- ../certmanager
2323

24-
patches:
24+
patchesStrategicMerge:
2525
- manager_image_patch.yaml
2626
# Protect the /metrics endpoint by putting it behind auth.
2727
# Only one of manager_auth_proxy_patch.yaml and

pkg/scaffold/v2/makefile.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,10 @@ run: generate fmt vet manifests
7171
7272
# Install CRDs into a cluster
7373
install: manifests
74-
kubectl apply -f config/crd/bases
74+
kustomize build config/crd | kubectl apply -f -
7575
7676
# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
7777
deploy: manifests
78-
kubectl apply -f config/crd/bases
7978
cd config/manager && kustomize edit set image controller=${IMG}
8079
kustomize build config/default | kubectl apply -f -
8180

testdata/project-v2/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ run: generate fmt vet manifests
2727

2828
# Install CRDs into a cluster
2929
install: manifests
30-
kubectl apply -f config/crd/bases
30+
kustomize build config/crd | kubectl apply -f -
3131

3232
# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
3333
deploy: manifests
34-
kubectl apply -f config/crd/bases
3534
cd config/manager && kustomize edit set image controller=${IMG}
3635
kustomize build config/default | kubectl apply -f -
3736

0 commit comments

Comments
 (0)