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 format option for utils describe-stacks #2718
Add format option for utils describe-stacks #2718
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few minor comments but otherwise LGTM.
Thanks for the PR!
taken care of, waiting on @cPu1 response
pkg/ctl/utils/describe_stacks.go
Outdated
cmdutils.AddTimeoutFlag(fs, &cmd.ProviderConfig.WaitTimeout) | ||
}) | ||
|
||
cmdutils.AddCommonFlagsForAWS(cmd.FlagSetGroup, &cmd.ProviderConfig, false) | ||
} | ||
|
||
func doDescribeStacksCmd(cmd *cmdutils.Cmd, all, events, trail bool) error { | ||
func doDescribeStacksCmd(cmd *cmdutils.Cmd, all, events, trail bool, printer printers.OutputPrinter, output printers.Type) error { | ||
if output != "" && (all || events || trail) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should do the validation in RunE
, and using flag.Changed
(or CobraCommand.Flags.Changed()
) is more accurate.
@cPu1 thanks a lot for your suggestions. I appreciate your guidance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the proposed changes 🎉 . I've suggested some minor improvements and the PR is good to merge after they're resolved.
Closes #1495
Description
This MR enables the use of a flag
output
for theeksctl utils describe-stacks
command for JSON or YAML formatted output.How to run
eksctl utils describe-stacks --name=mycluster --output json
or
eksctl utils describe-stacks --name=mycluster --output yaml
Checklist
README.md
, or theuserdocs
directory)area/nodegroup
), target version (e.g.version/0.12.0
) and kind (e.g.kind/improvement
)