@@ -25,7 +25,6 @@ import (
25
25
26
26
"github.com/golang/protobuf/ptypes"
27
27
28
- "github.com/golang/glog"
29
28
"github.com/golang/protobuf/ptypes/wrappers"
30
29
"github.com/pborman/uuid"
31
30
"golang.org/x/net/context"
@@ -45,13 +44,13 @@ const (
45
44
46
45
func (hp * hostPath ) CreateVolume (ctx context.Context , req * csi.CreateVolumeRequest ) (resp * csi.CreateVolumeResponse , finalErr error ) {
47
46
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 )
49
48
return nil , err
50
49
}
51
50
52
51
if len (req .GetMutableParameters ()) > 0 {
53
52
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 )
55
54
return nil , err
56
55
}
57
56
// Check if the mutable parameters are in the accepted list
@@ -152,7 +151,7 @@ func (hp *hostPath) CreateVolume(ctx context.Context, req *csi.CreateVolumeReque
152
151
if err != nil {
153
152
return nil , err
154
153
}
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 )
156
155
157
156
if req .GetVolumeContentSource () != nil {
158
157
path := hp .getVolumePath (volumeID )
@@ -172,13 +171,13 @@ func (hp *hostPath) CreateVolume(ctx context.Context, req *csi.CreateVolumeReque
172
171
err = status .Errorf (codes .InvalidArgument , "%v not a proper volume source" , volumeSource )
173
172
}
174
173
if err != nil {
175
- glog .V (4 ).Infof ("VolumeSource error: %v" , err )
174
+ klog .V (4 ).Infof ("VolumeSource error: %v" , err )
176
175
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 )
178
177
}
179
178
return nil , err
180
179
}
181
- glog .V (4 ).Infof ("successfully populated volume %s" , vol .VolID )
180
+ klog .V (4 ).Infof ("successfully populated volume %s" , vol .VolID )
182
181
}
183
182
184
183
return & csi.CreateVolumeResponse {
@@ -199,7 +198,7 @@ func (hp *hostPath) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeReque
199
198
}
200
199
201
200
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 )
203
202
return nil , err
204
203
}
205
204
@@ -227,7 +226,7 @@ func (hp *hostPath) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeReque
227
226
if err := hp .deleteVolume (volId ); err != nil {
228
227
return nil , fmt .Errorf ("failed to delete volume %v: %w" , volId , err )
229
228
}
230
- glog .V (4 ).Infof ("volume %v successfully deleted" , volId )
229
+ klog .V (4 ).Infof ("volume %v successfully deleted" , volId )
231
230
232
231
return & csi.DeleteVolumeResponse {}, nil
233
232
}
@@ -446,7 +445,7 @@ func (hp *hostPath) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest
446
445
for index := startIdx - 1 ; index < volumesLength && index < maxLength ; index ++ {
447
446
hpVolume = volumes [index ]
448
447
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 )
450
449
volumeRes .Entries = append (volumeRes .Entries , & csi.ListVolumesResponse_Entry {
451
450
Volume : & csi.Volume {
452
451
VolumeId : hpVolume .VolID ,
@@ -462,7 +461,7 @@ func (hp *hostPath) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest
462
461
})
463
462
}
464
463
465
- glog .V (5 ).Infof ("Volumes are: %+v" , * volumeRes )
464
+ klog .V (5 ).Infof ("Volumes are: %+v" , * volumeRes )
466
465
return volumeRes , nil
467
466
}
468
467
@@ -489,7 +488,7 @@ func (hp *hostPath) ControllerGetVolume(ctx context.Context, req *csi.Controller
489
488
}
490
489
491
490
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 )
493
492
return & csi.ControllerGetVolumeResponse {
494
493
Volume : & csi.Volume {
495
494
VolumeId : volume .VolID ,
@@ -541,7 +540,7 @@ func (hp *hostPath) ControllerModifyVolume(ctx context.Context, req *csi.Control
541
540
// archives of entire directories. The host image must have "tar" binaries in /bin, /usr/sbin, or /usr/bin.
542
541
func (hp * hostPath ) CreateSnapshot (ctx context.Context , req * csi.CreateSnapshotRequest ) (* csi.CreateSnapshotResponse , error ) {
543
542
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 )
545
544
return nil , err
546
545
}
547
546
@@ -592,7 +591,7 @@ func (hp *hostPath) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotR
592
591
return nil , err
593
592
}
594
593
595
- glog .V (4 ).Infof ("create volume snapshot %s" , file )
594
+ klog .V (4 ).Infof ("create volume snapshot %s" , file )
596
595
snapshot := state.Snapshot {}
597
596
snapshot .Name = req .GetName ()
598
597
snapshot .Id = snapshotID
@@ -623,7 +622,7 @@ func (hp *hostPath) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotR
623
622
}
624
623
625
624
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 )
627
626
return nil , err
628
627
}
629
628
snapshotID := req .GetSnapshotId ()
@@ -638,7 +637,7 @@ func (hp *hostPath) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotR
638
637
return nil , status .Errorf (codes .InvalidArgument , "Snapshot with ID %s is part of groupsnapshot %s" , snapshotID , snapshot .GroupSnapshotID )
639
638
}
640
639
641
- glog .V (4 ).Infof ("deleting snapshot %s" , snapshotID )
640
+ klog .V (4 ).Infof ("deleting snapshot %s" , snapshotID )
642
641
path := hp .getSnapshotPath (snapshotID )
643
642
os .RemoveAll (path )
644
643
if err := hp .state .DeleteSnapshot (snapshotID ); err != nil {
@@ -649,7 +648,7 @@ func (hp *hostPath) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotR
649
648
650
649
func (hp * hostPath ) ListSnapshots (ctx context.Context , req * csi.ListSnapshotsRequest ) (* csi.ListSnapshotsResponse , error ) {
651
650
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 )
653
652
return nil , err
654
653
}
655
654
0 commit comments