Skip to content

Commit 394decc

Browse files
author
Mengqi Yu
committed
✨ replace patches with patchesStrategicMerge
kustomize has deprecated `patches` fields for months. It should be replaced by `patchesStrategicMerge`. This is not considered as a breaking change since kustomize will auto convert patches if in old format.
1 parent 7be1de3 commit 394decc

File tree

7 files changed

+6
-7
lines changed

7 files changed

+6
-7
lines changed

go.sum

-1
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,3 @@ gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
6868
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
6969
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
7070
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
71-

pkg/scaffold/project/kustomize.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ bases:
6969
- ../rbac
7070
- ../manager
7171
72-
patches:
72+
patchesStrategicMerge:
7373
- manager_image_patch.yaml
7474
# Protect the /metrics endpoint by putting it behind auth.
7575
# Only one of manager_auth_proxy_patch.yaml and

pkg/scaffold/v2/crd/kustomization.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ var kustomizationTemplate = fmt.Sprintf(`# This kustomization.yaml is not intend
8181
resources:
8282
%s
8383
84-
patches:
84+
patchesStrategicMerge:
8585
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
8686
# patches here are for enabling the conversion webhook for each CRD
8787
%s

pkg/scaffold/v2/kustomize.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ bases:
7474
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'. 'WEBHOOK' components are required.
7575
#- ../certmanager
7676
77-
patches:
77+
patchesStrategicMerge:
7878
# Protect the /metrics endpoint by putting it behind auth.
7979
# Only one of manager_auth_proxy_patch.yaml and
8080
# manager_prometheus_metrics_patch.yaml should be enabled.

testdata/gopath/src/project/config/default/kustomization.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ bases:
1616
- ../rbac
1717
- ../manager
1818

19-
patches:
19+
patchesStrategicMerge:
2020
- manager_image_patch.yaml
2121
# Protect the /metrics endpoint by putting it behind auth.
2222
# Only one of manager_auth_proxy_patch.yaml and

testdata/project-v2/config/crd/kustomization.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ resources:
77
- bases/crew.testproject.org_admirals.yaml
88
# +kubebuilder:scaffold:crdkustomizeresource
99

10-
patches:
10+
patchesStrategicMerge:
1111
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
1212
# patches here are for enabling the conversion webhook for each CRD
1313
#- patches/webhook_in_captains.yaml

testdata/project-v2/config/default/kustomization.yaml

+1-1
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
# Protect the /metrics endpoint by putting it behind auth.
2626
# Only one of manager_auth_proxy_patch.yaml and
2727
# manager_prometheus_metrics_patch.yaml should be enabled.

0 commit comments

Comments
 (0)