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 output flag, change printYaml function signature #7828

Conversation

Rohitrajak1807
Copy link
Contributor

What this PR does / why we need it:
This PR adds support for an output flag as a convenient way to write yaml output directly to a local file.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #7612

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 3, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: Rohitrajak1807 / name: Rohit Rajak (acb97ca)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jan 3, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @Rohitrajak1807!

It looks like this is your first PR to kubernetes-sigs/cluster-api 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 3, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @Rohitrajak1807. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jan 3, 2023
@Rohitrajak1807
Copy link
Contributor Author

/easycla

@sbueringer
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 3, 2023
@Rohitrajak1807
Copy link
Contributor Author

@sbueringer golangci-lint check is failing. Can you please point to perhaps a make target that can format the code or will running go fmt ./... do?

@sbueringer
Copy link
Member

sbueringer commented Jan 3, 2023

Depends on the exact linter error you got. gofmt and make lint-fix can help but they might not be enough

@Rohitrajak1807
Copy link
Contributor Author

Depends on the exact linter error you got. gofmt and make lint-fix can help but they might not be enough

thank you.

@Rohitrajak1807
Copy link
Contributor Author

Some e2e tests are failing due to GitHub API rate limits. Will retry later.

@Rohitrajak1807
Copy link
Contributor Author

/retest

@Rohitrajak1807
Copy link
Contributor Author

/joke

@k8s-ci-robot
Copy link
Contributor

@Rohitrajak1807: I ate a clock yesterday. It was so time consuming.

In response to this:

/joke

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@Rohitrajak1807
Copy link
Contributor Author

@sbueringer, @ykakarap the lint actions is still waiting, can you please take a look?

@sbueringer
Copy link
Member

@sbueringer, @ykakarap the lint actions is still waiting, can you please take a look?

Yup for new contributors it unfortunately has to be manually approved by someone with write access - done.

@Rohitrajak1807
Copy link
Contributor Author

@sbueringer, @ykakarap the lint actions is still waiting, can you please take a look?

Yup for new contributors it unfortunately has to be manually approved by someone with write access - done.

Thanks

@Rohitrajak1807
Copy link
Contributor Author

@sbueringer please let me know if there are any other steps that need to be done for this PR to progress.

@sbueringer
Copy link
Member

I think it's fine so far. Just a matter of time until Yuvaraj and/or Fabrizio will have some time for a review
/assign @fabriziopandini
/assign @ykakarap

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

/lgtm

@ykakarap @Jont828 PTAL

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

@sbueringer can you please approve the lint workflow? I've made some changes.

@Rohitrajak1807 Rohitrajak1807 force-pushed the private/Rohitrajak1807/output-flag branch from d5cc9d0 to 7b8f2b9 Compare January 9, 2023 12:33
@sbueringer
Copy link
Member

/lgtm
from my side

But I leave this to the clusterctl folks :)

cc @fabriziopandini @ykakarap @Jont828

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

LGTM label has been added.

Git tree hash: af67419c6346962d5230c37e74f40f9131a95f11

@Rohitrajak1807 Rohitrajak1807 force-pushed the private/Rohitrajak1807/output-flag branch from 7b8f2b9 to ae10bcb Compare January 9, 2023 16:00
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 9, 2023
cmd/clusterctl/cmd/generate_provider.go Outdated Show resolved Hide resolved
cmd/clusterctl/cmd/util.go Outdated Show resolved Hide resolved
cmd/clusterctl/cmd/util.go Outdated Show resolved Hide resolved
@Rohitrajak1807 Rohitrajak1807 force-pushed the private/Rohitrajak1807/output-flag branch from ae10bcb to 475d8bf Compare January 9, 2023 16:34
@Rohitrajak1807
Copy link
Contributor Author

@fabriziopandini the requested changes are in PTAL.

update godoc for printYamlOutput, default to stdout if flag is not set
@Rohitrajak1807 Rohitrajak1807 force-pushed the private/Rohitrajak1807/output-flag branch from 475d8bf to 8961830 Compare January 9, 2023 16:37
@Rohitrajak1807 Rohitrajak1807 requested review from fabriziopandini and removed request for sbueringer and ykakarap January 9, 2023 16:38
Copy link
Contributor

@Jont828 Jont828 left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution, I don't see anything wrong on my end!

/lgtm

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

LGTM label has been added.

Git tree hash: d41a333db011469597c14fe6e02a89191aa1d32b

@Rohitrajak1807
Copy link
Contributor Author

Thanks for the contribution, I don't see anything wrong on my end!

/lgtm

Happy to contribute. I see that the lint workflow hasn't been approved, can you please look into it?

@Rohitrajak1807
Copy link
Contributor Author

@fabriziopandini can you please confirm that the above conversations can be resolved?

@fabriziopandini
Copy link
Member

great work!
/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini

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

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel 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 14, 2023
@k8s-ci-robot k8s-ci-robot merged commit 059eb76 into kubernetes-sigs:main Jan 14, 2023
@k8s-ci-robot k8s-ci-robot added this to the v1.4 milestone Jan 14, 2023
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for output flag for generate command.
7 participants