Skip to content

Commit

Permalink
Fix kustomize v5 deprecation warnings
Browse files Browse the repository at this point in the history
Using 'kustomize edit fix' to fix 'patchesStrategicMerge', 'bases', and 'patchesJson6902' deprecations
  • Loading branch information
razo7 committed Jun 14, 2023
1 parent ce55cac commit 144013d
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 61 deletions.
3 changes: 2 additions & 1 deletion config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ resources:
- bases/fence-agents-remediation.medik8s.io_fenceagentsremediationtemplates.yaml
#+kubebuilder:scaffold:crdkustomizeresource

patchesStrategicMerge:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
#- patches/webhook_in_fenceagentsremediations.yaml
Expand All @@ -22,3 +21,5 @@ patchesStrategicMerge:
# the following config is for teaching kustomize how to do kustomization for CRDs.
configurations:
- kustomizeconfig.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
48 changes: 12 additions & 36 deletions config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@ namePrefix: fence-agents-remediation-

# Labels to add to all resources and selectors.
#commonLabels:
commonLabels:
app: "fence-agents-remediation-operator"

bases:
- ../crd
- ../rbac
- ../manager
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in
# crd/kustomization.yaml
#- ../webhook
Expand All @@ -25,11 +19,9 @@ bases:
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
#- ../prometheus

patchesStrategicMerge:
# Protect the /metrics endpoint by putting it behind auth.
# If you want your controller-manager to expose the /metrics
# endpoint w/o any authn/z, please comment the following line.
- manager_auth_proxy_patch.yaml

# Mount the controller config file for loading manager configurations
# through a ComponentConfig type
Expand All @@ -45,31 +37,15 @@ patchesStrategicMerge:
#- webhookcainjection_patch.yaml

# the following config is for teaching kustomize how to do var substitution
vars:
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
#- name: CERTIFICATE_NAMESPACE # namespace of the certificate CR
# objref:
# kind: Certificate
# group: cert-manager.io
# version: v1
# name: serving-cert # this name should match the one in certificate.yaml
# fieldref:
# fieldpath: metadata.namespace
#- name: CERTIFICATE_NAME
# objref:
# kind: Certificate
# group: cert-manager.io
# version: v1
# name: serving-cert # this name should match the one in certificate.yaml
#- name: SERVICE_NAMESPACE # namespace of the service
# objref:
# kind: Service
# version: v1
# name: webhook-service
# fieldref:
# fieldpath: metadata.namespace
#- name: SERVICE_NAME
# objref:
# kind: Service
# version: v1
# name: webhook-service
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../crd
- ../rbac
- ../manager
labels:
- includeSelectors: true
pairs:
app: fence-agents-remediation-operator
patches:
- path: manager_auth_proxy_patch.yaml
22 changes: 2 additions & 20 deletions config/manifests/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,5 @@ resources:
- ../default
- ../samples
- ../scorecard

# [WEBHOOK] To enable webhooks, uncomment all the sections with [WEBHOOK] prefix.
# Do NOT uncomment sections with prefix [CERTMANAGER], as OLM does not support cert-manager.
# These patches remove the unnecessary "cert" volume and its manager container volumeMount.
#patchesJson6902:
#- target:
# group: apps
# version: v1
# kind: Deployment
# name: controller-manager
# namespace: system
# patch: |-
# # Remove the manager container's "cert" volumeMount, since OLM will create and mount a set of certs.
# # Update the indices in this path if adding or removing containers/volumeMounts in the manager's Deployment.
# - op: remove
# path: /spec/template/spec/containers/1/volumeMounts/0
# # Remove the "cert" volume, since OLM will create and mount a set of certs.
# # Update the indices in this path if adding or removing volumes in the manager's Deployment.
# - op: remove
# path: /spec/template/spec/volumes/0
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
9 changes: 5 additions & 4 deletions config/scorecard/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
resources:
- bases/config.yaml
patchesJson6902:
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
patches:
- path: patches/basic.config.yaml
target:
group: scorecard.operatorframework.io
version: v1alpha3
kind: Configuration
name: config
version: v1alpha3
- path: patches/olm.config.yaml
target:
group: scorecard.operatorframework.io
version: v1alpha3
kind: Configuration
name: config
#+kubebuilder:scaffold:patchesJson6902
version: v1alpha3

0 comments on commit 144013d

Please sign in to comment.