Skip to content
Permalink
Browse files

If provisioning PVC's PV is not found, check next time.

  • Loading branch information...
cofyc committed Jan 7, 2019
1 parent cfc8ef5 commit 1a62f53d3fc915a1c99156c8de049fedd2219a41
Showing with 9 additions and 1 deletion.
  1. +9 −1 pkg/controller/volume/persistentvolume/scheduler_binder.go
@@ -518,7 +518,15 @@ func (b *volumeBinder) checkBindings(pod *v1.Pod, bindings []*bindingInfo, claim
if pvc.Spec.VolumeName != "" {
pv, err := b.pvCache.GetAPIPV(pvc.Spec.VolumeName)
if err != nil {
return false, fmt.Errorf("failed to get pv %q from cache: %v", pvc.Spec.VolumeName, err)
if _, ok := err.(*errNotFound); ok {
// We tolerate NotFound error here, because PV is possibly
// not found because of API delay, we can check next time.
// And if PV does not exist because it's deleted, PVC will
// be unbound eventually.
return false, nil
} else {
return false, fmt.Errorf("failed to get pv %q from cache: %v", pvc.Spec.VolumeName, err)
}
}
if err := volumeutil.CheckNodeAffinity(pv, node.Labels); err != nil {
return false, fmt.Errorf("pv %q node affinity doesn't match node %q: %v", pv.Name, node.Name, err)

0 comments on commit 1a62f53

Please sign in to comment.
You can’t perform that action at this time.