Skip to content

Commit

Permalink
Migrate from the deprecated github.com/golang/protobuf (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarick authored Dec 14, 2021
1 parent 4d9720d commit ef8c2eb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions envoy/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package config
import (
"fmt"
"sort"
"time"

cluster "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3"
core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
Expand All @@ -17,7 +16,8 @@ import (
"github.com/envoyproxy/go-control-plane/pkg/cache/v3"
"github.com/envoyproxy/go-control-plane/pkg/resource/v3"
"github.com/gofrs/uuid"
"github.com/golang/protobuf/ptypes"

"google.golang.org/protobuf/types/known/durationpb"
)

// Simplified objects hierarchy configuration as for the static Envoy config
Expand Down Expand Up @@ -147,7 +147,7 @@ func (e *envoyConfiguration) AddCluster(clusterName string, upstreamServiceHost

e.clusters[clusterName] = &cluster.Cluster{
Name: clusterName,
ConnectTimeout: ptypes.DurationProto(5 * time.Second),
ConnectTimeout: &durationpb.Duration{Seconds: 5},
ClusterDiscoveryType: &cluster.Cluster_Type{Type: cluster.Cluster_LOGICAL_DNS},
LbPolicy: cluster.Cluster_ROUND_ROBIN,
LoadAssignment: upstreamEndpoint,
Expand Down
3 changes: 1 addition & 2 deletions envoy/config/config_routines.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/envoyproxy/go-control-plane/pkg/resource/v3"
"github.com/envoyproxy/go-control-plane/pkg/wellknown"
"github.com/getkin/kin-openapi/openapi3"
"github.com/golang/protobuf/ptypes/wrappers"
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/durationpb"
"google.golang.org/protobuf/types/known/wrapperspb"
Expand Down Expand Up @@ -338,7 +337,7 @@ func generateRoute(
if retries != 0 {
routeRoute.Route.RetryPolicy = &route.RetryPolicy{
RetryOn: "5xx",
NumRetries: &wrappers.UInt32Value{Value: retries},
NumRetries: &wrapperspb.UInt32Value{Value: retries},
}
}
if err := routeRoute.Route.Validate(); err != nil {
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/ghodss/yaml v1.0.0
github.com/go-ozzo/ozzo-validation/v4 v4.3.0
github.com/gofrs/uuid v4.0.0+incompatible
github.com/golang/protobuf v1.5.2
github.com/onsi/ginkgo v1.16.4
github.com/onsi/gomega v1.15.0
github.com/stretchr/testify v1.7.0
Expand Down

0 comments on commit ef8c2eb

Please sign in to comment.