From 23e6cf735afae56f97f28bc1251a50a36211d737 Mon Sep 17 00:00:00 2001 From: IvanHunters Date: Wed, 19 Nov 2025 16:23:51 +0300 Subject: [PATCH] fix flatten with rabbit recomendation Signed-off-by: IvanHunters --- packages/library/cozy-lib/templates/_resources.tpl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/library/cozy-lib/templates/_resources.tpl b/packages/library/cozy-lib/templates/_resources.tpl index 82fd2391..daeee1a5 100644 --- a/packages/library/cozy-lib/templates/_resources.tpl +++ b/packages/library/cozy-lib/templates/_resources.tpl @@ -174,6 +174,16 @@ resource maps. {{- end }} {{- define "cozy-lib.resources.flatten" -}} +{{- /* +This helper either outputs raw ResourceQuota fields (e.g., services.loadbalancers) +as-is, or flattens sanitized resource maps into limits.* / requests.* keys. + +If ALL keys in the input are recognized quota keys (pods, services.*, etc.), +the input is output directly as YAML. Otherwise, the input is treated as a +resource map and processed through sanitize + flatten. + +Do not mix quota keys and resource keys in a single call. +*/ -}} {{- $input := index . 0 -}} {{- $ctx := index . 1 -}}