Skip to content

Commit

Permalink
replacements documentation for escaping '.'
Browse files Browse the repository at this point in the history
  • Loading branch information
natasha41575 committed Oct 4, 2021
1 parent b2199de commit 8313fa6
Showing 1 changed file with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,27 @@ The fieldPath and fieldPaths fields support a format of a '.'-separated path to

`metadata.name`

Strings are used for mapping nodes. For sequence nodes, we support two options:
You can escape the '.' one of two ways. For example, say we have the following resource:

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
config.kubernetes.io/local-config: true # this is what we want to target
```

We can express our path:

1. Index by number:
1. With a '\': `metadata.annotations.config\.kubernetes\.io/local-config`

`spec.template.spec.containers.1.image`
2. With '[]': `metadata.annotations.[config.kubernetes.io/local-config]`

Strings are used for mapping nodes. For sequence nodes, we support two options:

2. Index by key-value pair:
1. Index by number: `spec.template.spec.containers.1.image`

`spec.template.spec.containers.[name=nginx].image`
2. Index by key-value pair: `spec.template.spec.containers.[name=nginx].image`


### Example
Expand Down

0 comments on commit 8313fa6

Please sign in to comment.