aws: fix get version error (#2127)

* init

* only add awsLB to versions if installed
This commit is contained in:
Adrian Stobbe 2023-07-24 14:25:11 +02:00 committed by GitHub
parent 92abb890ef
commit 39cea48741
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.