mirror of
https://github.com/truecharts/library-charts.git
synced 2026-07-07 08:40:23 -03:00
allow to override metallb shared key
This commit is contained in:
@@ -230,6 +230,26 @@ tests:
|
||||
some_key: value
|
||||
some_key1: value1
|
||||
|
||||
- it: should pass with addAnnotations set to true and overridden metalLBSharedKey
|
||||
documentIndex: *serviceDoc
|
||||
set:
|
||||
addAnnotations:
|
||||
traefik: true
|
||||
metallb: true
|
||||
service:
|
||||
main:
|
||||
type: LoadBalancer
|
||||
metalLBSharedKey: custom-shared-key
|
||||
ports:
|
||||
main:
|
||||
protocol: HTTPS
|
||||
asserts:
|
||||
- equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
traefik.ingress.kubernetes.io/service.serversscheme: https
|
||||
metallb.universe.tf/allow-shared-ip: custom-shared-key
|
||||
|
||||
- it: should pass with labels
|
||||
documentIndex: *serviceDoc
|
||||
set:
|
||||
|
||||
@@ -32,13 +32,17 @@ metadata:
|
||||
{{- with (include "ix.v1.common.util.labels.render" (dict "root" $root "labels" $labels) | trim) }}
|
||||
labels:
|
||||
{{- . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- $additionalAnnotations := dict -}}
|
||||
{{- if and $root.Values.addAnnotations.traefik (eq ($primaryPort.protocol | default "") "HTTPS") }}
|
||||
{{- if and $root.Values.addAnnotations.traefik (eq ($primaryPort.protocol | default "") "HTTPS") -}}
|
||||
{{- $_ := set $additionalAnnotations "traefik.ingress.kubernetes.io/service.serversscheme" "https" -}}
|
||||
{{- end -}}
|
||||
{{- if and $root.Values.addAnnotations.metallb (eq $svcType "LoadBalancer") }}
|
||||
{{- $_ := set $additionalAnnotations "metallb.universe.tf/allow-shared-ip" (include "ix.v1.common.names.fullname" $root) }}
|
||||
{{- if and $root.Values.addAnnotations.metallb (eq $svcType "LoadBalancer") -}}
|
||||
{{- $sharedLBKey := include "ix.v1.common.names.fullname" $root -}}
|
||||
{{- with $svcValues.metalLBSharedKey -}}
|
||||
{{- $sharedLBKey = tpl . $root -}}
|
||||
{{- end -}}
|
||||
{{- $_ := set $additionalAnnotations "metallb.universe.tf/allow-shared-ip" $sharedLBKey -}}
|
||||
{{- end -}}
|
||||
{{- $annotations := (mustMerge ($svcValues.annotations | default dict) (include "ix.v1.common.annotations" $root | fromYaml) $additionalAnnotations) -}}
|
||||
{{- with (include "ix.v1.common.util.annotations.render" (dict "root" $root "annotations" $annotations) | trim) }}
|
||||
|
||||
Reference in New Issue
Block a user