Skip to content

Commit 83dfaa6

Browse files
Merge pull request #89058 from porridge/overlays-configmaps
ROX-27332,ROX-27333: Overlays for configmaps
2 parents 9bc5d7c + 596babb commit 83dfaa6

File tree

1 file changed

+20
-11
lines changed

1 file changed

+20
-11
lines changed

modules/customize-installation-operator-overlays.adoc

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,21 @@ The following example shows the structure of an overlay:
3939
[source,yaml]
4040
----
4141
overlays:
42-
- apiVersion: v1 # <1>
43-
kind: ConfigMap # <2>
44-
name: my-configmap # <3>
42+
- apiVersion: v1 # <1>
43+
kind: ExampleKind # <2>
44+
name: my-resource # <3>
4545
patches:
46-
- path: .data # <4>
47-
value: | # <5>
46+
- path: .some.field # <4>
47+
value: | # <5>
4848
key1: data2
4949
key2: data2
5050
----
5151

5252
<1> Targeted Kubernetes resource ApiVersion, for example `apps/v1`, `v1`, `networking.k8s.io/v1`
5353
<2> Resource type (e.g., Deployment, ConfigMap, NetworkPolicy)
54-
<3> Name of the resource, for example `my-configmap`
54+
<3> Name of the resource, for example `my-resource`
5555
<4> JSONPath expression to the field, for example `spec.template.spec.containers[name:central].env[-1]`
56-
<5> YAML string for the new field value
56+
<5> YAML string for the new field value. If you do not want to use YAML parsing, you can use the `verbatim` key as shown in the following ConfigMap example.
5757

5858
[id="adding-an-overlay_{context}"]
5959
=== Adding an overlay
@@ -157,12 +157,21 @@ spec:
157157
kind: ConfigMap
158158
name: central-endpoints
159159
patches:
160-
- path: data
161-
value: |
162-
endpoints.yaml: |
163-
disableDefault: false
160+
- path: data.endpoints\.yaml
161+
verbatim: |
162+
disableDefault: false
163+
# another line
164164
----
165165

166+
This example shows how to override only a single item (file) under `data`.
167+
168+
Follow this example by taking these steps:
169+
170+
* Use the `verbatim` key, rather than `value`.
171+
This helps pass through characters such as newlines or quotes so that they are unaffected.
172+
* You must escape the dot in the filename in the `path` key as shown, or
173+
you can write the path as `data["endpoints.yaml"]`.
174+
166175
[id="adding-a-container-to-a-deployment_{context}"]
167176
=== Adding a container to the `Central` deployment
168177

0 commit comments

Comments
 (0)