Skip to content

Conversation

LordAbhishek
Copy link

@LordAbhishek LordAbhishek commented Sep 22, 2025

Changes proposed in this PR

  • Added support for a new output format 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

* feat: `proxy list -output archive` cmd will write output to json file
@LordAbhishek LordAbhishek requested a review from a team as a code owner September 22, 2025 05:32
@LordAbhishek LordAbhishek added area/cli CLI pr/no-backport signals that a PR will not contain a backport label labels Sep 22, 2025
Copy link

hashicorp-cla-app bot commented Sep 22, 2025

CLA assistant check
All committers have signed the CLA.

Copy link

CLA assistant check

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.

@LordAbhishek LordAbhishek changed the title Do-not-merge [Only for test] -feat: add new output format archive to proxy list cmd CSL-10969: add new output format archive to proxy list command Sep 22, 2025
@LordAbhishek LordAbhishek changed the title CSL-10969: add new output format archive to proxy list command CSL-10969: Add new output format archive to proxy list command Sep 22, 2025
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) {

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?

Copy link
Author

Choose a reason for hiding this comment

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

updated.

} else {
c.UI.Output(string(jsonSt))
}
} else if c.flagOutputFormat == "archive" {

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

Copy link
Author

Choose a reason for hiding this comment

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

updated.

sanikachavan5
sanikachavan5 previously approved these changes Sep 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli CLI pr/no-backport signals that a PR will not contain a backport label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants