Skip to content

fix(pkg/cli): ensure correct configuration from kubeconfig file - #7982

Merged
adamreese merged 1 commit into
helm:masterfrom
adamreese:fix/7539-kube-client-config
Apr 24, 2020
Merged

adamreese merged 1 commit into
helm:masterfrom
adamreese:fix/7539-kube-client-config

Conversation

@adamreese

Copy link
Copy Markdown
Member

Bind Helm flags to Kubernetes configuration loader to get a merged
config with kubeconfig.

Fixes: #7539

@adamreese adamreese added awaiting review bug Categorizes issue or PR as related to a bug. labels Apr 23, 2020
@adamreese adamreese self-assigned this Apr 23, 2020
@helm-bot helm-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 23, 2020
Comment thread pkg/cli/environment.go
Comment on lines +115 to +118
// broken, these are populated from helm flags and not kubeconfig.
"HELM_KUBECONTEXT": s.KubeContext,
"HELM_KUBETOKEN": s.KubeToken,
"HELM_KUBEAPISERVER": s.KubeAPIServer,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not sure what to do with this

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same... I don't understand their purpose in the first place. I guess leaving them alone is the safest bet.

@technosophos technosophos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. cobra.OnInitialize is GREAT

Bind Helm flags to Kubernetes configuration loader to get a merged
config with kubeconfig.

Fixes: helm#7539

Signed-off-by: Adam Reese <[email protected]>
@adamreese
adamreese force-pushed the fix/7539-kube-client-config branch from 4b5248c to 4a0dfbe Compare April 23, 2020 19:20
@helm-bot helm-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 23, 2020

@technosophos technosophos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Re-reviewed with the changes to the unit tests.

@adamreese
adamreese merged commit 0acd2aa into helm:master Apr 24, 2020
@adamreese
adamreese deleted the fix/7539-kube-client-config branch April 24, 2020 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Helm v3 getting current-context wrong

3 participants