-
Notifications
You must be signed in to change notification settings - Fork 327
CSL-10969: Add new output format archive
to proxy list command
#4785
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
base: main
Are you sure you want to change the base?
Conversation
* feat: `proxy list -output archive` cmd will write output to json file
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. |
archive
to proxy list cmdarchive
to proxy list command
archive
to proxy list commandarchive
to proxy list command
cli/cmd/proxy/list/command.go
Outdated
if errs := validation.ValidateNamespaceName(c.flagNamespace, false); c.flagNamespace != "" && len(errs) > 0 { | ||
return fmt.Errorf("invalid namespace name passed for -namespace/-n: %v", strings.Join(errs, "; ")) | ||
} | ||
if outputs := []string{"table", "json", "archive"}; !slices.Contains(outputs, c.flagOutputFormat) { |
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.
can't this be a constant?
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.
updated.
cli/cmd/proxy/list/command.go
Outdated
} else { | ||
c.UI.Output(string(jsonSt)) | ||
} | ||
} else if c.flagOutputFormat == "archive" { |
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.
could we have used switch case and make the internal modular. Makes it legible
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.
updated.
Changes proposed in this PR
archive
to the proxy list command. This will write the proxy list command json output to a json file in current working dir.consul-k8s proxy list -output archive