mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Merge pull request #99590 from liggitt/kubelet-warning
Avoid kubelet warnings for imagePullSecret entries with empty names
This commit is contained in:
commit
35c233f18d
@ -881,6 +881,11 @@ func (kl *Kubelet) getPullSecretsForPod(pod *v1.Pod) []v1.Secret {
|
|||||||
pullSecrets := []v1.Secret{}
|
pullSecrets := []v1.Secret{}
|
||||||
|
|
||||||
for _, secretRef := range pod.Spec.ImagePullSecrets {
|
for _, secretRef := range pod.Spec.ImagePullSecrets {
|
||||||
|
if len(secretRef.Name) == 0 {
|
||||||
|
// API validation permitted entries with empty names (http://issue.k8s.io/99454#issuecomment-787838112).
|
||||||
|
// Ignore to avoid unnecessary warnings.
|
||||||
|
continue
|
||||||
|
}
|
||||||
secret, err := kl.secretManager.GetSecret(pod.Namespace, secretRef.Name)
|
secret, err := kl.secretManager.GetSecret(pod.Namespace, secretRef.Name)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.Warningf("Unable to retrieve pull secret %s/%s for %s/%s due to %v. The image pull may not succeed.", pod.Namespace, secretRef.Name, pod.Namespace, pod.Name, err)
|
klog.Warningf("Unable to retrieve pull secret %s/%s for %s/%s due to %v. The image pull may not succeed.", pod.Namespace, secretRef.Name, pod.Namespace, pod.Name, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user