From 39cea48741fc3a1c2e4745ae7a582235a8cf365b Mon Sep 17 00:00:00 2001 From: Adrian Stobbe Date: Mon, 24 Jul 2023 14:25:11 +0200 Subject: [PATCH] aws: fix get version error (#2127) * init * only add awsLB to versions if installed --- cli/internal/helm/client.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cli/internal/helm/client.go b/cli/internal/helm/client.go index e884830c6..9ba346a6d 100644 --- a/cli/internal/helm/client.go +++ b/cli/internal/helm/client.go @@ -206,17 +206,20 @@ func (c *Client) Versions() (ServiceVersions, error) { return ServiceVersions{}, fmt.Errorf("getting %s version: %w", constellationServicesInfo.releaseName, err) } awsLBVersion, err := c.currentVersion(awsLBControllerInfo.releaseName) - if !errors.Is(err, errReleaseNotFound) { + if err != nil && !errors.Is(err, errReleaseNotFound) { return ServiceVersions{}, fmt.Errorf("getting %s version: %w", awsLBControllerInfo.releaseName, err) } - return ServiceVersions{ + res := ServiceVersions{ cilium: compatibility.EnsurePrefixV(ciliumVersion), certManager: compatibility.EnsurePrefixV(certManagerVersion), constellationOperators: compatibility.EnsurePrefixV(operatorsVersion), constellationServices: compatibility.EnsurePrefixV(servicesVersion), - awsLBController: compatibility.EnsurePrefixV(awsLBVersion), - }, nil + } + if awsLBVersion != "" { + res.awsLBController = compatibility.EnsurePrefixV(awsLBVersion) + } + return res, nil } // currentVersion returns the version of the currently installed helm release.