mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
return skip
This commit is contained in:
parent
ca5c522080
commit
059d520537
@ -47,7 +47,6 @@ const (
|
||||
// framework.CycleState, in the later phases we don't need to call Write method
|
||||
// to update the value
|
||||
type stateData struct {
|
||||
skip bool // set true if pod does not have PVCs
|
||||
allBound bool
|
||||
// podVolumesByNode holds the pod's volume information found in the Filter
|
||||
// phase for each node
|
||||
@ -166,8 +165,7 @@ func (pl *VolumeBinding) PreFilter(ctx context.Context, state *framework.CycleSt
|
||||
if hasPVC, err := pl.podHasPVCs(pod); err != nil {
|
||||
return nil, framework.NewStatus(framework.UnschedulableAndUnresolvable, err.Error())
|
||||
} else if !hasPVC {
|
||||
state.Write(stateKey, &stateData{skip: true})
|
||||
return nil, nil
|
||||
return nil, framework.NewStatus(framework.Skip)
|
||||
}
|
||||
podVolumeClaims, err := pl.Binder.GetPodVolumeClaims(pod)
|
||||
if err != nil {
|
||||
@ -243,10 +241,6 @@ func (pl *VolumeBinding) Filter(ctx context.Context, cs *framework.CycleState, p
|
||||
return framework.AsStatus(err)
|
||||
}
|
||||
|
||||
if state.skip {
|
||||
return nil
|
||||
}
|
||||
|
||||
podVolumes, reasons, err := pl.Binder.FindPodVolumes(pod, state.podVolumeClaims, node)
|
||||
|
||||
if err != nil {
|
||||
|
@ -92,9 +92,7 @@ func TestVolumeBinding(t *testing.T) {
|
||||
nodes: []*v1.Node{
|
||||
makeNode("node-a").Node,
|
||||
},
|
||||
wantStateAfterPreFilter: &stateData{
|
||||
skip: true,
|
||||
},
|
||||
wantPreFilterStatus: framework.NewStatus(framework.Skip),
|
||||
wantFilterStatus: []*framework.Status{
|
||||
nil,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user