Skip to content

Commit e6d1eeb

Browse files
authored
Merge pull request #2526 from lizardruss/patch-docs
docs: update patch path examples to match v2beta1 schema
2 parents 1dddb94 + e82c2b7 commit e6d1eeb

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

docs/pages/configuration/profiles/patches.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,21 @@ The `name` option is mandatory and expects a string defining the name of the pro
6464
### `patches`
6565
The `patches` option expects an array of patch objects which consists of the following properties:
6666
- `op` stating the patch operation (possible values: `replace`, `add`, `remove`)
67-
- `path` stating a jsonpath or a xpath within the config (e.g. `images.backend.image`, `deployments.name=backend.helm.values.containers[1]`)
67+
- `path` stating a jsonpath or a xpath within the config (e.g. `images.backend.image`, `deployments.backend.helm.values.containers.name=backend`)
6868
- `value` stating an arbitrary value used by the operation (e.g. a string, an integer, a boolean, a yaml object)
6969

7070
:::warning `op: add` only for arrays
71-
Using `op: add` only works as expected when `path` points to an array value. Using `op: add` to add properties to an object (e.g. `deployments[*].helm.values`) will **not** work and instead replace all existing properties.
71+
Using `op: add` only works as expected when `path` points to an array value. Using `op: add` to add properties to an object (e.g. `deployments.*.helm.values`) will **not** work and instead replace all existing properties.
7272
:::
7373

7474
:::tip Array Paths
75-
When you want to define a `path` that contains an array (e.g. `deployments`), you have several options:
75+
When you want to define a `path` that contains an array (e.g. `hooks`), you have several options:
7676

77-
1. Use the index of the array item you want to patch, e.g. `deployments[0]`, `deployments/0`
78-
2. Use a property selector matching the array item(s) you want to patch, e.g. `deployments.name=backend`
79-
3. Use a wildcard selector to match all array item(s), e.g. `deployments.*`,`deployments[*]` or `deployments/*`
80-
4. Use a comparison selector matching the array item(s) you want to patch, e.g. `deployments[?(@.helm.timeout=='1000s')]`
81-
5. Use a regular expression selector matching the array item(s) you want to patch, e.g. `deployments[?(@.name=~/^production/)]`
77+
1. Use the index of the array item you want to patch, e.g. `hooks[0]`, `hooks/0`
78+
2. Use a property selector matching the array item(s) you want to patch, e.g. `hooks.name=backend`
79+
3. Use a wildcard selector to match all array item(s), e.g. `hooks.*`,`hooks[*]` or `hooks/*`
80+
4. Use a comparison selector matching the array item(s) you want to patch, e.g. `hooks[?(@.events=='before:build')]`
81+
5. Use a regular expression selector matching the array item(s) you want to patch, e.g. `hooks[?(@.name=~/^production/)]`
8282

8383
Using a selector rather than the array index is often better because it is more resilient and will not cause any issues even if the order of an array's items is changed later on. A selector is also able to select multiple array items if all of them have the same value for this property.
8484
:::

0 commit comments

Comments
 (0)