ingress2gateway
ingress2gateway copied to clipboard
feat: add --output-file flag (#145)
What type of PR is this?
/kind feature
What this PR does / why we need it:
To separate the output and logs, we have introduced a new --output-file
flag to allow users to dump the converted resources into a specific file, while the console only outputs log messages/warnings. The --output-file
has the following requirements:
- By default,
--output-file
is "./ingress2gateway.yaml" or "./ingress2gateway.json", depending on whether theoutput
flag is set to "yaml" or "json". - If the user customizes the filename, the file must have a ".yaml" extension (when the output flag is "yaml"), or a ".json" extension (when the output flag is "json").
Which issue(s) this PR fixes:
Fixes #145
Does this PR introduce a user-facing change?:
Added a new `--output-file` flag to support dumping converted resources into a specific file and logs/warnings to the console.
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: ipsum-0320 / name: ipsum-0320 (580b0fe9721de4c65332dabafaff4d51afb3e37b)
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: ipsum-0320 Once this PR has been reviewed and has the lgtm label, please assign robscott for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment
Welcome @ipsum-0320!
It looks like this is your first PR to kubernetes-sigs/ingress2gateway 🎉. 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/ingress2gateway 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. :smiley:
Hi @ipsum-0320. 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.
@Xunzhuo @levikobi PTAL 😊
/ok-to-test
@Xunzhuo @levikobi can u review the code again? Thanks! 😊
@LiorLieberman @mlavacca Could you please review my code? The other two reviewers didn't seem to have time. I have a lot of time to contribute to the project, please feel free to give me your insights on my code 😊
sorry for not getting to this one yet @ipsum-0320, I will get to it within the next two days
sorry for not getting to this one yet @ipsum-0320, I will get to it within the next two days
@levikobi ok, thanks!
Thanks @ipsum-0320. This PR intends to always dump the results to a file? If yes, why dont we maintain the current functionality to print the results to the console while letting people the option to specify an output-file?
/hold
Thanks @ipsum-0320. 谢谢 。 This PR intends to always dump the results to a file? If yes, why dont we maintain the current functionality to print the results to the console while letting people the option to specify an output-file? 这个 PR 打算总是将结果转储到文件中吗?如果是,为什么我们不保留当前的功能以将结果打印到控制台,同时让人们可以选择指定输出文件?
/hold /抓住
hi, @LiorLieberman . As mentioned in issue #145, if we output any other log messages to the console, such messages will also be dumped into the output file, thus contaminating the .yaml/.json file.
That I understand. I am saying why we default to a file? Why we dont keep the default to the console ?
That I understand. I am saying why we default to a file? Why we dont keep the default to the console ?
Oh, @LiorLieberman I think if we force it to output to a file, we can completely avoid contaminating the conversion results with log messages. Of course, outputting to the console is more convenient... I'll make it optional.
New changes are detected. LGTM label has been removed.
@levikobi @LiorLieberman hi guys, PTAL 😊
@mlavacca PTAL 😊
PR needs rebase.
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.
👋 @ipsum-0320, how are things going? If you need any help in addressing the comments and move this one forward, please let us know
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.
This bot triages PRs according to the following rules:
- After 90d of inactivity,
lifecycle/stale
is applied - After 30d of inactivity since
lifecycle/stale
was applied,lifecycle/rotten
is applied - After 30d of inactivity since
lifecycle/rotten
was applied, the PR is closed
You can:
- Mark this PR as fresh with
/remove-lifecycle stale
- Close this PR with
/close
- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale