cli: unify terraform variable creation (#2119)

Before we defined the variables twice.
Once for upgrades, once for create.
Also move default node group names into a constant
This commit is contained in:
Otto Bittner 2023-07-21 10:04:29 +02:00 committed by GitHub
parent f9391ed903
commit cf822f7eee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 464 additions and 451 deletions

View file

@ -15,6 +15,7 @@ import (
"sort"
"strings"
"github.com/edgelesssys/constellation/v2/cli/internal/cloudcmd"
"github.com/edgelesssys/constellation/v2/cli/internal/featureset"
"github.com/edgelesssys/constellation/v2/cli/internal/helm"
"github.com/edgelesssys/constellation/v2/cli/internal/kubernetes"
@ -219,7 +220,12 @@ func (u *upgradeCheckCmd) upgradeCheck(cmd *cobra.Command, fileHandler file.Hand
return fmt.Errorf("checking workspace: %w", err)
}
vars, err := parseTerraformUpgradeVars(cmd, conf, u.imagefetcher)
imageRef, err := getImage(cmd.Context(), conf, u.imagefetcher)
if err != nil {
return fmt.Errorf("fetching image reference: %w", err)
}
vars, err := cloudcmd.TerraformUpgradeVars(conf, imageRef)
if err != nil {
return fmt.Errorf("parsing upgrade variables: %w", err)
}