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 json output to install and related commands #12641

Merged
merged 3 commits into from
Jun 4, 2024
Merged

Conversation

adleong
Copy link
Member

@adleong adleong commented May 23, 2024

We add support for the --output/-o flag in linkerd install and related commands. The supported output formats are yaml (default) and json. Kubectl is able to accept both of these formats which means that the output can be piped into kubectl regardless of which output format is used.

The full list of install related commands which we add json support to is:

  • linkerd install
  • linkerd prune
  • linkerd upgrade
  • linkerd uninstall
  • linkerd viz install
  • linkerd viz prune
  • linkerd viz uninstall
  • linkerd multicluster install
  • linkerd multicluster prune
  • linkerd multicluster uninstall
  • linkerd jaeger install
  • linkerd jaeger prune
  • linkerd jaeger uninstall

adleong added 2 commits May 22, 2024 23:35
Signed-off-by: Alex Leong <alex@buoyant.io>
Signed-off-by: Alex Leong <alex@buoyant.io>
@adleong adleong requested a review from a team as a code owner May 23, 2024 01:16
cli/cmd/install.go Outdated Show resolved Hide resolved
Comment on lines 440 to 443
} else if format == "yaml" {
_, err = w.Write(buf.Bytes())
return err
}
Copy link
Member

Choose a reason for hiding this comment

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

Same nit:

Suggested change
} else if format == "yaml" {
_, err = w.Write(buf.Bytes())
return err
}
if format == "yaml" {
_, err = w.Write(buf.Bytes())
return err
}

jaeger/cmd/install.go Outdated Show resolved Hide resolved
cli/cmd/install.go Outdated Show resolved Hide resolved
viz/cmd/uninstall.go Outdated Show resolved Hide resolved
Signed-off-by: Alex Leong <alex@buoyant.io>
Copy link
Member

@alpeb alpeb left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@adleong adleong merged commit 3bc12b7 into main Jun 4, 2024
38 checks passed
@adleong adleong deleted the alex/install-json branch June 4, 2024 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants