@@ -47,19 +47,19 @@ Defines the configurable parameters that developers can set when attaching this
4747
4848# ### Parameter Schema Syntax
4949
50- Uses the same inline schema syntax as ComponentType :
50+ Uses the same inline schema syntax as ComponentType : a single pipe after the type, then space-separated constraints:
5151
5252` ` `
53- fieldName: "type | default=value | required=true | enum=val1,val2"
53+ fieldName: "type | default=value enum=val1,val2"
5454` ` `
5555
5656**Example:**
5757
5858` ` ` yaml
5959schema:
6060 parameters:
61- volumeName: " string | required=true"
62- mountPath: " string | required=true"
61+ volumeName: string
62+ mountPath: string
6363 containerName: "string | default=app"
6464
6565 envOverrides:
@@ -110,7 +110,7 @@ Defines a modification using JSONPatch format (RFC 6902) with OpenChoreo extensi
110110
111111| Field | Type | Required | Description |
112112|---------|--------|----------|-------------------------------------------------------|
113- | `op` | string | Yes | Operation : ` add` , `replace`, `remove`, `mergeShallow` |
113+ | `op` | string | Yes | Operation : ` add` , `replace`, `remove` |
114114| `path` | string | Yes | JSON Pointer to the field (RFC 6901) |
115115| `value` | any | No | Value to set (not used for `remove`) |
116116
@@ -119,14 +119,13 @@ Defines a modification using JSONPatch format (RFC 6902) with OpenChoreo extensi
119119- **add**: Add a new field or array element
120120- **replace**: Replace an existing field value
121121- **remove**: Delete a field
122- - **mergeShallow**: OpenChoreo extension for overlaying map keys
123122
124123# ### Path Syntax
125124
126125Supports array filters for targeting specific elements :
127126
128127` ` `
129- /spec/containers/ [?(@.name=='app')]/volumeMounts/-
128+ /spec/containers[?(@.name=='app')]/volumeMounts/-
130129` ` `
131130
132131# # Examples
@@ -142,8 +141,8 @@ metadata:
142141spec:
143142 schema:
144143 parameters:
145- volumeName: " string | required=true"
146- mountPath: " string | required=true"
144+ volumeName: string
145+ mountPath: string
147146 containerName: "string | default=app"
148147
149148 envOverrides:
@@ -172,7 +171,7 @@ spec:
172171 kind: Deployment
173172 operations:
174173 - op: add
175- path: /spec/template/spec/containers/ [?(@.name=='${trait.parameters.containerName}')]/volumeMounts/-
174+ path: /spec/template/spec/containers[?(@.name=='${trait.parameters.containerName}')]/volumeMounts/-
176175 value:
177176 name: ${trait.parameters.volumeName}
178177 mountPath: ${trait.parameters.mountPath}
@@ -239,12 +238,12 @@ spec:
239238 version: v1
240239 kind: Deployment
241240 operations:
242- - op: mergeShallow
243- path: /spec/template/spec/containers/ [?(@.name=='main')]/resources
244- value:
245- limits:
246- cpu: ${trait.parameters.cpuLimit}
247- memory : ${trait.parameters.memoryLimit}
241+ - op: add
242+ path: /spec/template/spec/containers[?(@.name=='main')]/resources/limits/cpu
243+ value: ${trait.parameters.cpuLimit}
244+ - op: add
245+ path: /spec/template/spec/containers[?(@.name=='main')]/resources/limits/memory
246+ value : ${trait.parameters.memoryLimit}
248247` ` `
249248
250249# ## Multi-Container Trait with forEach
@@ -257,8 +256,12 @@ metadata:
257256 namespace: default
258257spec:
259258 schema:
259+ types:
260+ Mount:
261+ name: string
262+ path: string
260263 parameters:
261- mounts: "array<object> | required=true "
264+ mounts: "[]Mount "
262265
263266 patches:
264267 - target:
@@ -274,7 +277,7 @@ spec:
274277 name: ${mount.name}
275278 emptyDir: {}
276279 - op: add
277- path: /spec/template/spec/containers/ [?(@.name=='app')]/volumeMounts/-
280+ path: /spec/template/spec/containers[?(@.name=='app')]/volumeMounts/-
278281 value:
279282 name: ${mount.name}
280283 mountPath: ${mount.path}
0 commit comments