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