Skip to content

Commit

Permalink
Fixed: should use make(map[string]string) instead (S1019)
Browse files Browse the repository at this point in the history
  • Loading branch information
divyenpatel committed Apr 4, 2020
1 parent 8942cc1 commit e714e0f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/csi/service/vanilla/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ func (c *controller) ControllerPublishVolume(ctx context.Context, req *csi.Contr
}

log.Debugf("Found VirtualMachine for node:%q.", req.NodeId)
publishInfo := make(map[string]string, 0)
publishInfo := make(map[string]string)
// Check whether its a block or file volume
if common.IsFileVolumeRequest(ctx, []*csi.VolumeCapability{req.GetVolumeCapability()}) {
// File Volume
Expand Down
6 changes: 3 additions & 3 deletions pkg/csi/service/vanilla/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ func TestCreateVolumeWithStoragePolicy(t *testing.T) {
ct := getControllerTest(t)

// Create
params := make(map[string]string, 0)
params := make(map[string]string)
if v := os.Getenv("VSPHERE_DATASTORE_URL"); v != "" {
params[common.AttributeDatastoreURL] = v
}
Expand Down Expand Up @@ -400,7 +400,7 @@ func TestExtendVolume(t *testing.T) {
ct := getControllerTest(t)

// Create
params := make(map[string]string, 0)
params := make(map[string]string)
if v := os.Getenv("VSPHERE_DATASTORE_URL"); v != "" {
params[common.AttributeDatastoreURL] = v
}
Expand Down Expand Up @@ -521,7 +521,7 @@ func TestCompleteControllerFlow(t *testing.T) {
ct := getControllerTest(t)

// Create
params := make(map[string]string, 0)
params := make(map[string]string)
if v := os.Getenv("VSPHERE_DATASTORE_URL"); v != "" {
params[common.AttributeDatastoreURL] = v
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/csi/service/wcp/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func (c *controller) ControllerPublishVolume(ctx context.Context, req *csi.Contr
return nil, status.Errorf(codes.Internal, msg)
}

publishInfo := make(map[string]string, 0)
publishInfo := make(map[string]string)
publishInfo[common.AttributeDiskType] = common.DiskTypeBlockVolume
publishInfo[common.AttributeFirstClassDiskUUID] = common.FormatDiskUUID(diskUUID)
resp := &csi.ControllerPublishVolumeResponse{
Expand Down
2 changes: 1 addition & 1 deletion pkg/csi/service/wcp/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ func TestWCPCreateVolumeWithStoragePolicy(t *testing.T) {
ct := getControllerTest(t)

// Create
params := make(map[string]string, 0)
params := make(map[string]string)

profileID := os.Getenv("VSPHERE_STORAGE_POLICY_ID")
if profileID == "" {
Expand Down
2 changes: 1 addition & 1 deletion pkg/csi/service/wcpguest/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ func (c *controller) ControllerPublishVolume(ctx context.Context, req *csi.Contr
}

//return PublishContext with diskUUID of the volume attached to node.
publishInfo := make(map[string]string, 0)
publishInfo := make(map[string]string)
publishInfo[common.AttributeDiskType] = common.DiskTypeBlockVolume
publishInfo[common.AttributeFirstClassDiskUUID] = common.FormatDiskUUID(diskUUID)
resp := &csi.ControllerPublishVolumeResponse{
Expand Down
2 changes: 1 addition & 1 deletion pkg/csi/service/wcpguest/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func TestGuestClusterControllerFlow(t *testing.T) {
ct := getControllerTest(t)

// Create
params := make(map[string]string, 0)
params := make(map[string]string)

params[common.AttributeSupervisorStorageClass] = testStorageClass
if v := os.Getenv("SUPERVISOR_STORAGE_CLASS"); v != "" {
Expand Down

0 comments on commit e714e0f

Please sign in to comment.