Skip to content

Commit 19649f7

Browse files
committed
remove direct deps on github.com/golang/protobuf
it is outdated and replaced by google.golang.org/protobuf
1 parent 41aae60 commit 19649f7

File tree

13 files changed

+12
-656
lines changed

13 files changed

+12
-656
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ go 1.21
44

55
require (
66
github.com/container-storage-interface/spec v1.10.0
7-
github.com/golang/protobuf v1.5.4
87
github.com/kubernetes-csi/csi-lib-utils v0.17.0
98
github.com/pborman/uuid v1.2.1
109
github.com/stretchr/testify v1.9.0
1110
golang.org/x/net v0.26.0
1211
google.golang.org/grpc v1.64.0
12+
google.golang.org/protobuf v1.33.0
1313
k8s.io/apimachinery v0.29.0
1414
k8s.io/klog/v2 v2.130.0
1515
k8s.io/kubernetes v1.29.2
@@ -23,6 +23,7 @@ require (
2323
github.com/davecgh/go-spew v1.1.1 // indirect
2424
github.com/go-logr/logr v1.4.1 // indirect
2525
github.com/gogo/protobuf v1.3.2 // indirect
26+
github.com/golang/protobuf v1.5.4 // indirect
2627
github.com/google/uuid v1.6.0 // indirect
2728
github.com/kr/text v0.2.0 // indirect
2829
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
@@ -36,7 +37,6 @@ require (
3637
golang.org/x/sys v0.21.0 // indirect
3738
golang.org/x/text v0.16.0 // indirect
3839
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
39-
google.golang.org/protobuf v1.33.0 // indirect
4040
gopkg.in/inf.v0 v0.9.1 // indirect
4141
gopkg.in/yaml.v2 v2.4.0 // indirect
4242
gopkg.in/yaml.v3 v3.0.1 // indirect

pkg/hostpath/controllerserver.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

@@ -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 {

pkg/hostpath/groupcontrollerserver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ import (
2020
"os"
2121

2222
"github.com/container-storage-interface/spec/lib/go/csi"
23-
"github.com/golang/protobuf/ptypes"
2423
"github.com/pborman/uuid"
2524
"golang.org/x/net/context"
2625
"google.golang.org/grpc/codes"
2726
"google.golang.org/grpc/status"
27+
"google.golang.org/protobuf/types/known/timestamppb"
2828
"k8s.io/klog/v2"
2929

3030
"github.com/kubernetes-csi/csi-driver-host-path/pkg/state"
@@ -104,7 +104,7 @@ func (hp *hostPath) CreateVolumeGroupSnapshot(ctx context.Context, req *csi.Crea
104104
groupSnapshot := state.GroupSnapshot{
105105
Name: req.GetName(),
106106
Id: uuid.NewUUID().String(),
107-
CreationTime: ptypes.TimestampNow(),
107+
CreationTime: timestamppb.Now(),
108108
SnapshotIDs: make([]string, len(req.GetSourceVolumeIds())),
109109
SourceVolumeIDs: make([]string, len(req.GetSourceVolumeIds())),
110110
ReadyToUse: true,

pkg/state/state.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import (
2424
"os"
2525
"sort"
2626

27-
timestamp "github.com/golang/protobuf/ptypes/timestamp"
2827
"google.golang.org/grpc/codes"
2928
"google.golang.org/grpc/status"
29+
"google.golang.org/protobuf/types/known/timestamppb"
3030
)
3131

3232
type AccessType int
@@ -63,7 +63,7 @@ type Snapshot struct {
6363
Id string
6464
VolID string
6565
Path string
66-
CreationTime *timestamp.Timestamp
66+
CreationTime *timestamppb.Timestamp
6767
SizeBytes int64
6868
ReadyToUse bool
6969
GroupSnapshotID string
@@ -74,7 +74,7 @@ type GroupSnapshot struct {
7474
Id string
7575
SnapshotIDs []string
7676
SourceVolumeIDs []string
77-
CreationTime *timestamp.Timestamp
77+
CreationTime *timestamppb.Timestamp
7878
ReadyToUse bool
7979
}
8080

vendor/github.com/golang/protobuf/ptypes/any.go

Lines changed: 0 additions & 180 deletions
This file was deleted.

vendor/github.com/golang/protobuf/ptypes/any/any.pb.go

Lines changed: 0 additions & 62 deletions
This file was deleted.

vendor/github.com/golang/protobuf/ptypes/doc.go

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)