Skip to content

Commit

Permalink
migrate from github.com/golang/protobuf/ptypes to google.golang.org/p…
Browse files Browse the repository at this point in the history
…rotobuf/types/known

Signed-off-by: Matthieu MOREL <[email protected]>
  • Loading branch information
mmorel-35 committed Jul 22, 2024
1 parent 73d93fd commit 5343197
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 14 deletions.
6 changes: 0 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,6 @@ issues:
- linters:
- staticcheck
text: 'SA1019: "github.com/golang/protobuf' # TODO ignore deprecation of proto library. We don't want to migrate yet because go-control-plane is not ready
- linters:
- staticcheck
text: "SA1019: proto.MessageName is deprecated" # TODO ignore deprecation of proto library. We don't want to migrate yet because go-control-plane is not ready
- linters:
- staticcheck
text: "SA1019: proto.MessageType is deprecated" # TODO ignore deprecation of proto library. We don't want to migrate yet because go-control-plane is not ready
- linters:
- staticcheck
text: "SA1019: l.UseOriginalDst is deprecated: Do not use." # TODO What is the up-to-date alternative ?
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/containernetworking/cni v1.2.2
github.com/containernetworking/plugins v1.5.1
github.com/emicklei/go-restful/v3 v3.12.1
github.com/envoyproxy/go-control-plane v0.12.0
github.com/envoyproxy/go-control-plane v0.12.1-0.20240716023226-bc563f4e9b28
github.com/envoyproxy/protoc-gen-validate v1.0.4
github.com/evanphx/json-patch/v5 v5.9.0
github.com/exaring/otelpgx v0.6.2
Expand Down Expand Up @@ -186,6 +186,7 @@ require (
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/pquerna/otp v1.2.0 // indirect
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/emicklei/go-restful/v3 v3.12.1 h1:PJMDIM/ak7btuL8Ex0iYET9hxM3CI2sjZtzpL63nKAU=
github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc=
github.com/envoyproxy/go-control-plane v0.11.2-0.20231010133108-1dfbe83bcebc h1:k6n7EmQYjNHEKr8XI3rdtFIhb0UdJSyCWnt9gvgLx5g=
github.com/envoyproxy/go-control-plane v0.11.2-0.20231010133108-1dfbe83bcebc/go.mod h1:9ODlpdyEVNyci9DZ6cdQYkwYSW1YMrnSz3xnku3cjL0=
github.com/envoyproxy/go-control-plane v0.12.1-0.20240716023226-bc563f4e9b28 h1:XVTfL79z4+FmNQPagc18t8GpZOzyQN+pPjYDO6V/9mU=
github.com/envoyproxy/go-control-plane v0.12.1-0.20240716023226-bc563f4e9b28/go.mod h1:GRaKG3dwvFoTg4nj7aXdZnvMg4d7nvT/wl9WgVXn3Q8=
github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A=
github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew=
github.com/evanphx/json-patch v5.7.0+incompatible h1:vgGkfT/9f8zE6tvSCe74nfpAVDQ2tG6yudJd8LBksgI=
Expand Down Expand Up @@ -333,6 +333,8 @@ github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaR
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 h1:GFCKgmp0tecUJ0sJuv4pzYCqS9+RGSn52M3FUwPs+uo=
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package xds
import (
envoy_cluster "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3"
corev3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
"github.com/golang/protobuf/ptypes/wrappers"
"google.golang.org/protobuf/types/known/wrapperspb"

common_api "github.com/kumahq/kuma/api/common/v1alpha1"
api "github.com/kumahq/kuma/pkg/plugins/policies/meshloadbalancingstrategy/api/v1alpha1"
Expand Down Expand Up @@ -49,11 +49,11 @@ func (c *LoadBalancerConfigurer) Configure(cluster *envoy_cluster.Cluster) error
if c.LoadBalancer.RingHash == nil {
return nil
}
var minimumRingSize *wrappers.UInt64Value
var minimumRingSize *wrapperspb.UInt64Value
if min := c.LoadBalancer.RingHash.MinRingSize; min != nil {
minimumRingSize = util_proto.UInt64(uint64(*min))
}
var maximumRingSize *wrappers.UInt64Value
var maximumRingSize *wrapperspb.UInt64Value
if max := c.LoadBalancer.RingHash.MaxRingSize; max != nil {
maximumRingSize = util_proto.UInt64(uint64(*max))
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/util/envoy/raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"errors"

envoy_types "github.com/envoyproxy/go-control-plane/pkg/cache/types"
"github.com/golang/protobuf/ptypes/any"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/anypb"
"sigs.k8s.io/yaml"

util_proto "github.com/kumahq/kuma/pkg/util/proto"
Expand All @@ -17,7 +17,7 @@ func ResourceFromYaml(resYaml string) (proto.Message, error) {
json = []byte(resYaml)
}

var anything any.Any
var anything anypb.Any
if err := util_proto.FromJSON(json, &anything); err != nil {
return nil, err
}
Expand Down
20 changes: 20 additions & 0 deletions pkg/xds/envoy/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ import (
_ "github.com/envoyproxy/go-control-plane/envoy/data/tap/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/file/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/filters/cel/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/fluentd/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/grpc/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/open_telemetry/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/access_loggers/stream/v3"
Expand All @@ -151,19 +152,22 @@ import (
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/common/dependency/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/common/fault/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/common/matcher/action/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/common/set_filter_state/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/adaptive_concurrency/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/admission_control/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/alternate_protocols_cache/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/aws_lambda/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/aws_request_signing/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/bandwidth_limit/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/basic_auth/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/buffer/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/cache/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/cdn_loop/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/composite/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/compressor/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/connect_grpc_bridge/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/cors/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/credential_injector/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/csrf/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/custom_response/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/decompressor/v3"
Expand Down Expand Up @@ -193,13 +197,16 @@ import (
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/oauth2/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/on_demand/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/original_src/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/proto_message_logging/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/rate_limit_quota/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/ratelimit/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/rbac/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/router/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/set_filter_state/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/set_metadata/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/stateful_session/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/tap/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/thrift_to_metadata/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/upstream_codec/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/http/wasm/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/listener/http_inspector/v3"
Expand All @@ -220,6 +227,7 @@ import (
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/ratelimit/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/rbac/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/redis_proxy/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/set_filter_state/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/sni_cluster/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/sni_dynamic_forward_proxy/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/tcp_proxy/v3"
Expand All @@ -231,11 +239,14 @@ import (
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/wasm/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/zookeeper_proxy/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/udp/dns_filter/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/udp/udp_proxy/session/dynamic_forward_proxy/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/udp/udp_proxy/session/http_capsule/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/udp/udp_proxy/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/formatter/cel/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/formatter/metadata/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/formatter/req_without_query/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/geoip_providers/common/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/geoip_providers/maxmind/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/health_check/event_sinks/file/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/health_checkers/redis/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/health_checkers/thrift/v3"
Expand All @@ -246,6 +257,8 @@ import (
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/http/early_header_mutation/header_mutation/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/http/header_formatters/preserve_case/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/http/header_validators/envoy_default/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/http/injected_credentials/generic/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/http/injected_credentials/oauth2/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/http/original_ip_detection/custom_header/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/http/original_ip_detection/xff/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/http/stateful_session/cookie/v3"
Expand Down Expand Up @@ -275,8 +288,11 @@ import (
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/network/dns_resolver/cares/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/network/dns_resolver/getaddrinfo/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/network/socket_interface/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/outlier_detection_monitors/common/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/outlier_detection_monitors/consecutive_errors/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/path/match/uri_template/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/path/rewrite/uri_template/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/quic/connection_debug_visitor/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/quic/connection_id_generator/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/quic/crypto_stream/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/quic/proof_source/v3"
Expand All @@ -293,9 +309,13 @@ import (
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/retry/host/omit_host_metadata/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/retry/host/previous_hosts/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/retry/priority/previous_priorities/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/router/cluster_specifiers/lua/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/stat_sinks/graphite_statsd/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/stat_sinks/open_telemetry/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/stat_sinks/wasm/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/string_matcher/lua/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/tracers/opentelemetry/resource_detectors/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/tracers/opentelemetry/samplers/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/alts/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/http_11_proxy/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/internal_upstream/v3"
Expand Down

0 comments on commit 5343197

Please sign in to comment.