From 2deefae089f10b9aea07524f3938af6bca1b4f7b Mon Sep 17 00:00:00 2001 From: MisterMX Date: Tue, 24 Jan 2023 03:06:23 +0100 Subject: [PATCH] docs(compositions): Add docs for quantity transform (#292) Signed-off-by: Maximilian Blatt Signed-off-by: Maximilian Blatt --- content/master/reference/composition.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/content/master/reference/composition.md b/content/master/reference/composition.md index 8126891f..193d1a8f 100644 --- a/content/master/reference/composition.md +++ b/content/master/reference/composition.md @@ -779,6 +779,17 @@ true converts to integer 1 and float 1.0, while false converts to 0 and 0.0. toType: int ``` +Converting `string` to `float64` additionally supports parsing string in +[K8s quantity format](https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#Quantity), +such as `1000m` or `500 Mi`: + +```yaml +- type: convert + convert: + toType: float64 + format: quantity +``` + ### Connection Details Connection details secret of XR is an aggregated sum of the connection details