You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/pipelines/concepts/integrate_with_connector.mdx
+30-1Lines changed: 30 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -158,6 +158,10 @@ Output attributes calculated from parameters and connector information, and thei
158
158
attributes:
159
159
- name: url
160
160
param: git-url # Pipeline parameter name (when parameterized)
161
+
transform: # Optional value transform
162
+
prefix: "https://" # Add prefix before resolved attribute value
163
+
suffix: ".git" # Add suffix after resolved attribute value
164
+
accessor: "repository" # Read sub-value (field/index) from structured attribute
161
165
refPath: # Where this attribute is used
162
166
- tasks.git-clone.params.url # PipelineTask parameter that receives this value
163
167
- name: revision
@@ -171,8 +175,33 @@ attributes:
171
175
- **Attribute value** is calculated using the expression defined in `ResourceInterface.spec.attributes[].expression`
172
176
- **Parameterized attributes** create pipeline parameters (specified by `param` field)
173
177
- **Static attributes** use fixed values (specified by `value` field)
178
+
- **transform** optionally adjusts a resolved attribute value before mapping:
179
+
- `prefix`: adds a prefix string to the attribute value
180
+
- `suffix`: adds a suffix string to the attribute value
181
+
- `accessor`: selects a sub-value from structured attributes:
182
+
- for array attributes, use an index (for example, `"0"`)
183
+
- for object attributes, use a field name (for example, `"repository"`)
184
+
- after `accessor` selects a sub-value, the resulting attribute value is converted to `string`
174
185
- **refPath** defines where the attribute value is used in pipeline tasks
175
186
187
+
**Quick example (`transform`)**
188
+
189
+
```yaml
190
+
attributes:
191
+
- name: artifacts
192
+
param: chartRef
193
+
transform:
194
+
accessor: "0"
195
+
prefix: "oci://"
196
+
suffix: "-prod"
197
+
```
198
+
199
+
If the resolved `artifacts` value is `["registry.example.com/team/app"]`, this mapping uses the first item and produces `oci://registry.example.com/team/app-prod`.
200
+
201
+
- Use `accessor` when the attribute is an array/object and you only need one item/field.
202
+
- Use `prefix` when the downstream task expects a fixed protocol or literal prefix (for example, `oci://`).
203
+
- Use `suffix` when the downstream task needs a fixed postfix such as an environment marker (for example, `-prod`).
204
+
176
205
### Workspaces
177
206
178
207
Workspace mapping between ResourceInterface workspaces and pipeline workspaces:
@@ -310,4 +339,4 @@ For example:
310
339
## References
311
340
312
341
- <ExternalSiteLink name="connectors" href="/connectors/concepts/connector.html" children="What is Connector" />
313
-
- <ExternalSiteLink name="connectors" href="/connectors/concepts/resource_interface.html" children="What is ResourceInterface" />
342
+
- <ExternalSiteLink name="connectors" href="/connectors/concepts/resource_interface.html" children="What is ResourceInterface" />
0 commit comments