@@ -23,10 +23,9 @@ import (
23
23
"testing"
24
24
25
25
v1 "k8s.io/api/core/v1"
26
- volumescheduling "k8s.io/kubernetes/pkg/controller/volume/scheduling"
26
+ "k8s.io/kubernetes/pkg/controller/volume/scheduling"
27
27
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
28
28
schedulernodeinfo "k8s.io/kubernetes/pkg/scheduler/nodeinfo"
29
- "k8s.io/kubernetes/pkg/scheduler/volumebinder"
30
29
)
31
30
32
31
func TestVolumeBinding (t * testing.T ) {
@@ -44,7 +43,7 @@ func TestVolumeBinding(t *testing.T) {
44
43
name string
45
44
pod * v1.Pod
46
45
node * v1.Node
47
- volumeBinderConfig * volumescheduling .FakeVolumeBinderConfig
46
+ volumeBinderConfig * scheduling .FakeVolumeBinderConfig
48
47
wantStatus * framework.Status
49
48
}{
50
49
{
@@ -57,7 +56,7 @@ func TestVolumeBinding(t *testing.T) {
57
56
name : "all bound" ,
58
57
pod : & v1.Pod {Spec : volState },
59
58
node : & v1.Node {},
60
- volumeBinderConfig : & volumescheduling .FakeVolumeBinderConfig {
59
+ volumeBinderConfig : & scheduling .FakeVolumeBinderConfig {
61
60
AllBound : true ,
62
61
},
63
62
wantStatus : nil ,
@@ -66,32 +65,32 @@ func TestVolumeBinding(t *testing.T) {
66
65
name : "unbound/no matches" ,
67
66
pod : & v1.Pod {Spec : volState },
68
67
node : & v1.Node {},
69
- volumeBinderConfig : & volumescheduling .FakeVolumeBinderConfig {
70
- FindReasons : []volumescheduling .ConflictReason {volumescheduling .ErrReasonBindConflict },
68
+ volumeBinderConfig : & scheduling .FakeVolumeBinderConfig {
69
+ FindReasons : []scheduling .ConflictReason {scheduling .ErrReasonBindConflict },
71
70
},
72
- wantStatus : framework .NewStatus (framework .UnschedulableAndUnresolvable , string (volumescheduling .ErrReasonBindConflict )),
71
+ wantStatus : framework .NewStatus (framework .UnschedulableAndUnresolvable , string (scheduling .ErrReasonBindConflict )),
73
72
},
74
73
{
75
74
name : "bound and unbound unsatisfied" ,
76
75
pod : & v1.Pod {Spec : volState },
77
76
node : & v1.Node {},
78
- volumeBinderConfig : & volumescheduling .FakeVolumeBinderConfig {
79
- FindReasons : []volumescheduling .ConflictReason {volumescheduling .ErrReasonBindConflict , volumescheduling .ErrReasonNodeConflict },
77
+ volumeBinderConfig : & scheduling .FakeVolumeBinderConfig {
78
+ FindReasons : []scheduling .ConflictReason {scheduling .ErrReasonBindConflict , scheduling .ErrReasonNodeConflict },
80
79
},
81
- wantStatus : framework .NewStatus (framework .UnschedulableAndUnresolvable , string (volumescheduling .ErrReasonBindConflict ), string (volumescheduling .ErrReasonNodeConflict )),
80
+ wantStatus : framework .NewStatus (framework .UnschedulableAndUnresolvable , string (scheduling .ErrReasonBindConflict ), string (scheduling .ErrReasonNodeConflict )),
82
81
},
83
82
{
84
83
name : "unbound/found matches/bind succeeds" ,
85
84
pod : & v1.Pod {Spec : volState },
86
85
node : & v1.Node {},
87
- volumeBinderConfig : & volumescheduling .FakeVolumeBinderConfig {},
86
+ volumeBinderConfig : & scheduling .FakeVolumeBinderConfig {},
88
87
wantStatus : nil ,
89
88
},
90
89
{
91
90
name : "predicate error" ,
92
91
pod : & v1.Pod {Spec : volState },
93
92
node : & v1.Node {},
94
- volumeBinderConfig : & volumescheduling .FakeVolumeBinderConfig {
93
+ volumeBinderConfig : & scheduling .FakeVolumeBinderConfig {
95
94
FindErr : findErr ,
96
95
},
97
96
wantStatus : framework .NewStatus (framework .Error , findErr .Error ()),
@@ -102,7 +101,7 @@ func TestVolumeBinding(t *testing.T) {
102
101
t .Run (item .name , func (t * testing.T ) {
103
102
nodeInfo := schedulernodeinfo .NewNodeInfo ()
104
103
nodeInfo .SetNode (item .node )
105
- fakeVolumeBinder := volumebinder .NewFakeVolumeBinder (item .volumeBinderConfig )
104
+ fakeVolumeBinder := scheduling .NewFakeVolumeBinder (item .volumeBinderConfig )
106
105
p := & VolumeBinding {
107
106
binder : fakeVolumeBinder ,
108
107
}
0 commit comments