Skip to content
Merged
Show file tree
Hide file tree
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
19 changes: 19 additions & 0 deletions content/master/guides/function-patch-and-transform.md
Original file line number Diff line number Diff line change
Expand Up @@ -1655,6 +1655,25 @@ patches:
trim: `-north-1'
```

#### Replace

The `type: Replace` replaces all occurrences of the `search` string with the `replace` string. If `replace` is an empty string, it removes the `search` string.


```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
19 changes: 19 additions & 0 deletions content/v1.20/guides/function-patch-and-transform.md
Original file line number Diff line number Diff line change
Expand Up @@ -1678,6 +1678,25 @@ patches:
trim: `-north-1'
```

#### Replace

The `type: Replace` replaces all occurrences of the `search` string with the `replace` string. If `replace` is an empty string, it removes the `search` string.


```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
19 changes: 19 additions & 0 deletions content/v2.0/guides/function-patch-and-transform.md
Original file line number Diff line number Diff line change
Expand Up @@ -1655,6 +1655,25 @@ patches:
trim: `-north-1'
```

#### Replace

The `type: Replace` replaces all occurrences of the `search` string with the `replace` string. If `replace` is an empty string, it removes the `search` string.


```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
19 changes: 19 additions & 0 deletions content/v2.1/guides/function-patch-and-transform.md
Original file line number Diff line number Diff line change
Expand Up @@ -1655,6 +1655,25 @@ patches:
trim: `-north-1'
```

#### Replace

The `type: Replace` replaces all occurrences of the `search` string with the `replace` string. If `replace` is an empty string, it removes the `search` string.


```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
Loading