Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/gce-pd-csi-driver/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ func (ns *GCENodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePub
return nil, status.Error(codes.Internal, fmt.Sprintf("Failed to create block file at target path %v: %v", targetPath, err.Error()))
}
} else {
return nil, status.Error(codes.InvalidArgument, fmt.Sprintf("NodePublishVolume volume capability must specify either mount or block mode"))
return nil, status.Error(codes.InvalidArgument, "NodePublishVolume volume capability must specify either mount or block mode")
Copy link
Contributor

@sunnylovestiramisu sunnylovestiramisu Jul 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this is the only one that is not needed? What about other status.Error in the above lines? I do believe we added this for debug logging intentionally.

}

err = ns.Mounter.Interface.Mount(sourcePath, targetPath, fstype, options)
Expand Down
8 changes: 4 additions & 4 deletions pkg/gce-pd-csi-driver/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ func TestNodeStageVolume(t *testing.T) {
&testingexec.FakeCmd{
CombinedOutputScript: []testingexec.FakeAction{
func() ([]byte, []byte, error) {
return []byte(fmt.Sprintf("DEVNAME=/dev/sdb\nTYPE=ext4")), nil, nil
return []byte("DEVNAME=/dev/sdb\nTYPE=ext4"), nil, nil
},
},
},
Expand Down Expand Up @@ -534,7 +534,7 @@ func TestNodeStageVolume(t *testing.T) {
&testingexec.FakeCmd{
CombinedOutputScript: []testingexec.FakeAction{
func() ([]byte, []byte, error) {
return []byte(fmt.Sprintf("DEVNAME=/dev/sdb\nTYPE=ext4")), nil, nil
return []byte("DEVNAME=/dev/sdb\nTYPE=ext4"), nil, nil
},
},
},
Expand All @@ -560,7 +560,7 @@ func TestNodeStageVolume(t *testing.T) {
&testingexec.FakeCmd{
CombinedOutputScript: []testingexec.FakeAction{
func() ([]byte, []byte, error) {
return []byte(fmt.Sprintf("DEVNAME=/dev/sdb\nTYPE=ext4")), nil, nil
return []byte("DEVNAME=/dev/sdb\nTYPE=ext4"), nil, nil
},
},
},
Expand All @@ -572,7 +572,7 @@ func TestNodeStageVolume(t *testing.T) {
CombinedOutputScript: []testingexec.FakeAction{
func() ([]byte, []byte, error) {
resizeCalled = true
return []byte(fmt.Sprintf("DEVNAME=/dev/sdb\nTYPE=ext4")), nil, nil
return []byte("DEVNAME=/dev/sdb\nTYPE=ext4"), nil, nil
},
},
},
Expand Down