Skip to content

Commit

Permalink
docs: replace patchesStrategicMerge with patches in tests/docs (a…
Browse files Browse the repository at this point in the history
…rgoproj#3010)

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 <[email protected]>
Signed-off-by: Philip Clark <[email protected]>
  • Loading branch information
therealdwright authored and phclark committed Oct 13, 2023
1 parent 7c4f01e commit 8928032
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 39 deletions.
26 changes: 13 additions & 13 deletions docs/features/kustomize.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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).
Expand Down
4 changes: 2 additions & 2 deletions examples/notifications/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ kind: Kustomization
resources:
- ../../manifests/notifications

patchesStrategicMerge:
- configmap.yaml
patches:
- path: configmap.yaml
4 changes: 2 additions & 2 deletions manifests/namespace-install/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions manifests/notifications/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
24 changes: 12 additions & 12 deletions test/kustomize/rollout/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8928032

Please sign in to comment.