tolerate missing image pull secrets:

pull/6/head
deads2k 2015-08-14 12:51:28 -04:00
parent 27599b9164
commit c24d176f65
1 changed files with 2 additions and 2 deletions

View File

@ -1279,7 +1279,6 @@ func (kl *Kubelet) syncPod(pod *api.Pod, mirrorPod *api.Pod, runningPod kubecont
}
// getPullSecretsForPod inspects the Pod and retrieves the referenced pull secrets
// TODO transitively search through the referenced service account to find the required secrets
// TODO duplicate secrets are being retrieved multiple times and there is no cache. Creating and using a secret manager interface will make this easier to address.
func (kl *Kubelet) getPullSecretsForPod(pod *api.Pod) ([]api.Secret, error) {
pullSecrets := []api.Secret{}
@ -1287,7 +1286,8 @@ func (kl *Kubelet) getPullSecretsForPod(pod *api.Pod) ([]api.Secret, error) {
for _, secretRef := range pod.Spec.ImagePullSecrets {
secret, err := kl.kubeClient.Secrets(pod.Namespace).Get(secretRef.Name)
if err != nil {
return nil, err
glog.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)
continue
}
pullSecrets = append(pullSecrets, *secret)