Skip to content

Commit 5089bc3

Browse files
abaysGPT-5 (AI Assistant)
andcommitted
[OSPRH-19099] Use unified Kustomize patches; drop deprecated fields
Summary: - Replace deprecated Kustomize fields with the unified patches format. - Switch bases to resources in config/default. Changes: - config/default/kustomization.yaml: - bases -> resources - patchesStrategicMerge -> patches; entries converted to - path: ... - config/crd/kustomization.yaml: - patchesStrategicMerge -> patches; entries converted to - path: ... - config/scorecard/kustomization.yaml: - patchesJson6902 -> patches; JSON 6902 ops preserved under path with target - update scaffold marker to #+kubebuilder:scaffold:patches - config/manifests/kustomization.yaml: - comment example updated to use #patches: Validation: - kustomize build passes for config/default, config/crd, config/scorecard, and config/manifests. Motivation: - patchesStrategicMerge and patchesJson6902 are deprecated in Kustomize; using patches avoids subtle generation differences and aligns with other operators. References: - Jira: https://issues.redhat.com/browse/OSPRH-19099 - Upstream inspiration: openstack-k8s-operators/keystone-operator#610 Co-authored-by: GPT-5 (AI Assistant) <[email protected]>
1 parent 8b60a24 commit 5089bc3

File tree

4 files changed

+22
-19
lines changed

4 files changed

+22
-19
lines changed

config/crd/kustomization.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@ resources:
77
- bases/mariadb.openstack.org_mariadbaccounts.yaml
88
#+kubebuilder:scaffold:crdkustomizeresource
99

10-
patchesStrategicMerge:
10+
patches:
1111
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
1212
# patches here are for enabling the conversion webhook for each CRD
13-
#- patches/webhook_in_galeras.yaml
14-
#- patches/webhook_in_mariadbdatabases.yaml
15-
#- patches/webhook_in_mariadbaccounts.yaml
13+
#- path: patches/webhook_in_galeras.yaml
14+
#- path: patches/webhook_in_mariadbdatabases.yaml
15+
#- path: patches/webhook_in_mariadbaccounts.yaml
1616
#+kubebuilder:scaffold:crdkustomizewebhookpatch
1717

1818
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
1919
# patches here are for enabling the CA injection for each CRD
20-
#- patches/cainjection_in_galeras.yaml
21-
#- patches/cainjection_in_mariadbdatabases.yaml
22-
#- patches/cainjection_in_mariadbaccounts.yaml
20+
#- path: patches/cainjection_in_galeras.yaml
21+
#- path: patches/cainjection_in_mariadbdatabases.yaml
22+
#- path: patches/cainjection_in_mariadbaccounts.yaml
2323
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
2424

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

config/default/kustomization.yaml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ namespace: mariadb-operator-system
99
namePrefix: mariadb-operator-
1010

1111
# Labels to add to all resources and selectors.
12-
#commonLabels:
13-
# someName: someValue
12+
#labels:
13+
#- includeSelectors: true
14+
# includeTemplates: true
15+
# pairs:
16+
# someName: someValue
1417

15-
bases:
18+
resources:
1619
- ../crd
1720
- ../rbac
1821
- ../manager
@@ -24,27 +27,27 @@ bases:
2427
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
2528
#- ../prometheus
2629

27-
patchesStrategicMerge:
30+
patches:
2831
# Protect the /metrics endpoint by putting it behind auth.
2932
# If you want your controller-manager to expose the /metrics
3033
# endpoint w/o any authn/z, please comment the following line.
31-
- manager_auth_proxy_patch.yaml
34+
- path: manager_auth_proxy_patch.yaml
3235

3336
# Mount the controller config file for loading manager configurations
3437
# through a ComponentConfig type
35-
#- manager_config_patch.yaml
38+
#- path: manager_config_patch.yaml
3639

3740
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
3841
# crd/kustomization.yaml
39-
- manager_webhook_patch.yaml
42+
- path: manager_webhook_patch.yaml
4043

4144
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
4245
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
4346
# 'CERTMANAGER' needs to be enabled to use ca injection
44-
#- webhookcainjection_patch.yaml
47+
#- path: webhookcainjection_patch.yaml
4548

4649
# Injects our custom images (ENV variable settings)
47-
- manager_default_images.yaml
50+
- path: manager_default_images.yaml
4851

4952
# the following config is for teaching kustomize how to do var substitution
5053
vars:

config/manifests/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ resources:
99
# [WEBHOOK] To enable webhooks, uncomment all the sections with [WEBHOOK] prefix.
1010
# Do NOT uncomment sections with prefix [CERTMANAGER], as OLM does not support cert-manager.
1111
# These patches remove the unnecessary "cert" volume and its manager container volumeMount.
12-
#patchesJson6902:
12+
#patches:
1313
#- target:
1414
# group: apps
1515
# version: v1

config/scorecard/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
resources:
22
- bases/config.yaml
3-
patchesJson6902:
3+
patches:
44
- path: patches/basic.config.yaml
55
target:
66
group: scorecard.operatorframework.io
@@ -13,4 +13,4 @@ patchesJson6902:
1313
version: v1alpha3
1414
kind: Configuration
1515
name: config
16-
#+kubebuilder:scaffold:patchesJson6902
16+
#+kubebuilder:scaffold:patches

0 commit comments

Comments
 (0)