Skip to content

Commit

Permalink
use depguard to prohibitate importing github.com/golang/protobuf
Browse files Browse the repository at this point in the history
Signed-off-by: adam <[email protected]>
  • Loading branch information
adam committed Sep 23, 2024
1 parent de58451 commit a59339e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ install:
$(QUIET) make install -C bpf/deserialization_to_bpf_map
$(QUIET) make install -C kernel/ko_src

$(QUIET) go install github.com/OpenPeeDeeP/depguard/cmd/depguard@latest

$(call printlog, INSTALL, $(INSTALL_BIN)/$(APPS1))
$(QUIET) install -Dp -m 0500 $(APPS1) $(INSTALL_BIN)

Expand Down
8 changes: 4 additions & 4 deletions pkg/controller/ads/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
filters_network_http "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3"
filters_network_tcp "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/tcp_proxy/v3"
pkg_wellknown "github.com/envoyproxy/go-control-plane/pkg/wellknown"
"github.com/golang/protobuf/ptypes/wrappers"
//"github.com/golang/protobuf/ptypes/wrappers"
"github.com/stretchr/testify/assert"
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/durationpb"
Expand Down Expand Up @@ -429,7 +429,7 @@ func TestCreateApiListenerByLds(t *testing.T) {
status := core_v2.ApiStatus_UPDATE
typedConfig := &filters_network_tcp.TcpProxy{
StatPrefix: "ut-test",
MaxConnectAttempts: &wrappers.UInt32Value{
MaxConnectAttempts: &wrapperspb.UInt32Value{
Value: uint32(3),
},
ClusterSpecifier: &filters_network_tcp.TcpProxy_Cluster{
Expand Down Expand Up @@ -482,7 +482,7 @@ func TestCreateApiListenerByLds(t *testing.T) {
status := core_v2.ApiStatus_UPDATE
typedConfig := &filters_network_tcp.TcpProxy{
StatPrefix: "ut-test",
MaxConnectAttempts: &wrappers.UInt32Value{
MaxConnectAttempts: &wrapperspb.UInt32Value{
Value: uint32(3),
},
ClusterSpecifier: &filters_network_tcp.TcpProxy_Cluster{
Expand Down Expand Up @@ -534,7 +534,7 @@ func TestCreateApiListenerByLds(t *testing.T) {
status := core_v2.ApiStatus_UNCHANGED
typedConfig := &filters_network_tcp.TcpProxy{
StatPrefix: "ut-test",
MaxConnectAttempts: &wrappers.UInt32Value{
MaxConnectAttempts: &wrapperspb.UInt32Value{
Value: uint32(3),
},
ClusterSpecifier: &filters_network_tcp.TcpProxy_Cluster{
Expand Down
7 changes: 4 additions & 3 deletions pkg/controller/ads/convert_filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ import (
"testing"

envoy_filters_tcp_proxy "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/tcp_proxy/v3"
"github.com/golang/protobuf/ptypes/wrappers"
//"github.com/golang/protobuf/ptypes/wrappers"
"github.com/stretchr/testify/require"
"google.golang.org/protobuf/types/known/wrapperspb"
"gotest.tools/assert"

"kmesh.net/kmesh/api/v2/filter"
Expand All @@ -31,7 +32,7 @@ func TestNewFilterTcpProxy(t *testing.T) {
t.Run("ClusterSpecifier is Cluster", func(t *testing.T) {
envoyTcpProxy := &envoy_filters_tcp_proxy.TcpProxy{
StatPrefix: "ut-test",
MaxConnectAttempts: &wrappers.UInt32Value{
MaxConnectAttempts: &wrapperspb.UInt32Value{
Value: uint32(3),
},
ClusterSpecifier: &envoy_filters_tcp_proxy.TcpProxy_Cluster{
Expand All @@ -55,7 +56,7 @@ func TestNewFilterTcpProxy(t *testing.T) {
}
envoyTcpProxy := &envoy_filters_tcp_proxy.TcpProxy{
StatPrefix: "ut-test",
MaxConnectAttempts: &wrappers.UInt32Value{
MaxConnectAttempts: &wrapperspb.UInt32Value{
Value: uint32(3),
},
ClusterSpecifier: &envoy_filters_tcp_proxy.TcpProxy_WeightedClusters{
Expand Down
3 changes: 2 additions & 1 deletion pkg/controller/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import (
"strings"

config_core_v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
structpb "github.com/golang/protobuf/ptypes/struct"
//structpb "github.com/golang/protobuf/ptypes/struct"
"google.golang.org/protobuf/types/known/structpb"
"istio.io/istio/pkg/cluster"
"istio.io/istio/pkg/model"
"istio.io/istio/pkg/util/protomarshal"
Expand Down
3 changes: 2 additions & 1 deletion pkg/controller/workload/workload_hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import (
"math"
"os"

"gopkg.in/yaml.v3"
//"gopkg.in/yaml.v3"
"sigs.k8s.io/yaml"
)

const (
Expand Down
6 changes: 4 additions & 2 deletions pkg/dns/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ import (
clusterv3 "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3"
v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
endpointv3 "github.com/envoyproxy/go-control-plane/envoy/config/endpoint/v3"
"github.com/golang/protobuf/ptypes/wrappers"
//"github.com/golang/protobuf/ptypes/wrappers"
"google.golang.org/protobuf/types/known/wrapperspb"

"github.com/miekg/dns"
"k8s.io/client-go/util/workqueue"

Expand Down Expand Up @@ -100,7 +102,7 @@ func overwriteDnsCluster(cluster *clusterv3.Cluster, domain string, addrs []stri
},
},
// TODO: support LoadBalancingWeight
LoadBalancingWeight: &wrappers.UInt32Value{
LoadBalancingWeight: &wrapperspb.UInt32Value{
Value: 1,
},
}
Expand Down

0 comments on commit a59339e

Please sign in to comment.