Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a CLI command for retrieving the autopilot configuration. #9142

Merged
merged 1 commit into from
Nov 11, 2020

Conversation

mkeeler
Copy link
Member

@mkeeler mkeeler commented Nov 9, 2020

This is a small shim around the new /v1/operator/autopilot/state endpoint. The new command supports both JSON and pretty output formats.

@mkeeler mkeeler requested a review from a team November 9, 2020 22:02
@github-actions github-actions bot added theme/cli Flags and documentation for the CLI interface type/docs Documentation needs to be created/updated/clarified labels Nov 9, 2020
Copy link
Contributor

@schristoff schristoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks great, I hardly have any comments. Aside from the thing we discussed in Slack I think my only concern is that locally I am getting remnants of enterprise features in my output, however this is probably just be a me issue. Just wanted to bring it up in case it shows up.
I'm going to approve this now since there is only 1 small thing needed to be added and then it should be good.

website/pages/commands/operator/autopilot.mdx Outdated Show resolved Hide resolved
@mkeeler
Copy link
Member Author

mkeeler commented Nov 11, 2020

The output contains 2 things that would look enterprise related. the first is the optimistic failure tolerance and the second is the network segment showing up in the server Meta.

The empty network segment meta is due to Consul OSS always populating that here:

meta[structs.MetaSegmentKey] = conf.SegmentName

The optimistic failure tolerance which really only applies when redundancy zones are in use is due to the field in the api.AutopilotState struct being an int and that 0 is a valid value when the system cannot tolerate more failures. So we cannot just tag the field with a omitempty JSON tag. We could turn this field into a pointer in which case we could detect being unset vs a zero value but the ergonomics of using the struct would be diminished.

@mkeeler mkeeler merged commit 7ef9b04 into master Nov 11, 2020
@mkeeler mkeeler deleted the feature/autopilot-state-cli branch November 11, 2020 18:19
@hashicorp-ci
Copy link
Contributor

🍒 Starting backport cherry picking.

To cherry-pick post-merge, add backport labels and re-run https://circleci.com/gh/hashicorp/consul/278550.

@hashicorp-ci
Copy link
Contributor

🍒✅ Cherry pick of commit 7ef9b04 onto release/1.9.x succeeded!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/cli Flags and documentation for the CLI interface type/docs Documentation needs to be created/updated/clarified
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants