-
Notifications
You must be signed in to change notification settings - Fork 187
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
Support defining a KubeConfig Secret data key #615
Conversation
41cda0d
to
cd86bf4
Compare
47cdf1d
to
8d27221
Compare
Looking for feedback on the code changes in this PR. NOTE: |
I think that running $ git status
On branch secret-ref-key
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: docs/api/kustomize.md and |
4babc32
to
d9c541f
Compare
3393f9d
to
19f4971
Compare
if len(kubeConfig) == 0 { | ||
return nil, fmt.Errorf("KubeConfig secret '%s' doesn't contain a 'value' key ", secretName.String()) | ||
if key := ki.kustomization.Spec.KubeConfig.SecretRef.Key; key != "" { | ||
kubeConfig = secret.Data[key] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In retrospect also better for helm-controller.
If the user has declared their own configuration, it might be better to error out to let them know their configuration is not correct, including the key in the error string. This helps detecting typos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added error containing user-specified secret key name
Signed-off-by: Nick Stogner <nicholas.stogner@gmail.com>
19f4971
to
6aeff8c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy with this 💯
Thanks a lot 🙇🏼♂️, and sorry for being a pain with nitpicks 😅
Fixes #613.