mirror of https://github.com/crossplane/docs.git
Math Transforms: Document `ClampMin` and `ClampMax`
Feature added in this PR: https://github.com/crossplane/crossplane/pull/3917 Signed-off-by: Julien Duchesne <julien.duchesne@grafana.com>
This commit is contained in:
parent
b1423cef55
commit
cc2d868032
|
@ -904,14 +904,39 @@ transform.
|
||||||
```
|
```
|
||||||
|
|
||||||
`math`. Transforms values using math. The input value must be an integer.
|
`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
|
```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
|
# If the value of the 'from' field is 2, the value of the 'to' field will be set
|
||||||
# to 4.
|
# to 4.
|
||||||
- type: math
|
- type: math
|
||||||
math:
|
math:
|
||||||
multiply: 2
|
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.
|
`string`. Transforms string values.
|
||||||
|
|
Loading…
Reference in New Issue