kubernetes/kubernetes

API can be streamlined: assume same key for some `EnvVarSource`

Open

#132.195 aperta il 9 giu 2025

Vedi su GitHub
 (15 commenti) (0 reazioni) (0 assegnatari)Go (43.066 fork)batch import
area/apihelp wantedkind/featureneeds-triagepriority/backlogsig/node

Metriche repository

Star
 (122.268 star)
Metriche merge PR
 (Merge medio 28g 17h) (343 PR mergiate in 30 g)

Descrizione

https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/api/core/v1/types.go#L2376

All EnvVarSource must specify name in the parent, but the ConfigMapKeyRef and SecretKeyRef fields both require a key to be specified. https://github.com/kubernetes/enhancements/pull/5384 introduces another case.

It seems like we could assume the env var's name if the key is not specified. One less line of YAML in many cases.

It would require a feature gate which means a (small) KEP.

Impl is in pkg/kubelet/kubelet_pods.go

Guida contributor