@@ -276,21 +276,19 @@ func (r *snapshotReactor) React(action core.Action) (handled bool, ret runtime.O
276276 if found {
277277 glog .V (4 ).Infof ("GetVolume: found %s" , content .Name )
278278 return true , content , nil
279- } else {
280- glog .V (4 ).Infof ("GetVolume: content %s not found" , name )
281- return true , nil , fmt .Errorf ("cannot find content %s" , name )
282279 }
280+ glog .V (4 ).Infof ("GetVolume: content %s not found" , name )
281+ return true , nil , fmt .Errorf ("cannot find content %s" , name )
283282
284283 case action .Matches ("get" , "volumesnapshots" ):
285284 name := action .(core.GetAction ).GetName ()
286285 snapshot , found := r .snapshots [name ]
287286 if found {
288287 glog .V (4 ).Infof ("GetSnapshot: found %s" , snapshot .Name )
289288 return true , snapshot , nil
290- } else {
291- glog .V (4 ).Infof ("GetSnapshot: content %s not found" , name )
292- return true , nil , fmt .Errorf ("cannot find snapshot %s" , name )
293289 }
290+ glog .V (4 ).Infof ("GetSnapshot: content %s not found" , name )
291+ return true , nil , fmt .Errorf ("cannot find snapshot %s" , name )
294292
295293 case action .Matches ("delete" , "volumesnapshotcontents" ):
296294 name := action .(core.DeleteAction ).GetName ()
@@ -300,9 +298,8 @@ func (r *snapshotReactor) React(action core.Action) (handled bool, ret runtime.O
300298 delete (r .contents , name )
301299 r .changedSinceLastSync ++
302300 return true , nil , nil
303- } else {
304- return true , nil , fmt .Errorf ("cannot delete content %s: not found" , name )
305301 }
302+ return true , nil , fmt .Errorf ("cannot delete content %s: not found" , name )
306303
307304 case action .Matches ("delete" , "volumesnapshots" ):
308305 name := action .(core.DeleteAction ).GetName ()
@@ -312,53 +309,49 @@ func (r *snapshotReactor) React(action core.Action) (handled bool, ret runtime.O
312309 delete (r .snapshots , name )
313310 r .changedSinceLastSync ++
314311 return true , nil , nil
315- } else {
316- return true , nil , fmt .Errorf ("cannot delete snapshot %s: not found" , name )
317312 }
313+ return true , nil , fmt .Errorf ("cannot delete snapshot %s: not found" , name )
318314
319315 case action .Matches ("get" , "persistentvolumes" ):
320316 name := action .(core.GetAction ).GetName ()
321317 volume , found := r .volumes [name ]
322318 if found {
323319 glog .V (4 ).Infof ("GetVolume: found %s" , volume .Name )
324320 return true , volume , nil
325- } else {
326- glog .V (4 ).Infof ("GetVolume: volume %s not found" , name )
327- return true , nil , fmt .Errorf ("cannot find volume %s" , name )
328321 }
322+ glog .V (4 ).Infof ("GetVolume: volume %s not found" , name )
323+ return true , nil , fmt .Errorf ("cannot find volume %s" , name )
329324
330325 case action .Matches ("get" , "persistentvolumeclaims" ):
331326 name := action .(core.GetAction ).GetName ()
332327 claim , found := r .claims [name ]
333328 if found {
334329 glog .V (4 ).Infof ("GetClaim: found %s" , claim .Name )
335330 return true , claim , nil
336- } else {
337- glog .V (4 ).Infof ("GetClaim: claim %s not found" , name )
338- return true , nil , fmt .Errorf ("cannot find claim %s" , name )
339331 }
332+ glog .V (4 ).Infof ("GetClaim: claim %s not found" , name )
333+ return true , nil , fmt .Errorf ("cannot find claim %s" , name )
340334
341335 case action .Matches ("get" , "storageclasses" ):
342336 name := action .(core.GetAction ).GetName ()
343337 storageClass , found := r .storageClasses [name ]
344338 if found {
345339 glog .V (4 ).Infof ("GetStorageClass: found %s" , storageClass .Name )
346340 return true , storageClass , nil
347- } else {
348- glog .V (4 ).Infof ("GetStorageClass: storageClass %s not found" , name )
349- return true , nil , fmt .Errorf ("cannot find storageClass %s" , name )
350341 }
342+ glog .V (4 ).Infof ("GetStorageClass: storageClass %s not found" , name )
343+ return true , nil , fmt .Errorf ("cannot find storageClass %s" , name )
351344
352345 case action .Matches ("get" , "secrets" ):
353346 name := action .(core.GetAction ).GetName ()
354347 secret , found := r .secrets [name ]
355348 if found {
356349 glog .V (4 ).Infof ("GetSecret: found %s" , secret .Name )
357350 return true , secret , nil
358- } else {
359- glog .V (4 ).Infof ("GetSecret: secret %s not found" , name )
360- return true , nil , fmt .Errorf ("cannot find secret %s" , name )
361351 }
352+ glog .V (4 ).Infof ("GetSecret: secret %s not found" , name )
353+ return true , nil , fmt .Errorf ("cannot find secret %s" , name )
354+
362355 }
363356
364357 return false , nil , nil
0 commit comments