Skip to content

Commit c00a840

Browse files
abaysclaude
andcommitted
[OSPRH-19353] Remove deprecated Kustomize fields in config dir
Update all deprecated Kustomize fields to their modern equivalents across the config directory to ensure compatibility with Kustomize v5.3+ and future versions. Changes made: config/default/kustomization.yaml: - Replace 'patchesStrategicMerge:' with 'patches:' - Convert patch entries to use 'path:' format - Split webhook CA injection patch into separate mutating and validating patches for compatibility with modern Kustomize config/crd/kustomization.yaml: - Replace 'patchesStrategicMerge:' with 'patches:' - Update commented patch entries to use 'path:' format for both webhook and cainjection patches config/manifests/kustomization.yaml: - Replace commented '#patchesJson6902:' with '#patches:' config/scorecard/kustomization.yaml: - Replace 'patchesJson6902:' with 'patches:' - Update kubebuilder scaffold comment from 'patchesJson6902' to 'patches' config/default/mutatingwebhookcainjection_patch.yaml: - New file: separate mutating webhook configuration for CA injection config/default/validatingwebhookcainjection_patch.yaml: - Renamed from webhookcainjection_patch.yaml: separate validating webhook configuration for CA injection These changes eliminate deprecation warnings and align with the modern Kustomize field syntax while maintaining full backward compatibility. The webhook configuration split ensures certificate injection works properly with the modernized Kustomize patches field. Jira: https://issues.redhat.com/browse/OSPRH-19353 Co-authored-by: Claude <claude@anthropic.com>
1 parent 50fbf47 commit c00a840

6 files changed

Lines changed: 35 additions & 34 deletions

File tree

config/crd/kustomization.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@ resources:
1212
- bases/lightspeed.openstack.org_openstacklightspeeds.yaml
1313
#+kubebuilder:scaffold:crdkustomizeresource
1414

15-
patchesStrategicMerge:
15+
patches:
1616
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
1717
# patches here are for enabling the conversion webhook for each CRD
18-
#- patches/webhook_in_core_openstackcontrolplanes.yaml
19-
#- patches/webhook_in_client_openstackclients.yaml
20-
#- patches/webhook_in_core_openstackversions.yaml
21-
#- patches/webhook_in_operator_openstacks.yaml
18+
#- path: patches/webhook_in_core_openstackcontrolplanes.yaml
19+
#- path: patches/webhook_in_client_openstackclients.yaml
20+
#- path: patches/webhook_in_core_openstackversions.yaml
21+
#- path: patches/webhook_in_operator_openstacks.yaml
2222
#+kubebuilder:scaffold:crdkustomizewebhookpatch
2323

2424
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
2525
# patches here are for enabling the CA injection for each CRD
26-
#- patches/cainjection_in_core_openstackcontrolplanes.yaml
27-
#- patches/cainjection_in_client_openstackclients.yaml
28-
#- patches/cainjection_in_core_openstackversions.yaml
29-
#- patches/cainjection_in_operator_openstacks.yaml
30-
#- patches/cainjection_in_openstacklightspeeds.yaml
26+
#- path: patches/cainjection_in_core_openstackcontrolplanes.yaml
27+
#- path: patches/cainjection_in_client_openstackclients.yaml
28+
#- path: patches/cainjection_in_core_openstackversions.yaml
29+
#- path: patches/cainjection_in_operator_openstacks.yaml
30+
#- path: patches/cainjection_in_openstacklightspeeds.yaml
3131
#+kubebuilder:scaffold:crdkustomizecainjectionpatch
3232

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

config/default/kustomization.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,25 @@ resources:
2424
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
2525
#- ../prometheus
2626

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

3333
# Mount the controller config file for loading manager configurations
3434
# through a ComponentConfig type
35-
#- manager_config_patch.yaml
35+
#- path: manager_config_patch.yaml
3636

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

4141
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
4242
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
4343
# 'CERTMANAGER' needs to be enabled to use ca injection
44-
- webhookcainjection_patch.yaml
44+
- path: mutatingwebhookcainjection_patch.yaml
45+
- path: validatingwebhookcainjection_patch.yaml
4546

4647
# the following config is for teaching kustomize how to do var substitution
4748
vars:
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This patch add annotation to admission webhook config and
2+
# the variables $(CERTIFICATE_NAMESPACE) and $(CERTIFICATE_NAME) will be substituted by kustomize.
3+
apiVersion: admissionregistration.k8s.io/v1
4+
kind: MutatingWebhookConfiguration
5+
metadata:
6+
labels:
7+
app.kubernetes.io/name: mutatingingwebhookconfiguration
8+
app.kubernetes.io/instance: mutating-webhook-configuration
9+
app.kubernetes.io/component: webhook
10+
app.kubernetes.io/created-by: openstack-operator
11+
app.kubernetes.io/part-of: openstack-operator
12+
app.kubernetes.io/managed-by: kustomize
13+
name: mutating-webhook-configuration
14+
annotations:
15+
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# This patch add annotation to admission webhook config and
22
# the variables $(CERTIFICATE_NAMESPACE) and $(CERTIFICATE_NAME) will be substituted by kustomize.
3-
---
43
apiVersion: admissionregistration.k8s.io/v1
54
kind: ValidatingWebhookConfiguration
65
metadata:
@@ -13,18 +12,4 @@ metadata:
1312
app.kubernetes.io/managed-by: kustomize
1413
name: validating-webhook-configuration
1514
annotations:
16-
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
17-
---
18-
apiVersion: admissionregistration.k8s.io/v1
19-
kind: MutatingWebhookConfiguration
20-
metadata:
21-
labels:
22-
app.kubernetes.io/name: mutatingingwebhookconfiguration
23-
app.kubernetes.io/instance: mutating-webhook-configuration
24-
app.kubernetes.io/component: webhook
25-
app.kubernetes.io/created-by: openstack-operator
26-
app.kubernetes.io/part-of: openstack-operator
27-
app.kubernetes.io/managed-by: kustomize
28-
name: mutating-webhook-configuration
29-
annotations:
30-
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
15+
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)

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)