Skip to content

feat: add a kubeconfig flag to specify kubeconfig file location#133

Merged
k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
YTGhost:feat-add-kubeconfig-flag
Mar 4, 2024
Merged

feat: add a kubeconfig flag to specify kubeconfig file location#133
k8s-ci-robot merged 1 commit intokubernetes-sigs:mainfrom
YTGhost:feat-add-kubeconfig-flag

Conversation

@YTGhost
Copy link
Copy Markdown
Contributor

@YTGhost YTGhost commented Feb 18, 2024

What type of PR is this?
/kind feature

What this PR does / why we need it:
Some users and organizations work with multiple Kubernetes clusters by utilizing multiple config files instead of one. The --kubeconfig flag allows you to switch between these clusters by specifying different configuration files.

Which issue(s) this PR fixes:

Fixes #81

Does this PR introduce a user-facing change?:

Add a `--kubeconfig` flag to specify kubeconfig file location 

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Feb 18, 2024
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 18, 2024
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Welcome @YTGhost!

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. 😃

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @YTGhost. 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.

Details

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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 18, 2024
@YTGhost
Copy link
Copy Markdown
Contributor Author

YTGhost commented Feb 18, 2024

@levikobi @LiorLieberman PTAL

@LiorLieberman
Copy link
Copy Markdown
Member

/cc

Copy link
Copy Markdown
Member

@LiorLieberman LiorLieberman left a comment

Choose a reason for hiding this comment

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

Thanks @YTGhost
This is set an environment variable for users when they invoke the command. This env var will be user in their subsequent requests with kubectl.

Can we simply change it to just read a --kubeconfig path?
I'd suggest you check if this function can help us.

Two more small bullets:

please note that we have two uses of the config, here and here. We should consider making them consistent with the new kubeconfig file flag.

I dont think we need to update go.mod can you revert it?

@YTGhost YTGhost force-pushed the feat-add-kubeconfig-flag branch from bd3e221 to 02e3a68 Compare February 24, 2024 11:04
@YTGhost
Copy link
Copy Markdown
Contributor Author

YTGhost commented Feb 24, 2024

Thanks @YTGhost This is set an environment variable for users when they invoke the command. This env var will be user in their subsequent requests with kubectl.

Can we simply change it to just read a --kubeconfig path? I'd suggest you check if this function can help us.

Two more small bullets:

please note that we have two uses of the config, here and here. We should consider making them consistent with the new kubeconfig file flag.

I dont think we need to update go.mod can you revert it?

@LiorLieberman Thank you for such detailed review suggestions! I have made the corresponding code changes. PTAL

@LiorLieberman
Copy link
Copy Markdown
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 Feb 28, 2024
Copy link
Copy Markdown
Member

@LiorLieberman LiorLieberman left a comment

Choose a reason for hiding this comment

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

Thanks @YTGhost. Actually I think I was wrong and your initial approach with the env was easier. (no need to add function parameters and make it more consistent)

Can you please change it again to the env based approach? Apologies for the confusion. I also pinged you offline with an idea

Signed-off-by: Liang Deng <283304489@qq.com>
@YTGhost YTGhost force-pushed the feat-add-kubeconfig-flag branch from 02e3a68 to fdb7cbd Compare March 3, 2024 08:43
@YTGhost
Copy link
Copy Markdown
Contributor Author

YTGhost commented Mar 3, 2024

Thanks @YTGhost. Actually I think I was wrong and your initial approach with the env was easier. (no need to add function parameters and make it more consistent)

Can you please change it again to the env based approach? Apologies for the confusion. I also pinged you offline with an idea

Hey Lior, I've updated the code for setting the environment variable. PTAL

@YTGhost
Copy link
Copy Markdown
Contributor Author

YTGhost commented Mar 3, 2024

/retest

@YTGhost
Copy link
Copy Markdown
Contributor Author

YTGhost commented Mar 4, 2024

Thanks @YTGhost. Actually I think I was wrong and your initial approach with the env was easier. (no need to add function parameters and make it more consistent)
Can you please change it again to the env based approach? Apologies for the confusion. I also pinged you offline with an idea

Hey Lior, I've updated the code for setting the environment variable. PTAL

Looks like something went wrong with the unit test, still trying to fix that :)

@LiorLieberman
Copy link
Copy Markdown
Member

Thanks @YTGhost. Actually I think I was wrong and your initial approach with the env was easier. (no need to add function parameters and make it more consistent)
Can you please change it again to the env based approach? Apologies for the confusion. I also pinged you offline with an idea

Hey Lior, I've updated the code for setting the environment variable. PTAL

Looks like something went wrong with the unit test, still trying to fix that :)

I dont understand whats wrong either, tests work perfectly fine locally. Can you try to rebase?

@LiorLieberman
Copy link
Copy Markdown
Member

/retest

@LiorLieberman
Copy link
Copy Markdown
Member

I found the flaky test cause and opened a PR to address this - #139

Thanks again @YTGhost
/approve
/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: LiorLieberman, YTGhost

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

The pull request process is described here

Details 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 Mar 4, 2024
@k8s-ci-robot k8s-ci-robot merged commit 1633f2e into kubernetes-sigs:main Mar 4, 2024
@YTGhost
Copy link
Copy Markdown
Contributor Author

YTGhost commented Mar 5, 2024

I found the flaky test cause and opened a PR to address this - #139

Thanks again @YTGhost /approve /lgtm

Yes, I've found that because of the use of map last night, it leads to the possibility of inconsistent ordering. But it looks like I'm a step behind since you've already submitted a PR :)

xtineskim pushed a commit to xtineskim/ingress2gateway that referenced this pull request Apr 23, 2024
rajashish pushed a commit to rajashish/ingress2gateway1 that referenced this pull request Feb 21, 2026
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. kind/feature Categorizes issue or PR as related to a new feature. 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/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a --kubeconfig flag to specify kubeconfig file location

3 participants