mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Avoid kubelet warnings for imagePullSecret entries with empty names
This commit is contained in:
parent
793390e13b
commit
4798d0bce2
@ -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