Commit Graph

201 Commits

Author SHA1 Message Date
Davanum Srinivas
26cc8e40a8
fix deadcode issues
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-07-14 08:41:21 -04:00
Aditi Sharma
def93317b4 Kubelet Credential Provider
Improve concurrency and cache for credential provider

Removed lock from "Provide" as it can be called in parallel
from image puller. To avoid execing for the same image concurrently
wrapped exec in singleflight.

Purging the cache for expried data with 15mins interval only when
a request for credential is made.

KEP:2133

Signed-off-by: Aditi Sharma <adi.sky17@gmail.com>
2021-06-28 21:15:03 +05:30
Kubernetes Prow Robot
43a32c14f5
Merge pull request #100686 from hasheddan/azure-credential-client
Add timeout to Azure ACR credential provider
2021-04-21 01:10:11 -07:00
Kubernetes Prow Robot
24350a922e
Merge pull request #101086 from enj/enj/i/auth_owners_gen
Prune stale entries from OWNERS files
2021-04-15 08:27:50 -07:00
Kubernetes Prow Robot
3c20c5aa2f
Merge pull request #100177 from wangyx1992/wrapped-error
fix errors in wrapped format
2021-04-13 23:24:42 -07:00
Monis Khan
91241eac9b
Prune stale entries from OWNERS files
Signed-off-by: Monis Khan <mok@vmware.com>
2021-04-13 20:54:50 -04:00
hasheddan
7c7cff6d27
Add timeout to Azure ACR credential provider
Adds a default timeout to the Azure ACR HTTP client to avoid hanging
when unable to reach server.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2021-03-30 17:15:54 -05:00
wangyx1992
34c2b2360b fix errors in wrapped format
Signed-off-by: wangyx1992 <wang.yixiang@zte.com.cn>
2021-03-26 14:57:55 +08:00
Nick Turner
d422a92e66 Fix ECR provider startup latency
* Before this change, even on non-AWS platforms, the Enabled() check attempts
  to make calls to the metadata endpoint when the session and credentials
  are initialized (in order to determine if the provider should be
  initialized at all).
* This can cause latency because the SDK times out and retries -- up to
  20 seconds of latency has been observed on non-AWS platforms when the
  metadata IP was blocked with an iptables rule.
* Instead, check once if we are running on an EC2 platform, first trying
  to find the EC2 UUID in system files, and second attempting to get
  credentials.
* Add a benchmark test that includes intialization and the credential
  check.
2021-03-19 23:37:11 +00:00
Kermit Alexander
0dcafb1f37 Add RegistryConfig/RegistryConfigEntry. 2021-03-02 00:08:54 +00:00
Kermit Alexander
42fb89eb89 Move config and provider code out of pkg/credentialprovider and into staging. 2021-03-02 00:07:02 +00:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Nikhita Raghunath
dc3f59c881 *: remove mbohlool from reviewers 2021-02-16 10:59:27 +05:30
10177505
2ecbf7e4f5 fix klog.Info -> klog.Infof 2021-01-15 17:22:58 +08:00
Gurleen Grewal
7a0b5acf00 Fix golint issues in pkg/credentialprovider/plugin 2020-12-08 15:11:44 -08:00
andyzhangx
48ba8830cd fix pull image error from multiple ACRs using azure managed identity
fix comments

fix comment

fix comments

fix comments

fix comments

fix comments

fix bazel
2020-11-12 09:51:26 +00:00
Andrew Sy Kim
aadc1d25b3 pkg/credentialprovider: export URL parsing and matching helper functions
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
2020-11-10 13:44:07 -05:00
Andrew Sy Kim
5344afd4fb pkg/credentialprovider: add initial exec-based credential provider plugin
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
2020-11-10 13:44:07 -05:00
Andy Zhang
9056e3a86a
add andyzhangx as reviewer 2020-11-08 16:55:03 +08:00
Andrew Sy Kim
44e6998f1b kubelet: add unit tests for imagePullSecrets keyring
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
2020-09-23 14:11:10 -04:00
Nikolaos Moraitis
b907f9e118 avoid potential secret leaking while reading .dockercfg
There are a lot of scenarios where an invalid .dockercfg file
will still contain secrets. This commit removes logging of the
contents to avoid any potential leaking and manages the actual error
by printing to the user the actual location of the invalid file.

Signed-off-by: Nikolaos Moraitis <nmoraiti@redhat.com>
2020-09-14 15:39:05 +02:00
Jordan Liggitt
1420b377e4 Add providerless tags 2020-07-30 13:48:40 -04:00
Benjamin Elder
d8f2b131b5 remove david-mcmahon from reviewers 2020-06-30 14:06:58 -07:00
Benjamin Elder
2abc8afece eparis to emeritus 2020-06-30 09:50:44 -07:00
andyzhangx
fe873af660 fix: don't use docker config cache if it's empty
add one comment

test: add unit test

fix comments

fix comments

revert test change

fix comments
2020-06-22 15:10:47 +00:00
Davanum Srinivas
07d88617e5
Run hack/update-vendor.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:33 -04:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
David Parks
333b0493fb fix: ACR auth fails in private azure clouds 2020-04-24 19:13:52 -07:00
martin-schibsted
9ba2bd57fb
Improve error message (#82829)
* Improve error message

* Update pkg/credentialprovider/config.go

Co-Authored-By: Jordan Liggitt <jordan@liggitt.net>

Co-authored-by: Jordan Liggitt <jordan@liggitt.net>
2020-03-20 00:02:36 -07:00
zzde
a95d04993a
Fix golint failures in pkg/credentialprovider (#88860)
* Fix golint failures in pkg/credentialprovider

* improve Comment

* test
2020-03-18 20:10:43 -07:00
Tim Allclair
9d3670f358 Ensure testing credentials are labeled as such 2020-02-04 10:36:05 -08:00
Yuriy Gridasov
f641ecd6f8 Whitelisting *.pkg.dev for the GCP credential provider 2020-01-24 10:19:19 -08:00
Oleg Bulatov
5bec54ed5b
fix: padded base64 encoded docker auth field
base64 allows usage of new line characters and some tools use them.
As a result, the length of the encoded string cannot be used to
determine whether it's padded or not.

This patch fixes the regression after #82148.
2019-11-28 17:12:03 +01:00
jadarsie
3322ff9551 generalize solution 2019-11-21 19:14:47 -08:00
jadarsie
55828d059d misc fixes 2019-11-21 10:19:25 -08:00
jadarsie
ec57d8a4d0 Support Azure Stack dynamic environments 2019-11-18 15:06:32 -08:00
hwdef
170eadc3d2 pkg/credentialprovider: fix staticcheck warning 2019-11-11 09:46:52 +08:00
Roy Hvaara
e40c473334
Fix golint errors in pkg/credentialprovider/gcp 2019-10-28 21:54:45 +01:00
Bob Killen
666c5e5040
Prune inactive owners from pkg/credentialprovider/* OWNERS files. 2019-10-13 08:51:44 -04:00
Kubernetes Prow Robot
5675ef858e
Merge pull request #82148 from bbourbie/fix_docker_credential
fix: adding padding the encoded docker auth field
2019-09-25 11:04:14 -07:00
hwdef
4e7ef9ad36 delete unused var 2019-09-19 18:04:13 +08:00
Han Kang
866ea74326 remove pkg/version and some of redundant copies of it
Change-Id: Ia58367c1b1274bfb49c8a4784051463abaf795de
2019-09-16 16:24:35 -07:00
Benoît Bourbié
a3e434cee4 fix: handling unpadded base64 encoded docker auth field
docker-credential-desk does not pad anymore the auth field.
it is then possible to have unpadded auth field.

field might be encoded either with RawStdEncoding or StdEncoding

we now determine if it is correctly padded in order to handle
both cases.
2019-09-09 21:30:03 -07:00
Stephen Augustus
a8ea88960d Update Azure imports to latest API versions
Signed-off-by: Stephen Augustus <saugustus@vmware.com>
2019-08-19 13:27:27 -04:00
Stephen Augustus
c7858aa976 Lint Azure imports
Signed-off-by: Stephen Augustus <saugustus@vmware.com>
2019-08-15 18:03:05 -04:00
Angela Li
a02289a91b Determine system model for windows nodes 2019-07-30 14:28:53 -07:00
Ted Yu
7a5e7030d2 Handle error return from http.NewRequest() 2019-07-08 17:41:02 -07:00
tiffany jernigan
27a0d91f2d Remove lazy provide from credential provider and kubelet (#79674)
* Remove LazyProvide from kubelet

* Remove LazyProvide from cloud providers

* Remove LazyProvide from credential provider keyring and provider
2019-07-03 13:52:52 -07:00
Stephen Augustus
a64cf7a1e2 Update azure-sdk-for-go/services/containerregistry to 2018-09-01
Signed-off-by: Stephen Augustus <saugustus@vmware.com>
2019-07-01 00:24:15 -04:00
Claudiu Belu
16da70c249 credentialprovider: Sets homeDirPath to os.UserHomeDir()
Currently, the credential provider will look in the path set in
the $HOME env variable, but that environment does not exist on
Windows, but $HOMEPATH does. Because of this, if credentials are
set in ~/.docker on Windows, they will not be used by kubelet
when pulling images.

The function os.UserHomeDir can solve this problem [1].

[1] https://golang.org/pkg/os/#UserHomeDir
2019-05-25 12:52:32 -07:00