From 9b392a1f645d1b21874b040904789ae3ec416979 Mon Sep 17 00:00:00 2001 From: Patrice Ferlet Date: Fri, 8 Nov 2024 16:55:18 +0100 Subject: [PATCH] Fix problem on getting tls mapping The types were not compatible to get TLS activation --- generator/ingress.go | 2 +- generator/values.go | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/generator/ingress.go b/generator/ingress.go index c407872..7d012d4 100644 --- a/generator/ingress.go +++ b/generator/ingress.go @@ -55,7 +55,7 @@ func NewIngress(service types.ServiceConfig, Chart *HelmChart) *Ingress { Host: mapping.Hostname, Class: mapping.Class, Annotations: mapping.Annotations, - TLS: mapping.TLS, + TLS: TLS{Enabled: mapping.TLS.Enabled}, } // ingressClassName := `{{ .Values.` + service.Name + `.ingress.class }}` diff --git a/generator/values.go b/generator/values.go index 9d57eba..2b6f83a 100644 --- a/generator/values.go +++ b/generator/values.go @@ -20,6 +20,10 @@ type PersistenceValue struct { Enabled bool `yaml:"enabled"` } +type TLS struct { + Enabled bool `yaml:"enabled"` +} + // IngressValue is a ingress configuration that will be saved in values.yaml. type IngressValue struct { Annotations map[string]string `yaml:"annotations"` @@ -27,9 +31,7 @@ type IngressValue struct { Path string `yaml:"path"` Class string `yaml:"class"` Enabled bool `yaml:"enabled"` - TLS struct { - Enabled bool `yaml:"enabled"` - } `yaml:"tls"` + TLS TLS `yaml:"tls"` } // Value will be saved in values.yaml. It contains configuraiton for all deployment and services.