mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +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
|
||||
pkg/controller/replicaset
|
||||
pkg/kubelet/dockershim
|
||||
pkg/volume/testing
|
||||
test/e2e/autoscaling
|
||||
test/integration/examples
|
||||
test/integration/framework
|
||||
|
@ -201,14 +201,16 @@ var _ DeviceMountableVolumePlugin = &FakeVolumePlugin{}
|
||||
var _ NodeExpandableVolumePlugin = &FakeVolumePlugin{}
|
||||
|
||||
func (plugin *FakeVolumePlugin) getFakeVolume(list *[]*FakeVolume) *FakeVolume {
|
||||
volumeList := *list
|
||||
if list != nil && len(volumeList) > 0 {
|
||||
volume := volumeList[0]
|
||||
volume.Lock()
|
||||
defer volume.Unlock()
|
||||
volume.WaitForAttachHook = plugin.WaitForAttachHook
|
||||
volume.UnmountDeviceHook = plugin.UnmountDeviceHook
|
||||
return volume
|
||||
if list != nil {
|
||||
volumeList := *list
|
||||
if len(volumeList) > 0 {
|
||||
volume := volumeList[0]
|
||||
volume.Lock()
|
||||
defer volume.Unlock()
|
||||
volume.WaitForAttachHook = plugin.WaitForAttachHook
|
||||
volume.UnmountDeviceHook = plugin.UnmountDeviceHook
|
||||
return volume
|
||||
}
|
||||
}
|
||||
volume := &FakeVolume{
|
||||
WaitForAttachHook: plugin.WaitForAttachHook,
|
||||
@ -217,7 +219,9 @@ func (plugin *FakeVolumePlugin) getFakeVolume(list *[]*FakeVolume) *FakeVolume {
|
||||
volume.VolumesAttached = make(map[string]sets.String)
|
||||
volume.DeviceMountState = make(map[string]string)
|
||||
volume.VolumeMountState = make(map[string]string)
|
||||
*list = append(*list, volume)
|
||||
if list != nil {
|
||||
*list = append(*list, volume)
|
||||
}
|
||||
return volume
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user