Commit Graph

18 Commits (2b0b605c804261551b63faf9a2644ed36c786849)

Author SHA1 Message Date
guangxuli 032e450ec4 make invocation ReadDockerConfigFile can handle .dockerconfigjson file
only extract ReadSpecificDockerConfigJsonFile from function ReadDockerConfigJSONFile

put error checking and logging in the loop above

godoc gofmt and return dockecfg directly
2016-11-17 09:32:32 +08:00
mbohlool 25afcc5522 Add +optional tag to all fields with omitempty json tag 2016-10-17 08:52:13 -07:00
guangxuli 8a9cfdf86a make function ReadDockerConfigFile more flexible
rename the variable

make parameter more flexible

handle docker config file path

use a single set of paths

delete debug print

gofmt

delete the empty line

comment is not correct

move the comment to the correct place

keep original signature

godoc
2016-10-14 23:23:46 +08:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Rudi Chiarito ca6bdba014 Allow lazy binding in credential providers; don't use it in AWS yet
This is step one for cross-region ECR support and has no visible effects yet.
I'm not crazy about the name LazyProvide. Perhaps the interface method could
remain like that and the package method of the same name could become
LateBind(). I still don't understand why the credential provider has a
DockerConfigEntry that has the same fields but is distinct from
docker.AuthConfiguration. I had to write a converter now that we do that in
more than one place.

In step two, I'll add another intermediate, lazy provider for each AWS region,
whose empty LazyAuthConfiguration will have a refresh time of months or years.
Behind the scenes, it'll use an actual ecrProvider with the usual ~12 hour
credentials, that will get created (and later refreshed) only when kubelet is
attempting to pull an image. If we simply turned ecrProvider directly into a
lazy provider, we would bypass all the caching and get new credentials for
each image pulled.
2016-03-29 15:39:30 -04:00
Yu-Ju Hong fd7e323cc6 Revert "Set timeout for accessing credential provider's URL"
This reverts commit 9d3806bceb.
2016-03-04 12:37:30 -08:00
Yu-Ju Hong 9d3806bceb Set timeout for accessing credential provider's URL
This changes sets the timeout and also adds the retry mechanism.
2016-03-01 15:41:16 -08:00
tamnd 906b279080 Support new docker config format for private registries 2015-08-22 15:37:25 +07:00
deads2k ac2c43fc87 serialize dockercfg with matching auth field 2015-06-05 11:14:10 -04:00
deads2k 72c0709f18 reduce scope of DockerConfigEntryWithAuth 2015-05-19 12:41:03 -04:00
deads2k be0f2d2930 add dockercfg secret types 2015-05-18 08:25:27 -04:00
Eric Paris 6b3a6e6b98 Make copyright ownership statement generic
Instead of saying "Google Inc." (which is not always correct) say "The
Kubernetes Authors", which is generic.
2015-05-01 17:49:56 -04:00
Mike Danese 33f158073b Check other dirs for .dockercfg 2015-01-27 15:54:20 -08:00
Dawn Chen 0962b86ce3 Remove useless and duplicate call. 2015-01-22 15:00:21 -08:00
Matt Moore 65c246d45a Make credentialprovider less verbose about benign errors.
In particular, a few of the utilities used within the credentialprovider had the pattern:
   glog.Errorf("while blah %s: %v", s, err)
   return nil, err

This change propagates those error message and puts the burden of logging on the caller.

In particular, this allows us to squelch all output during kubelet startup when we are detecting whether certain credentialprovider plugins should even be enabled.

Fixes: https://github.com/GoogleCloudPlatform/kubernetes/issues/2673
2014-12-01 11:54:50 -08:00
Tim Hockin 95a9098311 fix 'go vet' warnings 2014-11-21 09:45:28 +08:00
Clayton Coleman 2afa12073c Do not log an error when file does not exist 2014-11-19 22:04:36 -05:00
Matt Moore 0c5d9ed0d2 Implements a credentialprovider library for use by DockerPuller.
This change refactors the way Kubelet's DockerPuller handles the docker config credentials to utilize a new credentialprovider library.

The credentialprovider library is based on several of the files from the Kubelet's dockertools directory, but supports a new pluggable model for retrieving a .dockercfg-compatible JSON blob with credentials.

With this change, the Kubelet will lazily ask for the docker config from a set of DockerConfigProvider extensions each time it needs a credential.

This change provides common implementations of DockerConfigProvider for:
 - "Default": load .dockercfg from disk
 - "Caching": wraps another provider in a cache that expires after a pre-specified lifetime.

GCP-only:
 - "google-dockercfg": reads a .dockercfg from a GCE instance's metadata
 - "google-dockercfg-url": reads a .dockercfg from a URL specified in a GCE instance's metadata.
 - "google-container-registry": reads an access token from GCE metadata into a password field.
2014-11-17 21:46:54 -08:00