mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-02-13 21:41:37 -05:00
add iam migration warning to upgrade apply
This commit is contained in:
parent
3b0fb2c0c5
commit
a521e25567
@ -19,6 +19,8 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const upgradeRequiresIAMMigration = true // TODO(elchead): needs to be set on every release. Can we automate this?
|
||||||
|
|
||||||
func newIAMUpgradeCmd() *cobra.Command {
|
func newIAMUpgradeCmd() *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "upgrade",
|
Use: "upgrade",
|
||||||
|
@ -60,6 +60,16 @@ func runUpgradeApply(cmd *cobra.Command, _ []string) error {
|
|||||||
return fmt.Errorf("creating logger: %w", err)
|
return fmt.Errorf("creating logger: %w", err)
|
||||||
}
|
}
|
||||||
defer log.Sync()
|
defer log.Sync()
|
||||||
|
if upgradeRequiresIAMMigration {
|
||||||
|
yes, err := askToConfirm(cmd, "WARNING: This upgrade requires an IAM migration. Please make sure you have applied the IAM migration using `iam upgrade apply` before continuing.")
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("asking for confirmation: %w", err)
|
||||||
|
}
|
||||||
|
if !yes {
|
||||||
|
cmd.Println("Skipping upgrade.")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fileHandler := file.NewHandler(afero.NewOsFs())
|
fileHandler := file.NewHandler(afero.NewOsFs())
|
||||||
upgrader, err := kubernetes.NewUpgrader(cmd.Context(), cmd.OutOrStdout(), fileHandler, log, kubernetes.UpgradeCmdKindApply)
|
upgrader, err := kubernetes.NewUpgrader(cmd.Context(), cmd.OutOrStdout(), fileHandler, log, kubernetes.UpgradeCmdKindApply)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user