Skip to content
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.

Fix gke auth 1.3 #67

Merged
merged 4 commits into from
Sep 30, 2016
Merged

Fix gke auth 1.3 #67

merged 4 commits into from
Sep 30, 2016

Conversation

paultiplady
Copy link
Contributor

FIXES: #65

Get the GKE auth token from the config map.

Fix authentication when config uses auth-provider to store the
bearer token. This is the format in GKE with kubelet v1.3.
try:
token = self.config.user['auth-provider']['config']['access-token']
self._set_bearer_token(s, token)
except KeyError:
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not a fan of this exception style. Could you adjust this to token = self.config["auth-provider"].get("config", {}).get("access-token") then setting the bearer token when token is not None. This IMO is cleaner and more explicit.

@brosner
Copy link
Contributor

brosner commented Sep 8, 2016

Thank you for your contribution! This is a great way to solve the GKE authentication issue when kubectl has already resolved the token for us.

Pending the quick code change, I am going to merge this!

@paultiplady paultiplady changed the title [WIP] Fix gke auth 1.3 Fix gke auth 1.3 Sep 14, 2016
@paultiplady
Copy link
Contributor Author

@brosner fixed -- LMK if you want me to squash these commits.

@victorgp
Copy link
Contributor

Nice PR, i'm looking forward to seeing this merged!

@brosner brosner merged commit 2a712e3 into kelproject:master Sep 30, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants