Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added documentation for transform-replace #796

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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