return skip

This commit is contained in:
kidddddddddddddddddddddd 2023-01-07 21:58:54 +08:00
parent ca5c522080
commit 059d520537
2 changed files with 2 additions and 10 deletions

View File

@ -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 {

View File

@ -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,
},