Skip to content

Commit b986813

Browse files
committed
address comments
1 parent bef017e commit b986813

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

pkg/cloud/volumes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ func (c *client) CreateVolumeFromSnapshot(ctx context.Context, zoneID, name, dom
187187
vol, err := c.Volume.CreateVolume(p)
188188
if err != nil {
189189
// Handle the error accordingly
190-
return nil, fmt.Errorf("failed to create volume from snapshot'%s': %w", snapshotID, err)
190+
return nil, fmt.Errorf("failed to create volume from snapshot '%s': %w", snapshotID, err)
191191
}
192192

193193
v := Volume{

pkg/driver/controller.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,12 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
221221
}
222222

223223
func printVolumeAsJSON(vol *csi.CreateVolumeRequest) {
224-
b, _ := json.MarshalIndent(vol, "", " ")
225-
fmt.Println(string(b))
224+
b, err := json.MarshalIndent(vol, "", " ")
225+
if err != nil {
226+
klog.Errorf("Failed to marshal CreateVolumeRequest to JSON: %v", err)
227+
return
228+
}
229+
klog.V(5).Infof("CreateVolumeRequest as JSON:\n%s", string(b))
226230
}
227231

228232
func checkVolumeSuitable(vol *cloud.Volume,

0 commit comments

Comments
 (0)