mirror of
https://github.com/rancher/cli.git
synced 2026-02-05 09:48:36 +01:00
Remove --rollback flag for mcapp upgrade
Do no auto rollback on upgrade failure. Keep the behavior consistent with API
This commit is contained in:
committed by
Alena Prokharchyk
parent
3cc81d1346
commit
133a5a34ef
@@ -208,10 +208,6 @@ func MultiClusterAppCommand() cli.Command {
|
||||
Name: argUpgradeBatchInterval,
|
||||
Usage: "The number of seconds between updating the next app during upgrade. Only used if --upgrade-strategy is rolling-update.",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "rollback",
|
||||
Usage: "Rollback to previous revision when the upgrade fails",
|
||||
},
|
||||
timeoutFlag,
|
||||
},
|
||||
},
|
||||
@@ -568,24 +564,6 @@ func multiClusterAppUpgrade(ctx *cli.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
err = waitUntilMultiClusterAppActive(c, app.ID, ctx.Int(argTimeout))
|
||||
if err == nil || !ctx.Bool("rollback") {
|
||||
return err
|
||||
}
|
||||
|
||||
logrus.WithError(err).Errorf("failed to upgrade multi-cluster app %q. Rolling back to previous revision", app.Name)
|
||||
|
||||
if app.Status == nil {
|
||||
return errors.New("revision is unknown")
|
||||
}
|
||||
|
||||
rr := &managementClient.MultiClusterAppRollbackInput{
|
||||
RevisionID: app.Status.RevisionID,
|
||||
}
|
||||
if err := c.ManagementClient.MultiClusterApp.ActionRollback(app, rr); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return waitUntilMultiClusterAppActive(c, app.ID, ctx.Int(argTimeout))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user