mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-07-20 13:58:47 -04:00
cli: store kubernetes version as strong type in config (#2287)
Co-authored-by: Otto Bittner <cobittner@posteo.net> Co-authored-by: 3u13r <lc@edgeless.systems>
This commit is contained in:
parent
348418a4a1
commit
22c2a73ae2
23 changed files with 293 additions and 182 deletions
|
@ -40,7 +40,6 @@ import (
|
|||
"github.com/edgelesssys/constellation/v2/internal/kms/uri"
|
||||
"github.com/edgelesssys/constellation/v2/internal/kubernetes/kubectl"
|
||||
"github.com/edgelesssys/constellation/v2/internal/semver"
|
||||
"github.com/edgelesssys/constellation/v2/internal/versions"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -87,11 +86,10 @@ type Options struct {
|
|||
|
||||
// PrepareApply loads the charts and returns the executor to apply them.
|
||||
// TODO(elchead): remove validK8sVersion by putting ValidK8sVersion into config.Config, see AB#3374.
|
||||
func (h Client) PrepareApply(
|
||||
conf *config.Config, validK8sversion versions.ValidK8sVersion, idFile clusterid.File,
|
||||
flags Options, tfOutput terraform.ApplyOutput, serviceAccURI string, masterSecret uri.MasterSecret,
|
||||
func (h Client) PrepareApply(conf *config.Config, idFile clusterid.File, flags Options, tfOutput terraform.ApplyOutput,
|
||||
serviceAccURI string, masterSecret uri.MasterSecret,
|
||||
) (Applier, bool, error) {
|
||||
releases, err := h.loadReleases(conf, masterSecret, validK8sversion, idFile, flags, tfOutput, serviceAccURI)
|
||||
releases, err := h.loadReleases(conf, masterSecret, idFile, flags, tfOutput, serviceAccURI)
|
||||
if err != nil {
|
||||
return nil, false, fmt.Errorf("loading Helm releases: %w", err)
|
||||
}
|
||||
|
@ -100,11 +98,10 @@ func (h Client) PrepareApply(
|
|||
return &ChartApplyExecutor{actions: actions, log: h.log}, includesUpgrades, err
|
||||
}
|
||||
|
||||
func (h Client) loadReleases(
|
||||
conf *config.Config, secret uri.MasterSecret, validK8sVersion versions.ValidK8sVersion,
|
||||
idFile clusterid.File, flags Options, tfOutput terraform.ApplyOutput, serviceAccURI string,
|
||||
func (h Client) loadReleases(conf *config.Config, secret uri.MasterSecret, idFile clusterid.File, flags Options,
|
||||
tfOutput terraform.ApplyOutput, serviceAccURI string,
|
||||
) ([]Release, error) {
|
||||
helmLoader := newLoader(conf, idFile, validK8sVersion, h.cliVersion)
|
||||
helmLoader := newLoader(conf, idFile, h.cliVersion)
|
||||
h.log.Debugf("Created new Helm loader")
|
||||
return helmLoader.loadReleases(flags.Conformance, flags.HelmWaitMode, secret,
|
||||
serviceAccURI, tfOutput)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue