@@ -25,7 +25,6 @@ import (
2525
2626 "github.com/golang/protobuf/ptypes"
2727
28- "github.com/golang/glog"
2928 "github.com/golang/protobuf/ptypes/wrappers"
3029 "github.com/pborman/uuid"
3130 "golang.org/x/net/context"
@@ -45,13 +44,13 @@ const (
4544
4645func (hp * hostPath ) CreateVolume (ctx context.Context , req * csi.CreateVolumeRequest ) (resp * csi.CreateVolumeResponse , finalErr error ) {
4746 if err := hp .validateControllerServiceRequest (csi .ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME ); err != nil {
48- glog .V (3 ).Infof ("invalid create volume req: %v" , req )
47+ klog .V (3 ).Infof ("invalid create volume req: %v" , req )
4948 return nil , err
5049 }
5150
5251 if len (req .GetMutableParameters ()) > 0 {
5352 if err := hp .validateControllerServiceRequest (csi .ControllerServiceCapability_RPC_MODIFY_VOLUME ); err != nil {
54- glog .V (3 ).Infof ("invalid create volume req: %v" , req )
53+ klog .V (3 ).Infof ("invalid create volume req: %v" , req )
5554 return nil , err
5655 }
5756 // Check if the mutable parameters are in the accepted list
@@ -152,7 +151,7 @@ func (hp *hostPath) CreateVolume(ctx context.Context, req *csi.CreateVolumeReque
152151 if err != nil {
153152 return nil , err
154153 }
155- glog .V (4 ).Infof ("created volume %s at path %s" , vol .VolID , vol .VolPath )
154+ klog .V (4 ).Infof ("created volume %s at path %s" , vol .VolID , vol .VolPath )
156155
157156 if req .GetVolumeContentSource () != nil {
158157 path := hp .getVolumePath (volumeID )
@@ -172,13 +171,13 @@ func (hp *hostPath) CreateVolume(ctx context.Context, req *csi.CreateVolumeReque
172171 err = status .Errorf (codes .InvalidArgument , "%v not a proper volume source" , volumeSource )
173172 }
174173 if err != nil {
175- glog .V (4 ).Infof ("VolumeSource error: %v" , err )
174+ klog .V (4 ).Infof ("VolumeSource error: %v" , err )
176175 if delErr := hp .deleteVolume (volumeID ); delErr != nil {
177- glog .V (2 ).Infof ("deleting hostpath volume %v failed: %v" , volumeID , delErr )
176+ klog .V (2 ).Infof ("deleting hostpath volume %v failed: %v" , volumeID , delErr )
178177 }
179178 return nil , err
180179 }
181- glog .V (4 ).Infof ("successfully populated volume %s" , vol .VolID )
180+ klog .V (4 ).Infof ("successfully populated volume %s" , vol .VolID )
182181 }
183182
184183 return & csi.CreateVolumeResponse {
@@ -199,7 +198,7 @@ func (hp *hostPath) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeReque
199198 }
200199
201200 if err := hp .validateControllerServiceRequest (csi .ControllerServiceCapability_RPC_CREATE_DELETE_VOLUME ); err != nil {
202- glog .V (3 ).Infof ("invalid delete volume req: %v" , req )
201+ klog .V (3 ).Infof ("invalid delete volume req: %v" , req )
203202 return nil , err
204203 }
205204
@@ -227,7 +226,7 @@ func (hp *hostPath) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeReque
227226 if err := hp .deleteVolume (volId ); err != nil {
228227 return nil , fmt .Errorf ("failed to delete volume %v: %w" , volId , err )
229228 }
230- glog .V (4 ).Infof ("volume %v successfully deleted" , volId )
229+ klog .V (4 ).Infof ("volume %v successfully deleted" , volId )
231230
232231 return & csi.DeleteVolumeResponse {}, nil
233232}
@@ -446,7 +445,7 @@ func (hp *hostPath) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest
446445 for index := startIdx - 1 ; index < volumesLength && index < maxLength ; index ++ {
447446 hpVolume = volumes [index ]
448447 healthy , msg := hp .doHealthCheckInControllerSide (hpVolume .VolID )
449- glog .V (3 ).Infof ("Healthy state: %s Volume: %t" , hpVolume .VolName , healthy )
448+ klog .V (3 ).Infof ("Healthy state: %s Volume: %t" , hpVolume .VolName , healthy )
450449 volumeRes .Entries = append (volumeRes .Entries , & csi.ListVolumesResponse_Entry {
451450 Volume : & csi.Volume {
452451 VolumeId : hpVolume .VolID ,
@@ -462,7 +461,7 @@ func (hp *hostPath) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest
462461 })
463462 }
464463
465- glog .V (5 ).Infof ("Volumes are: %+v" , * volumeRes )
464+ klog .V (5 ).Infof ("Volumes are: %+v" , * volumeRes )
466465 return volumeRes , nil
467466}
468467
@@ -489,7 +488,7 @@ func (hp *hostPath) ControllerGetVolume(ctx context.Context, req *csi.Controller
489488 }
490489
491490 healthy , msg := hp .doHealthCheckInControllerSide (req .GetVolumeId ())
492- glog .V (3 ).Infof ("Healthy state: %s Volume: %t" , volume .VolName , healthy )
491+ klog .V (3 ).Infof ("Healthy state: %s Volume: %t" , volume .VolName , healthy )
493492 return & csi.ControllerGetVolumeResponse {
494493 Volume : & csi.Volume {
495494 VolumeId : volume .VolID ,
@@ -541,7 +540,7 @@ func (hp *hostPath) ControllerModifyVolume(ctx context.Context, req *csi.Control
541540// archives of entire directories. The host image must have "tar" binaries in /bin, /usr/sbin, or /usr/bin.
542541func (hp * hostPath ) CreateSnapshot (ctx context.Context , req * csi.CreateSnapshotRequest ) (* csi.CreateSnapshotResponse , error ) {
543542 if err := hp .validateControllerServiceRequest (csi .ControllerServiceCapability_RPC_CREATE_DELETE_SNAPSHOT ); err != nil {
544- glog .V (3 ).Infof ("invalid create snapshot req: %v" , req )
543+ klog .V (3 ).Infof ("invalid create snapshot req: %v" , req )
545544 return nil , err
546545 }
547546
@@ -592,7 +591,7 @@ func (hp *hostPath) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotR
592591 return nil , err
593592 }
594593
595- glog .V (4 ).Infof ("create volume snapshot %s" , file )
594+ klog .V (4 ).Infof ("create volume snapshot %s" , file )
596595 snapshot := state.Snapshot {}
597596 snapshot .Name = req .GetName ()
598597 snapshot .Id = snapshotID
@@ -623,7 +622,7 @@ func (hp *hostPath) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotR
623622 }
624623
625624 if err := hp .validateControllerServiceRequest (csi .ControllerServiceCapability_RPC_CREATE_DELETE_SNAPSHOT ); err != nil {
626- glog .V (3 ).Infof ("invalid delete snapshot req: %v" , req )
625+ klog .V (3 ).Infof ("invalid delete snapshot req: %v" , req )
627626 return nil , err
628627 }
629628 snapshotID := req .GetSnapshotId ()
@@ -638,7 +637,7 @@ func (hp *hostPath) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotR
638637 return nil , status .Errorf (codes .InvalidArgument , "Snapshot with ID %s is part of groupsnapshot %s" , snapshotID , snapshot .GroupSnapshotID )
639638 }
640639
641- glog .V (4 ).Infof ("deleting snapshot %s" , snapshotID )
640+ klog .V (4 ).Infof ("deleting snapshot %s" , snapshotID )
642641 path := hp .getSnapshotPath (snapshotID )
643642 os .RemoveAll (path )
644643 if err := hp .state .DeleteSnapshot (snapshotID ); err != nil {
@@ -649,7 +648,7 @@ func (hp *hostPath) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotR
649648
650649func (hp * hostPath ) ListSnapshots (ctx context.Context , req * csi.ListSnapshotsRequest ) (* csi.ListSnapshotsResponse , error ) {
651650 if err := hp .validateControllerServiceRequest (csi .ControllerServiceCapability_RPC_LIST_SNAPSHOTS ); err != nil {
652- glog .V (3 ).Infof ("invalid list snapshot req: %v" , req )
651+ klog .V (3 ).Infof ("invalid list snapshot req: %v" , req )
653652 return nil , err
654653 }
655654
0 commit comments