cli: add -json and -t flags to operator autopilot get-config#27991
cli: add -json and -t flags to operator autopilot get-config#27991singhvishalkr wants to merge 1 commit into
Conversation
The operator autopilot get-config command now supports structured output via the -json flag for JSON format and the -t flag for Go template formatting, matching the pattern used by other Nomad CLI commands. Addresses hashicorp#15894
|
Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement Learn more about why HashiCorp requires a CLA and what the CLA includes Have you signed the CLA already but the status is still pending? Recheck it. |
1 similar comment
|
Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement Learn more about why HashiCorp requires a CLA and what the CLA includes Have you signed the CLA already but the status is still pending? Recheck it. |
|
I have read and signed the CLA. |
|
@singhvishalkr to get the CLA bot to approve, you need to have signed with the same email address as the commit. (See https://patch-diff.githubusercontent.com/raw/hashicorp/nomad/pull/27991.patch if you're not sure which one that is) |
|
@tgross Every commit on this branch already lists |
I noticed that
nomad operator autopilot get-configis missing the-jsonand-tflags that other inspection commands have. Scripting and automation tools benefit from machine-readable output instead of parsing the default key=value lines.This PR adds both flags following the same pattern used by
nomad server membersand other commands:-jsonoutputs the full AutopilotConfiguration struct as JSON-taccepts a Go template for custom formattingTwo tests are included to verify the JSON unmarshals correctly and that templates work as expected.
Addresses #15894 (partial)