Skip to content

Commit

Permalink
added documentation for transform-replace
Browse files Browse the repository at this point in the history
Signed-off-by: Gilbert Scheiblhofer <[email protected]>
  • Loading branch information
gschei committed Jul 30, 2024
1 parent 9ad499b commit 466d36f
Showing 1 changed file with 21 additions and 0 deletions.
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

0 comments on commit 466d36f

Please sign in to comment.