Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions content/master/concepts/patch-and-transform.md
Original file line number Diff line number Diff line change
Expand Up @@ -1541,6 +1541,7 @@ String transforms support the following
* [Regexp](#regular-expression-type)
* [TrimPrefix](#trim-prefix)
* [TrimSuffix](#trim-suffix)
* [Replace](#replace)

#### String convert

Expand Down Expand Up @@ -1663,6 +1664,26 @@ patches:
trim: `-north-1'
```

#### Replace

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.


```yaml {label="typeReplace"}
patches:
- type: FromCompositeFieldPath
fromFieldPath: spec.location
toFieldPath: spec.forProvider.region
transforms:
- type: string
string:
type: Replace
replace:
search: "europe"
replace: "eu"
```


## Patch policies

Crossplane supports two types of patch policies:
Expand Down