Skip to content

Commit f20c6be

Browse files
committed
migrate from github.com/golang/protobuf to google.golang.org/protobuf due to deprecation of the former
1 parent 6e3972c commit f20c6be

File tree

217 files changed

+265744
-157954
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

217 files changed

+265744
-157954
lines changed

go.mod

+18-14
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ module sigs.k8s.io/gcp-compute-persistent-disk-csi-driver
33
go 1.17
44

55
require (
6-
cloud.google.com/go v0.81.0
7-
github.com/GoogleCloudPlatform/k8s-cloud-provider v1.16.1-0.20210702024009-ea6160c1d0e3
8-
github.com/container-storage-interface/spec v1.5.0
9-
github.com/golang/protobuf v1.5.2
6+
cloud.google.com/go/compute v1.7.0
7+
cloud.google.com/go/kms v1.4.0
8+
github.com/GoogleCloudPlatform/k8s-cloud-provider v1.18.0
9+
github.com/container-storage-interface/spec v1.6.0
1010
github.com/google/uuid v1.3.0
1111
github.com/kubernetes-csi/csi-proxy/client v1.1.1
12-
github.com/kubernetes-csi/csi-test/v4 v4.2.0
12+
github.com/kubernetes-csi/csi-test/v4 v4.4.0
1313
github.com/onsi/ginkgo v1.16.5
1414
github.com/onsi/gomega v1.20.0
15-
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8
16-
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8
17-
google.golang.org/api v0.46.0
18-
google.golang.org/genproto v0.0.0-20220107163113-42d7afdf6368
19-
google.golang.org/grpc v1.40.0
15+
golang.org/x/oauth2 v0.0.0-20220722155238-128564f6959c
16+
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f
17+
google.golang.org/api v0.86.0
18+
google.golang.org/genproto v0.0.0-20220720214146-176da50484ac
19+
google.golang.org/grpc v1.48.0
20+
google.golang.org/protobuf v1.28.0
2021
gopkg.in/gcfg.v1 v1.2.3
21-
gopkg.in/warnings.v0 v0.1.2 // indirect
2222
k8s.io/apimachinery v0.24.1
2323
k8s.io/client-go v11.0.1-0.20190805182717-6502b5e7b1b5+incompatible
2424
k8s.io/component-base v0.24.1
@@ -30,6 +30,8 @@ require (
3030
)
3131

3232
require (
33+
cloud.google.com/go v0.103.0 // indirect
34+
cloud.google.com/go/iam v0.3.0 // indirect
3335
github.com/Microsoft/go-winio v0.4.17 // indirect
3436
github.com/PuerkitoBio/purell v1.1.1 // indirect
3537
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
@@ -45,10 +47,12 @@ require (
4547
github.com/go-openapi/swag v0.21.1 // indirect
4648
github.com/gogo/protobuf v1.3.2 // indirect
4749
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
50+
github.com/golang/protobuf v1.5.2 // indirect
4851
github.com/google/gnostic v0.5.7-v3refs // indirect
4952
github.com/google/go-cmp v0.5.8 // indirect
5053
github.com/google/gofuzz v1.2.1-0.20210504230335-f78f29fc09ea // indirect
51-
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
54+
github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect
55+
github.com/googleapis/gax-go/v2 v2.4.0 // indirect
5256
github.com/hashicorp/errwrap v1.0.0 // indirect
5357
github.com/hashicorp/go-multierror v1.1.0 // indirect
5458
github.com/imdario/mergo v0.3.12 // indirect
@@ -69,14 +73,14 @@ require (
6973
github.com/spf13/pflag v1.0.5 // indirect
7074
go.opencensus.io v0.23.0 // indirect
7175
go4.org v0.0.0-20201209231011-d4a079459e60 // indirect
72-
golang.org/x/net v0.0.0-20220708220712-1185a9018129 // indirect
76+
golang.org/x/net v0.0.0-20220722155237-a158d28d115b // indirect
7377
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
7478
golang.org/x/text v0.3.7 // indirect
7579
golang.org/x/time v0.0.0-20220210224613-90d013bbcef8 // indirect
7680
google.golang.org/appengine v1.6.7 // indirect
77-
google.golang.org/protobuf v1.28.0 // indirect
7881
gopkg.in/inf.v0 v0.9.1 // indirect
7982
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
83+
gopkg.in/warnings.v0 v0.1.2 // indirect
8084
gopkg.in/yaml.v2 v2.4.0 // indirect
8185
gopkg.in/yaml.v3 v3.0.1 // indirect
8286
k8s.io/api v0.24.1 // indirect

go.sum

+175-21
Large diffs are not rendered by default.

pkg/gce-pd-csi-driver/controller.go

+9-10
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ import (
2424

2525
"github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud/meta"
2626
csi "github.com/container-storage-interface/spec/lib/go/csi"
27-
"github.com/golang/protobuf/ptypes"
28-
"github.com/golang/protobuf/ptypes/timestamp"
2927
compute "google.golang.org/api/compute/v1"
3028
"google.golang.org/grpc/codes"
3129
"google.golang.org/grpc/status"
30+
"google.golang.org/protobuf/types/known/timestamppb"
3231
"k8s.io/apimachinery/pkg/util/sets"
3332
"k8s.io/apimachinery/pkg/util/uuid"
3433
"k8s.io/client-go/util/flowcontrol"
@@ -925,14 +924,14 @@ func (gceCS *GCEControllerServer) validateExistingImage(image *compute.Image, vo
925924
return nil
926925
}
927926

928-
func parseTimestamp(creationTimestamp string) (*timestamp.Timestamp, error) {
927+
func parseTimestamp(creationTimestamp string) (*timestamppb.Timestamp, error) {
929928
t, err := time.Parse(time.RFC3339, creationTimestamp)
930929
if err != nil {
931930
return nil, err
932931
}
933932

934-
timestamp, err := ptypes.TimestampProto(t)
935-
if err != nil {
933+
timestamp := timestamppb.New(t)
934+
if err := timestamp.CheckValid(); err != nil {
936935
return nil, err
937936
}
938937
return timestamp, nil
@@ -1204,8 +1203,8 @@ func (gceCS *GCEControllerServer) getSnapshotByID(ctx context.Context, snapshotI
12041203
func generateDiskSnapshotEntry(snapshot *compute.Snapshot) (*csi.ListSnapshotsResponse_Entry, error) {
12051204
t, _ := time.Parse(time.RFC3339, snapshot.CreationTimestamp)
12061205

1207-
tp, err := ptypes.TimestampProto(t)
1208-
if err != nil {
1206+
tp := timestamppb.New(t)
1207+
if err := tp.CheckValid(); err != nil {
12091208
return nil, fmt.Errorf("Failed to covert creation timestamp: %v", err)
12101209
}
12111210

@@ -1229,9 +1228,9 @@ func generateDiskSnapshotEntry(snapshot *compute.Snapshot) (*csi.ListSnapshotsRe
12291228
func generateDiskImageEntry(image *compute.Image) (*csi.ListSnapshotsResponse_Entry, error) {
12301229
t, _ := time.Parse(time.RFC3339, image.CreationTimestamp)
12311230

1232-
tp, err := ptypes.TimestampProto(t)
1233-
if err != nil {
1234-
return nil, fmt.Errorf("Failed to covert creation timestamp: %v", err)
1231+
tp := timestamppb.New(t)
1232+
if err := tp.CheckValid(); err != nil {
1233+
return nil, fmt.Errorf("failed to covert creation timestamp: %v", err)
12351234
}
12361235

12371236
ready, _ := isImageReady(image.Status)

pkg/gce-pd-csi-driver/controller_test.go

+7-8
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"time"
2525

2626
"github.com/GoogleCloudPlatform/k8s-cloud-provider/pkg/cloud/meta"
27-
"github.com/golang/protobuf/ptypes"
27+
"google.golang.org/protobuf/types/known/timestamppb"
2828

2929
compute "google.golang.org/api/compute/v1"
3030
"google.golang.org/grpc/codes"
@@ -36,7 +36,6 @@ import (
3636
csi "github.com/container-storage-interface/spec/lib/go/csi"
3737
"sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/common"
3838
gce "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/gce-cloud-provider/compute"
39-
gcecloudprovider "sigs.k8s.io/gcp-compute-persistent-disk-csi-driver/pkg/gce-cloud-provider/compute"
4039
)
4140

4241
const (
@@ -71,8 +70,8 @@ var (
7170

7271
func TestCreateSnapshotArguments(t *testing.T) {
7372
thetime, _ := time.Parse(time.RFC3339, gce.Timestamp)
74-
tp, err := ptypes.TimestampProto(thetime)
75-
if err != nil {
73+
tp := timestamppb.New(thetime)
74+
if err := tp.CheckValid(); err != nil {
7675
t.Fatalf("Unable to conver time to timestamp: %v", err)
7776
}
7877
// Define test cases
@@ -2234,7 +2233,7 @@ func backoffTesterForUnpublish(t *testing.T, config *backoffTesterConfig) {
22342233
var respUnpublish <-chan error
22352234
respUnpublish = runUnpublishRequest(unpubreq)
22362235
execute := <-readyToExecute
2237-
s1 := gcecloudprovider.Signal{ReportError: true}
2236+
s1 := gce.Signal{ReportError: true}
22382237
execute <- s1
22392238
if err := <-respUnpublish; err == nil {
22402239
t.Errorf("expected error")
@@ -2256,7 +2255,7 @@ func backoffTesterForUnpublish(t *testing.T, config *backoffTesterConfig) {
22562255
// Now mock a successful ControllerUnpublish request, where DetachDisk call succeeds.
22572256
respUnpublish = runUnpublishRequest(unpubreq)
22582257
execute = <-readyToExecute
2259-
s1 = gcecloudprovider.Signal{}
2258+
s1 = gce.Signal{}
22602259
execute <- s1
22612260
if err := <-respUnpublish; err != nil {
22622261
t.Errorf("unexpected error")
@@ -2363,7 +2362,7 @@ func backoffTesterForPublish(t *testing.T, config *backoffTesterConfig) {
23632362
var respPublish <-chan error
23642363
respPublish = runPublishRequest(pubreq)
23652364
execute := <-readyToExecute
2366-
s1 := gcecloudprovider.Signal{ReportError: true}
2365+
s1 := gce.Signal{ReportError: true}
23672366
execute <- s1
23682367
if err := <-respPublish; err == nil {
23692368
t.Errorf("expected error")
@@ -2385,7 +2384,7 @@ func backoffTesterForPublish(t *testing.T, config *backoffTesterConfig) {
23852384
// Now mock a successful ControllerUnpublish request, where DetachDisk call succeeds.
23862385
respPublish = runPublishRequest(pubreq)
23872386
execute = <-readyToExecute
2388-
s1 = gcecloudprovider.Signal{}
2387+
s1 = gce.Signal{}
23892388
execute <- s1
23902389
if err := <-respPublish; err != nil {
23912390
t.Errorf("unexpected error")

vendor/cloud.google.com/go/.gitignore

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/cloud.google.com/go/.release-please-manifest-submodules.json

+107
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/cloud.google.com/go/.release-please-manifest.json

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)