Skip to content

Commit 4fc7ef3

Browse files
committed
added documentation for transform-replace
1 parent 9ad499b commit 4fc7ef3

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

content/master/concepts/patch-and-transform.md

+21
Original file line numberDiff line numberDiff line change
@@ -1541,6 +1541,7 @@ String transforms support the following
15411541
* [Regexp](#regular-expression-type)
15421542
* [TrimPrefix](#trim-prefix)
15431543
* [TrimSuffix](#trim-suffix)
1544+
* [Replace](#replace)
15441545

15451546
#### String convert
15461547

@@ -1663,6 +1664,26 @@ patches:
16631664
trim: `-north-1'
16641665
```
16651666

1667+
#### Replace
1668+
1669+
The {{<hover label="typeReplace" line="8">}}type: Replace{{</hover>}} replaces all occurrences of the {{<hover label="typeReplace" line="10">}}search{{</hover>}} string with the {{<hover label="typeReplace" line="11">}}replace{{</hover>}} string. If `replace` is an empty string, then the `search` string is removed.
1670+
1671+
1672+
```yaml {label="typeReplace"}
1673+
patches:
1674+
- type: FromCompositeFieldPath
1675+
fromFieldPath: spec.location
1676+
toFieldPath: spec.forProvider.region
1677+
transforms:
1678+
- type: string
1679+
string:
1680+
type: Replace
1681+
replace:
1682+
search: "europe"
1683+
replace: "eu"
1684+
```
1685+
1686+
16661687
## Patch policies
16671688

16681689
Crossplane supports two types of patch policies:

0 commit comments

Comments
 (0)