mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #83540 from cofyc/fix83343
Fix volume scheduling error handling
This commit is contained in:
commit
9f875de5d2
@ -353,11 +353,7 @@ func (b *volumeBinder) BindPodVolumes(assumedPod *v1.Pod) (err error) {
|
|||||||
return b, err
|
return b, err
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
pvcName := ""
|
return fmt.Errorf("Failed to bind volumes: %v", err)
|
||||||
if len(claimsToProvision) > 0 {
|
|
||||||
pvcName = claimsToProvision[0].Name
|
|
||||||
}
|
|
||||||
return fmt.Errorf("Failed to bind volumes: provisioning failed for PVC %q: %v", pvcName, err)
|
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -523,7 +519,10 @@ func (b *volumeBinder) checkBindings(pod *v1.Pod, bindings []*bindingInfo, claim
|
|||||||
}
|
}
|
||||||
selectedNode := pvc.Annotations[pvutil.AnnSelectedNode]
|
selectedNode := pvc.Annotations[pvutil.AnnSelectedNode]
|
||||||
if selectedNode != pod.Spec.NodeName {
|
if selectedNode != pod.Spec.NodeName {
|
||||||
return false, fmt.Errorf("selectedNode annotation value %q not set to scheduled node %q", selectedNode, pod.Spec.NodeName)
|
// If provisioner fails to provision a volume, selectedNode
|
||||||
|
// annotation will be removed to signal back to the scheduler to
|
||||||
|
// retry.
|
||||||
|
return false, fmt.Errorf("provisioning failed for PVC %q", pvc.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the PVC is bound to a PV, check its node affinity
|
// If the PVC is bound to a PV, check its node affinity
|
||||||
|
Loading…
Reference in New Issue
Block a user