Commit Graph

51 Commits

Author SHA1 Message Date
Jordan Liggitt
56b7eaf344 Narrow merge interface to merging the same types
Kubernetes-commit: 9fde1c6a85c1390c7be7705385eb99b3ebc8e06a
2024-08-17 20:43:53 -04:00
Jordan Liggitt
b3dca7eb8a Isolate mergo use, add test coverage and error checking
Kubernetes-commit: 3b3886a4509a83aff0afe7ad42da9b7819a17aed
2024-08-17 16:42:11 -04:00
Stephen Kitt
e996fa7a55 Drop references to auth-path and kubernetes_auth
These are long gone, removed in 2016:
* AuthPath removal: https://github.com/kubernetes/kubernetes/pull/29216
* Flag removal: https://github.com/kubernetes/kubernetes/pull/40048

This removes the remnants from clientcmd, mostly in the comments
describing how the configuration is loaded.

Since getServerIdentificationPartialConfig can no longer fail (it
copies fields from one struct to another), this drops the error
return, along with the error handling in the caller.

Signed-off-by: Stephen Kitt <skitt@redhat.com>

Kubernetes-commit: 8a8238ba7f850241de9c5cc4b22fa1a6b6a19480
2024-07-05 14:55:44 +02:00
Ivo Gosemann
89528c43be k8s.io/client-go: add OverridingClientConfig overriding RawConfig
Kubernetes-commit: 740b4c456d731922196f8231df9ab585198696d6
2023-07-18 13:40:12 +02:00
Ivo Gosemann
17b5405ddb k8s.io/client-go: add ClientConfig option to override raw config
Kubernetes-commit: db80aa56ed8bcf4115e30fc62d27c8a8d8ec7f92
2023-07-18 13:40:12 +02:00
Shyam Jeedigunta
b8a8d94944 Add DisableCompression option to KubeConfig
Kubernetes-commit: 641fd5b482c6117d459a22d99f76aae086c3524f
2022-09-07 18:04:17 -07:00
inosato
27de641f75 Remove ioutil from client-go
Signed-off-by: inosato <si17_21@yahoo.co.jp>

Kubernetes-commit: 88dfa51b6003c90e8f0a0508939a1d79950a40df
2022-07-30 20:54:41 +09:00
Margo Crawford
5fca705b7d --as-uid flag in kubectl and kubeconfigs.
This corresponds to previous work to allow impersonating UIDs:
* Introduce Impersonate-UID header: #99961
* Add UID to client-go impersonation config #104483

Signed-off-by: Margo Crawford <margaretc@vmware.com>

Kubernetes-commit: 7e079f5144474cae05802771f604df2b748d781f
2021-10-19 16:12:31 -07:00
xiongzhongliang
d7ba1f2e01 use klog.Info and klog.Warning when had no format
Kubernetes-commit: 90f4aeeea4cc5f96caa6ed87c67ca7e62d1ba21c
2020-11-14 00:55:06 +08:00
Mikhail Mazurskiy
6cc39819fd Make inClusterConfigProvider thread safe
If configuration object is used concurrently
it is not safe to mutate self.
There is no need for mutation so avoid it
just in case.

Kubernetes-commit: 9e360eb05efafd0fcabd5a065b62cb8226da94c2
2020-06-15 21:17:45 +10:00
Mikhail Mazurskiy
6d09f8e62e Stop using mergo.MergeWithOverwrite
Use the recommended replacement instead.

Kubernetes-commit: 243a9b204e14dc9c92f08cd3252c31731b9532fd
2020-06-15 21:11:27 +10:00
Marek Siarkowicz
e93788d387 Add datapolicy tags to staging/src/k8s.io/client-go/
Kubernetes-commit: e29c568c4a9cd45d15665345aa015e21bcff52dd
2020-10-29 18:15:52 +01:00
Andrew Keesler
a7ba87c612 exec credential provider: ProvideClusterInfo and kubeconfig shadow
- The main idea here is that we want to 1) prevent potentially large CA
  bundles from being set in an exec plugin's environment and 2) ensure
  that the exec plugin is getting everything it needs in order to talk to
  a cluster.
- Avoid breaking existing manual declarations of rest.Config instances by
  moving exec Cluster to kubeconfig internal type.
- Use client.authentication.k8s.io/exec to qualify exec cluster extension.
- Deep copy the exec Cluster.Config when we copy a rest.Config.

Signed-off-by: Andrew Keesler <akeesler@vmware.com>

Kubernetes-commit: c4299d15d5289768808034676858e76a177eeae5
2020-10-29 13:38:42 -04:00
Monis Khan
9e147f192f exec credential provider: wire in cluster info
Signed-off-by: Monis Khan <mok@vmware.com>

Kubernetes-commit: f97422c8bd57692f5a1a3aa6dc6abc31051ebc82
2020-05-06 01:01:09 -04:00
Andrew Keesler
6b620f1777 exec credential provider: add install hint
This commit adds the ability for users to specify an install hint for
their exec credential provider binary.

In the exec credential provider workflow, if the exec credential binary
does not exist, then the user will see some sort of ugly

  exec: exec: "does-not-exist": executable file not found in $PATH

error message.  If some user downloads a kubeconfig from somewhere, they
may not know that kubectl is trying to use a binary to obtain
credentials to auth to the API, and scratch their head when they see
this error message.  Furthermore, even if a user does know that their
kubeconfig is trying to run a binary, they might not know how to obtain
the binary.  This install hint seeks to ease the above 2 user pains.

Signed-off-by: Andrew Keesler <akeesler@vmware.com>

Kubernetes-commit: 94e2065df2eef3b198942efb156ef6e27abcc6f9
2020-05-20 15:20:20 -04:00
Dr. Stefan Schimanski
8f2b164e09 clientcmd: fix NPE in NewNonInteractiveDeferredLoadingClientConfig with nil overrides
Kubernetes-commit: 945991b40275b096707c7b9eb0f192e99bd15b6d
2020-06-26 15:59:17 +02:00
Davanum Srinivas
75fea27a27 switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 442a69c3bdf6fe8e525b05887e57d89db1e2f3a5
2020-04-17 15:25:06 -04:00
Mike Danese
0caa50056a rest.Config: support configuring an explict proxy URL
With support of http, https, and socks5 proxy support. We already
support configuring this via environmnet variables, but this approach
becomes inconvenient dealing with multiple clusters on different
networks, that require different proxies to connect to. Most solutions
require wrapping clients (like kubectl) in bash scripts.

Part of: https://github.com/kubernetes/client-go/issues/351

Kubernetes-commit: f3f666d5f1f6f74a8c948a5c64af993696178244
2019-05-03 13:50:17 -07:00
Maciej Szulik
71473e9b7b Revert "stop defaulting kubeconfig to http://localhost:8080"
This reverts commit b19ad9e7a78fea0ecdffe7aa53bbe309d9d346ee.

Kubernetes-commit: a871738c86a0bdf7c3b8924d1932e6f2c85ea8d8
2020-04-17 16:37:15 +02:00
David Eads
72322d0c6d stop defaulting kubeconfig to http://localhost:8080
Kubernetes-commit: b19ad9e7a78fea0ecdffe7aa53bbe309d9d346ee
2018-04-12 09:42:25 -04:00
David Eads
32fece0e08 update override behavior for kubectl --tls-server-name
Kubernetes-commit: 9dcbc0bf909a794cf77a801bfd29e306791b1e24
2020-03-03 13:16:50 -05:00
Suresh Kumar Ponnusamy
6a6b2af8ea Support TLS Server Name overrides in kubeconfig file
Signed-off-by: Suresh Kumar Ponnusamy <suresh.ponnusamy@freshworks.com>

Kubernetes-commit: 37c81ed79ac6836bce4b96f888aa407dc18d747c
2019-08-28 10:51:14 +05:30
Jordan Liggitt
24302e441b Overriding CA file should override skip TLS and CA data
Kubernetes-commit: 857572168e79430af2dbf05e9d4705dfb3f0d99b
2019-10-06 13:40:21 -04:00
Jordan Liggitt
9ae57bd75e honor overridden tokenfile, add InClusterConfig override tests
Kubernetes-commit: 7306fb7a89739a2fb48bfeb74595a5daa25060bd
2019-05-15 08:15:02 -04:00
Mike Danese
459cb72bc6 BoundServiceAccountTokenVolume: fix InClusterConfig
Kubernetes-commit: 4198f28855cbda6dac61408fcba6f2d576a9347c
2019-05-14 09:29:16 -07:00
Davanum Srinivas
2537fc5f76 remove unused code
Change-Id: If821920ec8872e326b7d85437ad8d2620807799d

Kubernetes-commit: 7b8c9acc09d51a8f6018eafc49490102ae7cb0c4
2019-04-18 17:22:45 -04:00
Jordan Liggitt
66e83da33c Plumb token and token file through rest.Config
Kubernetes-commit: dba85e58debadfcb66aff2b68ba8bcc2eafeac2d
2018-12-04 11:24:29 -05:00
Davanum Srinivas
74cd8bbeee 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

Kubernetes-commit: 954996e231074dc7429f7be1256a579bedd8344c
2018-11-09 13:49:10 -05:00
Mike Danese
98e0c7ac0d periodically reload tokens read from TokenFile in kubeconfig
Like we do with InClusterConfig.

Kubernetes-commit: 718adb7473d2249d706b2031e0b8e0ffbd835be9
2018-11-02 18:57:45 -07:00
Christoph Blecker
44530d33a7 Move from mergo.Merge to mergo.MergeWithOverwrite
Kubernetes-commit: a1f6d24962f2b9e6002bcc721e1b48d1008d6cbf
2018-07-04 12:52:01 -07:00
Clayton Coleman
7130d1acc2 client-go should not take a dependency on the v1 api lightly
These constants will never change, and tools/ should not be depending on
core/api/v1 (there is nothing v1 specific about them).

Kubernetes-commit: aa9fd2bf11ae6be922b5b0fe45f5254c40366b2e
2018-04-25 18:02:30 -04:00
David Eads
44608c3c9d provide easy methods for direct kubeconfig loading from bytes
Kubernetes-commit: 8eec665ecce5e91f858c4f4b92a5e7b674798b2f
2018-03-16 12:28:50 -04:00
Eric Chiang
19c591bac2 client-go: add an exec-based client auth provider
Kubernetes-commit: 6463e9efd9ba552e60d2555a3e6526ef90196473
2018-02-07 15:43:12 -08:00
Di Xu
d39d12f4b0 fix all the typos across the project
Kubernetes-commit: 48388fec7eaad4ac8d84fbe20673ffacf41964a1
2018-02-09 14:53:53 +08:00
bin liu
526671fd79 Fix typos
Kubernetes-commit: 4260bf2a2bbc7301072860567537d30ea413c395
2018-02-01 19:53:51 +08:00
Jordan Liggitt
53ab900949 Revert "Merge pull request #47353 from apelisse/http-cache"
This reverts commit fc89743dca6b563063b74728c3b28100cf674d9d, reversing
changes made to 29ab38e898988c36e2de34f77fa33be556eb21bd.

Kubernetes-commit: 4ee72eb300423772020dd1cf208159058ba7dab5
2017-08-29 12:51:24 +00:00
Antoine Pelisse
d7f469601f c-go: Use http Etag cache
Add a new command-line cachedir flag to specify where to store the http
cache responses. This cache will only be used for OpenAPI Swagger spec
for now (as this is the only end-point that returns an ETag).

Kubernetes-commit: d7bba25d4a42f346f1963c86fc0dab43aa4f242e
2017-08-29 12:50:18 +00:00
Chao Xu
1e9caa8e14 run root-rewrite-import-client-go-api-types
Kubernetes-commit: f2d3220a11111f86b2f481e70e3c1ca4f5896f44
2017-06-28 00:06:44 +00:00
Andy Goldstein
48409ad603 Fix in-cluster kubectl --namespace override
Before this change, if the config was empty, ConfirmUsable() would
return an "invalid configuration" error instead of examining and
honoring the value of the --namespace flag. This change looks at the
overrides first, and returns the overridden value if it exists before
attempting to check if the config is usable. This is most applicable to
in-cluster clients, where they don't have a kubeconfig but they do have
a token and can use KUBERNETES_SERVICE_HOST/_PORT.

Kubernetes-commit: 23e32b100fb9745b70203c30716697bd03926313
2017-06-13 20:38:44 +00:00
fate-grand-order
d12329fb4d correct misspell "identify" in client_config.go
Kubernetes-commit: 8f2891c10267b5fb8e8bc1f8d6cb6d84145c9577
2017-06-13 20:38:43 +00:00
Cao Shufeng
29b5bff0fa add --as-group option to cli
The usecase of this change:
When a super user grant some RBAC permissions to a group, he can use
--as-group to test whether the group get the permissions.
Note that now we support as-groups, as-user-extra in kubeconfig file
after this change.

Kubernetes-commit: e541defd49d01024d17dddf8e966eba2c46a6db0
2017-05-16 17:20:28 +00:00
Chao Xu
cf012f20d0 easy changes
Kubernetes-commit: 3fa7b7824abbf3daec1189b118b91b5bb726958f
2017-04-28 20:28:25 +00:00
Jordan Liggitt
21a475eefb Stop treating in-cluster-config namespace as an override
Kubernetes-commit: 1305559abbcd1e5558980062221ed3e65a8f0387
2017-04-25 20:28:25 +00:00
Kubernetes Publisher
49948ae0ca published by bot
(https://github.com/kubernetes/test-infra/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is c09311fa32be02ebb79c7959447e3e4294cc12a3
2017-02-01 03:06:37 +00:00
Kubernetes Publisher
0eb5431cb7 published by bot
(https://github.com/kubernetes/contrib/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is 8d5227bb2e05e01031ace81fa6611a13f598278e
2017-01-21 15:19:42 +00:00
Kubernetes Publisher
204f12b1f3 published by bot
(https://github.com/kubernetes/contrib/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is 616038db1b0d1e852b4a3d10c8c512a052f91fba
2017-01-14 15:19:47 +00:00
Kubernetes Publisher
5fe6fc56cb published by bot
(https://github.com/kubernetes/contrib/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is 5b2823adb9a8777f7819884fa79a6e1daa26b9c2
2016-12-17 15:19:41 +00:00
Kubernetes Publisher
243d8a9cb6 published by bot
(https://github.com/kubernetes/contrib/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is d8c925319a23f6bbf865baa53ae23f48f60dd73b
2016-12-11 15:19:40 +00:00
Kubernetes Publisher
41a99d711a published by bot
(https://github.com/kubernetes/contrib/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is 238ffdd0d6d79d610cea2ebe3a03868a197283c8
2016-12-03 08:16:09 +00:00
Kubernetes Publisher
75399f68c8 published by bot
(https://github.com/kubernetes/contrib/tree/master/mungegithub)

copied from https://github.com/kubernetes/kubernetes.git, branch master,
last commit is e56cfc5322138aa23e6418ee30a6ab54c7c6fe8c
2016-10-21 04:44:19 +00:00