@@ -52,11 +52,11 @@ func TestCanSupport(t *testing.T) {
52
52
plugMgr := volume.VolumePluginMgr {}
53
53
plugMgr .InitPlugins (ProbeVolumePlugins (volume.VolumeConfig {}), nil /* prober */ , volumetest .NewFakeVolumeHost (t , "fake" , nil , nil ))
54
54
55
- plug , err := plugMgr .FindPluginByName ("kubernetes.io/host-path" )
55
+ plug , err := plugMgr .FindPluginByName (hostPathPluginName )
56
56
if err != nil {
57
- t .Errorf ("Can't find the plugin by name" )
57
+ t .Fatal ("Can't find the plugin by name" )
58
58
}
59
- if plug .GetPluginName () != "kubernetes.io/host-path" {
59
+ if plug .GetPluginName () != hostPathPluginName {
60
60
t .Errorf ("Wrong name: %s" , plug .GetPluginName ())
61
61
}
62
62
if ! plug .CanSupport (& volume.Spec {Volume : & v1.Volume {VolumeSource : v1.VolumeSource {HostPath : & v1.HostPathVolumeSource {}}}}) {
@@ -74,9 +74,9 @@ func TestGetAccessModes(t *testing.T) {
74
74
plugMgr := volume.VolumePluginMgr {}
75
75
plugMgr .InitPlugins (ProbeVolumePlugins (volume.VolumeConfig {}), nil /* prober */ , volumetest .NewFakeVolumeHost (t , "/tmp/fake" , nil , nil ))
76
76
77
- plug , err := plugMgr .FindPersistentPluginByName ("kubernetes.io/host-path" )
77
+ plug , err := plugMgr .FindPersistentPluginByName (hostPathPluginName )
78
78
if err != nil {
79
- t .Errorf ("Can't find the plugin by name" )
79
+ t .Fatal ("Can't find the plugin by name" )
80
80
}
81
81
if len (plug .GetAccessModes ()) != 1 || plug .GetAccessModes ()[0 ] != v1 .ReadWriteOnce {
82
82
t .Errorf ("Expected %s PersistentVolumeAccessMode" , v1 .ReadWriteOnce )
@@ -109,7 +109,7 @@ func TestDeleter(t *testing.T) {
109
109
spec := & volume.Spec {PersistentVolume : & v1.PersistentVolume {Spec : v1.PersistentVolumeSpec {PersistentVolumeSource : v1.PersistentVolumeSource {HostPath : & v1.HostPathVolumeSource {Path : tempPath }}}}}
110
110
plug , err := plugMgr .FindDeletablePluginBySpec (spec )
111
111
if err != nil {
112
- t .Errorf ("Can't find the plugin by name" )
112
+ t .Fatal ("Can't find the plugin by name" )
113
113
}
114
114
deleter , err := plug .NewDeleter (spec )
115
115
if err != nil {
@@ -230,9 +230,9 @@ func TestPlugin(t *testing.T) {
230
230
plugMgr := volume.VolumePluginMgr {}
231
231
plugMgr .InitPlugins (ProbeVolumePlugins (volume.VolumeConfig {}), nil /* prober */ , volumetest .NewFakeVolumeHost (t , "fake" , nil , nil ))
232
232
233
- plug , err := plugMgr .FindPluginByName ("kubernetes.io/host-path" )
233
+ plug , err := plugMgr .FindPluginByName (hostPathPluginName )
234
234
if err != nil {
235
- t .Errorf ("Can't find the plugin by name" )
235
+ t .Fatal ("Can't find the plugin by name" )
236
236
}
237
237
238
238
volPath := "/tmp/vol1"
0 commit comments