Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added KubeconfigFlag option based on CCM --kubeconfig flag #47

Merged
merged 1 commit into from
Nov 5, 2019

Conversation

jnschaeffer
Copy link
Contributor

When explicitly passing a kubeconfig via --kubeconfig, the CCM would use the provided kubeconfig but Linode-specific logic would not. This would lead to errors when attempting to use a Kubernetes client to get TLS secrets, as the CCM was attempting to get those from the cluster it was in as opposed to the cluster it was pointing to based on the given kubeconfig.

This addresses that issue by defining and setting a KubeconfigFlag option in linode.Options, then using that when creating a Kubernetes client. The presence of the flag in the flag set is required, but its use is not; if --kubeconfig is not set, the CCM will default to authenticating using the in-cluster config.

I'm pretty sure this works, but still need to test it 馃懠 Placing it here now for review.

When explicitly passing a kubeconfig via --kubeconfig, the CCM would
use the provided kubeconfig but Linode-specific logic would not. This
would lead to errors when attempting to use a Kubernetes client to get
TLS secrets, as the CCM was attempting to get those from the cluster
it was in as opposed to the cluster it was pointing to based on the
given kubeconfig.

This addresses that issue by defining and setting a KubeconfigFlag
option in linode.Options, then using that when creating a Kubernetes
client. The presence of the flag in the flag set is required, but its
use is not; if --kubeconfig is not set, the CCM will default to
authenticating using the in-cluster config.
@jnschaeffer jnschaeffer changed the title [WIP] Added KubeconfigFlag option based on CCM --kubeconfig flag Added KubeconfigFlag option based on CCM --kubeconfig flag Nov 5, 2019
main.go Show resolved Hide resolved
Copy link
Contributor

@asauber asauber left a comment

Choose a reason for hiding this comment

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

See comments

@asauber asauber merged commit 8971947 into linode:master Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants