mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-23 14:39:40 -05:00
cli: only install aws-lb and csi charts conditionally (#2131)
* init * upgrade csi chart conditionally
This commit is contained in:
parent
7152633255
commit
04dc6256e6
@ -14,6 +14,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/edgelesssys/constellation/v2/cli/internal/clusterid"
|
||||
"github.com/edgelesssys/constellation/v2/internal/cloud/cloudprovider"
|
||||
"github.com/edgelesssys/constellation/v2/internal/compatibility"
|
||||
"github.com/edgelesssys/constellation/v2/internal/config"
|
||||
"github.com/edgelesssys/constellation/v2/internal/constants"
|
||||
@ -109,8 +110,7 @@ func (c *Client) Upgrade(ctx context.Context, config *config.Config, idFile clus
|
||||
upgradeErrs := []error{}
|
||||
upgradeReleases := []*chart.Chart{}
|
||||
newReleases := []*chart.Chart{}
|
||||
|
||||
for _, info := range []chartInfo{ciliumInfo, certManagerInfo, constellationOperatorsInfo, constellationServicesInfo, csiInfo, awsLBControllerInfo} {
|
||||
for _, info := range getManagedCharts(config) {
|
||||
c.log.Debugf("Checking release %s", info.releaseName)
|
||||
chart, err := loadChartsDir(helmFS, info.path)
|
||||
if err != nil {
|
||||
@ -187,6 +187,17 @@ func (c *Client) Upgrade(ctx context.Context, config *config.Config, idFile clus
|
||||
return errors.Join(upgradeErrs...)
|
||||
}
|
||||
|
||||
func getManagedCharts(config *config.Config) []chartInfo {
|
||||
charts := []chartInfo{ciliumInfo, certManagerInfo, constellationOperatorsInfo, constellationServicesInfo, csiInfo}
|
||||
if config.GetProvider() == cloudprovider.AWS {
|
||||
charts = append(charts, awsLBControllerInfo)
|
||||
}
|
||||
if config.DeployCSIDriver() {
|
||||
charts = append(charts, csiInfo)
|
||||
}
|
||||
return charts
|
||||
}
|
||||
|
||||
// Versions queries the cluster for running versions and returns a map of releaseName -> version.
|
||||
func (c *Client) Versions() (ServiceVersions, error) {
|
||||
ciliumVersion, err := c.currentVersion(ciliumInfo.releaseName)
|
||||
|
Loading…
Reference in New Issue
Block a user