diff --git a/go.mod b/go.mod index 0f615787..179ca3e7 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/orcaman/concurrent-map/v2 v2.0.1 github.com/osteele/liquid v1.3.2 github.com/pkg/errors v0.9.1 - github.com/pluralsh/console-client-go v0.1.15 + github.com/pluralsh/console-client-go v0.5.2 github.com/pluralsh/controller-reconcile-helper v0.0.4 github.com/pluralsh/gophoenix v0.1.3-0.20231201014135-dff1b4309e34 github.com/pluralsh/polly v0.1.7 diff --git a/go.sum b/go.sum index 44d7f575..02b3ef68 100644 --- a/go.sum +++ b/go.sum @@ -528,6 +528,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pluralsh/console-client-go v0.1.15 h1:1N8FxSkHbu29P7AtzF/tQbXlztM43CMATSNTxCulLhw= github.com/pluralsh/console-client-go v0.1.15/go.mod h1:eyCiLA44YbXiYyJh8303jk5JdPkt9McgCo5kBjk4lKo= +github.com/pluralsh/console-client-go v0.5.2 h1:vDiKzZ/vPFivr9TIXSSi/6Q1nOrH4y1huE5XkrCJ3D0= +github.com/pluralsh/console-client-go v0.5.2/go.mod h1:eyCiLA44YbXiYyJh8303jk5JdPkt9McgCo5kBjk4lKo= github.com/pluralsh/controller-reconcile-helper v0.0.4 h1:1o+7qYSyoeqKFjx+WgQTxDz4Q2VMpzprJIIKShxqG0E= github.com/pluralsh/controller-reconcile-helper v0.0.4/go.mod h1:AfY0gtteD6veBjmB6jiRx/aR4yevEf6K0M13/pGan/s= github.com/pluralsh/gophoenix v0.1.3-0.20231201014135-dff1b4309e34 h1:ab2PN+6if/Aq3/sJM0AVdy1SYuMAnq4g20VaKhTm/Bw= diff --git a/pkg/manifests/template/helm.go b/pkg/manifests/template/helm.go index dc01b09a..15348792 100644 --- a/pkg/manifests/template/helm.go +++ b/pkg/manifests/template/helm.go @@ -95,7 +95,12 @@ func (h *helm) Render(svc *console.GetServiceDeploymentForAgent_ServiceDeploymen } } - rel, err := h.templateHelm(config, svc.Name, svc.Namespace, values) + release := svc.Name + if svc.Helm != nil && svc.Helm.Release != nil { + release = *svc.Helm.Release + } + + rel, err := h.templateHelm(config, release, svc.Namespace, values) if err != nil { return nil, err } @@ -200,7 +205,7 @@ func (h *helm) valuesFile(svc *console.GetServiceDeploymentForAgent_ServiceDeplo return currentMap, nil } -func (h *helm) templateHelm(conf *action.Configuration, name, namespace string, values map[string]interface{}) (*release.Release, error) { +func (h *helm) templateHelm(conf *action.Configuration, release, namespace string, values map[string]interface{}) (*release.Release, error) { // load chart from the path chart, err := loader.Load(h.dir) if err != nil { @@ -212,7 +217,7 @@ func (h *helm) templateHelm(conf *action.Configuration, name, namespace string, if !DisableHelmTemplateDryRunServer { client.DryRunOption = "server" } - client.ReleaseName = name + client.ReleaseName = release client.Replace = true // Skip the name check client.ClientOnly = true client.Namespace = namespace