Open huikang opened 1 year ago
Hi @huikang , i am working on this.
@huikang PR https://github.com/hashicorp/consul/pull/19291 is ready for review. Tested different scenarios and included test cases as well.
@huikang, updated to support following scenario :
Example :
consul operator autopilot set-config -disable-upgrade-migration -cleanup-dead-servers=false -min-quorum 5
In the above example the value for boolean flag -disable-upgrade-migration is not provided, so the value will be assumed to be true. This works the same way , while also handling -disable-upgrade-migration false -cleanup-dead-servers=false -min-quorum 5
scenario.
With this all scenarios are handled :), PR can be reviewed.
Overview of the Issue
After
disable-upgrade-migration
is set to true, it can't be reset to false using the format of-disable-upgrade-migration false
. Although-disable-upgrade-migration=false
works, this inconsistency in the CLI will confuse the users.Further, there might be more cli sub-command with boolean argument have this issue.
Reproduction Steps
Steps to reproduce this issue
1) start a single server agent, 2)
consul operator autopilot set-config -disable-upgrade-migration true
, 3)consul operator autopilot get-config
to verify disable-upgrade-migration is true, 4)consul operator autopilot set-config -disable-upgrade-migration false
to set it back to false 5)consul operator autopilot get-config
is still true and auto migration won't happenConsul info for both Client and Server