mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +00:00
Merge pull request #96599 from tanjing2020/master
fix staticcheck:pkg/volume/testing
This commit is contained in:
commit
125a5f10a6
@ -1,7 +1,6 @@
|
|||||||
cluster/images/etcd/migrate
|
cluster/images/etcd/migrate
|
||||||
pkg/controller/replicaset
|
pkg/controller/replicaset
|
||||||
pkg/kubelet/dockershim
|
pkg/kubelet/dockershim
|
||||||
pkg/volume/testing
|
|
||||||
test/e2e/autoscaling
|
test/e2e/autoscaling
|
||||||
test/integration/examples
|
test/integration/examples
|
||||||
test/integration/framework
|
test/integration/framework
|
||||||
|
@ -201,8 +201,9 @@ var _ DeviceMountableVolumePlugin = &FakeVolumePlugin{}
|
|||||||
var _ NodeExpandableVolumePlugin = &FakeVolumePlugin{}
|
var _ NodeExpandableVolumePlugin = &FakeVolumePlugin{}
|
||||||
|
|
||||||
func (plugin *FakeVolumePlugin) getFakeVolume(list *[]*FakeVolume) *FakeVolume {
|
func (plugin *FakeVolumePlugin) getFakeVolume(list *[]*FakeVolume) *FakeVolume {
|
||||||
|
if list != nil {
|
||||||
volumeList := *list
|
volumeList := *list
|
||||||
if list != nil && len(volumeList) > 0 {
|
if len(volumeList) > 0 {
|
||||||
volume := volumeList[0]
|
volume := volumeList[0]
|
||||||
volume.Lock()
|
volume.Lock()
|
||||||
defer volume.Unlock()
|
defer volume.Unlock()
|
||||||
@ -210,6 +211,7 @@ func (plugin *FakeVolumePlugin) getFakeVolume(list *[]*FakeVolume) *FakeVolume {
|
|||||||
volume.UnmountDeviceHook = plugin.UnmountDeviceHook
|
volume.UnmountDeviceHook = plugin.UnmountDeviceHook
|
||||||
return volume
|
return volume
|
||||||
}
|
}
|
||||||
|
}
|
||||||
volume := &FakeVolume{
|
volume := &FakeVolume{
|
||||||
WaitForAttachHook: plugin.WaitForAttachHook,
|
WaitForAttachHook: plugin.WaitForAttachHook,
|
||||||
UnmountDeviceHook: plugin.UnmountDeviceHook,
|
UnmountDeviceHook: plugin.UnmountDeviceHook,
|
||||||
@ -217,7 +219,9 @@ func (plugin *FakeVolumePlugin) getFakeVolume(list *[]*FakeVolume) *FakeVolume {
|
|||||||
volume.VolumesAttached = make(map[string]sets.String)
|
volume.VolumesAttached = make(map[string]sets.String)
|
||||||
volume.DeviceMountState = make(map[string]string)
|
volume.DeviceMountState = make(map[string]string)
|
||||||
volume.VolumeMountState = make(map[string]string)
|
volume.VolumeMountState = make(map[string]string)
|
||||||
|
if list != nil {
|
||||||
*list = append(*list, volume)
|
*list = append(*list, volume)
|
||||||
|
}
|
||||||
return volume
|
return volume
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user