From cc2d868032f2eac0e4500b4776de545cd960babe Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Sun, 9 Apr 2023 22:58:19 -0400 Subject: [PATCH] Math Transforms: Document `ClampMin` and `ClampMax` Feature added in this PR: https://github.com/crossplane/crossplane/pull/3917 Signed-off-by: Julien Duchesne --- content/master/concepts/composition.md | 27 +++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/content/master/concepts/composition.md b/content/master/concepts/composition.md index 0d12d3e3..d5c74fc5 100644 --- a/content/master/concepts/composition.md +++ b/content/master/concepts/composition.md @@ -904,14 +904,39 @@ transform. ``` `math`. Transforms values using math. The input value must be an integer. -Currently only `multiply` is supported. +* math transform type `Multiply`, multiplies the input by the given value. +* math transform type `ClampMin`, sets a minimum value for the input. +* math transform type `ClampMax`, sets a maximum value for the input. ```yaml +# If you omit the field type, by default type is set to `Multiply` # If the value of the 'from' field is 2, the value of the 'to' field will be set # to 4. - type: math math: multiply: 2 + +# This is the same as above +# If the value of the 'from' field is 2, the value of the 'to' field will be set +# to 4. +- type: math + math: + type: Multiply + multiply: 2 + +# If the value of the 'from' field is 3, the value of the 'to' field will +# be set to 4. +- type: math + math: + type: ClampMin + clampMin: 4 + +# If the value of the 'from' field is 3, the value of the 'to' field will +# be set to 2. +- type: math + math: + type: ClampMax + clampMax: 2 ``` `string`. Transforms string values.