@@ -22,7 +22,7 @@ import (
2222func callGetVolume (v * volumeRouter , name string ) (* httptest.ResponseRecorder , error ) {
2323 ctx := context .WithValue (context .Background (), httputils.APIVersionKey {}, clusterVolumesVersion )
2424 vars := map [string ]string {"name" : name }
25- req := httptest .NewRequest (http .MethodGet , fmt .Sprintf ("/volumes/%s" , name ), nil )
25+ req := httptest .NewRequest (http .MethodGet , fmt .Sprintf ("/volumes/%s" , name ), http . NoBody )
2626 resp := httptest .NewRecorder ()
2727
2828 err := v .getVolumeByName (ctx , resp , req , vars )
@@ -32,7 +32,7 @@ func callGetVolume(v *volumeRouter, name string) (*httptest.ResponseRecorder, er
3232func callListVolumes (v * volumeRouter ) (* httptest.ResponseRecorder , error ) {
3333 ctx := context .WithValue (context .Background (), httputils.APIVersionKey {}, clusterVolumesVersion )
3434 vars := map [string ]string {}
35- req := httptest .NewRequest (http .MethodGet , "/volumes" , nil )
35+ req := httptest .NewRequest (http .MethodGet , "/volumes" , http . NoBody )
3636 resp := httptest .NewRecorder ()
3737
3838 err := v .getVolumesList (ctx , resp , req , vars )
@@ -428,7 +428,7 @@ func TestVolumeRemove(t *testing.T) {
428428 }
429429
430430 ctx := context .WithValue (context .Background (), httputils.APIVersionKey {}, clusterVolumesVersion )
431- req := httptest .NewRequest (http .MethodDelete , "/volumes/vol1" , nil )
431+ req := httptest .NewRequest (http .MethodDelete , "/volumes/vol1" , http . NoBody )
432432 resp := httptest .NewRecorder ()
433433
434434 err := v .deleteVolumes (ctx , resp , req , map [string ]string {"name" : "vol1" })
@@ -455,7 +455,7 @@ func TestVolumeRemoveSwarm(t *testing.T) {
455455 }
456456
457457 ctx := context .WithValue (context .Background (), httputils.APIVersionKey {}, clusterVolumesVersion )
458- req := httptest .NewRequest (http .MethodDelete , "/volumes/vol1" , nil )
458+ req := httptest .NewRequest (http .MethodDelete , "/volumes/vol1" , http . NoBody )
459459 resp := httptest .NewRecorder ()
460460
461461 err := v .deleteVolumes (ctx , resp , req , map [string ]string {"name" : "vol1" })
@@ -472,7 +472,7 @@ func TestVolumeRemoveNotFoundNoSwarm(t *testing.T) {
472472 }
473473
474474 ctx := context .WithValue (context .Background (), httputils.APIVersionKey {}, clusterVolumesVersion )
475- req := httptest .NewRequest (http .MethodDelete , "/volumes/vol1" , nil )
475+ req := httptest .NewRequest (http .MethodDelete , "/volumes/vol1" , http . NoBody )
476476 resp := httptest .NewRecorder ()
477477
478478 err := v .deleteVolumes (ctx , resp , req , map [string ]string {"name" : "vol1" })
@@ -489,7 +489,7 @@ func TestVolumeRemoveNotFoundNoManager(t *testing.T) {
489489 }
490490
491491 ctx := context .WithValue (context .Background (), httputils.APIVersionKey {}, clusterVolumesVersion )
492- req := httptest .NewRequest (http .MethodDelete , "/volumes/vol1" , nil )
492+ req := httptest .NewRequest (http .MethodDelete , "/volumes/vol1" , http . NoBody )
493493 resp := httptest .NewRecorder ()
494494
495495 err := v .deleteVolumes (ctx , resp , req , map [string ]string {"name" : "vol1" })
@@ -513,7 +513,7 @@ func TestVolumeRemoveFoundNoSwarm(t *testing.T) {
513513 }
514514
515515 ctx := context .WithValue (context .Background (), httputils.APIVersionKey {}, clusterVolumesVersion )
516- req := httptest .NewRequest (http .MethodDelete , "/volumes/vol1" , nil )
516+ req := httptest .NewRequest (http .MethodDelete , "/volumes/vol1" , http . NoBody )
517517 resp := httptest .NewRecorder ()
518518
519519 err := v .deleteVolumes (ctx , resp , req , map [string ]string {"name" : "vol1" })
@@ -536,7 +536,7 @@ func TestVolumeRemoveNoSwarmInUse(t *testing.T) {
536536 }
537537
538538 ctx := context .WithValue (context .Background (), httputils.APIVersionKey {}, clusterVolumesVersion )
539- req := httptest .NewRequest (http .MethodDelete , "/volumes/inuse" , nil )
539+ req := httptest .NewRequest (http .MethodDelete , "/volumes/inuse" , http . NoBody )
540540 resp := httptest .NewRecorder ()
541541
542542 err := v .deleteVolumes (ctx , resp , req , map [string ]string {"name" : "inuse" })
@@ -564,7 +564,7 @@ func TestVolumeRemoveSwarmForce(t *testing.T) {
564564 }
565565
566566 ctx := context .WithValue (context .Background (), httputils.APIVersionKey {}, clusterVolumesVersion )
567- req := httptest .NewRequest (http .MethodDelete , "/volumes/vol1" , nil )
567+ req := httptest .NewRequest (http .MethodDelete , "/volumes/vol1" , http . NoBody )
568568 resp := httptest .NewRecorder ()
569569
570570 err := v .deleteVolumes (ctx , resp , req , map [string ]string {"name" : "vol1" })
@@ -573,7 +573,7 @@ func TestVolumeRemoveSwarmForce(t *testing.T) {
573573 assert .Assert (t , cerrdefs .IsConflict (err ))
574574
575575 ctx = context .WithValue (context .Background (), httputils.APIVersionKey {}, clusterVolumesVersion )
576- req = httptest .NewRequest (http .MethodDelete , "/volumes/vol1?force=1" , nil )
576+ req = httptest .NewRequest (http .MethodDelete , "/volumes/vol1?force=1" , http . NoBody )
577577 resp = httptest .NewRecorder ()
578578
579579 err = v .deleteVolumes (ctx , resp , req , map [string ]string {"name" : "vol1" })
0 commit comments