mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 11:00:25 +00:00
linter fixes
This commit is contained in:
parent
6826694618
commit
e0a1661bee
@ -49,18 +49,18 @@ func TestLoadExDataFromMetadataStore(t *testing.T) {
|
||||
cs := &ControllerServer{
|
||||
MetadataStore: &testCachePersister{
|
||||
volumes: map[string]rbdVolume{
|
||||
"item1": rbdVolume{
|
||||
"item1": {
|
||||
VolID: "1",
|
||||
},
|
||||
"item2": rbdVolume{
|
||||
"item2": {
|
||||
VolID: "2",
|
||||
},
|
||||
},
|
||||
snapshots: map[string]rbdSnapshot{
|
||||
"item1": rbdSnapshot{
|
||||
"item1": {
|
||||
SnapID: "1",
|
||||
},
|
||||
"item2": rbdSnapshot{
|
||||
"item2": {
|
||||
SnapID: "2",
|
||||
},
|
||||
},
|
||||
|
@ -408,7 +408,8 @@ func getRBDVolumeByID(volumeID string) (*rbdVolume, error) {
|
||||
func getRBDVolumeByName(volName string) (*rbdVolume, error) {
|
||||
for _, rbdVol := range rbdVolumes {
|
||||
if rbdVol.VolName == volName {
|
||||
return &rbdVol, nil
|
||||
v := rbdVol
|
||||
return &v, nil
|
||||
}
|
||||
}
|
||||
return nil, fmt.Errorf("volume name %s does not exit in the volumes list", volName)
|
||||
@ -417,7 +418,8 @@ func getRBDVolumeByName(volName string) (*rbdVolume, error) {
|
||||
func getRBDSnapshotByName(snapName string) (*rbdSnapshot, error) {
|
||||
for _, rbdSnap := range rbdSnapshots {
|
||||
if rbdSnap.SnapName == snapName {
|
||||
return &rbdSnap, nil
|
||||
s := rbdSnap
|
||||
return &s, nil
|
||||
}
|
||||
}
|
||||
return nil, fmt.Errorf("snapshot name %s does not exit in the snapshots list", snapName)
|
||||
|
Loading…
Reference in New Issue
Block a user