Commit Graph

229 Commits

Author SHA1 Message Date
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
danielqsj
142fe19f2d fix increment-decrement lint error 2019-05-06 13:14:51 +08:00
Tongyao Si
a2f4f51b77 Add more test cases 2019-04-30 16:52:07 +08:00
Tongyao Si
b5cdb78190 Fix ACR MSI cross-subscription authentication error 2019-04-30 16:40:05 +08:00
Kubernetes Prow Robot
2776cc1e72
Merge pull request #77099 from dims/remove-rancher-credential-provider-from-upstream-kubernetes
Remove Rancher Credential Provider from upstream kubernetes
2019-04-26 04:32:39 -07:00
Stephen Augustus
2f74c90480 Staging the legacy Azure Cloud Provider
Signed-off-by: Stephen Augustus <saugustus@vmware.com>
2019-04-25 20:03:45 -04:00
Davanum Srinivas
edf8577654
Remove Rancher Credential Provider from upstream kubernetes
This is useful only in rancher environment, they are using this in a
very old branch (1.6), they are currently at 2.2.x. There is just no
point in us carrying this code as this is not useful to anyone else
outside of the rancher environment. Let us please remove this code from
upstream.

Change-Id: I5196d0edd79a7809c3a04e6028ddbd01063f224b
2019-04-25 19:10:01 -04:00
Davanum Srinivas
7b8c9acc09
remove unused code
Change-Id: If821920ec8872e326b7d85437ad8d2620807799d
2019-04-19 08:36:31 -04:00
Haiyan Meng
529ac8a2d8
Limit the read length of ioutil.ReadAll in pkg/credentialprovider
Signed-off-by: Haiyan Meng <haiyanmeng@google.com>
2019-04-16 13:59:44 -07:00
Kubernetes Prow Robot
90e9f29bad
Merge pull request #71900 from charrywanganthony/remove-unused-parseAcrToken
remove unused function
2019-04-02 00:14:35 -07:00
Kubernetes Prow Robot
dabeb20a1a
Merge pull request #75587 from tiffanyfay/cred-provider
Refactor AWS credential provider
2019-03-29 14:48:47 -07:00
tiffany jernigan
0d63fa4543 Update aws provider build files 2019-03-28 07:15:28 +00:00
tiffany jernigan
11efc01328 Refactors and fixes bugs in AWS credentialprovider
Adds caching per registry. Fixes caching of invalid ECR tokens.
2019-03-28 07:15:28 +00:00
Andrew Sy Kim
b8a92e82b2 add @andrewsykim and @mcrute as pkg/credentialprovider revierws
Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
2019-03-27 11:03:50 -04:00
tiffany jernigan
ecbb090f32 Credential provider Provide takes image (clouds) 2019-03-27 01:00:26 +00:00
tiffany jernigan
847cb24aa1 Credential provider Provide takes image (general) 2019-03-27 01:00:26 +00:00
andyzhangx
3c7de52cc2 add Azure Container Registry anonymous repo support
apply fix for msi and fix test failure
2019-02-28 12:16:21 +00:00
Kubernetes Prow Robot
808f2cf0ef
Merge pull request #72525 from justinsb/owners_should_not_be_executable
Remove executable file permission from OWNERS files
2019-02-14 23:55:45 -08:00
Roy Lenferink
b43c04452f Updated OWNERS files to include link to docs 2019-02-04 22:33:12 +01:00
Tara Gu
c8f6038c96 Fix type in comment 2019-02-03 15:25:09 -05:00
Justin SB
dd19b923b7
Remove executable file permission from OWNERS files 2019-01-11 16:42:59 -08:00
Micah Hausler
949d5f97c4 Added kubernetes version to user-agent for AWS SDK calls 2018-12-20 21:04:44 -08:00
Chao Wang
7f1327ffd8 remove unused function 2018-12-10 15:24:33 +08:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
Davanum Srinivas
43f523d405
Switch to sigs.k8s.io/yaml from ghodss/yaml
Change-Id: Ic72b5131bf441d159012d67a6a3d87088d0e6d31
2018-11-07 13:17:32 -05:00
k8s-ci-robot
a49e4e128e
Merge pull request #69708 from mcrute/fix-aws-imports
Fix AWS volume and cloud provider import order
2018-10-30 13:44:50 -07:00
Mike Crute
49df100af9 fix AWS volume and cloud provider import order 2018-10-30 08:18:45 -07:00
k8s-ci-robot
dad07683b1
Merge pull request #69013 from ibrasho-forks/switch-to-http.Error
Update usages of http.ResponseWriter.WriteHeader to use http.Error
2018-10-23 15:31:55 -07:00
Ibrahim AshShohail
2fb3ba71f1
Update usages of http.ResponseWriter.WriteHeader to use http.Error
Signed-off-by: Ibrahim AshShohail <me@ibrasho.com>
2018-10-14 05:58:00 +03:00
Yu-Ju Hong
ed92397eff GCP: Remove the deprecated google-json-key support
The flag was deprecated in 1.10. According to the deprecation policy, it
is safe to remove the flag now.
2018-10-02 16:53:28 -07:00
Clayton Coleman
7e398dc31f
Remove dependency on docker daemon for core credential types
We are removing dependencies on docker types where possible in the core
libraries. credentialprovider is generic to Docker and uses a public API
(the config file format) that must remain stable. Create an equivalent type
and use a type cast (which would error if we ever change the type) in the
dockershim. We already perform a transformation like this for CRI and so
we aren't changing much.
2018-09-07 16:36:14 -04:00
Kubernetes Submit Queue
152de38825
Merge pull request #65043 from brendandburns/todo4
Automatic merge from submit-queue (batch tested with PRs 64564, 65043). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Make CredentialProvider config loading deterministic.

@mattmoor fixed an old TODO :)
2018-08-26 14:07:04 -07:00
andyzhangx
a7e328c211 fix acr sp access issue 2018-07-20 08:39:31 +00:00
Jeff Grafton
23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Brendan Burns
804ee25b1e Make CredentialProvider config loading deterministic. 2018-06-12 21:39:46 -07:00
Pengfei Ni
471d00c929 Use new clients in Azure credential provider 2018-04-26 09:38:48 +08:00
Jeff Grafton
ef56a8d6bb Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
Pengfei Ni
4b453fb3ed update azure API for auth 2018-02-12 14:07:05 +08:00
Davanum Srinivas
0f5013b715 Better check for GCE VM
we should do what is being done in GoogleCloudPlatform/google-cloud-go:
https://github.com/GoogleCloudPlatform/google-cloud-go/blob/master/compute/metadata/metadata.go#L259-L267

Looks like folks are reusing appliances which end up with
```
$ cat /sys/class/dmi/id/product_name
Google Search Appliance
```
2018-01-17 18:35:51 -05:00
Michael Taufen
8ec1958667 All Kubelet flags should be explicitly registered
This explicitly registers Kubelet flags from libraries that were
registering flags globally, and stops parsing the global flag set.
In general, we should always be explicit about flags we register
and parse, so that we maintain control over our command-line API.
2018-01-09 17:37:34 -08:00
Kubernetes Submit Queue
738fcdd111
Merge pull request #57179 from chrislovecnm/aws-creds-owners
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Adding myself as a reviewer to aws credentialprovider

/assign @justinsb 
/release-note-none
2018-01-07 09:08:31 -08:00
Clayton Coleman
5210e6fefd
Remove dependency on v1 API in base credential provider
Credential provider is useful without the v1 API, move the only
dependency out so that we can more easily move credential provider to a
utility library in the future (other callers besides Kubelet may need to
load pull secrets like Docker).
2018-01-05 17:52:06 -05:00
Dong Liu
7eafa215f5 Split auth related config for Azure 2018-01-03 10:23:26 +08:00
Jeff Grafton
efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
andyzhangx
8d99c55bba add Dong Liu as approver and add OWNERS in credentialprovider 2017-12-19 09:31:43 +00:00
chrislovecnm
20a465ee4a Adding myself as a reviewer to aws credentialprovider 2017-12-13 22:53:49 -07:00
Zeqing Zhang
65bed1d982 fix awsStandardDNSSuffix 2017-11-15 16:39:48 +08:00
Zeqing Zhang
be7c0bdce2 add testcase for aws china region 2017-11-15 16:39:47 +08:00
Zeqing Zhang
6a1b31323e swap the return statements 2017-11-15 16:39:47 +08:00
Zeqing Zhang
45ae5bf1e5 Support AWS ECR credentials in China 2017-11-15 16:39:46 +08:00
Jeff Grafton
aee5f457db update BUILD files 2017-10-15 18:18:13 -07:00
Jeff Grafton
a7f49c906d Use buildozer to delete licenses() rules except under third_party/ 2017-08-11 09:32:39 -07:00
Jeff Grafton
33276f06be Use buildozer to remove deprecated automanaged tags 2017-08-11 09:31:50 -07:00
Cole Mickens
8e093b9e23 azure: acr: support auth to preview ACR w/ MSI+AAD 2017-07-18 15:22:34 -07:00
Kubernetes Submit Queue
23e60ac9ad Merge pull request #48308 from yguo0905/docker-api
Automatic merge from submit-queue

Update Docker API in Kubelet

Ref: https://github.com/kubernetes/kubernetes/issues/34308

The Kubelet currently uses deprecated docker API (https://godoc.org/github.com/docker/engine-api). This PR changes it to use the new one (https://godoc.org/github.com/moby/moby/client).

This PR updated the docker package from 1.11 to 1.13.1-rc2.

**Release note**:
```
None
```

/assign @Random-Liu 
/cc @yujuhong
2017-07-14 15:30:59 -07:00
Cole Mickens
931002ec1f azure: acr docker cred provider reuses auth 2017-07-13 14:27:37 -07:00
Yang Guo
bf2ced837c Updates Docker Engine API 2017-07-13 12:55:07 -07:00
Brendan Burns
29a0c6f56a Code updates for new SDK. 2017-07-12 06:09:31 -07:00
Chao Xu
60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu
f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00
Kubernetes Submit Queue
e1423acc50 Merge pull request #45056 from ericchiang/update-oauth2
Automatic merge from submit-queue

bump(golang.org/x/oauth2): a6bd8cefa1811bd24b86f8902872e4e8225f74c4

As I tackle https://github.com/kubernetes/kubernetes/issues/42654 kubectl's OpenID Connect plugin will start using golang.org/x/oauth2 for refreshing, instead of go-oidc's own hand rolled oauth2 implementation. In preparation, update golang.org/x/oauth2 to include 7374b3f1ec which fixes refreshing with Okta.

We also somehow removed the dependency on `google.golang.org/appengine`. Maybe 8cf58155e4?

cc @kubernetes/sig-auth-pr-reviews
2017-05-03 19:34:14 -07:00
Yu-Ju Hong
51188e6f70 Update bazel files 2017-05-03 11:22:06 -07:00
Yu-Ju Hong
607bdd574d Move docker keyring lookup test to pkg/credentailprovider
Also remove unused image tests in docker_test.go
2017-05-03 11:22:06 -07:00
Eric Chiang
3f888f2edf GCP credential provider: add "type" field to fake JSON key in unit test 2017-04-28 16:16:53 -07:00
Mike Danese
a05c3c0efd autogenerated 2017-04-14 10:40:57 -07:00
wlan0
3d58d79669 add vendor dirs for rancher credential provider 2017-03-27 16:44:15 -07:00
wlan0
38988fec78 add rancher credential provider 2017-03-27 16:22:53 -07:00
Kris
ee4227f4bf Remove krousey from some OWNERS files 2017-03-10 11:12:29 -08:00
Kubernetes Submit Queue
d62fca231e Merge pull request #40142 from colemickens/colemickens-acr-login-server
Automatic merge from submit-queue (batch tested with PRs 37055, 40142)

azure: azure container registry: fix login server

**What this PR does / why we need it**:

Fixes the Azure Container Registry integration

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
n/a

**Special notes for your reviewer**:

Before this change, if I created an ACR with name `colemicktest`, then the login server would be `colemicktest-microsoft.azurecr.io`. This code was concating to form `colemicktest.azurecr.io` which does not work.

The fix is to reach into RegistryProperties and read out the login server domain name directly.

Also, this should eliminate that existed when ACR gets to sovereign clouds.

**Release note**:

```release-note
azure: fix Azure Container Registry integration
```
2017-01-25 00:40:02 -08:00
Cole Mickens
1c72f2b9de azure: acr fix login server 2017-01-19 05:08:16 -08:00
Justin Santa Barbara
04b787b946 AWS: trust region if found from AWS metadata
Means we can run in newly announced regions without a code change.

We don't register the ECR provider in new regions, so we will still need
a code change for now.

This also means we do trust config / instance metadata, and don't reject
incorrectly configured zones.

Fix #35014
2017-01-18 09:17:55 -05:00
Kubernetes Submit Queue
c3b897d930 Merge pull request #36516 from apelisse/owners-pkg-credentialprovider
Automatic merge from submit-queue

Curating Owners: pkg/credentialprovider

cc @liggitt @erictune

In an effort to expand the existing pool of reviewers and establish a
two-tiered review process (first someone lgtms and then someone
experienced in the project approves), we are adding new reviewers to
existing owners files.


If You Care About the Process:
------------------------------

We did this by algorithmically figuring out who’s contributed code to
the project and in what directories.  Unfortunately, that doesn’t work
well: people that have made mechanical code changes (e.g change the
copyright header across all directories) end up as reviewers in lots of
places.

Instead of using pure commit data, we generated an excessively large
list of reviewers and pruned based on all time commit data, recent
commit data and review data (number of PRs commented on).

At this point we have a decent list of reviewers, but it needs one last
pass for fine tuning.

Also, see https://github.com/kubernetes/contrib/issues/1389.

TLDR:
-----

As an owner of a sig/directory and a leader of the project, here’s what
we need from you:

1. Use PR https://github.com/kubernetes/kubernetes/pull/35715 as an example.

2. The pull-request is made editable, please edit the `OWNERS` file to
remove the names of people that shouldn't be reviewing code in the
future in the **reviewers** section. You probably do NOT need to modify
the **approvers** section. Names asre sorted by relevance, using some
secret statistics.

3. Notify me if you want some OWNERS file to be removed.  Being an
approver or reviewer of a parent directory makes you a reviewer/approver
of the subdirectories too, so not all OWNERS files may be necessary.

4. Please use ALIAS if you want to use the same list of people over and
over again (don't hesitate to ask me for help, or use the pull-request
above as an example)
2017-01-13 14:34:02 -08:00
deads2k
6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00