From a3ceed37b1140ab367e5bb5ab7d7dd0c05fd0607 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten Date: Thu, 7 Mar 2024 12:25:04 +0100 Subject: [PATCH] Update _additionalAnnotations.tpl --- .../templates/lib/service/_additionalAnnotations.tpl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/library/common/templates/lib/service/_additionalAnnotations.tpl b/library/common/templates/lib/service/_additionalAnnotations.tpl index 2c426944..444f2818 100644 --- a/library/common/templates/lib/service/_additionalAnnotations.tpl +++ b/library/common/templates/lib/service/_additionalAnnotations.tpl @@ -20,8 +20,11 @@ annotations: The annotations variable reference, to append the MetalLB annotatio {{- if (hasKey $rootCtx.Values.global "metallb") -}} {{- if $rootCtx.Values.global.metallb.addServiceAnnotations -}} - - {{- if eq $objectData.externalTrafficPolicy "Cluster" -}} + {{- if $objectData.externalTrafficPolicy -}} + {{- if ne $objectData.externalTrafficPolicy "Local" -}} + {{- $_ := set $annotations "metallb.universe.tf/allow-shared-ip" $sharedKey -}} + {{- end -}} + {{- else -}} {{- $_ := set $annotations "metallb.universe.tf/allow-shared-ip" $sharedKey -}} {{- end -}}