Skip to content

Commit

Permalink
Bump istio/api and use protobufs defined there (istio#35498)
Browse files Browse the repository at this point in the history
* Bump istio/api and use protobufs defined there

* gen
  • Loading branch information
howardjohn authored Oct 6, 2021
1 parent 7a9f11e commit c869533
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 1,981 deletions.
4 changes: 2 additions & 2 deletions pilot/pkg/security/authn/v1beta1/policy_applier.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import (
duration "github.com/golang/protobuf/ptypes/duration"
"github.com/golang/protobuf/ptypes/empty"

authn_alpha "istio.io/api/authentication/v1alpha1"
authn_filter "istio.io/api/envoy/config/filter/http/authn/v2alpha1"
"istio.io/api/security/v1beta1"
"istio.io/istio/pilot/pkg/extensionproviders"
"istio.io/istio/pilot/pkg/features"
Expand All @@ -39,8 +41,6 @@ import (
authn_utils "istio.io/istio/pilot/pkg/security/authn/utils"
authn_model "istio.io/istio/pilot/pkg/security/model"
"istio.io/istio/pkg/config"
authn_alpha "istio.io/istio/pkg/envoy/config/authentication/v1alpha1"
authn_filter "istio.io/istio/pkg/envoy/config/filter/http/authn/v2alpha1"
"istio.io/pkg/log"
)

Expand Down
6 changes: 3 additions & 3 deletions pilot/pkg/security/authn/v1beta1/policy_applier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import (
"google.golang.org/protobuf/testing/protocmp"
"google.golang.org/protobuf/types/known/durationpb"

authn_alpha "istio.io/api/authentication/v1alpha1"
authn_filter "istio.io/api/envoy/config/filter/http/authn/v2alpha1"
"istio.io/api/security/v1beta1"
type_beta "istio.io/api/type/v1beta1"
"istio.io/istio/pilot/pkg/features"
Expand All @@ -42,8 +44,6 @@ import (
pilotutil "istio.io/istio/pilot/pkg/networking/util"
"istio.io/istio/pkg/config"
"istio.io/istio/pkg/config/host"
authn_alpha "istio.io/istio/pkg/envoy/config/authentication/v1alpha1"
authn_filter "istio.io/istio/pkg/envoy/config/filter/http/authn/v2alpha1"
protovalue "istio.io/istio/pkg/proto"
)

Expand Down Expand Up @@ -1024,7 +1024,7 @@ func humanReadableAuthnFilterDump(filter *http_conn.HttpFilter) string {
config := &authn_filter.FilterConfig{}
// nolint: staticcheck
ptypes.UnmarshalAny(filter.GetTypedConfig(), config)
return spew.Sdump(*config)
return spew.Sdump(config)
}

func TestAuthnFilterConfig(t *testing.T) {
Expand Down
20 changes: 4 additions & 16 deletions pilot/pkg/xds/filters/filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
package filters

import (
udpa "github.com/cncf/udpa/go/udpa/type/v1"
cluster "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3"
core "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
listener "github.com/envoyproxy/go-control-plane/envoy/config/listener/v3"
Expand All @@ -32,13 +31,12 @@ import (
hcm "github.com/envoyproxy/go-control-plane/envoy/extensions/filters/network/http_connection_manager/v3"
wasm "github.com/envoyproxy/go-control-plane/envoy/extensions/wasm/v3"
"github.com/envoyproxy/go-control-plane/pkg/wellknown"
protobuf "github.com/gogo/protobuf/types"
"google.golang.org/protobuf/types/known/structpb"
"google.golang.org/protobuf/types/known/wrapperspb"

alpn "istio.io/api/envoy/config/filter/http/alpn/v2alpha1"
"istio.io/api/envoy/config/filter/network/metadata_exchange"
"istio.io/istio/pilot/pkg/features"
"istio.io/istio/pilot/pkg/networking/util"
alpn "istio.io/istio/pkg/envoy/config/filter/http/alpn/v2alpha1"
)

const (
Expand Down Expand Up @@ -138,17 +136,7 @@ var (
},
}

tcpMx = util.MessageToAny(&udpa.TypedStruct{
// TODO(https://github.com/istio/istio/issues/35210) make this in API
TypeUrl: "type.googleapis.com/envoy.tcp.metadataexchange.config.MetadataExchange",
Value: &structpb.Struct{
Fields: map[string]*structpb.Value{
"protocol": {
Kind: &structpb.Value_StringValue{StringValue: "istio-peer-exchange"},
},
},
},
})
tcpMx = util.MessageToAny(&metadata_exchange.MetadataExchange{Protocol: "istio-peer-exchange"})

TCPListenerMx = &listener.Filter{
Name: MxFilterName,
Expand Down Expand Up @@ -194,7 +182,7 @@ func buildHTTPMxFilter() *hcm.HttpFilter {
httpMxConfigProto := &httpwasm.Wasm{
Config: &wasm.PluginConfig{
Vm: constructVMConfig("/etc/istio/extensions/metadata-exchange-filter.compiled.wasm", "envoy.wasm.metadata_exchange"),
Configuration: util.MessageToAny(&protobuf.StringValue{Value: "{}"}),
Configuration: util.MessageToAny(&metadata_exchange.MetadataExchange{}),
},
}

Expand Down
7 changes: 4 additions & 3 deletions pkg/config/xds/filter_types.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/config/xds/filter_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
//go:generate sh -c "echo 'package xds\n\nimport (' >> filter_types.gen.go"
//go:generate sh -c "go list github.com/envoyproxy/go-control-plane/... | grep 'v[2-9]' | grep -v /pkg/ | xargs -n1 -I{} echo '\t_ \"{}\"' >> filter_types.gen.go"
//go:generate sh -c "echo '\n\t// Istio-specific Envoy filters' >> filter_types.gen.go"
//go:generate sh -c "go list istio.io/istio/pkg/envoy/config/filter/... | grep 'v[2-9]' | xargs -n1 -I{} echo '\t_ \"{}\"' >> filter_types.gen.go"
//go:generate sh -c "go list istio.io/api/envoy/config/filter/... | grep 'v[2-9]' | xargs -n1 -I{} echo '\t_ \"{}\"' >> filter_types.gen.go"
//go:generate sh -c "echo ')' >> filter_types.gen.go"
package xds

Expand Down
Loading

0 comments on commit c869533

Please sign in to comment.