From a205b070377d40afa44c9b32e73241e8b68f56ad Mon Sep 17 00:00:00 2001 From: nhyatt Date: Sun, 26 Mar 2023 10:29:32 -0500 Subject: [PATCH] updates getDNSNames to use correct pramaeter order --- internal/config/initialize.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/config/initialize.go b/internal/config/initialize.go index 8c77aca..ee10bab 100644 --- a/internal/config/initialize.go +++ b/internal/config/initialize.go @@ -173,7 +173,7 @@ func certificateInit(cfg *Config) error { // certificate certificate is missing, create it if len(cfg.CertCert) == 0 { log.Printf("[TRACE] No server certificate detected") - csr, err := certificate.CreateCSR(cfg.CertPrivateKey, getDNSNames(cfg.NameSpace, cfg.ServiceName)) + csr, err := certificate.CreateCSR(cfg.CertPrivateKey, getDNSNames(cfg.ServiceName, cfg.NameSpace,)) if err != nil { return fmt.Errorf("Create CSR (%v)", err) } @@ -187,11 +187,10 @@ func certificateInit(cfg *Config) error { return nil } -func getDNSNames(ns, service string) []string { +func getDNSNames(service, ns string) []string { return []string{ fmt.Sprintf("%s", service), fmt.Sprintf("%s.%s", service, ns), - fmt.Sprintf("%s.%s", service, ns), fmt.Sprintf("%s.%s.svc", service, ns), fmt.Sprintf("%s.%s.svc.cluster", service, ns), fmt.Sprintf("%s.%s.svc.cluster.local", service, ns),