Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jroper
Copy link
Contributor

@jroper jroper commented Oct 23, 2019

This fixes two issues with gcp auth providers.

Firstly, a gcp auth provider can have no accessToken. I don't know if that's new or not.

Secondly, all the dates in my kube config file changed format, I don't know what changed them, if it was a new kubectl version, a new gcloud version, or something else. So, I added a date format for it.

  • Allow parsing dates with odd format
  • Allow there to be no access token

@jroper
Copy link
Contributor Author

jroper commented Oct 24, 2019

Some notes:

  • I just added a new gke auth to my .kube/config. Neither the access token, nor the expiry date, were written to the file. After using kubectl (version 1.16), there was still no access token or expiry date fields. So, my guess is that kubectl has now changed, it no longer caches the access token in the kube config file, and instead reads it from the gcloud commands cache every time.
  • The only thing other than gcloud and kubectl itself that would have touched the config is minikube. That said, I was using quite an old version of minikube until very recently when I upgraded. I just did a test then, when minikube modifies the file, it doesn't mangle the date, but the old version may have been what mangled them.

Anyway, I think I'll modify this PR to not support that weird date format, and instead, if the date fails to parse, or is not there, ignore the access token whether it's there or not, and always use gcloud instead.

* Don't require either the access token or expiry fields to be present
  in gcp auth.
* Ignore expiry dates that can't be parsed.
@jroper
Copy link
Contributor Author

jroper commented Oct 27, 2019

For anyone needing this fix now, I've published my fork here:

resolvers += Resolver.bintrayRepo("jroper", "maven")
libraryDependencies += "io.skuber" %% "skuber" % "2.3.0-jroper-1"

This also contains my fix to #268, for which there's no published version containing it yet.

@koiuo
Copy link

koiuo commented Dec 3, 2019

Fixes #301

I was looking for an issue, and didn't even think to look for a PR :) So I prepared a PR to address the optional access-token issue too. Will close it in favor of yours.

Thanks for working on this and for publishing the patched version.

@doriordan
Copy link
Owner

LGTM - thanks. (and also thanks for providing a fork, I plan to get this released "officially" in the next couple of days).

@doriordan doriordan merged commit c86bdfc into doriordan:master Dec 14, 2019
@jroper jroper deleted the more-gcp-fixes branch December 17, 2019 20:13
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.

3 participants