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

kops validate cluster can output YAML or JSON #4107

Merged
merged 2 commits into from
Jan 8, 2018

Conversation

chrislovecnm
Copy link
Contributor

@chrislovecnm chrislovecnm commented Dec 19, 2017

Adding the capability for kops validate cluster command to output YAML or JSON.
The validate.ValidationCluster struct is used as body of the JSON or
YAML document.

Outputting the list of the node API objects is a bunch of data, but we already have it, and I think
it is useful. It is the same data as kubectl get no -oyaml. That is the only question I have on this PR if we output that data.

Closes #3539

TODO

  • more testing
  • code comments
  • update cobra docs #

/assign @robinpercy @robertojrojas

If I can get a PR review that would be awesome.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 19, 2017
Adding the capbility for kops validate cluster command to output YAML or JSON.
The validate.ValidationCluster struct is used as body of the JSON or
YAML document.
@chrislovecnm chrislovecnm changed the title [WIP] kops validate cluster can output YAML or JSON kops validate cluster can output YAML or JSON Dec 20, 2017
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 20, 2017
@@ -88,7 +97,9 @@ func RunValidateCluster(f *util.Factory, cmd *cobra.Command, args []string, out
return fmt.Errorf("cannot get InstanceGroups for %q: %v", cluster.ObjectMeta.Name, err)
}

fmt.Fprintf(out, "Validating cluster %v\n\n", cluster.ObjectMeta.Name)
if options.output == OutputTable {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is specific to the OutputTable, does it make sense to move it to its case section of the switch below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well I would have to add it in two places ;(

Copy link
Contributor

Choose a reason for hiding this comment

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

yep I see what you mean.

@robertojrojas
Copy link
Contributor

lgtm

@chrislovecnm
Copy link
Contributor Author

btw ... it is /lgtm

@chrislovecnm
Copy link
Contributor Author

/assign @KashifSaadat @andrewsykim @geojaz

Whoever gets to it first wins a cookie :)

@KashifSaadat
Copy link
Contributor

Tested out, nice work!
/lgtm

Where's my cookie? :P

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 8, 2018
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: KashifSaadat

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 8, 2018
@k8s-ci-robot k8s-ci-robot merged commit b8a701b into kubernetes:master Jan 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants