Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#118135 replace gogo/protobuf and golang/protobuf with google #118140

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions staging/src/k8s.io/client-go/discovery/discovery_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ import (
"sync"
"time"

//nolint:staticcheck // SA1019 Keep using module since it's still being maintained and the api of google.golang.org/protobuf/proto differs
"github.com/golang/protobuf/proto"
"google.golang.org/protobuf/proto"
openapi_v2 "github.com/google/gnostic/openapiv2"

apidiscovery "k8s.io/api/apidiscovery/v2beta1"
Expand Down
13 changes: 6 additions & 7 deletions staging/src/k8s.io/client-go/discovery/discovery_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@ import (
"testing"
"time"

"github.com/gogo/protobuf/proto"
openapi_v2 "github.com/google/gnostic/openapiv2"
openapi_v3 "github.com/google/gnostic/openapiv3"
"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
golangproto "google.golang.org/protobuf/proto"
"google.golang.org/protobuf/proto"
apidiscovery "k8s.io/api/apidiscovery/v2beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -589,7 +588,7 @@ func TestGetOpenAPISchema(t *testing.T) {
if err != nil {
t.Fatalf("unexpected error getting openapi: %v", err)
}
if e, a := returnedOpenAPI(), got; !golangproto.Equal(e, a) {
if e, a := returnedOpenAPI(), got; !proto.Equal(e, a) {
t.Errorf("expected \n%v, got \n%v", e, a)
}
}
Expand Down Expand Up @@ -647,7 +646,7 @@ func TestGetOpenAPISchemaV3(t *testing.T) {
t.Fatal(err)
}

expectedPB, err := golangproto.Marshal(expectedGnostic)
expectedPB, err := proto.Marshal(expectedGnostic)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -685,7 +684,7 @@ func TestGetOpenAPISchemaForbiddenFallback(t *testing.T) {
if err != nil {
t.Fatalf("unexpected error getting openapi: %v", err)
}
if e, a := returnedOpenAPI(), got; !golangproto.Equal(e, a) {
if e, a := returnedOpenAPI(), got; !proto.Equal(e, a) {
t.Errorf("expected %v, got %v", e, a)
}
}
Expand All @@ -702,7 +701,7 @@ func TestGetOpenAPISchemaNotFoundFallback(t *testing.T) {
if err != nil {
t.Fatalf("unexpected error getting openapi: %v", err)
}
if e, a := returnedOpenAPI(), got; !golangproto.Equal(e, a) {
if e, a := returnedOpenAPI(), got; !proto.Equal(e, a) {
t.Errorf("expected %v, got %v", e, a)
}
}
Expand All @@ -719,7 +718,7 @@ func TestGetOpenAPISchemaNotAcceptableFallback(t *testing.T) {
if err != nil {
t.Fatalf("unexpected error getting openapi: %v", err)
}
if e, a := returnedOpenAPI(), got; !golangproto.Equal(e, a) {
if e, a := returnedOpenAPI(), got; !proto.Equal(e, a) {
t.Errorf("expected %v, got %v", e, a)
}
}
Expand Down
4 changes: 2 additions & 2 deletions staging/src/k8s.io/client-go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ go 1.20

require (
github.com/evanphx/json-patch v4.12.0+incompatible
github.com/gogo/protobuf v1.3.2
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
github.com/golang/protobuf v1.5.3
github.com/google/gnostic v0.5.7-v3refs
github.com/google/go-cmp v0.5.9
github.com/google/gofuzz v1.2.0
Expand Down Expand Up @@ -40,6 +38,8 @@ require (
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/btree v1.0.1 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand Down