mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-07 06:22:17 -04: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
1 changed files with 13 additions and 2 deletions
|
@ -14,6 +14,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/edgelesssys/constellation/v2/cli/internal/clusterid"
|
"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/compatibility"
|
||||||
"github.com/edgelesssys/constellation/v2/internal/config"
|
"github.com/edgelesssys/constellation/v2/internal/config"
|
||||||
"github.com/edgelesssys/constellation/v2/internal/constants"
|
"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{}
|
upgradeErrs := []error{}
|
||||||
upgradeReleases := []*chart.Chart{}
|
upgradeReleases := []*chart.Chart{}
|
||||||
newReleases := []*chart.Chart{}
|
newReleases := []*chart.Chart{}
|
||||||
|
for _, info := range getManagedCharts(config) {
|
||||||
for _, info := range []chartInfo{ciliumInfo, certManagerInfo, constellationOperatorsInfo, constellationServicesInfo, csiInfo, awsLBControllerInfo} {
|
|
||||||
c.log.Debugf("Checking release %s", info.releaseName)
|
c.log.Debugf("Checking release %s", info.releaseName)
|
||||||
chart, err := loadChartsDir(helmFS, info.path)
|
chart, err := loadChartsDir(helmFS, info.path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -187,6 +187,17 @@ func (c *Client) Upgrade(ctx context.Context, config *config.Config, idFile clus
|
||||||
return errors.Join(upgradeErrs...)
|
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.
|
// Versions queries the cluster for running versions and returns a map of releaseName -> version.
|
||||||
func (c *Client) Versions() (ServiceVersions, error) {
|
func (c *Client) Versions() (ServiceVersions, error) {
|
||||||
ciliumVersion, err := c.currentVersion(ciliumInfo.releaseName)
|
ciliumVersion, err := c.currentVersion(ciliumInfo.releaseName)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue