Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add support for --kubeconfig flag #10

Closed
wants to merge 1 commit into from

Conversation

sibucan
Copy link

@sibucan sibucan commented Jul 21, 2020

The --kubeconfig flag is useful in multi-cluster situations. This change passes the flag along to the kubectl command to support its usage.

(I renamed my binary show-secret to not clobber the existing installation)

$ kubectl --kubeconfig=admin.conf create secret generic test-secret --from-literal="password=123456"
secret/test-secret created
$ kubectl get secrets --kubeconfig=admin.conf test-secret -ojsonpath='{.data.password}';echo ""
MTIzNDU2
$ kubectl show-secret --kubeconfig=admin.conf test-secret --all
password=123456

The --kubeconfig flag is useful in multi-cluster situations. This change
passes the flag along to the kubectl command to support its usage.
@sibucan sibucan requested a review from elsesiy as a code owner July 21, 2020 02:26
@elsesiy
Copy link
Owner

elsesiy commented Jul 23, 2020

@sibucan Thanks for the PR. Can you add a test case for this too please?

@sibucan
Copy link
Author

sibucan commented Jul 24, 2020

The existing tests only cover the ProcessSecret() function, which wasn't modified, and currently there are no tests for flags that are passed directly to kubectl. Do you want me to create a new test function for kubectl flags?

@elsesiy elsesiy closed this in 79786fb Jul 26, 2020
@elsesiy elsesiy mentioned this pull request Jul 26, 2020
@elsesiy
Copy link
Owner

elsesiy commented Jul 26, 2020

Thanks for your submission, I had some other minor changes made and pushed it out!

@sibucan sibucan deleted the add-kubeconfig-flag-support branch July 26, 2020 19:17
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants