mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
cli: spinner for planning Terraform migrations (#2533)
* Remove mention of "changes below" for changes that are listed above the message * Add a spinner for Terraform Plan action --------- Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
78c5d09ae7
commit
e4d8bda792
@ -71,13 +71,15 @@ func (a *applyCmd) planTerraformMigration(cmd *cobra.Command, conf *config.Confi
|
|||||||
// u.upgrader.AddManualStateMigration(migration)
|
// u.upgrader.AddManualStateMigration(migration)
|
||||||
// }
|
// }
|
||||||
|
|
||||||
return a.clusterUpgrader.PlanClusterUpgrade(cmd.Context(), cmd.OutOrStdout(), vars, conf.GetProvider())
|
a.spinner.Start("Checking for infrastructure changes", false)
|
||||||
|
defer a.spinner.Stop()
|
||||||
|
return a.clusterUpgrader.PlanClusterUpgrade(cmd.Context(), a.spinner, vars, conf.GetProvider())
|
||||||
}
|
}
|
||||||
|
|
||||||
// migrateTerraform migrates an existing Terraform state and the post-migration infrastructure state is returned.
|
// migrateTerraform migrates an existing Terraform state and the post-migration infrastructure state is returned.
|
||||||
func (a *applyCmd) migrateTerraform(cmd *cobra.Command, conf *config.Config, upgradeDir string) (state.Infrastructure, error) {
|
func (a *applyCmd) migrateTerraform(cmd *cobra.Command, conf *config.Config, upgradeDir string) (state.Infrastructure, error) {
|
||||||
// Ask for confirmation first
|
// Ask for confirmation first
|
||||||
fmt.Fprintln(cmd.OutOrStdout(), "The upgrade requires a migration of Constellation cloud resources by applying an updated Terraform template. Please manually review the suggested changes below.")
|
cmd.Println("The upgrade requires a migration of Constellation cloud resources by applying an updated Terraform template.")
|
||||||
if !a.flags.yes {
|
if !a.flags.yes {
|
||||||
ok, err := askToConfirm(cmd, "Do you want to apply the Terraform migrations?")
|
ok, err := askToConfirm(cmd, "Do you want to apply the Terraform migrations?")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -288,4 +288,3 @@ data "azurerm_user_assigned_identity" "uaid" {
|
|||||||
name = local.uai_name
|
name = local.uai_name
|
||||||
resource_group_name = local.uai_resource_group
|
resource_group_name = local.uai_resource_group
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user