Commit Graph

31 Commits

Author SHA1 Message Date
HirazawaUi
84dc0417b2 fix fd leaks and failed file removing for pkg client-go
Kubernetes-commit: 73aeed8766c2c42a6cb4fc8632b1b974f4508dde
2023-05-03 01:35:16 +08: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
Andrew Keesler
37ed584bed exec credential provider: InteractiveMode support
The value here is that the exec plugin author can use the kubeconfig to assert
how standard input is treated with respect to the exec plugin, e.g.,
- an exec plugin author can ensure that kubectl fails if it cannot provide
  standard input to an exec plugin that needs it (Always)
- an exec plugin author can ensure that an client-go process will still call an
  exec plugin that prefers standard input even if standard input is not
  available (IfAvailable)

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

Kubernetes-commit: cd83d89ac94c5b61fdd38840098e7223e5af0d34
2021-06-14 17:15:36 -04:00
Mikhail Mazurskiy
6d09f8e62e Stop using mergo.MergeWithOverwrite
Use the recommended replacement instead.

Kubernetes-commit: 243a9b204e14dc9c92f08cd3252c31731b9532fd
2020-06-15 21:11:27 +10:00
Maciej Szulik
87661a7415 kubeconfig: add explicit path, if specified to loading precedence
Kubernetes-commit: 7c8e4c83fbe66548aeb446562c29c42efe1d4386
2020-07-21 15:45:36 +02: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
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
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
Tim Allclair
8462896174 Ensure testing credentials are labeled as such
Kubernetes-commit: 9d3670f3586c98c02cdca93b7c98dd91fc0b87bd
2020-02-04 10:36:05 -08:00
Jordan Liggitt
24302e441b Overriding CA file should override skip TLS and CA data
Kubernetes-commit: 857572168e79430af2dbf05e9d4705dfb3f0d99b
2019-10-06 13:40:21 -04:00
RainbowMango
532b6f676e Cleanup staticcheck issues for package in client-go.
Kubernetes-commit: c8c055b3163dd2661b3f9dd1b0ffb718a61aba24
2019-08-26 20:55:32 +08:00
Jordan Liggitt
9ae57bd75e honor overridden tokenfile, add InClusterConfig override tests
Kubernetes-commit: 7306fb7a89739a2fb48bfeb74595a5daa25060bd
2019-05-15 08:15:02 -04:00
Jordan Liggitt
66e83da33c Plumb token and token file through rest.Config
Kubernetes-commit: dba85e58debadfcb66aff2b68ba8bcc2eafeac2d
2018-12-04 11:24:29 -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
7f1c01699a Update gofmt for go1.11
Kubernetes-commit: 97b2992dc191a357e2167eff5035ce26237a4799
2018-10-05 12:59:38 -07:00
Christoph Blecker
43b95360bd add more tests to clientcmd
Kubernetes-commit: e9cf2b0f798f1fac07f52b5d193419e938e3a7cd
2018-08-11 22:16:26 -07:00
Christoph Blecker
442fc9f1c4 Improve TestMergoSemantics test
Kubernetes-commit: 194c471c9ccbb1cf57c66ac081828a693e7ce687
2018-07-04 13:52:44 -07:00
Christoph Blecker
44530d33a7 Move from mergo.Merge to mergo.MergeWithOverwrite
Kubernetes-commit: a1f6d24962f2b9e6002bcc721e1b48d1008d6cbf
2018-07-04 12:52:01 -07:00
juanvallejo
69308bcf06 use temp file for kubeconfig in test
Kubernetes-commit: 03af5089afb5d31707e7d91e55dfd6b157e6f8e1
2018-08-13 14:29:34 -04:00
juanvallejo
61141c1efe improve kubeconfig file modification time
Trades runtime complexity for spacial complexity when modifying
large amounts of contexts on a kubeconfig.

In cases where there are few destination filenames for a given
amount of contexts, but a large amount of contexts, this patch
prevents reading and writing to the same file (or small number
of files) over and over again needlessly.

Kubernetes-commit: d5651948cf1a14ed284b4708e2057e4cbc72bcbe
2018-08-07 15:13:57 -04:00
Di Xu
d39d12f4b0 fix all the typos across the project
Kubernetes-commit: 48388fec7eaad4ac8d84fbe20673ffacf41964a1
2018-02-09 14:53:53 +08: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
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
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
Chao Xu
a6d206121d remove the top-level folders for versions
remove scripts
2016-10-19 14:34:19 -07:00