mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-01-14 00:49:31 -05:00
move csp logic to cloudcmd (#2311)
This commit is contained in:
parent
25ba8ecfed
commit
0eb9ca2e18
@ -19,6 +19,14 @@ import (
|
|||||||
"github.com/edgelesssys/constellation/v2/internal/file"
|
"github.com/edgelesssys/constellation/v2/internal/file"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// UpgradeRequiresIAMMigration returns true if the given cloud provider requires an IAM migration.
|
||||||
|
func UpgradeRequiresIAMMigration(provider cloudprovider.Provider) bool {
|
||||||
|
switch provider {
|
||||||
|
default:
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// IAMUpgrader handles upgrades to IAM resources required by Constellation.
|
// IAMUpgrader handles upgrades to IAM resources required by Constellation.
|
||||||
type IAMUpgrader struct {
|
type IAMUpgrader struct {
|
||||||
tf tfIAMUpgradeClient
|
tf tfIAMUpgradeClient
|
||||||
|
@ -23,13 +23,6 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
func upgradeRequiresIAMMigration(provider cloudprovider.Provider) bool {
|
|
||||||
switch provider {
|
|
||||||
default:
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func newIAMUpgradeCmd() *cobra.Command {
|
func newIAMUpgradeCmd() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "upgrade",
|
Use: "upgrade",
|
||||||
|
@ -136,7 +136,7 @@ func (u *upgradeApplyCmd) upgradeApply(cmd *cobra.Command, upgradeDir string, fl
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if upgradeRequiresIAMMigration(conf.GetProvider()) {
|
if cloudcmd.UpgradeRequiresIAMMigration(conf.GetProvider()) {
|
||||||
cmd.Println("WARNING: This upgrade requires an IAM migration. Please make sure you have applied the IAM migration using `iam upgrade apply` before continuing.")
|
cmd.Println("WARNING: This upgrade requires an IAM migration. Please make sure you have applied the IAM migration using `iam upgrade apply` before continuing.")
|
||||||
if !flags.yes {
|
if !flags.yes {
|
||||||
yes, err := askToConfirm(cmd, "Did you upgrade the IAM resources?")
|
yes, err := askToConfirm(cmd, "Did you upgrade the IAM resources?")
|
||||||
|
Loading…
Reference in New Issue
Block a user