@@ -23,13 +23,12 @@ import (
2323 "sort"
2424 "strconv"
2525
26- "github.com/golang/protobuf/ptypes"
27-
28- "github.com/golang/protobuf/ptypes/wrappers"
2926 "github.com/pborman/uuid"
3027 "golang.org/x/net/context"
3128 "google.golang.org/grpc/codes"
3229 "google.golang.org/grpc/status"
30+ "google.golang.org/protobuf/types/known/timestamppb"
31+ "google.golang.org/protobuf/types/known/wrapperspb"
3332
3433 "github.com/container-storage-interface/spec/lib/go/csi"
3534 "k8s.io/apimachinery/pkg/util/sets"
@@ -397,11 +396,11 @@ func (hp *hostPath) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest
397396
398397 return & csi.GetCapacityResponse {
399398 AvailableCapacity : available ,
400- MaximumVolumeSize : & wrappers .Int64Value {Value : maxVolumeSize },
399+ MaximumVolumeSize : & wrapperspb .Int64Value {Value : maxVolumeSize },
401400
402401 // We don't have a minimum volume size, so we might as well report that.
403402 // Better explicit than implicit...
404- MinimumVolumeSize : & wrappers .Int64Value {Value : 0 },
403+ MinimumVolumeSize : & wrapperspb .Int64Value {Value : 0 },
405404 }, nil
406405}
407406
@@ -461,7 +460,7 @@ func (hp *hostPath) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest
461460 })
462461 }
463462
464- klog .V (5 ).Infof ("Volumes are: %+v" , * volumeRes )
463+ klog .V (5 ).Infof ("Volumes are: %+v" , volumeRes )
465464 return volumeRes , nil
466465}
467466
@@ -584,7 +583,7 @@ func (hp *hostPath) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotR
584583 }
585584
586585 snapshotID := uuid .NewUUID ().String ()
587- creationTime := ptypes . TimestampNow ()
586+ creationTime := timestamppb . Now ()
588587 file := hp .getSnapshotPath (snapshotID )
589588
590589 if err := hp .createSnapshotFromVolume (hostPathVolume , file ); err != nil {
@@ -678,15 +677,15 @@ func (hp *hostPath) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsReq
678677 return & csi.ListSnapshotsResponse {}, nil
679678 }
680679
681- var snapshots []csi.Snapshot
680+ var snapshots []* csi.Snapshot
682681 // case 3: no parameter is set, so we return all the snapshots.
683682 hpSnapshots := hp .state .GetSnapshots ()
684683 sort .Slice (hpSnapshots , func (i , j int ) bool {
685684 return hpSnapshots [i ].Id < hpSnapshots [j ].Id
686685 })
687686
688687 for _ , snap := range hpSnapshots {
689- snapshot := csi.Snapshot {
688+ snapshot := & csi.Snapshot {
690689 SnapshotId : snap .Id ,
691690 SourceVolumeId : snap .VolID ,
692691 CreationTime : snap .CreationTime ,
@@ -741,7 +740,7 @@ func (hp *hostPath) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsReq
741740
742741 for i = 0 ; i < len (entries ); i ++ {
743742 entries [i ] = & csi.ListSnapshotsResponse_Entry {
744- Snapshot : & snapshots [j ],
743+ Snapshot : snapshots [j ],
745744 }
746745 j ++
747746 }
0 commit comments