From 466d36fdaf50c7e05817043950dd5f63f05f33df Mon Sep 17 00:00:00 2001 From: Gilbert Scheiblhofer Date: Tue, 30 Jul 2024 22:12:18 +0200 Subject: [PATCH] added documentation for transform-replace Signed-off-by: Gilbert Scheiblhofer --- .../master/concepts/patch-and-transform.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/content/master/concepts/patch-and-transform.md b/content/master/concepts/patch-and-transform.md index d0c6051f..89fce938 100644 --- a/content/master/concepts/patch-and-transform.md +++ b/content/master/concepts/patch-and-transform.md @@ -1541,6 +1541,7 @@ String transforms support the following * [Regexp](#regular-expression-type) * [TrimPrefix](#trim-prefix) * [TrimSuffix](#trim-suffix) +* [Replace](#replace) #### String convert @@ -1663,6 +1664,26 @@ 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, 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: