Skip to content

Commit cabc0f1

Browse files
authored
Merge pull request kubernetes#2103 from ankeesler/exec-cred-prov-cluster-info-updates
exec credential provider: updates to KEP after cluster info PR
2 parents f60f0d9 + 1527ee6 commit cabc0f1

File tree

1 file changed

+13
-6
lines changed
  • keps/sig-auth/541-external-credential-providers

1 file changed

+13
-6
lines changed

keps/sig-auth/541-external-credential-providers/README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ users:
158158
159159
# Whether or not to provide cluster information, which could potentially contain
160160
# very large CA data, to this exec plugin as a part of the KUBERNETES_EXEC_INFO
161-
# environment variable.
161+
# environment variable. Optional. Defaults to false.
162162
provideClusterInfo: true
163163
clusters:
164164
- name: my-cluster
@@ -209,7 +209,8 @@ type ExecConfig struct {
209209
// ProvideClusterInfo determines whether or not to provide cluster information,
210210
// which could potentially contain very large CA data, to this exec plugin as a
211211
// part of the KUBERNETES_EXEC_INFO environment variable. By default, it is set
212-
// to false.
212+
// to false. Package k8s.io/client-go/tools/auth/exec provides helper methods for
213+
// reading this environment variable.
213214
ProvideClusterInfo bool `json:"provideClusterInfo"`
214215
}
215216
```
@@ -243,8 +244,10 @@ In JSON:
243244
"spec": {
244245
"cluster": {
245246
"server": "https://1.2.3.4:8080",
246-
"serverName": "bar",
247-
"caData": " ... ",
247+
"tls-server-name": "bar",
248+
"insecure-skip-tls-verify": true,
249+
"certificate-authority-data": " ... ",
250+
"proxy-url": "https://4.5.6.7:9090/proxy",
248251
"config": { ... }
249252
}
250253
}
@@ -310,7 +313,8 @@ type Cluster struct {
310313
// Config holds additional config data that is specific to the exec
311314
// plugin with regards to the cluster being authenticated to.
312315
//
313-
// This data is sourced from the clientcmd Cluster object's extensions[exec] field:
316+
// This data is sourced from the clientcmd Cluster object's
317+
// extensions[client.authentication.k8s.io/exec] field:
314318
//
315319
// clusters:
316320
// - name: my-cluster
@@ -426,6 +430,9 @@ func LoadExecCredentialFromEnv() (runtime.Object, *rest.Config, error)
426430
//
427431
// If the provided data is successfully unmarshalled, but it does not contain cluster information
428432
// (i.e., ExecCredential.Spec.Cluster == nil), then the returned rest.Config and error will be nil.
433+
//
434+
// Note that the returned rest.Config will use anonymous authentication, since the exec plugin has
435+
// not returned credentials for this cluster yet.
429436
func LoadExecCredential(data []byte) (runtime.Object, *rest.Config, error)
430437
```
431438

@@ -524,7 +531,7 @@ Unit tests to confirm:
524531
`CertificateAuthority` for reasons stated in design) so
525532
that structs are kept up to date
526533
- Helper methods properly create `"k8s.io/client-go/rest".Config` from
527-
`"k8s.io/client-go/pkg/apis/clientauthentication".Cluster`
534+
`"k8s.io/client-go/pkg/apis/clientauthentication".Cluster` and vice versa
528535

529536
Integration (or e2e CLI) tests to confirm:
530537

0 commit comments

Comments
 (0)