From 5c54fd6a6143a013ae6e3d50ec5e5e2dda42e03b Mon Sep 17 00:00:00 2001 From: Kyle Havlovitz Date: Tue, 18 Jul 2017 14:01:04 -0700 Subject: [PATCH] Add UpgradeVersionTag to autopilot get/set commands --- command/operator_autopilot_get.go | 1 + command/operator_autopilot_set.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/command/operator_autopilot_get.go b/command/operator_autopilot_get.go index d8dc59f83..e4ef81568 100644 --- a/command/operator_autopilot_get.go +++ b/command/operator_autopilot_get.go @@ -60,6 +60,7 @@ func (c *OperatorAutopilotGetCommand) Run(args []string) int { c.UI.Output(fmt.Sprintf("ServerStabilizationTime = %v", config.ServerStabilizationTime.String())) c.UI.Output(fmt.Sprintf("RedundancyZoneTag = %q", config.RedundancyZoneTag)) c.UI.Output(fmt.Sprintf("DisableUpgradeMigration = %v", config.DisableUpgradeMigration)) + c.UI.Output(fmt.Sprintf("UpgradeVersionTag = %q", config.UpgradeVersionTag)) return 0 } diff --git a/command/operator_autopilot_set.go b/command/operator_autopilot_set.go index 53df6945c..a864ad585 100644 --- a/command/operator_autopilot_set.go +++ b/command/operator_autopilot_set.go @@ -36,6 +36,7 @@ func (c *OperatorAutopilotSetCommand) Run(args []string) int { var serverStabilizationTime configutil.DurationValue var redundancyZoneTag configutil.StringValue var disableUpgradeMigration configutil.BoolValue + var upgradeVersionTag configutil.StringValue f := c.BaseCommand.NewFlagSet(c) @@ -60,6 +61,9 @@ func (c *OperatorAutopilotSetCommand) Run(args []string) int { f.Var(&disableUpgradeMigration, "disable-upgrade-migration", "(Enterprise-only) Controls whether Consul will avoid promoting new servers until "+ "it can perform a migration. Must be one of `true|false`.") + f.Var(&upgradeVersionTag, "upgrade-version-tag", + "(Enterprise-only) The node_meta tag to use for version info when performing upgrade "+ + "migrations. If left blank, the Consul version will be used.") if err := c.BaseCommand.Parse(args); err != nil { if err == flag.ErrHelp { @@ -88,6 +92,7 @@ func (c *OperatorAutopilotSetCommand) Run(args []string) int { cleanupDeadServers.Merge(&conf.CleanupDeadServers) redundancyZoneTag.Merge(&conf.RedundancyZoneTag) disableUpgradeMigration.Merge(&conf.DisableUpgradeMigration) + upgradeVersionTag.Merge(&conf.UpgradeVersionTag) trailing := uint(conf.MaxTrailingLogs) maxTrailingLogs.Merge(&trailing)