From e18bba1a4b215bbf2f5132dff357d472116de8d7 Mon Sep 17 00:00:00 2001 From: Daniel Wright Date: Mon, 4 Sep 2023 08:14:40 +1000 Subject: [PATCH] docs: replace `patchesStrategicMerge` with `patches` in tests/docs This update ensures documentation and test examples reflect the use of the newer `patches` method, transitioning away from the deprecated `patchesStrategicMerge`. This aligns with current best practices and recommendations from the kustomize project. Signed-off-by: Daniel Wright --- docs/features/kustomize.md | 26 +++++++++---------- examples/notifications/kustomization.yaml | 4 +-- .../namespace-install/kustomization.yaml | 4 +-- manifests/notifications/kustomization.yaml | 20 +++++++------- test/kustomize/rollout/kustomization.yaml | 24 ++++++++--------- 5 files changed, 39 insertions(+), 39 deletions(-) diff --git a/docs/features/kustomize.md b/docs/features/kustomize.md index 4efa4144a0..e1a691b511 100644 --- a/docs/features/kustomize.md +++ b/docs/features/kustomize.md @@ -4,7 +4,7 @@ Kustomize can be extended to understand CRD objects through the use of [transformer configs](https://github.com/kubernetes-sigs/kustomize/tree/master/examples/transformerconfigs). Using transformer configs, kustomize can be "taught" about the structure of a Rollout object and leverage kustomize features such as ConfigMap/Secret generators, variable references, and common -labels & annotations. To use Rollouts with kustomize: +labels & annotations. To use Rollouts with kustomize: 1. Download [`rollout-transform.yaml`](kustomize/rollout-transform.yaml) into your kustomize directory. @@ -65,18 +65,18 @@ resources: openapi: path: https://raw.githubusercontent.com/argoproj/argo-schema-generator/main/schema/argo_all_k8s_kustomize_schema.json -patchesStrategicMerge: -- |- - apiVersion: argoproj.io/v1alpha1 - kind: Rollout - metadata: - name: rollout-canary - spec: - template: - spec: - containers: - - name: rollouts-demo - image: nginx +patches: +- patch: |- + apiVersion: argoproj.io/v1alpha1 + kind: Rollout + metadata: + name: rollout-canary + spec: + template: + spec: + containers: + - name: rollouts-demo + image: nginx ``` The OpenAPI data is auto-generated and defined in this [file](https://github.com/argoproj/argo-schema-generator/blob/main/schema/argo_all_k8s_kustomize_schema.json). diff --git a/examples/notifications/kustomization.yaml b/examples/notifications/kustomization.yaml index df8b1ffb2f..73154065be 100644 --- a/examples/notifications/kustomization.yaml +++ b/examples/notifications/kustomization.yaml @@ -4,5 +4,5 @@ kind: Kustomization resources: - ../../manifests/notifications -patchesStrategicMerge: -- configmap.yaml \ No newline at end of file +patches: +- path: configmap.yaml diff --git a/manifests/namespace-install/kustomization.yaml b/manifests/namespace-install/kustomization.yaml index 5d902d1c4c..153432ec04 100644 --- a/manifests/namespace-install/kustomization.yaml +++ b/manifests/namespace-install/kustomization.yaml @@ -8,8 +8,8 @@ bases: resources: - argo-rollouts-rolebinding.yaml -patchesStrategicMerge: -- add-namespaced-flag.yaml +patches: +- path: add-namespaced-flag.yaml patchesJson6902: - path: clusterrole-to-role.yaml diff --git a/manifests/notifications/kustomization.yaml b/manifests/notifications/kustomization.yaml index e8b7beeed9..751122f02c 100644 --- a/manifests/notifications/kustomization.yaml +++ b/manifests/notifications/kustomization.yaml @@ -4,13 +4,13 @@ kind: Kustomization resources: - argo-rollouts-notification-configmap.yaml -patchesStrategicMerge: - - on-rollout-completed.yaml - - on-scaling-replica-set.yaml - - on-rollout-step-completed.yaml - - on-rollout-updated.yaml - - on-rollout-aborted.yaml - - on-rollout-paused.yaml - - on-analysis-run-running.yaml - - on-analysis-run-error.yaml - - on-analysis-run-failed.yaml +patches: + - path: on-rollout-completed.yaml + - path: on-scaling-replica-set.yaml + - path: on-rollout-step-completed.yaml + - path: on-rollout-updated.yaml + - path: on-rollout-aborted.yaml + - path: on-rollout-paused.yaml + - path: on-analysis-run-running.yaml + - path: on-analysis-run-error.yaml + - path: on-analysis-run-failed.yaml diff --git a/test/kustomize/rollout/kustomization.yaml b/test/kustomize/rollout/kustomization.yaml index 71a3660e3c..6f451758d9 100644 --- a/test/kustomize/rollout/kustomization.yaml +++ b/test/kustomize/rollout/kustomization.yaml @@ -45,15 +45,15 @@ images: openapi: path: https://raw.githubusercontent.com/argoproj/argo-schema-generator/main/schema/argo_all_k8s_kustomize_schema.json -patchesStrategicMerge: -- |- - apiVersion: argoproj.io/v1alpha1 - kind: Rollout - metadata: - name: guestbook - spec: - template: - spec: - containers: - - name: guestbook - image: guestbook-patched:v1 +patches: +- patch: |- + apiVersion: argoproj.io/v1alpha1 + kind: Rollout + metadata: + name: guestbook + spec: + template: + spec: + containers: + - name: guestbook + image: guestbook-patched:v1