From 259670bd37b2ff6ea16b6a942f588bdf37dece3b Mon Sep 17 00:00:00 2001 From: Nghia Tran Date: Mon, 3 Aug 2020 16:40:25 -0700 Subject: [PATCH] Rollback #147 --- hack/update-codegen.sh | 4 +- .../istio/clientset/versioned/clientset.go | 18 +- .../versioned/fake/clientset_generated.go | 10 +- .../clientset/versioned/fake/register.go | 4 +- .../clientset/versioned/scheme/register.go | 4 +- .../{v1beta1 => v1alpha3}/destinationrule.go | 36 +- .../networking/{v1beta1 => v1alpha3}/doc.go | 2 +- .../typed/networking/v1alpha3/envoyfilter.go | 174 + .../{v1beta1 => v1alpha3}/fake/doc.go | 0 .../fake/fake_destinationrule.go | 44 +- .../v1alpha3/fake/fake_envoyfilter.go | 128 + .../fake/fake_gateway.go | 44 +- .../fake/fake_networking_client.go | 22 +- .../fake/fake_serviceentry.go | 44 +- .../fake/fake_sidecar.go | 44 +- .../fake/fake_virtualservice.go | 44 +- .../fake/fake_workloadentry.go | 44 +- .../{v1beta1 => v1alpha3}/gateway.go | 36 +- .../generated_expansion.go | 4 +- .../networking_client.go | 47 +- .../{v1beta1 => v1alpha3}/serviceentry.go | 36 +- .../{v1beta1 => v1alpha3}/sidecar.go | 36 +- .../{v1beta1 => v1alpha3}/virtualservice.go | 36 +- .../{v1beta1 => v1alpha3}/workloadentry.go | 36 +- .../informers/externalversions/generic.go | 30 +- .../externalversions/networking/interface.go | 12 +- .../{v1beta1 => v1alpha3}/destinationrule.go | 20 +- .../networking/v1alpha3/envoyfilter.go | 89 + .../{v1beta1 => v1alpha3}/gateway.go | 20 +- .../{v1beta1 => v1alpha3}/interface.go | 9 +- .../{v1beta1 => v1alpha3}/serviceentry.go | 20 +- .../{v1beta1 => v1alpha3}/sidecar.go | 20 +- .../{v1beta1 => v1alpha3}/virtualservice.go | 20 +- .../{v1beta1 => v1alpha3}/workloadentry.go | 20 +- .../destinationrule/destinationrule.go | 10 +- .../destinationrule/fake/fake.go | 4 +- .../v1alpha3/envoyfilter/envoyfilter.go | 52 + .../v1alpha3/envoyfilter/fake/fake.go | 40 + .../gateway/fake/fake.go | 4 +- .../{v1beta1 => v1alpha3}/gateway/gateway.go | 10 +- .../serviceentry/fake/fake.go | 4 +- .../serviceentry/serviceentry.go | 10 +- .../sidecar/fake/fake.go | 4 +- .../{v1beta1 => v1alpha3}/sidecar/sidecar.go | 10 +- .../virtualservice/fake/fake.go | 4 +- .../virtualservice/virtualservice.go | 10 +- .../workloadentry/fake/fake.go | 4 +- .../workloadentry/workloadentry.go | 10 +- .../{v1beta1 => v1alpha3}/destinationrule.go | 24 +- .../networking/v1alpha3/envoyfilter.go | 94 + .../expansion_generated.go | 10 +- .../{v1beta1 => v1alpha3}/gateway.go | 24 +- .../{v1beta1 => v1alpha3}/serviceentry.go | 24 +- .../{v1beta1 => v1alpha3}/sidecar.go | 24 +- .../{v1beta1 => v1alpha3}/virtualservice.go | 24 +- .../{v1beta1 => v1alpha3}/workloadentry.go | 24 +- .../accessor/istio/virtualservice.go | 14 +- .../accessor/istio/virtualservice_test.go | 28 +- pkg/reconciler/ingress/controller.go | 8 +- pkg/reconciler/ingress/ingress.go | 32 +- pkg/reconciler/ingress/ingress_test.go | 130 +- pkg/reconciler/ingress/lister.go | 12 +- pkg/reconciler/ingress/lister_test.go | 188 +- pkg/reconciler/ingress/resources/gateway.go | 82 +- .../ingress/resources/gateway_test.go | 286 +- .../ingress/resources/virtual_service.go | 74 +- .../ingress/resources/virtual_service_test.go | 166 +- pkg/reconciler/testing/listers.go | 8 +- .../networking/{v1beta1 => v1alpha3}/LICENSE | 0 .../v1alpha3/destination_rule.gen.json | 554 + .../v1alpha3/destination_rule.pb.go | 7016 ++++++++++ .../v1alpha3/destination_rule.pb.html | 1831 +++ .../v1alpha3/destination_rule.proto | 1042 ++ .../v1alpha3/destination_rule_deepcopy.gen.go | 414 + .../v1alpha3/destination_rule_json.gen.go | 341 + .../networking/v1alpha3/envoy_filter.gen.json | 374 + .../networking/v1alpha3/envoy_filter.pb.go | 4762 +++++++ .../networking/v1alpha3/envoy_filter.pb.html | 1183 ++ .../networking/v1alpha3/envoy_filter.proto | 601 + .../v1alpha3/envoy_filter_deepcopy.gen.go | 405 + .../v1alpha3/envoy_filter_json.gen.go | 347 + .../api/networking/v1alpha3/gateway.gen.json | 174 + .../api/networking/v1alpha3/gateway.pb.go | 2630 ++++ .../api/networking/v1alpha3/gateway.pb.html | 954 ++ .../api/networking/v1alpha3/gateway.proto | 712 + .../v1alpha3/gateway_deepcopy.gen.go | 408 + .../networking/v1alpha3/gateway_json.gen.go | 395 + .../v1alpha3/service_entry.gen.json | 168 + .../networking/v1alpha3/service_entry.pb.go | 1749 +++ .../networking/v1alpha3/service_entry.pb.html | 1071 ++ .../networking/v1alpha3/service_entry.proto | 957 ++ .../v1alpha3/service_entry_deepcopy.gen.go | 779 ++ .../v1alpha3/service_entry_json.gen.go | 781 ++ .../api/networking/v1alpha3/sidecar.gen.json | 340 + .../api/networking/v1alpha3/sidecar.pb.go | 2903 ++++ .../api/networking/v1alpha3/sidecar.pb.html | 806 ++ .../api/networking/v1alpha3/sidecar.proto | 740 + .../v1alpha3/sidecar_deepcopy.gen.go | 490 + .../networking/v1alpha3/sidecar_json.gen.go | 467 + .../v1alpha3/virtual_service.gen.json | 817 ++ .../networking/v1alpha3/virtual_service.pb.go | 11118 ++++++++++++++++ .../v1alpha3/virtual_service.pb.html | 2784 ++++ .../networking/v1alpha3/virtual_service.proto | 1842 +++ .../v1alpha3/virtual_service_deepcopy.gen.go | 533 + .../v1alpha3/virtual_service_json.gen.go | 425 + .../v1alpha3/workload_entry.gen.json | 56 + .../networking/v1alpha3/workload_entry.pb.go | 1137 ++ .../v1alpha3/workload_entry.pb.html | 348 + .../networking/v1alpha3/workload_entry.proto | 313 + .../v1alpha3/workload_entry_deepcopy.gen.go | 238 + .../v1alpha3/workload_entry_json.gen.go | 240 + .../networking/{v1beta1 => v1alpha3}/doc.go | 2 +- .../{v1beta1 => v1alpha3}/register.gen.go | 6 +- .../{v1beta1 => v1alpha3}/types.gen.go | 89 +- .../zz_generated.deepcopy.gen.go | 62 +- vendor/modules.txt | 3 +- 116 files changed, 56989 insertions(+), 1027 deletions(-) rename pkg/client/istio/clientset/versioned/typed/networking/{v1beta1 => v1alpha3}/destinationrule.go (80%) rename pkg/client/istio/clientset/versioned/typed/networking/{v1beta1 => v1alpha3}/doc.go (97%) create mode 100644 pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/envoyfilter.go rename pkg/client/istio/clientset/versioned/typed/networking/{v1beta1 => v1alpha3}/fake/doc.go (100%) rename pkg/client/istio/clientset/versioned/typed/networking/{v1beta1 => v1alpha3}/fake/fake_destinationrule.go (72%) create mode 100644 pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_envoyfilter.go rename pkg/client/istio/clientset/versioned/typed/networking/{v1beta1 => v1alpha3}/fake/fake_gateway.go (75%) rename pkg/client/istio/clientset/versioned/typed/networking/{v1beta1 => v1alpha3}/fake/fake_networking_client.go (55%) rename pkg/client/istio/clientset/versioned/typed/networking/{v1beta1 => v1alpha3}/fake/fake_serviceentry.go (73%) rename pkg/client/istio/clientset/versioned/typed/networking/{v1beta1 => v1alpha3}/fake/fake_sidecar.go (75%) rename pkg/client/istio/clientset/versioned/typed/networking/{v1beta1 => v1alpha3}/fake/fake_virtualservice.go (72%) rename pkg/client/istio/clientset/versioned/typed/networking/{v1beta1 => v1alpha3}/fake/fake_workloadentry.go (72%) rename pkg/client/istio/clientset/versioned/typed/networking/{v1beta1 => v1alpha3}/gateway.go (81%) rename pkg/client/istio/clientset/versioned/typed/networking/{v1beta1 => v1alpha3}/generated_expansion.go (93%) rename pkg/client/istio/clientset/versioned/typed/networking/{v1beta1 => v1alpha3}/networking_client.go (54%) rename pkg/client/istio/clientset/versioned/typed/networking/{v1beta1 => v1alpha3}/serviceentry.go (80%) rename pkg/client/istio/clientset/versioned/typed/networking/{v1beta1 => v1alpha3}/sidecar.go (81%) rename pkg/client/istio/clientset/versioned/typed/networking/{v1beta1 => v1alpha3}/virtualservice.go (80%) rename pkg/client/istio/clientset/versioned/typed/networking/{v1beta1 => v1alpha3}/workloadentry.go (80%) rename pkg/client/istio/informers/externalversions/networking/{v1beta1 => v1alpha3}/destinationrule.go (82%) create mode 100644 pkg/client/istio/informers/externalversions/networking/v1alpha3/envoyfilter.go rename pkg/client/istio/informers/externalversions/networking/{v1beta1 => v1alpha3}/gateway.go (84%) rename pkg/client/istio/informers/externalversions/networking/{v1beta1 => v1alpha3}/interface.go (90%) rename pkg/client/istio/informers/externalversions/networking/{v1beta1 => v1alpha3}/serviceentry.go (83%) rename pkg/client/istio/informers/externalversions/networking/{v1beta1 => v1alpha3}/sidecar.go (84%) rename pkg/client/istio/informers/externalversions/networking/{v1beta1 => v1alpha3}/virtualservice.go (83%) rename pkg/client/istio/informers/externalversions/networking/{v1beta1 => v1alpha3}/workloadentry.go (83%) rename pkg/client/istio/injection/informers/networking/{v1beta1 => v1alpha3}/destinationrule/destinationrule.go (80%) rename pkg/client/istio/injection/informers/networking/{v1beta1 => v1alpha3}/destinationrule/fake/fake.go (91%) create mode 100644 pkg/client/istio/injection/informers/networking/v1alpha3/envoyfilter/envoyfilter.go create mode 100644 pkg/client/istio/injection/informers/networking/v1alpha3/envoyfilter/fake/fake.go rename pkg/client/istio/injection/informers/networking/{v1beta1 => v1alpha3}/gateway/fake/fake.go (93%) rename pkg/client/istio/injection/informers/networking/{v1beta1 => v1alpha3}/gateway/gateway.go (81%) rename pkg/client/istio/injection/informers/networking/{v1beta1 => v1alpha3}/serviceentry/fake/fake.go (92%) rename pkg/client/istio/injection/informers/networking/{v1beta1 => v1alpha3}/serviceentry/serviceentry.go (80%) rename pkg/client/istio/injection/informers/networking/{v1beta1 => v1alpha3}/sidecar/fake/fake.go (93%) rename pkg/client/istio/injection/informers/networking/{v1beta1 => v1alpha3}/sidecar/sidecar.go (81%) rename pkg/client/istio/injection/informers/networking/{v1beta1 => v1alpha3}/virtualservice/fake/fake.go (92%) rename pkg/client/istio/injection/informers/networking/{v1beta1 => v1alpha3}/virtualservice/virtualservice.go (80%) rename pkg/client/istio/injection/informers/networking/{v1beta1 => v1alpha3}/workloadentry/fake/fake.go (92%) rename pkg/client/istio/injection/informers/networking/{v1beta1 => v1alpha3}/workloadentry/workloadentry.go (80%) rename pkg/client/istio/listers/networking/{v1beta1 => v1alpha3}/destinationrule.go (80%) create mode 100644 pkg/client/istio/listers/networking/v1alpha3/envoyfilter.go rename pkg/client/istio/listers/networking/{v1beta1 => v1alpha3}/expansion_generated.go (88%) rename pkg/client/istio/listers/networking/{v1beta1 => v1alpha3}/gateway.go (80%) rename pkg/client/istio/listers/networking/{v1beta1 => v1alpha3}/serviceentry.go (80%) rename pkg/client/istio/listers/networking/{v1beta1 => v1alpha3}/sidecar.go (80%) rename pkg/client/istio/listers/networking/{v1beta1 => v1alpha3}/virtualservice.go (80%) rename pkg/client/istio/listers/networking/{v1beta1 => v1alpha3}/workloadentry.go (80%) rename third_party/VENDOR-LICENSE/istio.io/client-go/pkg/apis/networking/{v1beta1 => v1alpha3}/LICENSE (100%) create mode 100644 vendor/istio.io/api/networking/v1alpha3/destination_rule.gen.json create mode 100644 vendor/istio.io/api/networking/v1alpha3/destination_rule.pb.go create mode 100644 vendor/istio.io/api/networking/v1alpha3/destination_rule.pb.html create mode 100644 vendor/istio.io/api/networking/v1alpha3/destination_rule.proto create mode 100644 vendor/istio.io/api/networking/v1alpha3/destination_rule_deepcopy.gen.go create mode 100644 vendor/istio.io/api/networking/v1alpha3/destination_rule_json.gen.go create mode 100644 vendor/istio.io/api/networking/v1alpha3/envoy_filter.gen.json create mode 100644 vendor/istio.io/api/networking/v1alpha3/envoy_filter.pb.go create mode 100644 vendor/istio.io/api/networking/v1alpha3/envoy_filter.pb.html create mode 100644 vendor/istio.io/api/networking/v1alpha3/envoy_filter.proto create mode 100644 vendor/istio.io/api/networking/v1alpha3/envoy_filter_deepcopy.gen.go create mode 100644 vendor/istio.io/api/networking/v1alpha3/envoy_filter_json.gen.go create mode 100644 vendor/istio.io/api/networking/v1alpha3/gateway.gen.json create mode 100644 vendor/istio.io/api/networking/v1alpha3/gateway.pb.go create mode 100644 vendor/istio.io/api/networking/v1alpha3/gateway.pb.html create mode 100644 vendor/istio.io/api/networking/v1alpha3/gateway.proto create mode 100644 vendor/istio.io/api/networking/v1alpha3/gateway_deepcopy.gen.go create mode 100644 vendor/istio.io/api/networking/v1alpha3/gateway_json.gen.go create mode 100644 vendor/istio.io/api/networking/v1alpha3/service_entry.gen.json create mode 100644 vendor/istio.io/api/networking/v1alpha3/service_entry.pb.go create mode 100644 vendor/istio.io/api/networking/v1alpha3/service_entry.pb.html create mode 100644 vendor/istio.io/api/networking/v1alpha3/service_entry.proto create mode 100644 vendor/istio.io/api/networking/v1alpha3/service_entry_deepcopy.gen.go create mode 100644 vendor/istio.io/api/networking/v1alpha3/service_entry_json.gen.go create mode 100644 vendor/istio.io/api/networking/v1alpha3/sidecar.gen.json create mode 100644 vendor/istio.io/api/networking/v1alpha3/sidecar.pb.go create mode 100644 vendor/istio.io/api/networking/v1alpha3/sidecar.pb.html create mode 100644 vendor/istio.io/api/networking/v1alpha3/sidecar.proto create mode 100644 vendor/istio.io/api/networking/v1alpha3/sidecar_deepcopy.gen.go create mode 100644 vendor/istio.io/api/networking/v1alpha3/sidecar_json.gen.go create mode 100644 vendor/istio.io/api/networking/v1alpha3/virtual_service.gen.json create mode 100644 vendor/istio.io/api/networking/v1alpha3/virtual_service.pb.go create mode 100644 vendor/istio.io/api/networking/v1alpha3/virtual_service.pb.html create mode 100644 vendor/istio.io/api/networking/v1alpha3/virtual_service.proto create mode 100644 vendor/istio.io/api/networking/v1alpha3/virtual_service_deepcopy.gen.go create mode 100644 vendor/istio.io/api/networking/v1alpha3/virtual_service_json.gen.go create mode 100644 vendor/istio.io/api/networking/v1alpha3/workload_entry.gen.json create mode 100644 vendor/istio.io/api/networking/v1alpha3/workload_entry.pb.go create mode 100644 vendor/istio.io/api/networking/v1alpha3/workload_entry.pb.html create mode 100644 vendor/istio.io/api/networking/v1alpha3/workload_entry.proto create mode 100644 vendor/istio.io/api/networking/v1alpha3/workload_entry_deepcopy.gen.go create mode 100644 vendor/istio.io/api/networking/v1alpha3/workload_entry_json.gen.go rename vendor/istio.io/client-go/pkg/apis/networking/{v1beta1 => v1alpha3}/doc.go (97%) rename vendor/istio.io/client-go/pkg/apis/networking/{v1beta1 => v1alpha3}/register.gen.go (95%) rename vendor/istio.io/client-go/pkg/apis/networking/{v1beta1 => v1alpha3}/types.gen.go (81%) rename vendor/istio.io/client-go/pkg/apis/networking/{v1beta1 => v1alpha3}/zz_generated.deepcopy.gen.go (86%) diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 202f890f9f..7a9b9c3054 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -37,13 +37,13 @@ ${REPO_ROOT}/hack/update-deps.sh # Knative Injection (for istio) ${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh "injection" \ knative.dev/net-istio/pkg/client/istio istio.io/client-go/pkg/apis \ - "networking:v1beta1" \ + "networking:v1alpha3" \ --go-header-file ${REPO_ROOT}/hack/boilerplate/boilerplate.go.txt # Generate our own client for istio (otherwise injection won't work) ${CODEGEN_PKG}/generate-groups.sh "client,informer,lister" \ knative.dev/net-istio/pkg/client/istio istio.io/client-go/pkg/apis \ - "networking:v1beta1" \ + "networking:v1alpha3" \ --go-header-file ${REPO_ROOT}/hack/boilerplate/boilerplate.go.txt # Depends on generate-groups.sh to install bin/deepcopy-gen diff --git a/pkg/client/istio/clientset/versioned/clientset.go b/pkg/client/istio/clientset/versioned/clientset.go index 2d1a8bf816..13136d817a 100644 --- a/pkg/client/istio/clientset/versioned/clientset.go +++ b/pkg/client/istio/clientset/versioned/clientset.go @@ -24,24 +24,24 @@ import ( discovery "k8s.io/client-go/discovery" rest "k8s.io/client-go/rest" flowcontrol "k8s.io/client-go/util/flowcontrol" - networkingv1beta1 "knative.dev/net-istio/pkg/client/istio/clientset/versioned/typed/networking/v1beta1" + networkingv1alpha3 "knative.dev/net-istio/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3" ) type Interface interface { Discovery() discovery.DiscoveryInterface - NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Interface + NetworkingV1alpha3() networkingv1alpha3.NetworkingV1alpha3Interface } // Clientset contains the clients for groups. Each group has exactly one // version included in a Clientset. type Clientset struct { *discovery.DiscoveryClient - networkingV1beta1 *networkingv1beta1.NetworkingV1beta1Client + networkingV1alpha3 *networkingv1alpha3.NetworkingV1alpha3Client } -// NetworkingV1beta1 retrieves the NetworkingV1beta1Client -func (c *Clientset) NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Interface { - return c.networkingV1beta1 +// NetworkingV1alpha3 retrieves the NetworkingV1alpha3Client +func (c *Clientset) NetworkingV1alpha3() networkingv1alpha3.NetworkingV1alpha3Interface { + return c.networkingV1alpha3 } // Discovery retrieves the DiscoveryClient @@ -65,7 +65,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { } var cs Clientset var err error - cs.networkingV1beta1, err = networkingv1beta1.NewForConfig(&configShallowCopy) + cs.networkingV1alpha3, err = networkingv1alpha3.NewForConfig(&configShallowCopy) if err != nil { return nil, err } @@ -81,7 +81,7 @@ func NewForConfig(c *rest.Config) (*Clientset, error) { // panics if there is an error in the config. func NewForConfigOrDie(c *rest.Config) *Clientset { var cs Clientset - cs.networkingV1beta1 = networkingv1beta1.NewForConfigOrDie(c) + cs.networkingV1alpha3 = networkingv1alpha3.NewForConfigOrDie(c) cs.DiscoveryClient = discovery.NewDiscoveryClientForConfigOrDie(c) return &cs @@ -90,7 +90,7 @@ func NewForConfigOrDie(c *rest.Config) *Clientset { // New creates a new Clientset for the given RESTClient. func New(c rest.Interface) *Clientset { var cs Clientset - cs.networkingV1beta1 = networkingv1beta1.New(c) + cs.networkingV1alpha3 = networkingv1alpha3.New(c) cs.DiscoveryClient = discovery.NewDiscoveryClient(c) return &cs diff --git a/pkg/client/istio/clientset/versioned/fake/clientset_generated.go b/pkg/client/istio/clientset/versioned/fake/clientset_generated.go index 0a0da3795f..9c45647d99 100644 --- a/pkg/client/istio/clientset/versioned/fake/clientset_generated.go +++ b/pkg/client/istio/clientset/versioned/fake/clientset_generated.go @@ -25,8 +25,8 @@ import ( fakediscovery "k8s.io/client-go/discovery/fake" "k8s.io/client-go/testing" clientset "knative.dev/net-istio/pkg/client/istio/clientset/versioned" - networkingv1beta1 "knative.dev/net-istio/pkg/client/istio/clientset/versioned/typed/networking/v1beta1" - fakenetworkingv1beta1 "knative.dev/net-istio/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake" + networkingv1alpha3 "knative.dev/net-istio/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3" + fakenetworkingv1alpha3 "knative.dev/net-istio/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake" ) // NewSimpleClientset returns a clientset that will respond with the provided objects. @@ -76,7 +76,7 @@ func (c *Clientset) Tracker() testing.ObjectTracker { var _ clientset.Interface = &Clientset{} -// NetworkingV1beta1 retrieves the NetworkingV1beta1Client -func (c *Clientset) NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Interface { - return &fakenetworkingv1beta1.FakeNetworkingV1beta1{Fake: &c.Fake} +// NetworkingV1alpha3 retrieves the NetworkingV1alpha3Client +func (c *Clientset) NetworkingV1alpha3() networkingv1alpha3.NetworkingV1alpha3Interface { + return &fakenetworkingv1alpha3.FakeNetworkingV1alpha3{Fake: &c.Fake} } diff --git a/pkg/client/istio/clientset/versioned/fake/register.go b/pkg/client/istio/clientset/versioned/fake/register.go index 298781d1cc..85b5cbcb2f 100644 --- a/pkg/client/istio/clientset/versioned/fake/register.go +++ b/pkg/client/istio/clientset/versioned/fake/register.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - networkingv1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + networkingv1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -31,7 +31,7 @@ var scheme = runtime.NewScheme() var codecs = serializer.NewCodecFactory(scheme) var parameterCodec = runtime.NewParameterCodec(scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - networkingv1beta1.AddToScheme, + networkingv1alpha3.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/istio/clientset/versioned/scheme/register.go b/pkg/client/istio/clientset/versioned/scheme/register.go index 9d695695bb..6f2a312b25 100644 --- a/pkg/client/istio/clientset/versioned/scheme/register.go +++ b/pkg/client/istio/clientset/versioned/scheme/register.go @@ -19,7 +19,7 @@ limitations under the License. package scheme import ( - networkingv1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + networkingv1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -31,7 +31,7 @@ var Scheme = runtime.NewScheme() var Codecs = serializer.NewCodecFactory(Scheme) var ParameterCodec = runtime.NewParameterCodec(Scheme) var localSchemeBuilder = runtime.SchemeBuilder{ - networkingv1beta1.AddToScheme, + networkingv1alpha3.AddToScheme, } // AddToScheme adds all types of this clientset into the given scheme. This allows composition diff --git a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/destinationrule.go b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/destinationrule.go similarity index 80% rename from pkg/client/istio/clientset/versioned/typed/networking/v1beta1/destinationrule.go rename to pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/destinationrule.go index 59762a3c30..cc41c2a817 100644 --- a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/destinationrule.go +++ b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/destinationrule.go @@ -16,12 +16,12 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( "time" - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -37,14 +37,14 @@ type DestinationRulesGetter interface { // DestinationRuleInterface has methods to work with DestinationRule resources. type DestinationRuleInterface interface { - Create(*v1beta1.DestinationRule) (*v1beta1.DestinationRule, error) - Update(*v1beta1.DestinationRule) (*v1beta1.DestinationRule, error) + Create(*v1alpha3.DestinationRule) (*v1alpha3.DestinationRule, error) + Update(*v1alpha3.DestinationRule) (*v1alpha3.DestinationRule, error) Delete(name string, options *v1.DeleteOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.DestinationRule, error) - List(opts v1.ListOptions) (*v1beta1.DestinationRuleList, error) + Get(name string, options v1.GetOptions) (*v1alpha3.DestinationRule, error) + List(opts v1.ListOptions) (*v1alpha3.DestinationRuleList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.DestinationRule, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.DestinationRule, err error) DestinationRuleExpansion } @@ -55,7 +55,7 @@ type destinationRules struct { } // newDestinationRules returns a DestinationRules -func newDestinationRules(c *NetworkingV1beta1Client, namespace string) *destinationRules { +func newDestinationRules(c *NetworkingV1alpha3Client, namespace string) *destinationRules { return &destinationRules{ client: c.RESTClient(), ns: namespace, @@ -63,8 +63,8 @@ func newDestinationRules(c *NetworkingV1beta1Client, namespace string) *destinat } // Get takes name of the destinationRule, and returns the corresponding destinationRule object, and an error if there is any. -func (c *destinationRules) Get(name string, options v1.GetOptions) (result *v1beta1.DestinationRule, err error) { - result = &v1beta1.DestinationRule{} +func (c *destinationRules) Get(name string, options v1.GetOptions) (result *v1alpha3.DestinationRule, err error) { + result = &v1alpha3.DestinationRule{} err = c.client.Get(). Namespace(c.ns). Resource("destinationrules"). @@ -76,12 +76,12 @@ func (c *destinationRules) Get(name string, options v1.GetOptions) (result *v1be } // List takes label and field selectors, and returns the list of DestinationRules that match those selectors. -func (c *destinationRules) List(opts v1.ListOptions) (result *v1beta1.DestinationRuleList, err error) { +func (c *destinationRules) List(opts v1.ListOptions) (result *v1alpha3.DestinationRuleList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1beta1.DestinationRuleList{} + result = &v1alpha3.DestinationRuleList{} err = c.client.Get(). Namespace(c.ns). Resource("destinationrules"). @@ -108,8 +108,8 @@ func (c *destinationRules) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a destinationRule and creates it. Returns the server's representation of the destinationRule, and an error, if there is any. -func (c *destinationRules) Create(destinationRule *v1beta1.DestinationRule) (result *v1beta1.DestinationRule, err error) { - result = &v1beta1.DestinationRule{} +func (c *destinationRules) Create(destinationRule *v1alpha3.DestinationRule) (result *v1alpha3.DestinationRule, err error) { + result = &v1alpha3.DestinationRule{} err = c.client.Post(). Namespace(c.ns). Resource("destinationrules"). @@ -120,8 +120,8 @@ func (c *destinationRules) Create(destinationRule *v1beta1.DestinationRule) (res } // Update takes the representation of a destinationRule and updates it. Returns the server's representation of the destinationRule, and an error, if there is any. -func (c *destinationRules) Update(destinationRule *v1beta1.DestinationRule) (result *v1beta1.DestinationRule, err error) { - result = &v1beta1.DestinationRule{} +func (c *destinationRules) Update(destinationRule *v1alpha3.DestinationRule) (result *v1alpha3.DestinationRule, err error) { + result = &v1alpha3.DestinationRule{} err = c.client.Put(). Namespace(c.ns). Resource("destinationrules"). @@ -160,8 +160,8 @@ func (c *destinationRules) DeleteCollection(options *v1.DeleteOptions, listOptio } // Patch applies the patch and returns the patched destinationRule. -func (c *destinationRules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.DestinationRule, err error) { - result = &v1beta1.DestinationRule{} +func (c *destinationRules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.DestinationRule, err error) { + result = &v1alpha3.DestinationRule{} err = c.client.Patch(pt). Namespace(c.ns). Resource("destinationrules"). diff --git a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/doc.go b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/doc.go similarity index 97% rename from pkg/client/istio/clientset/versioned/typed/networking/v1beta1/doc.go rename to pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/doc.go index b641cb3730..65f0a55be9 100644 --- a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/doc.go +++ b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/doc.go @@ -17,4 +17,4 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. // This package has the automatically generated typed clients. -package v1beta1 +package v1alpha3 diff --git a/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/envoyfilter.go b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/envoyfilter.go new file mode 100644 index 0000000000..c345c6025a --- /dev/null +++ b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/envoyfilter.go @@ -0,0 +1,174 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + "time" + + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + rest "k8s.io/client-go/rest" + scheme "knative.dev/net-istio/pkg/client/istio/clientset/versioned/scheme" +) + +// EnvoyFiltersGetter has a method to return a EnvoyFilterInterface. +// A group's client should implement this interface. +type EnvoyFiltersGetter interface { + EnvoyFilters(namespace string) EnvoyFilterInterface +} + +// EnvoyFilterInterface has methods to work with EnvoyFilter resources. +type EnvoyFilterInterface interface { + Create(*v1alpha3.EnvoyFilter) (*v1alpha3.EnvoyFilter, error) + Update(*v1alpha3.EnvoyFilter) (*v1alpha3.EnvoyFilter, error) + Delete(name string, options *v1.DeleteOptions) error + DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error + Get(name string, options v1.GetOptions) (*v1alpha3.EnvoyFilter, error) + List(opts v1.ListOptions) (*v1alpha3.EnvoyFilterList, error) + Watch(opts v1.ListOptions) (watch.Interface, error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.EnvoyFilter, err error) + EnvoyFilterExpansion +} + +// envoyFilters implements EnvoyFilterInterface +type envoyFilters struct { + client rest.Interface + ns string +} + +// newEnvoyFilters returns a EnvoyFilters +func newEnvoyFilters(c *NetworkingV1alpha3Client, namespace string) *envoyFilters { + return &envoyFilters{ + client: c.RESTClient(), + ns: namespace, + } +} + +// Get takes name of the envoyFilter, and returns the corresponding envoyFilter object, and an error if there is any. +func (c *envoyFilters) Get(name string, options v1.GetOptions) (result *v1alpha3.EnvoyFilter, err error) { + result = &v1alpha3.EnvoyFilter{} + err = c.client.Get(). + Namespace(c.ns). + Resource("envoyfilters"). + Name(name). + VersionedParams(&options, scheme.ParameterCodec). + Do(). + Into(result) + return +} + +// List takes label and field selectors, and returns the list of EnvoyFilters that match those selectors. +func (c *envoyFilters) List(opts v1.ListOptions) (result *v1alpha3.EnvoyFilterList, err error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + result = &v1alpha3.EnvoyFilterList{} + err = c.client.Get(). + Namespace(c.ns). + Resource("envoyfilters"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Do(). + Into(result) + return +} + +// Watch returns a watch.Interface that watches the requested envoyFilters. +func (c *envoyFilters) Watch(opts v1.ListOptions) (watch.Interface, error) { + var timeout time.Duration + if opts.TimeoutSeconds != nil { + timeout = time.Duration(*opts.TimeoutSeconds) * time.Second + } + opts.Watch = true + return c.client.Get(). + Namespace(c.ns). + Resource("envoyfilters"). + VersionedParams(&opts, scheme.ParameterCodec). + Timeout(timeout). + Watch() +} + +// Create takes the representation of a envoyFilter and creates it. Returns the server's representation of the envoyFilter, and an error, if there is any. +func (c *envoyFilters) Create(envoyFilter *v1alpha3.EnvoyFilter) (result *v1alpha3.EnvoyFilter, err error) { + result = &v1alpha3.EnvoyFilter{} + err = c.client.Post(). + Namespace(c.ns). + Resource("envoyfilters"). + Body(envoyFilter). + Do(). + Into(result) + return +} + +// Update takes the representation of a envoyFilter and updates it. Returns the server's representation of the envoyFilter, and an error, if there is any. +func (c *envoyFilters) Update(envoyFilter *v1alpha3.EnvoyFilter) (result *v1alpha3.EnvoyFilter, err error) { + result = &v1alpha3.EnvoyFilter{} + err = c.client.Put(). + Namespace(c.ns). + Resource("envoyfilters"). + Name(envoyFilter.Name). + Body(envoyFilter). + Do(). + Into(result) + return +} + +// Delete takes name of the envoyFilter and deletes it. Returns an error if one occurs. +func (c *envoyFilters) Delete(name string, options *v1.DeleteOptions) error { + return c.client.Delete(). + Namespace(c.ns). + Resource("envoyfilters"). + Name(name). + Body(options). + Do(). + Error() +} + +// DeleteCollection deletes a collection of objects. +func (c *envoyFilters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + var timeout time.Duration + if listOptions.TimeoutSeconds != nil { + timeout = time.Duration(*listOptions.TimeoutSeconds) * time.Second + } + return c.client.Delete(). + Namespace(c.ns). + Resource("envoyfilters"). + VersionedParams(&listOptions, scheme.ParameterCodec). + Timeout(timeout). + Body(options). + Do(). + Error() +} + +// Patch applies the patch and returns the patched envoyFilter. +func (c *envoyFilters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.EnvoyFilter, err error) { + result = &v1alpha3.EnvoyFilter{} + err = c.client.Patch(pt). + Namespace(c.ns). + Resource("envoyfilters"). + SubResource(subresources...). + Name(name). + Body(data). + Do(). + Into(result) + return +} diff --git a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/doc.go b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/doc.go similarity index 100% rename from pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/doc.go rename to pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/doc.go diff --git a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_destinationrule.go b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_destinationrule.go similarity index 72% rename from pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_destinationrule.go rename to pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_destinationrule.go index b5871d20bd..36937c27ef 100644 --- a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_destinationrule.go +++ b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_destinationrule.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,29 +30,29 @@ import ( // FakeDestinationRules implements DestinationRuleInterface type FakeDestinationRules struct { - Fake *FakeNetworkingV1beta1 + Fake *FakeNetworkingV1alpha3 ns string } -var destinationrulesResource = schema.GroupVersionResource{Group: "networking.istio.io", Version: "v1beta1", Resource: "destinationrules"} +var destinationrulesResource = schema.GroupVersionResource{Group: "networking.istio.io", Version: "v1alpha3", Resource: "destinationrules"} -var destinationrulesKind = schema.GroupVersionKind{Group: "networking.istio.io", Version: "v1beta1", Kind: "DestinationRule"} +var destinationrulesKind = schema.GroupVersionKind{Group: "networking.istio.io", Version: "v1alpha3", Kind: "DestinationRule"} // Get takes name of the destinationRule, and returns the corresponding destinationRule object, and an error if there is any. -func (c *FakeDestinationRules) Get(name string, options v1.GetOptions) (result *v1beta1.DestinationRule, err error) { +func (c *FakeDestinationRules) Get(name string, options v1.GetOptions) (result *v1alpha3.DestinationRule, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(destinationrulesResource, c.ns, name), &v1beta1.DestinationRule{}) + Invokes(testing.NewGetAction(destinationrulesResource, c.ns, name), &v1alpha3.DestinationRule{}) if obj == nil { return nil, err } - return obj.(*v1beta1.DestinationRule), err + return obj.(*v1alpha3.DestinationRule), err } // List takes label and field selectors, and returns the list of DestinationRules that match those selectors. -func (c *FakeDestinationRules) List(opts v1.ListOptions) (result *v1beta1.DestinationRuleList, err error) { +func (c *FakeDestinationRules) List(opts v1.ListOptions) (result *v1alpha3.DestinationRuleList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(destinationrulesResource, destinationrulesKind, c.ns, opts), &v1beta1.DestinationRuleList{}) + Invokes(testing.NewListAction(destinationrulesResource, destinationrulesKind, c.ns, opts), &v1alpha3.DestinationRuleList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeDestinationRules) List(opts v1.ListOptions) (result *v1beta1.Destin if label == nil { label = labels.Everything() } - list := &v1beta1.DestinationRuleList{ListMeta: obj.(*v1beta1.DestinationRuleList).ListMeta} - for _, item := range obj.(*v1beta1.DestinationRuleList).Items { + list := &v1alpha3.DestinationRuleList{ListMeta: obj.(*v1alpha3.DestinationRuleList).ListMeta} + for _, item := range obj.(*v1alpha3.DestinationRuleList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,31 +79,31 @@ func (c *FakeDestinationRules) Watch(opts v1.ListOptions) (watch.Interface, erro } // Create takes the representation of a destinationRule and creates it. Returns the server's representation of the destinationRule, and an error, if there is any. -func (c *FakeDestinationRules) Create(destinationRule *v1beta1.DestinationRule) (result *v1beta1.DestinationRule, err error) { +func (c *FakeDestinationRules) Create(destinationRule *v1alpha3.DestinationRule) (result *v1alpha3.DestinationRule, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(destinationrulesResource, c.ns, destinationRule), &v1beta1.DestinationRule{}) + Invokes(testing.NewCreateAction(destinationrulesResource, c.ns, destinationRule), &v1alpha3.DestinationRule{}) if obj == nil { return nil, err } - return obj.(*v1beta1.DestinationRule), err + return obj.(*v1alpha3.DestinationRule), err } // Update takes the representation of a destinationRule and updates it. Returns the server's representation of the destinationRule, and an error, if there is any. -func (c *FakeDestinationRules) Update(destinationRule *v1beta1.DestinationRule) (result *v1beta1.DestinationRule, err error) { +func (c *FakeDestinationRules) Update(destinationRule *v1alpha3.DestinationRule) (result *v1alpha3.DestinationRule, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(destinationrulesResource, c.ns, destinationRule), &v1beta1.DestinationRule{}) + Invokes(testing.NewUpdateAction(destinationrulesResource, c.ns, destinationRule), &v1alpha3.DestinationRule{}) if obj == nil { return nil, err } - return obj.(*v1beta1.DestinationRule), err + return obj.(*v1alpha3.DestinationRule), err } // Delete takes name of the destinationRule and deletes it. Returns an error if one occurs. func (c *FakeDestinationRules) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(destinationrulesResource, c.ns, name), &v1beta1.DestinationRule{}) + Invokes(testing.NewDeleteAction(destinationrulesResource, c.ns, name), &v1alpha3.DestinationRule{}) return err } @@ -112,17 +112,17 @@ func (c *FakeDestinationRules) Delete(name string, options *v1.DeleteOptions) er func (c *FakeDestinationRules) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(destinationrulesResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &v1beta1.DestinationRuleList{}) + _, err := c.Fake.Invokes(action, &v1alpha3.DestinationRuleList{}) return err } // Patch applies the patch and returns the patched destinationRule. -func (c *FakeDestinationRules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.DestinationRule, err error) { +func (c *FakeDestinationRules) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.DestinationRule, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(destinationrulesResource, c.ns, name, pt, data, subresources...), &v1beta1.DestinationRule{}) + Invokes(testing.NewPatchSubresourceAction(destinationrulesResource, c.ns, name, pt, data, subresources...), &v1alpha3.DestinationRule{}) if obj == nil { return nil, err } - return obj.(*v1beta1.DestinationRule), err + return obj.(*v1alpha3.DestinationRule), err } diff --git a/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_envoyfilter.go b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_envoyfilter.go new file mode 100644 index 0000000000..381a8efe94 --- /dev/null +++ b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_envoyfilter.go @@ -0,0 +1,128 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by client-gen. DO NOT EDIT. + +package fake + +import ( + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + labels "k8s.io/apimachinery/pkg/labels" + schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" + watch "k8s.io/apimachinery/pkg/watch" + testing "k8s.io/client-go/testing" +) + +// FakeEnvoyFilters implements EnvoyFilterInterface +type FakeEnvoyFilters struct { + Fake *FakeNetworkingV1alpha3 + ns string +} + +var envoyfiltersResource = schema.GroupVersionResource{Group: "networking.istio.io", Version: "v1alpha3", Resource: "envoyfilters"} + +var envoyfiltersKind = schema.GroupVersionKind{Group: "networking.istio.io", Version: "v1alpha3", Kind: "EnvoyFilter"} + +// Get takes name of the envoyFilter, and returns the corresponding envoyFilter object, and an error if there is any. +func (c *FakeEnvoyFilters) Get(name string, options v1.GetOptions) (result *v1alpha3.EnvoyFilter, err error) { + obj, err := c.Fake. + Invokes(testing.NewGetAction(envoyfiltersResource, c.ns, name), &v1alpha3.EnvoyFilter{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha3.EnvoyFilter), err +} + +// List takes label and field selectors, and returns the list of EnvoyFilters that match those selectors. +func (c *FakeEnvoyFilters) List(opts v1.ListOptions) (result *v1alpha3.EnvoyFilterList, err error) { + obj, err := c.Fake. + Invokes(testing.NewListAction(envoyfiltersResource, envoyfiltersKind, c.ns, opts), &v1alpha3.EnvoyFilterList{}) + + if obj == nil { + return nil, err + } + + label, _, _ := testing.ExtractFromListOptions(opts) + if label == nil { + label = labels.Everything() + } + list := &v1alpha3.EnvoyFilterList{ListMeta: obj.(*v1alpha3.EnvoyFilterList).ListMeta} + for _, item := range obj.(*v1alpha3.EnvoyFilterList).Items { + if label.Matches(labels.Set(item.Labels)) { + list.Items = append(list.Items, item) + } + } + return list, err +} + +// Watch returns a watch.Interface that watches the requested envoyFilters. +func (c *FakeEnvoyFilters) Watch(opts v1.ListOptions) (watch.Interface, error) { + return c.Fake. + InvokesWatch(testing.NewWatchAction(envoyfiltersResource, c.ns, opts)) + +} + +// Create takes the representation of a envoyFilter and creates it. Returns the server's representation of the envoyFilter, and an error, if there is any. +func (c *FakeEnvoyFilters) Create(envoyFilter *v1alpha3.EnvoyFilter) (result *v1alpha3.EnvoyFilter, err error) { + obj, err := c.Fake. + Invokes(testing.NewCreateAction(envoyfiltersResource, c.ns, envoyFilter), &v1alpha3.EnvoyFilter{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha3.EnvoyFilter), err +} + +// Update takes the representation of a envoyFilter and updates it. Returns the server's representation of the envoyFilter, and an error, if there is any. +func (c *FakeEnvoyFilters) Update(envoyFilter *v1alpha3.EnvoyFilter) (result *v1alpha3.EnvoyFilter, err error) { + obj, err := c.Fake. + Invokes(testing.NewUpdateAction(envoyfiltersResource, c.ns, envoyFilter), &v1alpha3.EnvoyFilter{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha3.EnvoyFilter), err +} + +// Delete takes name of the envoyFilter and deletes it. Returns an error if one occurs. +func (c *FakeEnvoyFilters) Delete(name string, options *v1.DeleteOptions) error { + _, err := c.Fake. + Invokes(testing.NewDeleteAction(envoyfiltersResource, c.ns, name), &v1alpha3.EnvoyFilter{}) + + return err +} + +// DeleteCollection deletes a collection of objects. +func (c *FakeEnvoyFilters) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { + action := testing.NewDeleteCollectionAction(envoyfiltersResource, c.ns, listOptions) + + _, err := c.Fake.Invokes(action, &v1alpha3.EnvoyFilterList{}) + return err +} + +// Patch applies the patch and returns the patched envoyFilter. +func (c *FakeEnvoyFilters) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.EnvoyFilter, err error) { + obj, err := c.Fake. + Invokes(testing.NewPatchSubresourceAction(envoyfiltersResource, c.ns, name, pt, data, subresources...), &v1alpha3.EnvoyFilter{}) + + if obj == nil { + return nil, err + } + return obj.(*v1alpha3.EnvoyFilter), err +} diff --git a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_gateway.go b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_gateway.go similarity index 75% rename from pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_gateway.go rename to pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_gateway.go index c252bcd96f..a04c805c3d 100644 --- a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_gateway.go +++ b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_gateway.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,29 +30,29 @@ import ( // FakeGateways implements GatewayInterface type FakeGateways struct { - Fake *FakeNetworkingV1beta1 + Fake *FakeNetworkingV1alpha3 ns string } -var gatewaysResource = schema.GroupVersionResource{Group: "networking.istio.io", Version: "v1beta1", Resource: "gateways"} +var gatewaysResource = schema.GroupVersionResource{Group: "networking.istio.io", Version: "v1alpha3", Resource: "gateways"} -var gatewaysKind = schema.GroupVersionKind{Group: "networking.istio.io", Version: "v1beta1", Kind: "Gateway"} +var gatewaysKind = schema.GroupVersionKind{Group: "networking.istio.io", Version: "v1alpha3", Kind: "Gateway"} // Get takes name of the gateway, and returns the corresponding gateway object, and an error if there is any. -func (c *FakeGateways) Get(name string, options v1.GetOptions) (result *v1beta1.Gateway, err error) { +func (c *FakeGateways) Get(name string, options v1.GetOptions) (result *v1alpha3.Gateway, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(gatewaysResource, c.ns, name), &v1beta1.Gateway{}) + Invokes(testing.NewGetAction(gatewaysResource, c.ns, name), &v1alpha3.Gateway{}) if obj == nil { return nil, err } - return obj.(*v1beta1.Gateway), err + return obj.(*v1alpha3.Gateway), err } // List takes label and field selectors, and returns the list of Gateways that match those selectors. -func (c *FakeGateways) List(opts v1.ListOptions) (result *v1beta1.GatewayList, err error) { +func (c *FakeGateways) List(opts v1.ListOptions) (result *v1alpha3.GatewayList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(gatewaysResource, gatewaysKind, c.ns, opts), &v1beta1.GatewayList{}) + Invokes(testing.NewListAction(gatewaysResource, gatewaysKind, c.ns, opts), &v1alpha3.GatewayList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeGateways) List(opts v1.ListOptions) (result *v1beta1.GatewayList, e if label == nil { label = labels.Everything() } - list := &v1beta1.GatewayList{ListMeta: obj.(*v1beta1.GatewayList).ListMeta} - for _, item := range obj.(*v1beta1.GatewayList).Items { + list := &v1alpha3.GatewayList{ListMeta: obj.(*v1alpha3.GatewayList).ListMeta} + for _, item := range obj.(*v1alpha3.GatewayList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,31 +79,31 @@ func (c *FakeGateways) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a gateway and creates it. Returns the server's representation of the gateway, and an error, if there is any. -func (c *FakeGateways) Create(gateway *v1beta1.Gateway) (result *v1beta1.Gateway, err error) { +func (c *FakeGateways) Create(gateway *v1alpha3.Gateway) (result *v1alpha3.Gateway, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(gatewaysResource, c.ns, gateway), &v1beta1.Gateway{}) + Invokes(testing.NewCreateAction(gatewaysResource, c.ns, gateway), &v1alpha3.Gateway{}) if obj == nil { return nil, err } - return obj.(*v1beta1.Gateway), err + return obj.(*v1alpha3.Gateway), err } // Update takes the representation of a gateway and updates it. Returns the server's representation of the gateway, and an error, if there is any. -func (c *FakeGateways) Update(gateway *v1beta1.Gateway) (result *v1beta1.Gateway, err error) { +func (c *FakeGateways) Update(gateway *v1alpha3.Gateway) (result *v1alpha3.Gateway, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(gatewaysResource, c.ns, gateway), &v1beta1.Gateway{}) + Invokes(testing.NewUpdateAction(gatewaysResource, c.ns, gateway), &v1alpha3.Gateway{}) if obj == nil { return nil, err } - return obj.(*v1beta1.Gateway), err + return obj.(*v1alpha3.Gateway), err } // Delete takes name of the gateway and deletes it. Returns an error if one occurs. func (c *FakeGateways) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(gatewaysResource, c.ns, name), &v1beta1.Gateway{}) + Invokes(testing.NewDeleteAction(gatewaysResource, c.ns, name), &v1alpha3.Gateway{}) return err } @@ -112,17 +112,17 @@ func (c *FakeGateways) Delete(name string, options *v1.DeleteOptions) error { func (c *FakeGateways) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(gatewaysResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &v1beta1.GatewayList{}) + _, err := c.Fake.Invokes(action, &v1alpha3.GatewayList{}) return err } // Patch applies the patch and returns the patched gateway. -func (c *FakeGateways) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Gateway, err error) { +func (c *FakeGateways) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.Gateway, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(gatewaysResource, c.ns, name, pt, data, subresources...), &v1beta1.Gateway{}) + Invokes(testing.NewPatchSubresourceAction(gatewaysResource, c.ns, name, pt, data, subresources...), &v1alpha3.Gateway{}) if obj == nil { return nil, err } - return obj.(*v1beta1.Gateway), err + return obj.(*v1alpha3.Gateway), err } diff --git a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_networking_client.go b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_networking_client.go similarity index 55% rename from pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_networking_client.go rename to pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_networking_client.go index bf47fe8ab2..abf20dec4a 100644 --- a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_networking_client.go +++ b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_networking_client.go @@ -21,40 +21,44 @@ package fake import ( rest "k8s.io/client-go/rest" testing "k8s.io/client-go/testing" - v1beta1 "knative.dev/net-istio/pkg/client/istio/clientset/versioned/typed/networking/v1beta1" + v1alpha3 "knative.dev/net-istio/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3" ) -type FakeNetworkingV1beta1 struct { +type FakeNetworkingV1alpha3 struct { *testing.Fake } -func (c *FakeNetworkingV1beta1) DestinationRules(namespace string) v1beta1.DestinationRuleInterface { +func (c *FakeNetworkingV1alpha3) DestinationRules(namespace string) v1alpha3.DestinationRuleInterface { return &FakeDestinationRules{c, namespace} } -func (c *FakeNetworkingV1beta1) Gateways(namespace string) v1beta1.GatewayInterface { +func (c *FakeNetworkingV1alpha3) EnvoyFilters(namespace string) v1alpha3.EnvoyFilterInterface { + return &FakeEnvoyFilters{c, namespace} +} + +func (c *FakeNetworkingV1alpha3) Gateways(namespace string) v1alpha3.GatewayInterface { return &FakeGateways{c, namespace} } -func (c *FakeNetworkingV1beta1) ServiceEntries(namespace string) v1beta1.ServiceEntryInterface { +func (c *FakeNetworkingV1alpha3) ServiceEntries(namespace string) v1alpha3.ServiceEntryInterface { return &FakeServiceEntries{c, namespace} } -func (c *FakeNetworkingV1beta1) Sidecars(namespace string) v1beta1.SidecarInterface { +func (c *FakeNetworkingV1alpha3) Sidecars(namespace string) v1alpha3.SidecarInterface { return &FakeSidecars{c, namespace} } -func (c *FakeNetworkingV1beta1) VirtualServices(namespace string) v1beta1.VirtualServiceInterface { +func (c *FakeNetworkingV1alpha3) VirtualServices(namespace string) v1alpha3.VirtualServiceInterface { return &FakeVirtualServices{c, namespace} } -func (c *FakeNetworkingV1beta1) WorkloadEntries(namespace string) v1beta1.WorkloadEntryInterface { +func (c *FakeNetworkingV1alpha3) WorkloadEntries(namespace string) v1alpha3.WorkloadEntryInterface { return &FakeWorkloadEntries{c, namespace} } // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *FakeNetworkingV1beta1) RESTClient() rest.Interface { +func (c *FakeNetworkingV1alpha3) RESTClient() rest.Interface { var ret *rest.RESTClient return ret } diff --git a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_serviceentry.go b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_serviceentry.go similarity index 73% rename from pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_serviceentry.go rename to pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_serviceentry.go index 58a321bb90..470bceaffd 100644 --- a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_serviceentry.go +++ b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_serviceentry.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,29 +30,29 @@ import ( // FakeServiceEntries implements ServiceEntryInterface type FakeServiceEntries struct { - Fake *FakeNetworkingV1beta1 + Fake *FakeNetworkingV1alpha3 ns string } -var serviceentriesResource = schema.GroupVersionResource{Group: "networking.istio.io", Version: "v1beta1", Resource: "serviceentries"} +var serviceentriesResource = schema.GroupVersionResource{Group: "networking.istio.io", Version: "v1alpha3", Resource: "serviceentries"} -var serviceentriesKind = schema.GroupVersionKind{Group: "networking.istio.io", Version: "v1beta1", Kind: "ServiceEntry"} +var serviceentriesKind = schema.GroupVersionKind{Group: "networking.istio.io", Version: "v1alpha3", Kind: "ServiceEntry"} // Get takes name of the serviceEntry, and returns the corresponding serviceEntry object, and an error if there is any. -func (c *FakeServiceEntries) Get(name string, options v1.GetOptions) (result *v1beta1.ServiceEntry, err error) { +func (c *FakeServiceEntries) Get(name string, options v1.GetOptions) (result *v1alpha3.ServiceEntry, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(serviceentriesResource, c.ns, name), &v1beta1.ServiceEntry{}) + Invokes(testing.NewGetAction(serviceentriesResource, c.ns, name), &v1alpha3.ServiceEntry{}) if obj == nil { return nil, err } - return obj.(*v1beta1.ServiceEntry), err + return obj.(*v1alpha3.ServiceEntry), err } // List takes label and field selectors, and returns the list of ServiceEntries that match those selectors. -func (c *FakeServiceEntries) List(opts v1.ListOptions) (result *v1beta1.ServiceEntryList, err error) { +func (c *FakeServiceEntries) List(opts v1.ListOptions) (result *v1alpha3.ServiceEntryList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(serviceentriesResource, serviceentriesKind, c.ns, opts), &v1beta1.ServiceEntryList{}) + Invokes(testing.NewListAction(serviceentriesResource, serviceentriesKind, c.ns, opts), &v1alpha3.ServiceEntryList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeServiceEntries) List(opts v1.ListOptions) (result *v1beta1.ServiceE if label == nil { label = labels.Everything() } - list := &v1beta1.ServiceEntryList{ListMeta: obj.(*v1beta1.ServiceEntryList).ListMeta} - for _, item := range obj.(*v1beta1.ServiceEntryList).Items { + list := &v1alpha3.ServiceEntryList{ListMeta: obj.(*v1alpha3.ServiceEntryList).ListMeta} + for _, item := range obj.(*v1alpha3.ServiceEntryList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,31 +79,31 @@ func (c *FakeServiceEntries) Watch(opts v1.ListOptions) (watch.Interface, error) } // Create takes the representation of a serviceEntry and creates it. Returns the server's representation of the serviceEntry, and an error, if there is any. -func (c *FakeServiceEntries) Create(serviceEntry *v1beta1.ServiceEntry) (result *v1beta1.ServiceEntry, err error) { +func (c *FakeServiceEntries) Create(serviceEntry *v1alpha3.ServiceEntry) (result *v1alpha3.ServiceEntry, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(serviceentriesResource, c.ns, serviceEntry), &v1beta1.ServiceEntry{}) + Invokes(testing.NewCreateAction(serviceentriesResource, c.ns, serviceEntry), &v1alpha3.ServiceEntry{}) if obj == nil { return nil, err } - return obj.(*v1beta1.ServiceEntry), err + return obj.(*v1alpha3.ServiceEntry), err } // Update takes the representation of a serviceEntry and updates it. Returns the server's representation of the serviceEntry, and an error, if there is any. -func (c *FakeServiceEntries) Update(serviceEntry *v1beta1.ServiceEntry) (result *v1beta1.ServiceEntry, err error) { +func (c *FakeServiceEntries) Update(serviceEntry *v1alpha3.ServiceEntry) (result *v1alpha3.ServiceEntry, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(serviceentriesResource, c.ns, serviceEntry), &v1beta1.ServiceEntry{}) + Invokes(testing.NewUpdateAction(serviceentriesResource, c.ns, serviceEntry), &v1alpha3.ServiceEntry{}) if obj == nil { return nil, err } - return obj.(*v1beta1.ServiceEntry), err + return obj.(*v1alpha3.ServiceEntry), err } // Delete takes name of the serviceEntry and deletes it. Returns an error if one occurs. func (c *FakeServiceEntries) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(serviceentriesResource, c.ns, name), &v1beta1.ServiceEntry{}) + Invokes(testing.NewDeleteAction(serviceentriesResource, c.ns, name), &v1alpha3.ServiceEntry{}) return err } @@ -112,17 +112,17 @@ func (c *FakeServiceEntries) Delete(name string, options *v1.DeleteOptions) erro func (c *FakeServiceEntries) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(serviceentriesResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &v1beta1.ServiceEntryList{}) + _, err := c.Fake.Invokes(action, &v1alpha3.ServiceEntryList{}) return err } // Patch applies the patch and returns the patched serviceEntry. -func (c *FakeServiceEntries) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ServiceEntry, err error) { +func (c *FakeServiceEntries) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.ServiceEntry, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(serviceentriesResource, c.ns, name, pt, data, subresources...), &v1beta1.ServiceEntry{}) + Invokes(testing.NewPatchSubresourceAction(serviceentriesResource, c.ns, name, pt, data, subresources...), &v1alpha3.ServiceEntry{}) if obj == nil { return nil, err } - return obj.(*v1beta1.ServiceEntry), err + return obj.(*v1alpha3.ServiceEntry), err } diff --git a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_sidecar.go b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_sidecar.go similarity index 75% rename from pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_sidecar.go rename to pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_sidecar.go index 7d474d03c9..230dfbdcf2 100644 --- a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_sidecar.go +++ b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_sidecar.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,29 +30,29 @@ import ( // FakeSidecars implements SidecarInterface type FakeSidecars struct { - Fake *FakeNetworkingV1beta1 + Fake *FakeNetworkingV1alpha3 ns string } -var sidecarsResource = schema.GroupVersionResource{Group: "networking.istio.io", Version: "v1beta1", Resource: "sidecars"} +var sidecarsResource = schema.GroupVersionResource{Group: "networking.istio.io", Version: "v1alpha3", Resource: "sidecars"} -var sidecarsKind = schema.GroupVersionKind{Group: "networking.istio.io", Version: "v1beta1", Kind: "Sidecar"} +var sidecarsKind = schema.GroupVersionKind{Group: "networking.istio.io", Version: "v1alpha3", Kind: "Sidecar"} // Get takes name of the sidecar, and returns the corresponding sidecar object, and an error if there is any. -func (c *FakeSidecars) Get(name string, options v1.GetOptions) (result *v1beta1.Sidecar, err error) { +func (c *FakeSidecars) Get(name string, options v1.GetOptions) (result *v1alpha3.Sidecar, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(sidecarsResource, c.ns, name), &v1beta1.Sidecar{}) + Invokes(testing.NewGetAction(sidecarsResource, c.ns, name), &v1alpha3.Sidecar{}) if obj == nil { return nil, err } - return obj.(*v1beta1.Sidecar), err + return obj.(*v1alpha3.Sidecar), err } // List takes label and field selectors, and returns the list of Sidecars that match those selectors. -func (c *FakeSidecars) List(opts v1.ListOptions) (result *v1beta1.SidecarList, err error) { +func (c *FakeSidecars) List(opts v1.ListOptions) (result *v1alpha3.SidecarList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(sidecarsResource, sidecarsKind, c.ns, opts), &v1beta1.SidecarList{}) + Invokes(testing.NewListAction(sidecarsResource, sidecarsKind, c.ns, opts), &v1alpha3.SidecarList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeSidecars) List(opts v1.ListOptions) (result *v1beta1.SidecarList, e if label == nil { label = labels.Everything() } - list := &v1beta1.SidecarList{ListMeta: obj.(*v1beta1.SidecarList).ListMeta} - for _, item := range obj.(*v1beta1.SidecarList).Items { + list := &v1alpha3.SidecarList{ListMeta: obj.(*v1alpha3.SidecarList).ListMeta} + for _, item := range obj.(*v1alpha3.SidecarList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,31 +79,31 @@ func (c *FakeSidecars) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a sidecar and creates it. Returns the server's representation of the sidecar, and an error, if there is any. -func (c *FakeSidecars) Create(sidecar *v1beta1.Sidecar) (result *v1beta1.Sidecar, err error) { +func (c *FakeSidecars) Create(sidecar *v1alpha3.Sidecar) (result *v1alpha3.Sidecar, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(sidecarsResource, c.ns, sidecar), &v1beta1.Sidecar{}) + Invokes(testing.NewCreateAction(sidecarsResource, c.ns, sidecar), &v1alpha3.Sidecar{}) if obj == nil { return nil, err } - return obj.(*v1beta1.Sidecar), err + return obj.(*v1alpha3.Sidecar), err } // Update takes the representation of a sidecar and updates it. Returns the server's representation of the sidecar, and an error, if there is any. -func (c *FakeSidecars) Update(sidecar *v1beta1.Sidecar) (result *v1beta1.Sidecar, err error) { +func (c *FakeSidecars) Update(sidecar *v1alpha3.Sidecar) (result *v1alpha3.Sidecar, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(sidecarsResource, c.ns, sidecar), &v1beta1.Sidecar{}) + Invokes(testing.NewUpdateAction(sidecarsResource, c.ns, sidecar), &v1alpha3.Sidecar{}) if obj == nil { return nil, err } - return obj.(*v1beta1.Sidecar), err + return obj.(*v1alpha3.Sidecar), err } // Delete takes name of the sidecar and deletes it. Returns an error if one occurs. func (c *FakeSidecars) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(sidecarsResource, c.ns, name), &v1beta1.Sidecar{}) + Invokes(testing.NewDeleteAction(sidecarsResource, c.ns, name), &v1alpha3.Sidecar{}) return err } @@ -112,17 +112,17 @@ func (c *FakeSidecars) Delete(name string, options *v1.DeleteOptions) error { func (c *FakeSidecars) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(sidecarsResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &v1beta1.SidecarList{}) + _, err := c.Fake.Invokes(action, &v1alpha3.SidecarList{}) return err } // Patch applies the patch and returns the patched sidecar. -func (c *FakeSidecars) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Sidecar, err error) { +func (c *FakeSidecars) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.Sidecar, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(sidecarsResource, c.ns, name, pt, data, subresources...), &v1beta1.Sidecar{}) + Invokes(testing.NewPatchSubresourceAction(sidecarsResource, c.ns, name, pt, data, subresources...), &v1alpha3.Sidecar{}) if obj == nil { return nil, err } - return obj.(*v1beta1.Sidecar), err + return obj.(*v1alpha3.Sidecar), err } diff --git a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_virtualservice.go b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_virtualservice.go similarity index 72% rename from pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_virtualservice.go rename to pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_virtualservice.go index a253b0e2cf..16dc607e02 100644 --- a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_virtualservice.go +++ b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_virtualservice.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,29 +30,29 @@ import ( // FakeVirtualServices implements VirtualServiceInterface type FakeVirtualServices struct { - Fake *FakeNetworkingV1beta1 + Fake *FakeNetworkingV1alpha3 ns string } -var virtualservicesResource = schema.GroupVersionResource{Group: "networking.istio.io", Version: "v1beta1", Resource: "virtualservices"} +var virtualservicesResource = schema.GroupVersionResource{Group: "networking.istio.io", Version: "v1alpha3", Resource: "virtualservices"} -var virtualservicesKind = schema.GroupVersionKind{Group: "networking.istio.io", Version: "v1beta1", Kind: "VirtualService"} +var virtualservicesKind = schema.GroupVersionKind{Group: "networking.istio.io", Version: "v1alpha3", Kind: "VirtualService"} // Get takes name of the virtualService, and returns the corresponding virtualService object, and an error if there is any. -func (c *FakeVirtualServices) Get(name string, options v1.GetOptions) (result *v1beta1.VirtualService, err error) { +func (c *FakeVirtualServices) Get(name string, options v1.GetOptions) (result *v1alpha3.VirtualService, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(virtualservicesResource, c.ns, name), &v1beta1.VirtualService{}) + Invokes(testing.NewGetAction(virtualservicesResource, c.ns, name), &v1alpha3.VirtualService{}) if obj == nil { return nil, err } - return obj.(*v1beta1.VirtualService), err + return obj.(*v1alpha3.VirtualService), err } // List takes label and field selectors, and returns the list of VirtualServices that match those selectors. -func (c *FakeVirtualServices) List(opts v1.ListOptions) (result *v1beta1.VirtualServiceList, err error) { +func (c *FakeVirtualServices) List(opts v1.ListOptions) (result *v1alpha3.VirtualServiceList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(virtualservicesResource, virtualservicesKind, c.ns, opts), &v1beta1.VirtualServiceList{}) + Invokes(testing.NewListAction(virtualservicesResource, virtualservicesKind, c.ns, opts), &v1alpha3.VirtualServiceList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeVirtualServices) List(opts v1.ListOptions) (result *v1beta1.Virtual if label == nil { label = labels.Everything() } - list := &v1beta1.VirtualServiceList{ListMeta: obj.(*v1beta1.VirtualServiceList).ListMeta} - for _, item := range obj.(*v1beta1.VirtualServiceList).Items { + list := &v1alpha3.VirtualServiceList{ListMeta: obj.(*v1alpha3.VirtualServiceList).ListMeta} + for _, item := range obj.(*v1alpha3.VirtualServiceList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,31 +79,31 @@ func (c *FakeVirtualServices) Watch(opts v1.ListOptions) (watch.Interface, error } // Create takes the representation of a virtualService and creates it. Returns the server's representation of the virtualService, and an error, if there is any. -func (c *FakeVirtualServices) Create(virtualService *v1beta1.VirtualService) (result *v1beta1.VirtualService, err error) { +func (c *FakeVirtualServices) Create(virtualService *v1alpha3.VirtualService) (result *v1alpha3.VirtualService, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(virtualservicesResource, c.ns, virtualService), &v1beta1.VirtualService{}) + Invokes(testing.NewCreateAction(virtualservicesResource, c.ns, virtualService), &v1alpha3.VirtualService{}) if obj == nil { return nil, err } - return obj.(*v1beta1.VirtualService), err + return obj.(*v1alpha3.VirtualService), err } // Update takes the representation of a virtualService and updates it. Returns the server's representation of the virtualService, and an error, if there is any. -func (c *FakeVirtualServices) Update(virtualService *v1beta1.VirtualService) (result *v1beta1.VirtualService, err error) { +func (c *FakeVirtualServices) Update(virtualService *v1alpha3.VirtualService) (result *v1alpha3.VirtualService, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(virtualservicesResource, c.ns, virtualService), &v1beta1.VirtualService{}) + Invokes(testing.NewUpdateAction(virtualservicesResource, c.ns, virtualService), &v1alpha3.VirtualService{}) if obj == nil { return nil, err } - return obj.(*v1beta1.VirtualService), err + return obj.(*v1alpha3.VirtualService), err } // Delete takes name of the virtualService and deletes it. Returns an error if one occurs. func (c *FakeVirtualServices) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(virtualservicesResource, c.ns, name), &v1beta1.VirtualService{}) + Invokes(testing.NewDeleteAction(virtualservicesResource, c.ns, name), &v1alpha3.VirtualService{}) return err } @@ -112,17 +112,17 @@ func (c *FakeVirtualServices) Delete(name string, options *v1.DeleteOptions) err func (c *FakeVirtualServices) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(virtualservicesResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &v1beta1.VirtualServiceList{}) + _, err := c.Fake.Invokes(action, &v1alpha3.VirtualServiceList{}) return err } // Patch applies the patch and returns the patched virtualService. -func (c *FakeVirtualServices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.VirtualService, err error) { +func (c *FakeVirtualServices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.VirtualService, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(virtualservicesResource, c.ns, name, pt, data, subresources...), &v1beta1.VirtualService{}) + Invokes(testing.NewPatchSubresourceAction(virtualservicesResource, c.ns, name, pt, data, subresources...), &v1alpha3.VirtualService{}) if obj == nil { return nil, err } - return obj.(*v1beta1.VirtualService), err + return obj.(*v1alpha3.VirtualService), err } diff --git a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_workloadentry.go b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_workloadentry.go similarity index 72% rename from pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_workloadentry.go rename to pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_workloadentry.go index 0ee4086780..b33f5dbf99 100644 --- a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/fake/fake_workloadentry.go +++ b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/fake/fake_workloadentry.go @@ -19,7 +19,7 @@ limitations under the License. package fake import ( - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" @@ -30,29 +30,29 @@ import ( // FakeWorkloadEntries implements WorkloadEntryInterface type FakeWorkloadEntries struct { - Fake *FakeNetworkingV1beta1 + Fake *FakeNetworkingV1alpha3 ns string } -var workloadentriesResource = schema.GroupVersionResource{Group: "networking.istio.io", Version: "v1beta1", Resource: "workloadentries"} +var workloadentriesResource = schema.GroupVersionResource{Group: "networking.istio.io", Version: "v1alpha3", Resource: "workloadentries"} -var workloadentriesKind = schema.GroupVersionKind{Group: "networking.istio.io", Version: "v1beta1", Kind: "WorkloadEntry"} +var workloadentriesKind = schema.GroupVersionKind{Group: "networking.istio.io", Version: "v1alpha3", Kind: "WorkloadEntry"} // Get takes name of the workloadEntry, and returns the corresponding workloadEntry object, and an error if there is any. -func (c *FakeWorkloadEntries) Get(name string, options v1.GetOptions) (result *v1beta1.WorkloadEntry, err error) { +func (c *FakeWorkloadEntries) Get(name string, options v1.GetOptions) (result *v1alpha3.WorkloadEntry, err error) { obj, err := c.Fake. - Invokes(testing.NewGetAction(workloadentriesResource, c.ns, name), &v1beta1.WorkloadEntry{}) + Invokes(testing.NewGetAction(workloadentriesResource, c.ns, name), &v1alpha3.WorkloadEntry{}) if obj == nil { return nil, err } - return obj.(*v1beta1.WorkloadEntry), err + return obj.(*v1alpha3.WorkloadEntry), err } // List takes label and field selectors, and returns the list of WorkloadEntries that match those selectors. -func (c *FakeWorkloadEntries) List(opts v1.ListOptions) (result *v1beta1.WorkloadEntryList, err error) { +func (c *FakeWorkloadEntries) List(opts v1.ListOptions) (result *v1alpha3.WorkloadEntryList, err error) { obj, err := c.Fake. - Invokes(testing.NewListAction(workloadentriesResource, workloadentriesKind, c.ns, opts), &v1beta1.WorkloadEntryList{}) + Invokes(testing.NewListAction(workloadentriesResource, workloadentriesKind, c.ns, opts), &v1alpha3.WorkloadEntryList{}) if obj == nil { return nil, err @@ -62,8 +62,8 @@ func (c *FakeWorkloadEntries) List(opts v1.ListOptions) (result *v1beta1.Workloa if label == nil { label = labels.Everything() } - list := &v1beta1.WorkloadEntryList{ListMeta: obj.(*v1beta1.WorkloadEntryList).ListMeta} - for _, item := range obj.(*v1beta1.WorkloadEntryList).Items { + list := &v1alpha3.WorkloadEntryList{ListMeta: obj.(*v1alpha3.WorkloadEntryList).ListMeta} + for _, item := range obj.(*v1alpha3.WorkloadEntryList).Items { if label.Matches(labels.Set(item.Labels)) { list.Items = append(list.Items, item) } @@ -79,31 +79,31 @@ func (c *FakeWorkloadEntries) Watch(opts v1.ListOptions) (watch.Interface, error } // Create takes the representation of a workloadEntry and creates it. Returns the server's representation of the workloadEntry, and an error, if there is any. -func (c *FakeWorkloadEntries) Create(workloadEntry *v1beta1.WorkloadEntry) (result *v1beta1.WorkloadEntry, err error) { +func (c *FakeWorkloadEntries) Create(workloadEntry *v1alpha3.WorkloadEntry) (result *v1alpha3.WorkloadEntry, err error) { obj, err := c.Fake. - Invokes(testing.NewCreateAction(workloadentriesResource, c.ns, workloadEntry), &v1beta1.WorkloadEntry{}) + Invokes(testing.NewCreateAction(workloadentriesResource, c.ns, workloadEntry), &v1alpha3.WorkloadEntry{}) if obj == nil { return nil, err } - return obj.(*v1beta1.WorkloadEntry), err + return obj.(*v1alpha3.WorkloadEntry), err } // Update takes the representation of a workloadEntry and updates it. Returns the server's representation of the workloadEntry, and an error, if there is any. -func (c *FakeWorkloadEntries) Update(workloadEntry *v1beta1.WorkloadEntry) (result *v1beta1.WorkloadEntry, err error) { +func (c *FakeWorkloadEntries) Update(workloadEntry *v1alpha3.WorkloadEntry) (result *v1alpha3.WorkloadEntry, err error) { obj, err := c.Fake. - Invokes(testing.NewUpdateAction(workloadentriesResource, c.ns, workloadEntry), &v1beta1.WorkloadEntry{}) + Invokes(testing.NewUpdateAction(workloadentriesResource, c.ns, workloadEntry), &v1alpha3.WorkloadEntry{}) if obj == nil { return nil, err } - return obj.(*v1beta1.WorkloadEntry), err + return obj.(*v1alpha3.WorkloadEntry), err } // Delete takes name of the workloadEntry and deletes it. Returns an error if one occurs. func (c *FakeWorkloadEntries) Delete(name string, options *v1.DeleteOptions) error { _, err := c.Fake. - Invokes(testing.NewDeleteAction(workloadentriesResource, c.ns, name), &v1beta1.WorkloadEntry{}) + Invokes(testing.NewDeleteAction(workloadentriesResource, c.ns, name), &v1alpha3.WorkloadEntry{}) return err } @@ -112,17 +112,17 @@ func (c *FakeWorkloadEntries) Delete(name string, options *v1.DeleteOptions) err func (c *FakeWorkloadEntries) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error { action := testing.NewDeleteCollectionAction(workloadentriesResource, c.ns, listOptions) - _, err := c.Fake.Invokes(action, &v1beta1.WorkloadEntryList{}) + _, err := c.Fake.Invokes(action, &v1alpha3.WorkloadEntryList{}) return err } // Patch applies the patch and returns the patched workloadEntry. -func (c *FakeWorkloadEntries) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.WorkloadEntry, err error) { +func (c *FakeWorkloadEntries) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.WorkloadEntry, err error) { obj, err := c.Fake. - Invokes(testing.NewPatchSubresourceAction(workloadentriesResource, c.ns, name, pt, data, subresources...), &v1beta1.WorkloadEntry{}) + Invokes(testing.NewPatchSubresourceAction(workloadentriesResource, c.ns, name, pt, data, subresources...), &v1alpha3.WorkloadEntry{}) if obj == nil { return nil, err } - return obj.(*v1beta1.WorkloadEntry), err + return obj.(*v1alpha3.WorkloadEntry), err } diff --git a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/gateway.go b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/gateway.go similarity index 81% rename from pkg/client/istio/clientset/versioned/typed/networking/v1beta1/gateway.go rename to pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/gateway.go index 8cf6b5142b..d59851b507 100644 --- a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/gateway.go +++ b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/gateway.go @@ -16,12 +16,12 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( "time" - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -37,14 +37,14 @@ type GatewaysGetter interface { // GatewayInterface has methods to work with Gateway resources. type GatewayInterface interface { - Create(*v1beta1.Gateway) (*v1beta1.Gateway, error) - Update(*v1beta1.Gateway) (*v1beta1.Gateway, error) + Create(*v1alpha3.Gateway) (*v1alpha3.Gateway, error) + Update(*v1alpha3.Gateway) (*v1alpha3.Gateway, error) Delete(name string, options *v1.DeleteOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.Gateway, error) - List(opts v1.ListOptions) (*v1beta1.GatewayList, error) + Get(name string, options v1.GetOptions) (*v1alpha3.Gateway, error) + List(opts v1.ListOptions) (*v1alpha3.GatewayList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Gateway, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.Gateway, err error) GatewayExpansion } @@ -55,7 +55,7 @@ type gateways struct { } // newGateways returns a Gateways -func newGateways(c *NetworkingV1beta1Client, namespace string) *gateways { +func newGateways(c *NetworkingV1alpha3Client, namespace string) *gateways { return &gateways{ client: c.RESTClient(), ns: namespace, @@ -63,8 +63,8 @@ func newGateways(c *NetworkingV1beta1Client, namespace string) *gateways { } // Get takes name of the gateway, and returns the corresponding gateway object, and an error if there is any. -func (c *gateways) Get(name string, options v1.GetOptions) (result *v1beta1.Gateway, err error) { - result = &v1beta1.Gateway{} +func (c *gateways) Get(name string, options v1.GetOptions) (result *v1alpha3.Gateway, err error) { + result = &v1alpha3.Gateway{} err = c.client.Get(). Namespace(c.ns). Resource("gateways"). @@ -76,12 +76,12 @@ func (c *gateways) Get(name string, options v1.GetOptions) (result *v1beta1.Gate } // List takes label and field selectors, and returns the list of Gateways that match those selectors. -func (c *gateways) List(opts v1.ListOptions) (result *v1beta1.GatewayList, err error) { +func (c *gateways) List(opts v1.ListOptions) (result *v1alpha3.GatewayList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1beta1.GatewayList{} + result = &v1alpha3.GatewayList{} err = c.client.Get(). Namespace(c.ns). Resource("gateways"). @@ -108,8 +108,8 @@ func (c *gateways) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a gateway and creates it. Returns the server's representation of the gateway, and an error, if there is any. -func (c *gateways) Create(gateway *v1beta1.Gateway) (result *v1beta1.Gateway, err error) { - result = &v1beta1.Gateway{} +func (c *gateways) Create(gateway *v1alpha3.Gateway) (result *v1alpha3.Gateway, err error) { + result = &v1alpha3.Gateway{} err = c.client.Post(). Namespace(c.ns). Resource("gateways"). @@ -120,8 +120,8 @@ func (c *gateways) Create(gateway *v1beta1.Gateway) (result *v1beta1.Gateway, er } // Update takes the representation of a gateway and updates it. Returns the server's representation of the gateway, and an error, if there is any. -func (c *gateways) Update(gateway *v1beta1.Gateway) (result *v1beta1.Gateway, err error) { - result = &v1beta1.Gateway{} +func (c *gateways) Update(gateway *v1alpha3.Gateway) (result *v1alpha3.Gateway, err error) { + result = &v1alpha3.Gateway{} err = c.client.Put(). Namespace(c.ns). Resource("gateways"). @@ -160,8 +160,8 @@ func (c *gateways) DeleteCollection(options *v1.DeleteOptions, listOptions v1.Li } // Patch applies the patch and returns the patched gateway. -func (c *gateways) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Gateway, err error) { - result = &v1beta1.Gateway{} +func (c *gateways) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.Gateway, err error) { + result = &v1alpha3.Gateway{} err = c.client.Patch(pt). Namespace(c.ns). Resource("gateways"). diff --git a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/generated_expansion.go b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/generated_expansion.go similarity index 93% rename from pkg/client/istio/clientset/versioned/typed/networking/v1beta1/generated_expansion.go rename to pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/generated_expansion.go index 30e082ec2a..60356aa543 100644 --- a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/generated_expansion.go +++ b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/generated_expansion.go @@ -16,10 +16,12 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 type DestinationRuleExpansion interface{} +type EnvoyFilterExpansion interface{} + type GatewayExpansion interface{} type ServiceEntryExpansion interface{} diff --git a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/networking_client.go b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/networking_client.go similarity index 54% rename from pkg/client/istio/clientset/versioned/typed/networking/v1beta1/networking_client.go rename to pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/networking_client.go index d402c246f9..4727552ba4 100644 --- a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/networking_client.go +++ b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/networking_client.go @@ -16,17 +16,18 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" rest "k8s.io/client-go/rest" "knative.dev/net-istio/pkg/client/istio/clientset/versioned/scheme" ) -type NetworkingV1beta1Interface interface { +type NetworkingV1alpha3Interface interface { RESTClient() rest.Interface DestinationRulesGetter + EnvoyFiltersGetter GatewaysGetter ServiceEntriesGetter SidecarsGetter @@ -34,37 +35,41 @@ type NetworkingV1beta1Interface interface { WorkloadEntriesGetter } -// NetworkingV1beta1Client is used to interact with features provided by the networking.istio.io group. -type NetworkingV1beta1Client struct { +// NetworkingV1alpha3Client is used to interact with features provided by the networking.istio.io group. +type NetworkingV1alpha3Client struct { restClient rest.Interface } -func (c *NetworkingV1beta1Client) DestinationRules(namespace string) DestinationRuleInterface { +func (c *NetworkingV1alpha3Client) DestinationRules(namespace string) DestinationRuleInterface { return newDestinationRules(c, namespace) } -func (c *NetworkingV1beta1Client) Gateways(namespace string) GatewayInterface { +func (c *NetworkingV1alpha3Client) EnvoyFilters(namespace string) EnvoyFilterInterface { + return newEnvoyFilters(c, namespace) +} + +func (c *NetworkingV1alpha3Client) Gateways(namespace string) GatewayInterface { return newGateways(c, namespace) } -func (c *NetworkingV1beta1Client) ServiceEntries(namespace string) ServiceEntryInterface { +func (c *NetworkingV1alpha3Client) ServiceEntries(namespace string) ServiceEntryInterface { return newServiceEntries(c, namespace) } -func (c *NetworkingV1beta1Client) Sidecars(namespace string) SidecarInterface { +func (c *NetworkingV1alpha3Client) Sidecars(namespace string) SidecarInterface { return newSidecars(c, namespace) } -func (c *NetworkingV1beta1Client) VirtualServices(namespace string) VirtualServiceInterface { +func (c *NetworkingV1alpha3Client) VirtualServices(namespace string) VirtualServiceInterface { return newVirtualServices(c, namespace) } -func (c *NetworkingV1beta1Client) WorkloadEntries(namespace string) WorkloadEntryInterface { +func (c *NetworkingV1alpha3Client) WorkloadEntries(namespace string) WorkloadEntryInterface { return newWorkloadEntries(c, namespace) } -// NewForConfig creates a new NetworkingV1beta1Client for the given config. -func NewForConfig(c *rest.Config) (*NetworkingV1beta1Client, error) { +// NewForConfig creates a new NetworkingV1alpha3Client for the given config. +func NewForConfig(c *rest.Config) (*NetworkingV1alpha3Client, error) { config := *c if err := setConfigDefaults(&config); err != nil { return nil, err @@ -73,12 +78,12 @@ func NewForConfig(c *rest.Config) (*NetworkingV1beta1Client, error) { if err != nil { return nil, err } - return &NetworkingV1beta1Client{client}, nil + return &NetworkingV1alpha3Client{client}, nil } -// NewForConfigOrDie creates a new NetworkingV1beta1Client for the given config and +// NewForConfigOrDie creates a new NetworkingV1alpha3Client for the given config and // panics if there is an error in the config. -func NewForConfigOrDie(c *rest.Config) *NetworkingV1beta1Client { +func NewForConfigOrDie(c *rest.Config) *NetworkingV1alpha3Client { client, err := NewForConfig(c) if err != nil { panic(err) @@ -86,13 +91,13 @@ func NewForConfigOrDie(c *rest.Config) *NetworkingV1beta1Client { return client } -// New creates a new NetworkingV1beta1Client for the given RESTClient. -func New(c rest.Interface) *NetworkingV1beta1Client { - return &NetworkingV1beta1Client{c} +// New creates a new NetworkingV1alpha3Client for the given RESTClient. +func New(c rest.Interface) *NetworkingV1alpha3Client { + return &NetworkingV1alpha3Client{c} } func setConfigDefaults(config *rest.Config) error { - gv := v1beta1.SchemeGroupVersion + gv := v1alpha3.SchemeGroupVersion config.GroupVersion = &gv config.APIPath = "/apis" config.NegotiatedSerializer = scheme.Codecs.WithoutConversion() @@ -106,7 +111,7 @@ func setConfigDefaults(config *rest.Config) error { // RESTClient returns a RESTClient that is used to communicate // with API server by this client implementation. -func (c *NetworkingV1beta1Client) RESTClient() rest.Interface { +func (c *NetworkingV1alpha3Client) RESTClient() rest.Interface { if c == nil { return nil } diff --git a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/serviceentry.go b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/serviceentry.go similarity index 80% rename from pkg/client/istio/clientset/versioned/typed/networking/v1beta1/serviceentry.go rename to pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/serviceentry.go index 3b68748071..4a1cfe3f36 100644 --- a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/serviceentry.go +++ b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/serviceentry.go @@ -16,12 +16,12 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( "time" - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -37,14 +37,14 @@ type ServiceEntriesGetter interface { // ServiceEntryInterface has methods to work with ServiceEntry resources. type ServiceEntryInterface interface { - Create(*v1beta1.ServiceEntry) (*v1beta1.ServiceEntry, error) - Update(*v1beta1.ServiceEntry) (*v1beta1.ServiceEntry, error) + Create(*v1alpha3.ServiceEntry) (*v1alpha3.ServiceEntry, error) + Update(*v1alpha3.ServiceEntry) (*v1alpha3.ServiceEntry, error) Delete(name string, options *v1.DeleteOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.ServiceEntry, error) - List(opts v1.ListOptions) (*v1beta1.ServiceEntryList, error) + Get(name string, options v1.GetOptions) (*v1alpha3.ServiceEntry, error) + List(opts v1.ListOptions) (*v1alpha3.ServiceEntryList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ServiceEntry, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.ServiceEntry, err error) ServiceEntryExpansion } @@ -55,7 +55,7 @@ type serviceEntries struct { } // newServiceEntries returns a ServiceEntries -func newServiceEntries(c *NetworkingV1beta1Client, namespace string) *serviceEntries { +func newServiceEntries(c *NetworkingV1alpha3Client, namespace string) *serviceEntries { return &serviceEntries{ client: c.RESTClient(), ns: namespace, @@ -63,8 +63,8 @@ func newServiceEntries(c *NetworkingV1beta1Client, namespace string) *serviceEnt } // Get takes name of the serviceEntry, and returns the corresponding serviceEntry object, and an error if there is any. -func (c *serviceEntries) Get(name string, options v1.GetOptions) (result *v1beta1.ServiceEntry, err error) { - result = &v1beta1.ServiceEntry{} +func (c *serviceEntries) Get(name string, options v1.GetOptions) (result *v1alpha3.ServiceEntry, err error) { + result = &v1alpha3.ServiceEntry{} err = c.client.Get(). Namespace(c.ns). Resource("serviceentries"). @@ -76,12 +76,12 @@ func (c *serviceEntries) Get(name string, options v1.GetOptions) (result *v1beta } // List takes label and field selectors, and returns the list of ServiceEntries that match those selectors. -func (c *serviceEntries) List(opts v1.ListOptions) (result *v1beta1.ServiceEntryList, err error) { +func (c *serviceEntries) List(opts v1.ListOptions) (result *v1alpha3.ServiceEntryList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1beta1.ServiceEntryList{} + result = &v1alpha3.ServiceEntryList{} err = c.client.Get(). Namespace(c.ns). Resource("serviceentries"). @@ -108,8 +108,8 @@ func (c *serviceEntries) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a serviceEntry and creates it. Returns the server's representation of the serviceEntry, and an error, if there is any. -func (c *serviceEntries) Create(serviceEntry *v1beta1.ServiceEntry) (result *v1beta1.ServiceEntry, err error) { - result = &v1beta1.ServiceEntry{} +func (c *serviceEntries) Create(serviceEntry *v1alpha3.ServiceEntry) (result *v1alpha3.ServiceEntry, err error) { + result = &v1alpha3.ServiceEntry{} err = c.client.Post(). Namespace(c.ns). Resource("serviceentries"). @@ -120,8 +120,8 @@ func (c *serviceEntries) Create(serviceEntry *v1beta1.ServiceEntry) (result *v1b } // Update takes the representation of a serviceEntry and updates it. Returns the server's representation of the serviceEntry, and an error, if there is any. -func (c *serviceEntries) Update(serviceEntry *v1beta1.ServiceEntry) (result *v1beta1.ServiceEntry, err error) { - result = &v1beta1.ServiceEntry{} +func (c *serviceEntries) Update(serviceEntry *v1alpha3.ServiceEntry) (result *v1alpha3.ServiceEntry, err error) { + result = &v1alpha3.ServiceEntry{} err = c.client.Put(). Namespace(c.ns). Resource("serviceentries"). @@ -160,8 +160,8 @@ func (c *serviceEntries) DeleteCollection(options *v1.DeleteOptions, listOptions } // Patch applies the patch and returns the patched serviceEntry. -func (c *serviceEntries) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ServiceEntry, err error) { - result = &v1beta1.ServiceEntry{} +func (c *serviceEntries) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.ServiceEntry, err error) { + result = &v1alpha3.ServiceEntry{} err = c.client.Patch(pt). Namespace(c.ns). Resource("serviceentries"). diff --git a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/sidecar.go b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/sidecar.go similarity index 81% rename from pkg/client/istio/clientset/versioned/typed/networking/v1beta1/sidecar.go rename to pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/sidecar.go index 80d84eccff..00b9abe879 100644 --- a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/sidecar.go +++ b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/sidecar.go @@ -16,12 +16,12 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( "time" - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -37,14 +37,14 @@ type SidecarsGetter interface { // SidecarInterface has methods to work with Sidecar resources. type SidecarInterface interface { - Create(*v1beta1.Sidecar) (*v1beta1.Sidecar, error) - Update(*v1beta1.Sidecar) (*v1beta1.Sidecar, error) + Create(*v1alpha3.Sidecar) (*v1alpha3.Sidecar, error) + Update(*v1alpha3.Sidecar) (*v1alpha3.Sidecar, error) Delete(name string, options *v1.DeleteOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.Sidecar, error) - List(opts v1.ListOptions) (*v1beta1.SidecarList, error) + Get(name string, options v1.GetOptions) (*v1alpha3.Sidecar, error) + List(opts v1.ListOptions) (*v1alpha3.SidecarList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Sidecar, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.Sidecar, err error) SidecarExpansion } @@ -55,7 +55,7 @@ type sidecars struct { } // newSidecars returns a Sidecars -func newSidecars(c *NetworkingV1beta1Client, namespace string) *sidecars { +func newSidecars(c *NetworkingV1alpha3Client, namespace string) *sidecars { return &sidecars{ client: c.RESTClient(), ns: namespace, @@ -63,8 +63,8 @@ func newSidecars(c *NetworkingV1beta1Client, namespace string) *sidecars { } // Get takes name of the sidecar, and returns the corresponding sidecar object, and an error if there is any. -func (c *sidecars) Get(name string, options v1.GetOptions) (result *v1beta1.Sidecar, err error) { - result = &v1beta1.Sidecar{} +func (c *sidecars) Get(name string, options v1.GetOptions) (result *v1alpha3.Sidecar, err error) { + result = &v1alpha3.Sidecar{} err = c.client.Get(). Namespace(c.ns). Resource("sidecars"). @@ -76,12 +76,12 @@ func (c *sidecars) Get(name string, options v1.GetOptions) (result *v1beta1.Side } // List takes label and field selectors, and returns the list of Sidecars that match those selectors. -func (c *sidecars) List(opts v1.ListOptions) (result *v1beta1.SidecarList, err error) { +func (c *sidecars) List(opts v1.ListOptions) (result *v1alpha3.SidecarList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1beta1.SidecarList{} + result = &v1alpha3.SidecarList{} err = c.client.Get(). Namespace(c.ns). Resource("sidecars"). @@ -108,8 +108,8 @@ func (c *sidecars) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a sidecar and creates it. Returns the server's representation of the sidecar, and an error, if there is any. -func (c *sidecars) Create(sidecar *v1beta1.Sidecar) (result *v1beta1.Sidecar, err error) { - result = &v1beta1.Sidecar{} +func (c *sidecars) Create(sidecar *v1alpha3.Sidecar) (result *v1alpha3.Sidecar, err error) { + result = &v1alpha3.Sidecar{} err = c.client.Post(). Namespace(c.ns). Resource("sidecars"). @@ -120,8 +120,8 @@ func (c *sidecars) Create(sidecar *v1beta1.Sidecar) (result *v1beta1.Sidecar, er } // Update takes the representation of a sidecar and updates it. Returns the server's representation of the sidecar, and an error, if there is any. -func (c *sidecars) Update(sidecar *v1beta1.Sidecar) (result *v1beta1.Sidecar, err error) { - result = &v1beta1.Sidecar{} +func (c *sidecars) Update(sidecar *v1alpha3.Sidecar) (result *v1alpha3.Sidecar, err error) { + result = &v1alpha3.Sidecar{} err = c.client.Put(). Namespace(c.ns). Resource("sidecars"). @@ -160,8 +160,8 @@ func (c *sidecars) DeleteCollection(options *v1.DeleteOptions, listOptions v1.Li } // Patch applies the patch and returns the patched sidecar. -func (c *sidecars) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Sidecar, err error) { - result = &v1beta1.Sidecar{} +func (c *sidecars) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.Sidecar, err error) { + result = &v1alpha3.Sidecar{} err = c.client.Patch(pt). Namespace(c.ns). Resource("sidecars"). diff --git a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/virtualservice.go b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/virtualservice.go similarity index 80% rename from pkg/client/istio/clientset/versioned/typed/networking/v1beta1/virtualservice.go rename to pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/virtualservice.go index 28a50b030c..59c043cd80 100644 --- a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/virtualservice.go +++ b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/virtualservice.go @@ -16,12 +16,12 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( "time" - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -37,14 +37,14 @@ type VirtualServicesGetter interface { // VirtualServiceInterface has methods to work with VirtualService resources. type VirtualServiceInterface interface { - Create(*v1beta1.VirtualService) (*v1beta1.VirtualService, error) - Update(*v1beta1.VirtualService) (*v1beta1.VirtualService, error) + Create(*v1alpha3.VirtualService) (*v1alpha3.VirtualService, error) + Update(*v1alpha3.VirtualService) (*v1alpha3.VirtualService, error) Delete(name string, options *v1.DeleteOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.VirtualService, error) - List(opts v1.ListOptions) (*v1beta1.VirtualServiceList, error) + Get(name string, options v1.GetOptions) (*v1alpha3.VirtualService, error) + List(opts v1.ListOptions) (*v1alpha3.VirtualServiceList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.VirtualService, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.VirtualService, err error) VirtualServiceExpansion } @@ -55,7 +55,7 @@ type virtualServices struct { } // newVirtualServices returns a VirtualServices -func newVirtualServices(c *NetworkingV1beta1Client, namespace string) *virtualServices { +func newVirtualServices(c *NetworkingV1alpha3Client, namespace string) *virtualServices { return &virtualServices{ client: c.RESTClient(), ns: namespace, @@ -63,8 +63,8 @@ func newVirtualServices(c *NetworkingV1beta1Client, namespace string) *virtualSe } // Get takes name of the virtualService, and returns the corresponding virtualService object, and an error if there is any. -func (c *virtualServices) Get(name string, options v1.GetOptions) (result *v1beta1.VirtualService, err error) { - result = &v1beta1.VirtualService{} +func (c *virtualServices) Get(name string, options v1.GetOptions) (result *v1alpha3.VirtualService, err error) { + result = &v1alpha3.VirtualService{} err = c.client.Get(). Namespace(c.ns). Resource("virtualservices"). @@ -76,12 +76,12 @@ func (c *virtualServices) Get(name string, options v1.GetOptions) (result *v1bet } // List takes label and field selectors, and returns the list of VirtualServices that match those selectors. -func (c *virtualServices) List(opts v1.ListOptions) (result *v1beta1.VirtualServiceList, err error) { +func (c *virtualServices) List(opts v1.ListOptions) (result *v1alpha3.VirtualServiceList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1beta1.VirtualServiceList{} + result = &v1alpha3.VirtualServiceList{} err = c.client.Get(). Namespace(c.ns). Resource("virtualservices"). @@ -108,8 +108,8 @@ func (c *virtualServices) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a virtualService and creates it. Returns the server's representation of the virtualService, and an error, if there is any. -func (c *virtualServices) Create(virtualService *v1beta1.VirtualService) (result *v1beta1.VirtualService, err error) { - result = &v1beta1.VirtualService{} +func (c *virtualServices) Create(virtualService *v1alpha3.VirtualService) (result *v1alpha3.VirtualService, err error) { + result = &v1alpha3.VirtualService{} err = c.client.Post(). Namespace(c.ns). Resource("virtualservices"). @@ -120,8 +120,8 @@ func (c *virtualServices) Create(virtualService *v1beta1.VirtualService) (result } // Update takes the representation of a virtualService and updates it. Returns the server's representation of the virtualService, and an error, if there is any. -func (c *virtualServices) Update(virtualService *v1beta1.VirtualService) (result *v1beta1.VirtualService, err error) { - result = &v1beta1.VirtualService{} +func (c *virtualServices) Update(virtualService *v1alpha3.VirtualService) (result *v1alpha3.VirtualService, err error) { + result = &v1alpha3.VirtualService{} err = c.client.Put(). Namespace(c.ns). Resource("virtualservices"). @@ -160,8 +160,8 @@ func (c *virtualServices) DeleteCollection(options *v1.DeleteOptions, listOption } // Patch applies the patch and returns the patched virtualService. -func (c *virtualServices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.VirtualService, err error) { - result = &v1beta1.VirtualService{} +func (c *virtualServices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.VirtualService, err error) { + result = &v1alpha3.VirtualService{} err = c.client.Patch(pt). Namespace(c.ns). Resource("virtualservices"). diff --git a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/workloadentry.go b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/workloadentry.go similarity index 80% rename from pkg/client/istio/clientset/versioned/typed/networking/v1beta1/workloadentry.go rename to pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/workloadentry.go index a221089705..3581da7fd8 100644 --- a/pkg/client/istio/clientset/versioned/typed/networking/v1beta1/workloadentry.go +++ b/pkg/client/istio/clientset/versioned/typed/networking/v1alpha3/workloadentry.go @@ -16,12 +16,12 @@ limitations under the License. // Code generated by client-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( "time" - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" @@ -37,14 +37,14 @@ type WorkloadEntriesGetter interface { // WorkloadEntryInterface has methods to work with WorkloadEntry resources. type WorkloadEntryInterface interface { - Create(*v1beta1.WorkloadEntry) (*v1beta1.WorkloadEntry, error) - Update(*v1beta1.WorkloadEntry) (*v1beta1.WorkloadEntry, error) + Create(*v1alpha3.WorkloadEntry) (*v1alpha3.WorkloadEntry, error) + Update(*v1alpha3.WorkloadEntry) (*v1alpha3.WorkloadEntry, error) Delete(name string, options *v1.DeleteOptions) error DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error - Get(name string, options v1.GetOptions) (*v1beta1.WorkloadEntry, error) - List(opts v1.ListOptions) (*v1beta1.WorkloadEntryList, error) + Get(name string, options v1.GetOptions) (*v1alpha3.WorkloadEntry, error) + List(opts v1.ListOptions) (*v1alpha3.WorkloadEntryList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.WorkloadEntry, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.WorkloadEntry, err error) WorkloadEntryExpansion } @@ -55,7 +55,7 @@ type workloadEntries struct { } // newWorkloadEntries returns a WorkloadEntries -func newWorkloadEntries(c *NetworkingV1beta1Client, namespace string) *workloadEntries { +func newWorkloadEntries(c *NetworkingV1alpha3Client, namespace string) *workloadEntries { return &workloadEntries{ client: c.RESTClient(), ns: namespace, @@ -63,8 +63,8 @@ func newWorkloadEntries(c *NetworkingV1beta1Client, namespace string) *workloadE } // Get takes name of the workloadEntry, and returns the corresponding workloadEntry object, and an error if there is any. -func (c *workloadEntries) Get(name string, options v1.GetOptions) (result *v1beta1.WorkloadEntry, err error) { - result = &v1beta1.WorkloadEntry{} +func (c *workloadEntries) Get(name string, options v1.GetOptions) (result *v1alpha3.WorkloadEntry, err error) { + result = &v1alpha3.WorkloadEntry{} err = c.client.Get(). Namespace(c.ns). Resource("workloadentries"). @@ -76,12 +76,12 @@ func (c *workloadEntries) Get(name string, options v1.GetOptions) (result *v1bet } // List takes label and field selectors, and returns the list of WorkloadEntries that match those selectors. -func (c *workloadEntries) List(opts v1.ListOptions) (result *v1beta1.WorkloadEntryList, err error) { +func (c *workloadEntries) List(opts v1.ListOptions) (result *v1alpha3.WorkloadEntryList, err error) { var timeout time.Duration if opts.TimeoutSeconds != nil { timeout = time.Duration(*opts.TimeoutSeconds) * time.Second } - result = &v1beta1.WorkloadEntryList{} + result = &v1alpha3.WorkloadEntryList{} err = c.client.Get(). Namespace(c.ns). Resource("workloadentries"). @@ -108,8 +108,8 @@ func (c *workloadEntries) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Create takes the representation of a workloadEntry and creates it. Returns the server's representation of the workloadEntry, and an error, if there is any. -func (c *workloadEntries) Create(workloadEntry *v1beta1.WorkloadEntry) (result *v1beta1.WorkloadEntry, err error) { - result = &v1beta1.WorkloadEntry{} +func (c *workloadEntries) Create(workloadEntry *v1alpha3.WorkloadEntry) (result *v1alpha3.WorkloadEntry, err error) { + result = &v1alpha3.WorkloadEntry{} err = c.client.Post(). Namespace(c.ns). Resource("workloadentries"). @@ -120,8 +120,8 @@ func (c *workloadEntries) Create(workloadEntry *v1beta1.WorkloadEntry) (result * } // Update takes the representation of a workloadEntry and updates it. Returns the server's representation of the workloadEntry, and an error, if there is any. -func (c *workloadEntries) Update(workloadEntry *v1beta1.WorkloadEntry) (result *v1beta1.WorkloadEntry, err error) { - result = &v1beta1.WorkloadEntry{} +func (c *workloadEntries) Update(workloadEntry *v1alpha3.WorkloadEntry) (result *v1alpha3.WorkloadEntry, err error) { + result = &v1alpha3.WorkloadEntry{} err = c.client.Put(). Namespace(c.ns). Resource("workloadentries"). @@ -160,8 +160,8 @@ func (c *workloadEntries) DeleteCollection(options *v1.DeleteOptions, listOption } // Patch applies the patch and returns the patched workloadEntry. -func (c *workloadEntries) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.WorkloadEntry, err error) { - result = &v1beta1.WorkloadEntry{} +func (c *workloadEntries) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha3.WorkloadEntry, err error) { + result = &v1alpha3.WorkloadEntry{} err = c.client.Patch(pt). Namespace(c.ns). Resource("workloadentries"). diff --git a/pkg/client/istio/informers/externalversions/generic.go b/pkg/client/istio/informers/externalversions/generic.go index c49a7b548c..76a89a3a55 100644 --- a/pkg/client/istio/informers/externalversions/generic.go +++ b/pkg/client/istio/informers/externalversions/generic.go @@ -21,7 +21,7 @@ package externalversions import ( "fmt" - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" schema "k8s.io/apimachinery/pkg/runtime/schema" cache "k8s.io/client-go/tools/cache" ) @@ -52,19 +52,21 @@ func (f *genericInformer) Lister() cache.GenericLister { // TODO extend this to unknown resources with a client pool func (f *sharedInformerFactory) ForResource(resource schema.GroupVersionResource) (GenericInformer, error) { switch resource { - // Group=networking.istio.io, Version=v1beta1 - case v1beta1.SchemeGroupVersion.WithResource("destinationrules"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().DestinationRules().Informer()}, nil - case v1beta1.SchemeGroupVersion.WithResource("gateways"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().Gateways().Informer()}, nil - case v1beta1.SchemeGroupVersion.WithResource("serviceentries"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().ServiceEntries().Informer()}, nil - case v1beta1.SchemeGroupVersion.WithResource("sidecars"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().Sidecars().Informer()}, nil - case v1beta1.SchemeGroupVersion.WithResource("virtualservices"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().VirtualServices().Informer()}, nil - case v1beta1.SchemeGroupVersion.WithResource("workloadentries"): - return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1beta1().WorkloadEntries().Informer()}, nil + // Group=networking.istio.io, Version=v1alpha3 + case v1alpha3.SchemeGroupVersion.WithResource("destinationrules"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha3().DestinationRules().Informer()}, nil + case v1alpha3.SchemeGroupVersion.WithResource("envoyfilters"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha3().EnvoyFilters().Informer()}, nil + case v1alpha3.SchemeGroupVersion.WithResource("gateways"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha3().Gateways().Informer()}, nil + case v1alpha3.SchemeGroupVersion.WithResource("serviceentries"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha3().ServiceEntries().Informer()}, nil + case v1alpha3.SchemeGroupVersion.WithResource("sidecars"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha3().Sidecars().Informer()}, nil + case v1alpha3.SchemeGroupVersion.WithResource("virtualservices"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha3().VirtualServices().Informer()}, nil + case v1alpha3.SchemeGroupVersion.WithResource("workloadentries"): + return &genericInformer{resource: resource.GroupResource(), informer: f.Networking().V1alpha3().WorkloadEntries().Informer()}, nil } diff --git a/pkg/client/istio/informers/externalversions/networking/interface.go b/pkg/client/istio/informers/externalversions/networking/interface.go index fd805f407b..8c3d752d27 100644 --- a/pkg/client/istio/informers/externalversions/networking/interface.go +++ b/pkg/client/istio/informers/externalversions/networking/interface.go @@ -20,13 +20,13 @@ package networking import ( internalinterfaces "knative.dev/net-istio/pkg/client/istio/informers/externalversions/internalinterfaces" - v1beta1 "knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1beta1" + v1alpha3 "knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1alpha3" ) // Interface provides access to each of this group's versions. type Interface interface { - // V1beta1 provides access to shared informers for resources in V1beta1. - V1beta1() v1beta1.Interface + // V1alpha3 provides access to shared informers for resources in V1alpha3. + V1alpha3() v1alpha3.Interface } type group struct { @@ -40,7 +40,7 @@ func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakList return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} } -// V1beta1 returns a new v1beta1.Interface. -func (g *group) V1beta1() v1beta1.Interface { - return v1beta1.New(g.factory, g.namespace, g.tweakListOptions) +// V1alpha3 returns a new v1alpha3.Interface. +func (g *group) V1alpha3() v1alpha3.Interface { + return v1alpha3.New(g.factory, g.namespace, g.tweakListOptions) } diff --git a/pkg/client/istio/informers/externalversions/networking/v1beta1/destinationrule.go b/pkg/client/istio/informers/externalversions/networking/v1alpha3/destinationrule.go similarity index 82% rename from pkg/client/istio/informers/externalversions/networking/v1beta1/destinationrule.go rename to pkg/client/istio/informers/externalversions/networking/v1alpha3/destinationrule.go index a382c1f4a6..52772e9777 100644 --- a/pkg/client/istio/informers/externalversions/networking/v1beta1/destinationrule.go +++ b/pkg/client/istio/informers/externalversions/networking/v1alpha3/destinationrule.go @@ -16,26 +16,26 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( time "time" - networkingv1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + networkingv1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" versioned "knative.dev/net-istio/pkg/client/istio/clientset/versioned" internalinterfaces "knative.dev/net-istio/pkg/client/istio/informers/externalversions/internalinterfaces" - v1beta1 "knative.dev/net-istio/pkg/client/istio/listers/networking/v1beta1" + v1alpha3 "knative.dev/net-istio/pkg/client/istio/listers/networking/v1alpha3" ) // DestinationRuleInformer provides access to a shared informer and lister for // DestinationRules. type DestinationRuleInformer interface { Informer() cache.SharedIndexInformer - Lister() v1beta1.DestinationRuleLister + Lister() v1alpha3.DestinationRuleLister } type destinationRuleInformer struct { @@ -61,16 +61,16 @@ func NewFilteredDestinationRuleInformer(client versioned.Interface, namespace st if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().DestinationRules(namespace).List(options) + return client.NetworkingV1alpha3().DestinationRules(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().DestinationRules(namespace).Watch(options) + return client.NetworkingV1alpha3().DestinationRules(namespace).Watch(options) }, }, - &networkingv1beta1.DestinationRule{}, + &networkingv1alpha3.DestinationRule{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *destinationRuleInformer) defaultInformer(client versioned.Interface, re } func (f *destinationRuleInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&networkingv1beta1.DestinationRule{}, f.defaultInformer) + return f.factory.InformerFor(&networkingv1alpha3.DestinationRule{}, f.defaultInformer) } -func (f *destinationRuleInformer) Lister() v1beta1.DestinationRuleLister { - return v1beta1.NewDestinationRuleLister(f.Informer().GetIndexer()) +func (f *destinationRuleInformer) Lister() v1alpha3.DestinationRuleLister { + return v1alpha3.NewDestinationRuleLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/istio/informers/externalversions/networking/v1alpha3/envoyfilter.go b/pkg/client/istio/informers/externalversions/networking/v1alpha3/envoyfilter.go new file mode 100644 index 0000000000..a60cf9ff67 --- /dev/null +++ b/pkg/client/istio/informers/externalversions/networking/v1alpha3/envoyfilter.go @@ -0,0 +1,89 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by informer-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + time "time" + + networkingv1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + runtime "k8s.io/apimachinery/pkg/runtime" + watch "k8s.io/apimachinery/pkg/watch" + cache "k8s.io/client-go/tools/cache" + versioned "knative.dev/net-istio/pkg/client/istio/clientset/versioned" + internalinterfaces "knative.dev/net-istio/pkg/client/istio/informers/externalversions/internalinterfaces" + v1alpha3 "knative.dev/net-istio/pkg/client/istio/listers/networking/v1alpha3" +) + +// EnvoyFilterInformer provides access to a shared informer and lister for +// EnvoyFilters. +type EnvoyFilterInformer interface { + Informer() cache.SharedIndexInformer + Lister() v1alpha3.EnvoyFilterLister +} + +type envoyFilterInformer struct { + factory internalinterfaces.SharedInformerFactory + tweakListOptions internalinterfaces.TweakListOptionsFunc + namespace string +} + +// NewEnvoyFilterInformer constructs a new informer for EnvoyFilter type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewEnvoyFilterInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers) cache.SharedIndexInformer { + return NewFilteredEnvoyFilterInformer(client, namespace, resyncPeriod, indexers, nil) +} + +// NewFilteredEnvoyFilterInformer constructs a new informer for EnvoyFilter type. +// Always prefer using an informer factory to get a shared informer instead of getting an independent +// one. This reduces memory footprint and number of connections to the server. +func NewFilteredEnvoyFilterInformer(client versioned.Interface, namespace string, resyncPeriod time.Duration, indexers cache.Indexers, tweakListOptions internalinterfaces.TweakListOptionsFunc) cache.SharedIndexInformer { + return cache.NewSharedIndexInformer( + &cache.ListWatch{ + ListFunc: func(options v1.ListOptions) (runtime.Object, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1alpha3().EnvoyFilters(namespace).List(options) + }, + WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { + if tweakListOptions != nil { + tweakListOptions(&options) + } + return client.NetworkingV1alpha3().EnvoyFilters(namespace).Watch(options) + }, + }, + &networkingv1alpha3.EnvoyFilter{}, + resyncPeriod, + indexers, + ) +} + +func (f *envoyFilterInformer) defaultInformer(client versioned.Interface, resyncPeriod time.Duration) cache.SharedIndexInformer { + return NewFilteredEnvoyFilterInformer(client, f.namespace, resyncPeriod, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, f.tweakListOptions) +} + +func (f *envoyFilterInformer) Informer() cache.SharedIndexInformer { + return f.factory.InformerFor(&networkingv1alpha3.EnvoyFilter{}, f.defaultInformer) +} + +func (f *envoyFilterInformer) Lister() v1alpha3.EnvoyFilterLister { + return v1alpha3.NewEnvoyFilterLister(f.Informer().GetIndexer()) +} diff --git a/pkg/client/istio/informers/externalversions/networking/v1beta1/gateway.go b/pkg/client/istio/informers/externalversions/networking/v1alpha3/gateway.go similarity index 84% rename from pkg/client/istio/informers/externalversions/networking/v1beta1/gateway.go rename to pkg/client/istio/informers/externalversions/networking/v1alpha3/gateway.go index e6e4c79d2b..7a04971e51 100644 --- a/pkg/client/istio/informers/externalversions/networking/v1beta1/gateway.go +++ b/pkg/client/istio/informers/externalversions/networking/v1alpha3/gateway.go @@ -16,26 +16,26 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( time "time" - networkingv1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + networkingv1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" versioned "knative.dev/net-istio/pkg/client/istio/clientset/versioned" internalinterfaces "knative.dev/net-istio/pkg/client/istio/informers/externalversions/internalinterfaces" - v1beta1 "knative.dev/net-istio/pkg/client/istio/listers/networking/v1beta1" + v1alpha3 "knative.dev/net-istio/pkg/client/istio/listers/networking/v1alpha3" ) // GatewayInformer provides access to a shared informer and lister for // Gateways. type GatewayInformer interface { Informer() cache.SharedIndexInformer - Lister() v1beta1.GatewayLister + Lister() v1alpha3.GatewayLister } type gatewayInformer struct { @@ -61,16 +61,16 @@ func NewFilteredGatewayInformer(client versioned.Interface, namespace string, re if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().Gateways(namespace).List(options) + return client.NetworkingV1alpha3().Gateways(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().Gateways(namespace).Watch(options) + return client.NetworkingV1alpha3().Gateways(namespace).Watch(options) }, }, - &networkingv1beta1.Gateway{}, + &networkingv1alpha3.Gateway{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *gatewayInformer) defaultInformer(client versioned.Interface, resyncPeri } func (f *gatewayInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&networkingv1beta1.Gateway{}, f.defaultInformer) + return f.factory.InformerFor(&networkingv1alpha3.Gateway{}, f.defaultInformer) } -func (f *gatewayInformer) Lister() v1beta1.GatewayLister { - return v1beta1.NewGatewayLister(f.Informer().GetIndexer()) +func (f *gatewayInformer) Lister() v1alpha3.GatewayLister { + return v1alpha3.NewGatewayLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/istio/informers/externalversions/networking/v1beta1/interface.go b/pkg/client/istio/informers/externalversions/networking/v1alpha3/interface.go similarity index 90% rename from pkg/client/istio/informers/externalversions/networking/v1beta1/interface.go rename to pkg/client/istio/informers/externalversions/networking/v1alpha3/interface.go index 17d9642a56..e6ed6da136 100644 --- a/pkg/client/istio/informers/externalversions/networking/v1beta1/interface.go +++ b/pkg/client/istio/informers/externalversions/networking/v1alpha3/interface.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( internalinterfaces "knative.dev/net-istio/pkg/client/istio/informers/externalversions/internalinterfaces" @@ -26,6 +26,8 @@ import ( type Interface interface { // DestinationRules returns a DestinationRuleInformer. DestinationRules() DestinationRuleInformer + // EnvoyFilters returns a EnvoyFilterInformer. + EnvoyFilters() EnvoyFilterInformer // Gateways returns a GatewayInformer. Gateways() GatewayInformer // ServiceEntries returns a ServiceEntryInformer. @@ -54,6 +56,11 @@ func (v *version) DestinationRules() DestinationRuleInformer { return &destinationRuleInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} } +// EnvoyFilters returns a EnvoyFilterInformer. +func (v *version) EnvoyFilters() EnvoyFilterInformer { + return &envoyFilterInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} +} + // Gateways returns a GatewayInformer. func (v *version) Gateways() GatewayInformer { return &gatewayInformer{factory: v.factory, namespace: v.namespace, tweakListOptions: v.tweakListOptions} diff --git a/pkg/client/istio/informers/externalversions/networking/v1beta1/serviceentry.go b/pkg/client/istio/informers/externalversions/networking/v1alpha3/serviceentry.go similarity index 83% rename from pkg/client/istio/informers/externalversions/networking/v1beta1/serviceentry.go rename to pkg/client/istio/informers/externalversions/networking/v1alpha3/serviceentry.go index 0c3af6ed1c..7887fcfd94 100644 --- a/pkg/client/istio/informers/externalversions/networking/v1beta1/serviceentry.go +++ b/pkg/client/istio/informers/externalversions/networking/v1alpha3/serviceentry.go @@ -16,26 +16,26 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( time "time" - networkingv1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + networkingv1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" versioned "knative.dev/net-istio/pkg/client/istio/clientset/versioned" internalinterfaces "knative.dev/net-istio/pkg/client/istio/informers/externalversions/internalinterfaces" - v1beta1 "knative.dev/net-istio/pkg/client/istio/listers/networking/v1beta1" + v1alpha3 "knative.dev/net-istio/pkg/client/istio/listers/networking/v1alpha3" ) // ServiceEntryInformer provides access to a shared informer and lister for // ServiceEntries. type ServiceEntryInformer interface { Informer() cache.SharedIndexInformer - Lister() v1beta1.ServiceEntryLister + Lister() v1alpha3.ServiceEntryLister } type serviceEntryInformer struct { @@ -61,16 +61,16 @@ func NewFilteredServiceEntryInformer(client versioned.Interface, namespace strin if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().ServiceEntries(namespace).List(options) + return client.NetworkingV1alpha3().ServiceEntries(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().ServiceEntries(namespace).Watch(options) + return client.NetworkingV1alpha3().ServiceEntries(namespace).Watch(options) }, }, - &networkingv1beta1.ServiceEntry{}, + &networkingv1alpha3.ServiceEntry{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *serviceEntryInformer) defaultInformer(client versioned.Interface, resyn } func (f *serviceEntryInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&networkingv1beta1.ServiceEntry{}, f.defaultInformer) + return f.factory.InformerFor(&networkingv1alpha3.ServiceEntry{}, f.defaultInformer) } -func (f *serviceEntryInformer) Lister() v1beta1.ServiceEntryLister { - return v1beta1.NewServiceEntryLister(f.Informer().GetIndexer()) +func (f *serviceEntryInformer) Lister() v1alpha3.ServiceEntryLister { + return v1alpha3.NewServiceEntryLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/istio/informers/externalversions/networking/v1beta1/sidecar.go b/pkg/client/istio/informers/externalversions/networking/v1alpha3/sidecar.go similarity index 84% rename from pkg/client/istio/informers/externalversions/networking/v1beta1/sidecar.go rename to pkg/client/istio/informers/externalversions/networking/v1alpha3/sidecar.go index 7edbeb18e5..4201f06bd3 100644 --- a/pkg/client/istio/informers/externalversions/networking/v1beta1/sidecar.go +++ b/pkg/client/istio/informers/externalversions/networking/v1alpha3/sidecar.go @@ -16,26 +16,26 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( time "time" - networkingv1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + networkingv1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" versioned "knative.dev/net-istio/pkg/client/istio/clientset/versioned" internalinterfaces "knative.dev/net-istio/pkg/client/istio/informers/externalversions/internalinterfaces" - v1beta1 "knative.dev/net-istio/pkg/client/istio/listers/networking/v1beta1" + v1alpha3 "knative.dev/net-istio/pkg/client/istio/listers/networking/v1alpha3" ) // SidecarInformer provides access to a shared informer and lister for // Sidecars. type SidecarInformer interface { Informer() cache.SharedIndexInformer - Lister() v1beta1.SidecarLister + Lister() v1alpha3.SidecarLister } type sidecarInformer struct { @@ -61,16 +61,16 @@ func NewFilteredSidecarInformer(client versioned.Interface, namespace string, re if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().Sidecars(namespace).List(options) + return client.NetworkingV1alpha3().Sidecars(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().Sidecars(namespace).Watch(options) + return client.NetworkingV1alpha3().Sidecars(namespace).Watch(options) }, }, - &networkingv1beta1.Sidecar{}, + &networkingv1alpha3.Sidecar{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *sidecarInformer) defaultInformer(client versioned.Interface, resyncPeri } func (f *sidecarInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&networkingv1beta1.Sidecar{}, f.defaultInformer) + return f.factory.InformerFor(&networkingv1alpha3.Sidecar{}, f.defaultInformer) } -func (f *sidecarInformer) Lister() v1beta1.SidecarLister { - return v1beta1.NewSidecarLister(f.Informer().GetIndexer()) +func (f *sidecarInformer) Lister() v1alpha3.SidecarLister { + return v1alpha3.NewSidecarLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/istio/informers/externalversions/networking/v1beta1/virtualservice.go b/pkg/client/istio/informers/externalversions/networking/v1alpha3/virtualservice.go similarity index 83% rename from pkg/client/istio/informers/externalversions/networking/v1beta1/virtualservice.go rename to pkg/client/istio/informers/externalversions/networking/v1alpha3/virtualservice.go index 354e4f7048..2d7c477cdd 100644 --- a/pkg/client/istio/informers/externalversions/networking/v1beta1/virtualservice.go +++ b/pkg/client/istio/informers/externalversions/networking/v1alpha3/virtualservice.go @@ -16,26 +16,26 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( time "time" - networkingv1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + networkingv1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" versioned "knative.dev/net-istio/pkg/client/istio/clientset/versioned" internalinterfaces "knative.dev/net-istio/pkg/client/istio/informers/externalversions/internalinterfaces" - v1beta1 "knative.dev/net-istio/pkg/client/istio/listers/networking/v1beta1" + v1alpha3 "knative.dev/net-istio/pkg/client/istio/listers/networking/v1alpha3" ) // VirtualServiceInformer provides access to a shared informer and lister for // VirtualServices. type VirtualServiceInformer interface { Informer() cache.SharedIndexInformer - Lister() v1beta1.VirtualServiceLister + Lister() v1alpha3.VirtualServiceLister } type virtualServiceInformer struct { @@ -61,16 +61,16 @@ func NewFilteredVirtualServiceInformer(client versioned.Interface, namespace str if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().VirtualServices(namespace).List(options) + return client.NetworkingV1alpha3().VirtualServices(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().VirtualServices(namespace).Watch(options) + return client.NetworkingV1alpha3().VirtualServices(namespace).Watch(options) }, }, - &networkingv1beta1.VirtualService{}, + &networkingv1alpha3.VirtualService{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *virtualServiceInformer) defaultInformer(client versioned.Interface, res } func (f *virtualServiceInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&networkingv1beta1.VirtualService{}, f.defaultInformer) + return f.factory.InformerFor(&networkingv1alpha3.VirtualService{}, f.defaultInformer) } -func (f *virtualServiceInformer) Lister() v1beta1.VirtualServiceLister { - return v1beta1.NewVirtualServiceLister(f.Informer().GetIndexer()) +func (f *virtualServiceInformer) Lister() v1alpha3.VirtualServiceLister { + return v1alpha3.NewVirtualServiceLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/istio/informers/externalversions/networking/v1beta1/workloadentry.go b/pkg/client/istio/informers/externalversions/networking/v1alpha3/workloadentry.go similarity index 83% rename from pkg/client/istio/informers/externalversions/networking/v1beta1/workloadentry.go rename to pkg/client/istio/informers/externalversions/networking/v1alpha3/workloadentry.go index 16f2fcf266..821298529a 100644 --- a/pkg/client/istio/informers/externalversions/networking/v1beta1/workloadentry.go +++ b/pkg/client/istio/informers/externalversions/networking/v1alpha3/workloadentry.go @@ -16,26 +16,26 @@ limitations under the License. // Code generated by informer-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( time "time" - networkingv1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + networkingv1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" watch "k8s.io/apimachinery/pkg/watch" cache "k8s.io/client-go/tools/cache" versioned "knative.dev/net-istio/pkg/client/istio/clientset/versioned" internalinterfaces "knative.dev/net-istio/pkg/client/istio/informers/externalversions/internalinterfaces" - v1beta1 "knative.dev/net-istio/pkg/client/istio/listers/networking/v1beta1" + v1alpha3 "knative.dev/net-istio/pkg/client/istio/listers/networking/v1alpha3" ) // WorkloadEntryInformer provides access to a shared informer and lister for // WorkloadEntries. type WorkloadEntryInformer interface { Informer() cache.SharedIndexInformer - Lister() v1beta1.WorkloadEntryLister + Lister() v1alpha3.WorkloadEntryLister } type workloadEntryInformer struct { @@ -61,16 +61,16 @@ func NewFilteredWorkloadEntryInformer(client versioned.Interface, namespace stri if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().WorkloadEntries(namespace).List(options) + return client.NetworkingV1alpha3().WorkloadEntries(namespace).List(options) }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil { tweakListOptions(&options) } - return client.NetworkingV1beta1().WorkloadEntries(namespace).Watch(options) + return client.NetworkingV1alpha3().WorkloadEntries(namespace).Watch(options) }, }, - &networkingv1beta1.WorkloadEntry{}, + &networkingv1alpha3.WorkloadEntry{}, resyncPeriod, indexers, ) @@ -81,9 +81,9 @@ func (f *workloadEntryInformer) defaultInformer(client versioned.Interface, resy } func (f *workloadEntryInformer) Informer() cache.SharedIndexInformer { - return f.factory.InformerFor(&networkingv1beta1.WorkloadEntry{}, f.defaultInformer) + return f.factory.InformerFor(&networkingv1alpha3.WorkloadEntry{}, f.defaultInformer) } -func (f *workloadEntryInformer) Lister() v1beta1.WorkloadEntryLister { - return v1beta1.NewWorkloadEntryLister(f.Informer().GetIndexer()) +func (f *workloadEntryInformer) Lister() v1alpha3.WorkloadEntryLister { + return v1alpha3.NewWorkloadEntryLister(f.Informer().GetIndexer()) } diff --git a/pkg/client/istio/injection/informers/networking/v1beta1/destinationrule/destinationrule.go b/pkg/client/istio/injection/informers/networking/v1alpha3/destinationrule/destinationrule.go similarity index 80% rename from pkg/client/istio/injection/informers/networking/v1beta1/destinationrule/destinationrule.go rename to pkg/client/istio/injection/informers/networking/v1alpha3/destinationrule/destinationrule.go index 7e9bb75236..d80033c896 100644 --- a/pkg/client/istio/injection/informers/networking/v1beta1/destinationrule/destinationrule.go +++ b/pkg/client/istio/injection/informers/networking/v1alpha3/destinationrule/destinationrule.go @@ -21,7 +21,7 @@ package destinationrule import ( context "context" - v1beta1 "knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1beta1" + v1alpha3 "knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1alpha3" factory "knative.dev/net-istio/pkg/client/istio/injection/informers/factory" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" @@ -37,16 +37,16 @@ type Key struct{} func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := factory.Get(ctx) - inf := f.Networking().V1beta1().DestinationRules() + inf := f.Networking().V1alpha3().DestinationRules() return context.WithValue(ctx, Key{}, inf), inf.Informer() } // Get extracts the typed informer from the context. -func Get(ctx context.Context) v1beta1.DestinationRuleInformer { +func Get(ctx context.Context) v1alpha3.DestinationRuleInformer { untyped := ctx.Value(Key{}) if untyped == nil { logging.FromContext(ctx).Panic( - "Unable to fetch knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1beta1.DestinationRuleInformer from context.") + "Unable to fetch knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1alpha3.DestinationRuleInformer from context.") } - return untyped.(v1beta1.DestinationRuleInformer) + return untyped.(v1alpha3.DestinationRuleInformer) } diff --git a/pkg/client/istio/injection/informers/networking/v1beta1/destinationrule/fake/fake.go b/pkg/client/istio/injection/informers/networking/v1alpha3/destinationrule/fake/fake.go similarity index 91% rename from pkg/client/istio/injection/informers/networking/v1beta1/destinationrule/fake/fake.go rename to pkg/client/istio/injection/informers/networking/v1alpha3/destinationrule/fake/fake.go index e504a1018a..7c37876c1f 100644 --- a/pkg/client/istio/injection/informers/networking/v1beta1/destinationrule/fake/fake.go +++ b/pkg/client/istio/injection/informers/networking/v1alpha3/destinationrule/fake/fake.go @@ -22,7 +22,7 @@ import ( context "context" fake "knative.dev/net-istio/pkg/client/istio/injection/informers/factory/fake" - destinationrule "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1beta1/destinationrule" + destinationrule "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1alpha3/destinationrule" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" ) @@ -35,6 +35,6 @@ func init() { func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := fake.Get(ctx) - inf := f.Networking().V1beta1().DestinationRules() + inf := f.Networking().V1alpha3().DestinationRules() return context.WithValue(ctx, destinationrule.Key{}, inf), inf.Informer() } diff --git a/pkg/client/istio/injection/informers/networking/v1alpha3/envoyfilter/envoyfilter.go b/pkg/client/istio/injection/informers/networking/v1alpha3/envoyfilter/envoyfilter.go new file mode 100644 index 0000000000..ea17f80e47 --- /dev/null +++ b/pkg/client/istio/injection/informers/networking/v1alpha3/envoyfilter/envoyfilter.go @@ -0,0 +1,52 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by injection-gen. DO NOT EDIT. + +package envoyfilter + +import ( + context "context" + + v1alpha3 "knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1alpha3" + factory "knative.dev/net-istio/pkg/client/istio/injection/informers/factory" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" + logging "knative.dev/pkg/logging" +) + +func init() { + injection.Default.RegisterInformer(withInformer) +} + +// Key is used for associating the Informer inside the context.Context. +type Key struct{} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := factory.Get(ctx) + inf := f.Networking().V1alpha3().EnvoyFilters() + return context.WithValue(ctx, Key{}, inf), inf.Informer() +} + +// Get extracts the typed informer from the context. +func Get(ctx context.Context) v1alpha3.EnvoyFilterInformer { + untyped := ctx.Value(Key{}) + if untyped == nil { + logging.FromContext(ctx).Panic( + "Unable to fetch knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1alpha3.EnvoyFilterInformer from context.") + } + return untyped.(v1alpha3.EnvoyFilterInformer) +} diff --git a/pkg/client/istio/injection/informers/networking/v1alpha3/envoyfilter/fake/fake.go b/pkg/client/istio/injection/informers/networking/v1alpha3/envoyfilter/fake/fake.go new file mode 100644 index 0000000000..2189f757bd --- /dev/null +++ b/pkg/client/istio/injection/informers/networking/v1alpha3/envoyfilter/fake/fake.go @@ -0,0 +1,40 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by injection-gen. DO NOT EDIT. + +package fake + +import ( + context "context" + + fake "knative.dev/net-istio/pkg/client/istio/injection/informers/factory/fake" + envoyfilter "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1alpha3/envoyfilter" + controller "knative.dev/pkg/controller" + injection "knative.dev/pkg/injection" +) + +var Get = envoyfilter.Get + +func init() { + injection.Fake.RegisterInformer(withInformer) +} + +func withInformer(ctx context.Context) (context.Context, controller.Informer) { + f := fake.Get(ctx) + inf := f.Networking().V1alpha3().EnvoyFilters() + return context.WithValue(ctx, envoyfilter.Key{}, inf), inf.Informer() +} diff --git a/pkg/client/istio/injection/informers/networking/v1beta1/gateway/fake/fake.go b/pkg/client/istio/injection/informers/networking/v1alpha3/gateway/fake/fake.go similarity index 93% rename from pkg/client/istio/injection/informers/networking/v1beta1/gateway/fake/fake.go rename to pkg/client/istio/injection/informers/networking/v1alpha3/gateway/fake/fake.go index 6dc1a23b56..61d026676e 100644 --- a/pkg/client/istio/injection/informers/networking/v1beta1/gateway/fake/fake.go +++ b/pkg/client/istio/injection/informers/networking/v1alpha3/gateway/fake/fake.go @@ -22,7 +22,7 @@ import ( context "context" fake "knative.dev/net-istio/pkg/client/istio/injection/informers/factory/fake" - gateway "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1beta1/gateway" + gateway "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1alpha3/gateway" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" ) @@ -35,6 +35,6 @@ func init() { func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := fake.Get(ctx) - inf := f.Networking().V1beta1().Gateways() + inf := f.Networking().V1alpha3().Gateways() return context.WithValue(ctx, gateway.Key{}, inf), inf.Informer() } diff --git a/pkg/client/istio/injection/informers/networking/v1beta1/gateway/gateway.go b/pkg/client/istio/injection/informers/networking/v1alpha3/gateway/gateway.go similarity index 81% rename from pkg/client/istio/injection/informers/networking/v1beta1/gateway/gateway.go rename to pkg/client/istio/injection/informers/networking/v1alpha3/gateway/gateway.go index d1ab456a45..11b75ab06a 100644 --- a/pkg/client/istio/injection/informers/networking/v1beta1/gateway/gateway.go +++ b/pkg/client/istio/injection/informers/networking/v1alpha3/gateway/gateway.go @@ -21,7 +21,7 @@ package gateway import ( context "context" - v1beta1 "knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1beta1" + v1alpha3 "knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1alpha3" factory "knative.dev/net-istio/pkg/client/istio/injection/informers/factory" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" @@ -37,16 +37,16 @@ type Key struct{} func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := factory.Get(ctx) - inf := f.Networking().V1beta1().Gateways() + inf := f.Networking().V1alpha3().Gateways() return context.WithValue(ctx, Key{}, inf), inf.Informer() } // Get extracts the typed informer from the context. -func Get(ctx context.Context) v1beta1.GatewayInformer { +func Get(ctx context.Context) v1alpha3.GatewayInformer { untyped := ctx.Value(Key{}) if untyped == nil { logging.FromContext(ctx).Panic( - "Unable to fetch knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1beta1.GatewayInformer from context.") + "Unable to fetch knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1alpha3.GatewayInformer from context.") } - return untyped.(v1beta1.GatewayInformer) + return untyped.(v1alpha3.GatewayInformer) } diff --git a/pkg/client/istio/injection/informers/networking/v1beta1/serviceentry/fake/fake.go b/pkg/client/istio/injection/informers/networking/v1alpha3/serviceentry/fake/fake.go similarity index 92% rename from pkg/client/istio/injection/informers/networking/v1beta1/serviceentry/fake/fake.go rename to pkg/client/istio/injection/informers/networking/v1alpha3/serviceentry/fake/fake.go index c33ec96b37..a418a03983 100644 --- a/pkg/client/istio/injection/informers/networking/v1beta1/serviceentry/fake/fake.go +++ b/pkg/client/istio/injection/informers/networking/v1alpha3/serviceentry/fake/fake.go @@ -22,7 +22,7 @@ import ( context "context" fake "knative.dev/net-istio/pkg/client/istio/injection/informers/factory/fake" - serviceentry "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1beta1/serviceentry" + serviceentry "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1alpha3/serviceentry" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" ) @@ -35,6 +35,6 @@ func init() { func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := fake.Get(ctx) - inf := f.Networking().V1beta1().ServiceEntries() + inf := f.Networking().V1alpha3().ServiceEntries() return context.WithValue(ctx, serviceentry.Key{}, inf), inf.Informer() } diff --git a/pkg/client/istio/injection/informers/networking/v1beta1/serviceentry/serviceentry.go b/pkg/client/istio/injection/informers/networking/v1alpha3/serviceentry/serviceentry.go similarity index 80% rename from pkg/client/istio/injection/informers/networking/v1beta1/serviceentry/serviceentry.go rename to pkg/client/istio/injection/informers/networking/v1alpha3/serviceentry/serviceentry.go index ac18dcf868..1eaccb937d 100644 --- a/pkg/client/istio/injection/informers/networking/v1beta1/serviceentry/serviceentry.go +++ b/pkg/client/istio/injection/informers/networking/v1alpha3/serviceentry/serviceentry.go @@ -21,7 +21,7 @@ package serviceentry import ( context "context" - v1beta1 "knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1beta1" + v1alpha3 "knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1alpha3" factory "knative.dev/net-istio/pkg/client/istio/injection/informers/factory" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" @@ -37,16 +37,16 @@ type Key struct{} func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := factory.Get(ctx) - inf := f.Networking().V1beta1().ServiceEntries() + inf := f.Networking().V1alpha3().ServiceEntries() return context.WithValue(ctx, Key{}, inf), inf.Informer() } // Get extracts the typed informer from the context. -func Get(ctx context.Context) v1beta1.ServiceEntryInformer { +func Get(ctx context.Context) v1alpha3.ServiceEntryInformer { untyped := ctx.Value(Key{}) if untyped == nil { logging.FromContext(ctx).Panic( - "Unable to fetch knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1beta1.ServiceEntryInformer from context.") + "Unable to fetch knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1alpha3.ServiceEntryInformer from context.") } - return untyped.(v1beta1.ServiceEntryInformer) + return untyped.(v1alpha3.ServiceEntryInformer) } diff --git a/pkg/client/istio/injection/informers/networking/v1beta1/sidecar/fake/fake.go b/pkg/client/istio/injection/informers/networking/v1alpha3/sidecar/fake/fake.go similarity index 93% rename from pkg/client/istio/injection/informers/networking/v1beta1/sidecar/fake/fake.go rename to pkg/client/istio/injection/informers/networking/v1alpha3/sidecar/fake/fake.go index 9f391e5012..8b65b21698 100644 --- a/pkg/client/istio/injection/informers/networking/v1beta1/sidecar/fake/fake.go +++ b/pkg/client/istio/injection/informers/networking/v1alpha3/sidecar/fake/fake.go @@ -22,7 +22,7 @@ import ( context "context" fake "knative.dev/net-istio/pkg/client/istio/injection/informers/factory/fake" - sidecar "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1beta1/sidecar" + sidecar "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1alpha3/sidecar" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" ) @@ -35,6 +35,6 @@ func init() { func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := fake.Get(ctx) - inf := f.Networking().V1beta1().Sidecars() + inf := f.Networking().V1alpha3().Sidecars() return context.WithValue(ctx, sidecar.Key{}, inf), inf.Informer() } diff --git a/pkg/client/istio/injection/informers/networking/v1beta1/sidecar/sidecar.go b/pkg/client/istio/injection/informers/networking/v1alpha3/sidecar/sidecar.go similarity index 81% rename from pkg/client/istio/injection/informers/networking/v1beta1/sidecar/sidecar.go rename to pkg/client/istio/injection/informers/networking/v1alpha3/sidecar/sidecar.go index 805e6cf8af..d85288db2c 100644 --- a/pkg/client/istio/injection/informers/networking/v1beta1/sidecar/sidecar.go +++ b/pkg/client/istio/injection/informers/networking/v1alpha3/sidecar/sidecar.go @@ -21,7 +21,7 @@ package sidecar import ( context "context" - v1beta1 "knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1beta1" + v1alpha3 "knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1alpha3" factory "knative.dev/net-istio/pkg/client/istio/injection/informers/factory" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" @@ -37,16 +37,16 @@ type Key struct{} func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := factory.Get(ctx) - inf := f.Networking().V1beta1().Sidecars() + inf := f.Networking().V1alpha3().Sidecars() return context.WithValue(ctx, Key{}, inf), inf.Informer() } // Get extracts the typed informer from the context. -func Get(ctx context.Context) v1beta1.SidecarInformer { +func Get(ctx context.Context) v1alpha3.SidecarInformer { untyped := ctx.Value(Key{}) if untyped == nil { logging.FromContext(ctx).Panic( - "Unable to fetch knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1beta1.SidecarInformer from context.") + "Unable to fetch knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1alpha3.SidecarInformer from context.") } - return untyped.(v1beta1.SidecarInformer) + return untyped.(v1alpha3.SidecarInformer) } diff --git a/pkg/client/istio/injection/informers/networking/v1beta1/virtualservice/fake/fake.go b/pkg/client/istio/injection/informers/networking/v1alpha3/virtualservice/fake/fake.go similarity index 92% rename from pkg/client/istio/injection/informers/networking/v1beta1/virtualservice/fake/fake.go rename to pkg/client/istio/injection/informers/networking/v1alpha3/virtualservice/fake/fake.go index dd970908da..8a17b1afae 100644 --- a/pkg/client/istio/injection/informers/networking/v1beta1/virtualservice/fake/fake.go +++ b/pkg/client/istio/injection/informers/networking/v1alpha3/virtualservice/fake/fake.go @@ -22,7 +22,7 @@ import ( context "context" fake "knative.dev/net-istio/pkg/client/istio/injection/informers/factory/fake" - virtualservice "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1beta1/virtualservice" + virtualservice "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1alpha3/virtualservice" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" ) @@ -35,6 +35,6 @@ func init() { func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := fake.Get(ctx) - inf := f.Networking().V1beta1().VirtualServices() + inf := f.Networking().V1alpha3().VirtualServices() return context.WithValue(ctx, virtualservice.Key{}, inf), inf.Informer() } diff --git a/pkg/client/istio/injection/informers/networking/v1beta1/virtualservice/virtualservice.go b/pkg/client/istio/injection/informers/networking/v1alpha3/virtualservice/virtualservice.go similarity index 80% rename from pkg/client/istio/injection/informers/networking/v1beta1/virtualservice/virtualservice.go rename to pkg/client/istio/injection/informers/networking/v1alpha3/virtualservice/virtualservice.go index 00db201dcd..ba0ee76ce8 100644 --- a/pkg/client/istio/injection/informers/networking/v1beta1/virtualservice/virtualservice.go +++ b/pkg/client/istio/injection/informers/networking/v1alpha3/virtualservice/virtualservice.go @@ -21,7 +21,7 @@ package virtualservice import ( context "context" - v1beta1 "knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1beta1" + v1alpha3 "knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1alpha3" factory "knative.dev/net-istio/pkg/client/istio/injection/informers/factory" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" @@ -37,16 +37,16 @@ type Key struct{} func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := factory.Get(ctx) - inf := f.Networking().V1beta1().VirtualServices() + inf := f.Networking().V1alpha3().VirtualServices() return context.WithValue(ctx, Key{}, inf), inf.Informer() } // Get extracts the typed informer from the context. -func Get(ctx context.Context) v1beta1.VirtualServiceInformer { +func Get(ctx context.Context) v1alpha3.VirtualServiceInformer { untyped := ctx.Value(Key{}) if untyped == nil { logging.FromContext(ctx).Panic( - "Unable to fetch knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1beta1.VirtualServiceInformer from context.") + "Unable to fetch knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1alpha3.VirtualServiceInformer from context.") } - return untyped.(v1beta1.VirtualServiceInformer) + return untyped.(v1alpha3.VirtualServiceInformer) } diff --git a/pkg/client/istio/injection/informers/networking/v1beta1/workloadentry/fake/fake.go b/pkg/client/istio/injection/informers/networking/v1alpha3/workloadentry/fake/fake.go similarity index 92% rename from pkg/client/istio/injection/informers/networking/v1beta1/workloadentry/fake/fake.go rename to pkg/client/istio/injection/informers/networking/v1alpha3/workloadentry/fake/fake.go index 81a9a5ac80..1424915eea 100644 --- a/pkg/client/istio/injection/informers/networking/v1beta1/workloadentry/fake/fake.go +++ b/pkg/client/istio/injection/informers/networking/v1alpha3/workloadentry/fake/fake.go @@ -22,7 +22,7 @@ import ( context "context" fake "knative.dev/net-istio/pkg/client/istio/injection/informers/factory/fake" - workloadentry "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1beta1/workloadentry" + workloadentry "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1alpha3/workloadentry" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" ) @@ -35,6 +35,6 @@ func init() { func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := fake.Get(ctx) - inf := f.Networking().V1beta1().WorkloadEntries() + inf := f.Networking().V1alpha3().WorkloadEntries() return context.WithValue(ctx, workloadentry.Key{}, inf), inf.Informer() } diff --git a/pkg/client/istio/injection/informers/networking/v1beta1/workloadentry/workloadentry.go b/pkg/client/istio/injection/informers/networking/v1alpha3/workloadentry/workloadentry.go similarity index 80% rename from pkg/client/istio/injection/informers/networking/v1beta1/workloadentry/workloadentry.go rename to pkg/client/istio/injection/informers/networking/v1alpha3/workloadentry/workloadentry.go index 16cddcc608..640443c0c5 100644 --- a/pkg/client/istio/injection/informers/networking/v1beta1/workloadentry/workloadentry.go +++ b/pkg/client/istio/injection/informers/networking/v1alpha3/workloadentry/workloadentry.go @@ -21,7 +21,7 @@ package workloadentry import ( context "context" - v1beta1 "knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1beta1" + v1alpha3 "knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1alpha3" factory "knative.dev/net-istio/pkg/client/istio/injection/informers/factory" controller "knative.dev/pkg/controller" injection "knative.dev/pkg/injection" @@ -37,16 +37,16 @@ type Key struct{} func withInformer(ctx context.Context) (context.Context, controller.Informer) { f := factory.Get(ctx) - inf := f.Networking().V1beta1().WorkloadEntries() + inf := f.Networking().V1alpha3().WorkloadEntries() return context.WithValue(ctx, Key{}, inf), inf.Informer() } // Get extracts the typed informer from the context. -func Get(ctx context.Context) v1beta1.WorkloadEntryInformer { +func Get(ctx context.Context) v1alpha3.WorkloadEntryInformer { untyped := ctx.Value(Key{}) if untyped == nil { logging.FromContext(ctx).Panic( - "Unable to fetch knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1beta1.WorkloadEntryInformer from context.") + "Unable to fetch knative.dev/net-istio/pkg/client/istio/informers/externalversions/networking/v1alpha3.WorkloadEntryInformer from context.") } - return untyped.(v1beta1.WorkloadEntryInformer) + return untyped.(v1alpha3.WorkloadEntryInformer) } diff --git a/pkg/client/istio/listers/networking/v1beta1/destinationrule.go b/pkg/client/istio/listers/networking/v1alpha3/destinationrule.go similarity index 80% rename from pkg/client/istio/listers/networking/v1beta1/destinationrule.go rename to pkg/client/istio/listers/networking/v1alpha3/destinationrule.go index b89518a17a..ea2c715958 100644 --- a/pkg/client/istio/listers/networking/v1beta1/destinationrule.go +++ b/pkg/client/istio/listers/networking/v1alpha3/destinationrule.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" @@ -28,7 +28,7 @@ import ( // DestinationRuleLister helps list DestinationRules. type DestinationRuleLister interface { // List lists all DestinationRules in the indexer. - List(selector labels.Selector) (ret []*v1beta1.DestinationRule, err error) + List(selector labels.Selector) (ret []*v1alpha3.DestinationRule, err error) // DestinationRules returns an object that can list and get DestinationRules. DestinationRules(namespace string) DestinationRuleNamespaceLister DestinationRuleListerExpansion @@ -45,9 +45,9 @@ func NewDestinationRuleLister(indexer cache.Indexer) DestinationRuleLister { } // List lists all DestinationRules in the indexer. -func (s *destinationRuleLister) List(selector labels.Selector) (ret []*v1beta1.DestinationRule, err error) { +func (s *destinationRuleLister) List(selector labels.Selector) (ret []*v1alpha3.DestinationRule, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.DestinationRule)) + ret = append(ret, m.(*v1alpha3.DestinationRule)) }) return ret, err } @@ -60,9 +60,9 @@ func (s *destinationRuleLister) DestinationRules(namespace string) DestinationRu // DestinationRuleNamespaceLister helps list and get DestinationRules. type DestinationRuleNamespaceLister interface { // List lists all DestinationRules in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1beta1.DestinationRule, err error) + List(selector labels.Selector) (ret []*v1alpha3.DestinationRule, err error) // Get retrieves the DestinationRule from the indexer for a given namespace and name. - Get(name string) (*v1beta1.DestinationRule, error) + Get(name string) (*v1alpha3.DestinationRule, error) DestinationRuleNamespaceListerExpansion } @@ -74,21 +74,21 @@ type destinationRuleNamespaceLister struct { } // List lists all DestinationRules in the indexer for a given namespace. -func (s destinationRuleNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.DestinationRule, err error) { +func (s destinationRuleNamespaceLister) List(selector labels.Selector) (ret []*v1alpha3.DestinationRule, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.DestinationRule)) + ret = append(ret, m.(*v1alpha3.DestinationRule)) }) return ret, err } // Get retrieves the DestinationRule from the indexer for a given namespace and name. -func (s destinationRuleNamespaceLister) Get(name string) (*v1beta1.DestinationRule, error) { +func (s destinationRuleNamespaceLister) Get(name string) (*v1alpha3.DestinationRule, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("destinationrule"), name) + return nil, errors.NewNotFound(v1alpha3.Resource("destinationrule"), name) } - return obj.(*v1beta1.DestinationRule), nil + return obj.(*v1alpha3.DestinationRule), nil } diff --git a/pkg/client/istio/listers/networking/v1alpha3/envoyfilter.go b/pkg/client/istio/listers/networking/v1alpha3/envoyfilter.go new file mode 100644 index 0000000000..9c6e2dd1b6 --- /dev/null +++ b/pkg/client/istio/listers/networking/v1alpha3/envoyfilter.go @@ -0,0 +1,94 @@ +/* +Copyright 2020 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Code generated by lister-gen. DO NOT EDIT. + +package v1alpha3 + +import ( + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" + "k8s.io/apimachinery/pkg/api/errors" + "k8s.io/apimachinery/pkg/labels" + "k8s.io/client-go/tools/cache" +) + +// EnvoyFilterLister helps list EnvoyFilters. +type EnvoyFilterLister interface { + // List lists all EnvoyFilters in the indexer. + List(selector labels.Selector) (ret []*v1alpha3.EnvoyFilter, err error) + // EnvoyFilters returns an object that can list and get EnvoyFilters. + EnvoyFilters(namespace string) EnvoyFilterNamespaceLister + EnvoyFilterListerExpansion +} + +// envoyFilterLister implements the EnvoyFilterLister interface. +type envoyFilterLister struct { + indexer cache.Indexer +} + +// NewEnvoyFilterLister returns a new EnvoyFilterLister. +func NewEnvoyFilterLister(indexer cache.Indexer) EnvoyFilterLister { + return &envoyFilterLister{indexer: indexer} +} + +// List lists all EnvoyFilters in the indexer. +func (s *envoyFilterLister) List(selector labels.Selector) (ret []*v1alpha3.EnvoyFilter, err error) { + err = cache.ListAll(s.indexer, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha3.EnvoyFilter)) + }) + return ret, err +} + +// EnvoyFilters returns an object that can list and get EnvoyFilters. +func (s *envoyFilterLister) EnvoyFilters(namespace string) EnvoyFilterNamespaceLister { + return envoyFilterNamespaceLister{indexer: s.indexer, namespace: namespace} +} + +// EnvoyFilterNamespaceLister helps list and get EnvoyFilters. +type EnvoyFilterNamespaceLister interface { + // List lists all EnvoyFilters in the indexer for a given namespace. + List(selector labels.Selector) (ret []*v1alpha3.EnvoyFilter, err error) + // Get retrieves the EnvoyFilter from the indexer for a given namespace and name. + Get(name string) (*v1alpha3.EnvoyFilter, error) + EnvoyFilterNamespaceListerExpansion +} + +// envoyFilterNamespaceLister implements the EnvoyFilterNamespaceLister +// interface. +type envoyFilterNamespaceLister struct { + indexer cache.Indexer + namespace string +} + +// List lists all EnvoyFilters in the indexer for a given namespace. +func (s envoyFilterNamespaceLister) List(selector labels.Selector) (ret []*v1alpha3.EnvoyFilter, err error) { + err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { + ret = append(ret, m.(*v1alpha3.EnvoyFilter)) + }) + return ret, err +} + +// Get retrieves the EnvoyFilter from the indexer for a given namespace and name. +func (s envoyFilterNamespaceLister) Get(name string) (*v1alpha3.EnvoyFilter, error) { + obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) + if err != nil { + return nil, err + } + if !exists { + return nil, errors.NewNotFound(v1alpha3.Resource("envoyfilter"), name) + } + return obj.(*v1alpha3.EnvoyFilter), nil +} diff --git a/pkg/client/istio/listers/networking/v1beta1/expansion_generated.go b/pkg/client/istio/listers/networking/v1alpha3/expansion_generated.go similarity index 88% rename from pkg/client/istio/listers/networking/v1beta1/expansion_generated.go rename to pkg/client/istio/listers/networking/v1alpha3/expansion_generated.go index 48de3710f5..b02c9db899 100644 --- a/pkg/client/istio/listers/networking/v1beta1/expansion_generated.go +++ b/pkg/client/istio/listers/networking/v1alpha3/expansion_generated.go @@ -16,7 +16,7 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 // DestinationRuleListerExpansion allows custom methods to be added to // DestinationRuleLister. @@ -26,6 +26,14 @@ type DestinationRuleListerExpansion interface{} // DestinationRuleNamespaceLister. type DestinationRuleNamespaceListerExpansion interface{} +// EnvoyFilterListerExpansion allows custom methods to be added to +// EnvoyFilterLister. +type EnvoyFilterListerExpansion interface{} + +// EnvoyFilterNamespaceListerExpansion allows custom methods to be added to +// EnvoyFilterNamespaceLister. +type EnvoyFilterNamespaceListerExpansion interface{} + // GatewayListerExpansion allows custom methods to be added to // GatewayLister. type GatewayListerExpansion interface{} diff --git a/pkg/client/istio/listers/networking/v1beta1/gateway.go b/pkg/client/istio/listers/networking/v1alpha3/gateway.go similarity index 80% rename from pkg/client/istio/listers/networking/v1beta1/gateway.go rename to pkg/client/istio/listers/networking/v1alpha3/gateway.go index cc6f9620f6..c04309fd82 100644 --- a/pkg/client/istio/listers/networking/v1beta1/gateway.go +++ b/pkg/client/istio/listers/networking/v1alpha3/gateway.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" @@ -28,7 +28,7 @@ import ( // GatewayLister helps list Gateways. type GatewayLister interface { // List lists all Gateways in the indexer. - List(selector labels.Selector) (ret []*v1beta1.Gateway, err error) + List(selector labels.Selector) (ret []*v1alpha3.Gateway, err error) // Gateways returns an object that can list and get Gateways. Gateways(namespace string) GatewayNamespaceLister GatewayListerExpansion @@ -45,9 +45,9 @@ func NewGatewayLister(indexer cache.Indexer) GatewayLister { } // List lists all Gateways in the indexer. -func (s *gatewayLister) List(selector labels.Selector) (ret []*v1beta1.Gateway, err error) { +func (s *gatewayLister) List(selector labels.Selector) (ret []*v1alpha3.Gateway, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Gateway)) + ret = append(ret, m.(*v1alpha3.Gateway)) }) return ret, err } @@ -60,9 +60,9 @@ func (s *gatewayLister) Gateways(namespace string) GatewayNamespaceLister { // GatewayNamespaceLister helps list and get Gateways. type GatewayNamespaceLister interface { // List lists all Gateways in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1beta1.Gateway, err error) + List(selector labels.Selector) (ret []*v1alpha3.Gateway, err error) // Get retrieves the Gateway from the indexer for a given namespace and name. - Get(name string) (*v1beta1.Gateway, error) + Get(name string) (*v1alpha3.Gateway, error) GatewayNamespaceListerExpansion } @@ -74,21 +74,21 @@ type gatewayNamespaceLister struct { } // List lists all Gateways in the indexer for a given namespace. -func (s gatewayNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Gateway, err error) { +func (s gatewayNamespaceLister) List(selector labels.Selector) (ret []*v1alpha3.Gateway, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Gateway)) + ret = append(ret, m.(*v1alpha3.Gateway)) }) return ret, err } // Get retrieves the Gateway from the indexer for a given namespace and name. -func (s gatewayNamespaceLister) Get(name string) (*v1beta1.Gateway, error) { +func (s gatewayNamespaceLister) Get(name string) (*v1alpha3.Gateway, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("gateway"), name) + return nil, errors.NewNotFound(v1alpha3.Resource("gateway"), name) } - return obj.(*v1beta1.Gateway), nil + return obj.(*v1alpha3.Gateway), nil } diff --git a/pkg/client/istio/listers/networking/v1beta1/serviceentry.go b/pkg/client/istio/listers/networking/v1alpha3/serviceentry.go similarity index 80% rename from pkg/client/istio/listers/networking/v1beta1/serviceentry.go rename to pkg/client/istio/listers/networking/v1alpha3/serviceentry.go index 44391a4abd..7222d1e887 100644 --- a/pkg/client/istio/listers/networking/v1beta1/serviceentry.go +++ b/pkg/client/istio/listers/networking/v1alpha3/serviceentry.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" @@ -28,7 +28,7 @@ import ( // ServiceEntryLister helps list ServiceEntries. type ServiceEntryLister interface { // List lists all ServiceEntries in the indexer. - List(selector labels.Selector) (ret []*v1beta1.ServiceEntry, err error) + List(selector labels.Selector) (ret []*v1alpha3.ServiceEntry, err error) // ServiceEntries returns an object that can list and get ServiceEntries. ServiceEntries(namespace string) ServiceEntryNamespaceLister ServiceEntryListerExpansion @@ -45,9 +45,9 @@ func NewServiceEntryLister(indexer cache.Indexer) ServiceEntryLister { } // List lists all ServiceEntries in the indexer. -func (s *serviceEntryLister) List(selector labels.Selector) (ret []*v1beta1.ServiceEntry, err error) { +func (s *serviceEntryLister) List(selector labels.Selector) (ret []*v1alpha3.ServiceEntry, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.ServiceEntry)) + ret = append(ret, m.(*v1alpha3.ServiceEntry)) }) return ret, err } @@ -60,9 +60,9 @@ func (s *serviceEntryLister) ServiceEntries(namespace string) ServiceEntryNamesp // ServiceEntryNamespaceLister helps list and get ServiceEntries. type ServiceEntryNamespaceLister interface { // List lists all ServiceEntries in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1beta1.ServiceEntry, err error) + List(selector labels.Selector) (ret []*v1alpha3.ServiceEntry, err error) // Get retrieves the ServiceEntry from the indexer for a given namespace and name. - Get(name string) (*v1beta1.ServiceEntry, error) + Get(name string) (*v1alpha3.ServiceEntry, error) ServiceEntryNamespaceListerExpansion } @@ -74,21 +74,21 @@ type serviceEntryNamespaceLister struct { } // List lists all ServiceEntries in the indexer for a given namespace. -func (s serviceEntryNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.ServiceEntry, err error) { +func (s serviceEntryNamespaceLister) List(selector labels.Selector) (ret []*v1alpha3.ServiceEntry, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.ServiceEntry)) + ret = append(ret, m.(*v1alpha3.ServiceEntry)) }) return ret, err } // Get retrieves the ServiceEntry from the indexer for a given namespace and name. -func (s serviceEntryNamespaceLister) Get(name string) (*v1beta1.ServiceEntry, error) { +func (s serviceEntryNamespaceLister) Get(name string) (*v1alpha3.ServiceEntry, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("serviceentry"), name) + return nil, errors.NewNotFound(v1alpha3.Resource("serviceentry"), name) } - return obj.(*v1beta1.ServiceEntry), nil + return obj.(*v1alpha3.ServiceEntry), nil } diff --git a/pkg/client/istio/listers/networking/v1beta1/sidecar.go b/pkg/client/istio/listers/networking/v1alpha3/sidecar.go similarity index 80% rename from pkg/client/istio/listers/networking/v1beta1/sidecar.go rename to pkg/client/istio/listers/networking/v1alpha3/sidecar.go index 31838d0f05..c41d03a9ad 100644 --- a/pkg/client/istio/listers/networking/v1beta1/sidecar.go +++ b/pkg/client/istio/listers/networking/v1alpha3/sidecar.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" @@ -28,7 +28,7 @@ import ( // SidecarLister helps list Sidecars. type SidecarLister interface { // List lists all Sidecars in the indexer. - List(selector labels.Selector) (ret []*v1beta1.Sidecar, err error) + List(selector labels.Selector) (ret []*v1alpha3.Sidecar, err error) // Sidecars returns an object that can list and get Sidecars. Sidecars(namespace string) SidecarNamespaceLister SidecarListerExpansion @@ -45,9 +45,9 @@ func NewSidecarLister(indexer cache.Indexer) SidecarLister { } // List lists all Sidecars in the indexer. -func (s *sidecarLister) List(selector labels.Selector) (ret []*v1beta1.Sidecar, err error) { +func (s *sidecarLister) List(selector labels.Selector) (ret []*v1alpha3.Sidecar, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Sidecar)) + ret = append(ret, m.(*v1alpha3.Sidecar)) }) return ret, err } @@ -60,9 +60,9 @@ func (s *sidecarLister) Sidecars(namespace string) SidecarNamespaceLister { // SidecarNamespaceLister helps list and get Sidecars. type SidecarNamespaceLister interface { // List lists all Sidecars in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1beta1.Sidecar, err error) + List(selector labels.Selector) (ret []*v1alpha3.Sidecar, err error) // Get retrieves the Sidecar from the indexer for a given namespace and name. - Get(name string) (*v1beta1.Sidecar, error) + Get(name string) (*v1alpha3.Sidecar, error) SidecarNamespaceListerExpansion } @@ -74,21 +74,21 @@ type sidecarNamespaceLister struct { } // List lists all Sidecars in the indexer for a given namespace. -func (s sidecarNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.Sidecar, err error) { +func (s sidecarNamespaceLister) List(selector labels.Selector) (ret []*v1alpha3.Sidecar, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.Sidecar)) + ret = append(ret, m.(*v1alpha3.Sidecar)) }) return ret, err } // Get retrieves the Sidecar from the indexer for a given namespace and name. -func (s sidecarNamespaceLister) Get(name string) (*v1beta1.Sidecar, error) { +func (s sidecarNamespaceLister) Get(name string) (*v1alpha3.Sidecar, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("sidecar"), name) + return nil, errors.NewNotFound(v1alpha3.Resource("sidecar"), name) } - return obj.(*v1beta1.Sidecar), nil + return obj.(*v1alpha3.Sidecar), nil } diff --git a/pkg/client/istio/listers/networking/v1beta1/virtualservice.go b/pkg/client/istio/listers/networking/v1alpha3/virtualservice.go similarity index 80% rename from pkg/client/istio/listers/networking/v1beta1/virtualservice.go rename to pkg/client/istio/listers/networking/v1alpha3/virtualservice.go index ef76a6a2a5..4fbc26a67c 100644 --- a/pkg/client/istio/listers/networking/v1beta1/virtualservice.go +++ b/pkg/client/istio/listers/networking/v1alpha3/virtualservice.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" @@ -28,7 +28,7 @@ import ( // VirtualServiceLister helps list VirtualServices. type VirtualServiceLister interface { // List lists all VirtualServices in the indexer. - List(selector labels.Selector) (ret []*v1beta1.VirtualService, err error) + List(selector labels.Selector) (ret []*v1alpha3.VirtualService, err error) // VirtualServices returns an object that can list and get VirtualServices. VirtualServices(namespace string) VirtualServiceNamespaceLister VirtualServiceListerExpansion @@ -45,9 +45,9 @@ func NewVirtualServiceLister(indexer cache.Indexer) VirtualServiceLister { } // List lists all VirtualServices in the indexer. -func (s *virtualServiceLister) List(selector labels.Selector) (ret []*v1beta1.VirtualService, err error) { +func (s *virtualServiceLister) List(selector labels.Selector) (ret []*v1alpha3.VirtualService, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VirtualService)) + ret = append(ret, m.(*v1alpha3.VirtualService)) }) return ret, err } @@ -60,9 +60,9 @@ func (s *virtualServiceLister) VirtualServices(namespace string) VirtualServiceN // VirtualServiceNamespaceLister helps list and get VirtualServices. type VirtualServiceNamespaceLister interface { // List lists all VirtualServices in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1beta1.VirtualService, err error) + List(selector labels.Selector) (ret []*v1alpha3.VirtualService, err error) // Get retrieves the VirtualService from the indexer for a given namespace and name. - Get(name string) (*v1beta1.VirtualService, error) + Get(name string) (*v1alpha3.VirtualService, error) VirtualServiceNamespaceListerExpansion } @@ -74,21 +74,21 @@ type virtualServiceNamespaceLister struct { } // List lists all VirtualServices in the indexer for a given namespace. -func (s virtualServiceNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.VirtualService, err error) { +func (s virtualServiceNamespaceLister) List(selector labels.Selector) (ret []*v1alpha3.VirtualService, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.VirtualService)) + ret = append(ret, m.(*v1alpha3.VirtualService)) }) return ret, err } // Get retrieves the VirtualService from the indexer for a given namespace and name. -func (s virtualServiceNamespaceLister) Get(name string) (*v1beta1.VirtualService, error) { +func (s virtualServiceNamespaceLister) Get(name string) (*v1alpha3.VirtualService, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("virtualservice"), name) + return nil, errors.NewNotFound(v1alpha3.Resource("virtualservice"), name) } - return obj.(*v1beta1.VirtualService), nil + return obj.(*v1alpha3.VirtualService), nil } diff --git a/pkg/client/istio/listers/networking/v1beta1/workloadentry.go b/pkg/client/istio/listers/networking/v1alpha3/workloadentry.go similarity index 80% rename from pkg/client/istio/listers/networking/v1beta1/workloadentry.go rename to pkg/client/istio/listers/networking/v1alpha3/workloadentry.go index 9ed44ec86b..e51a81ff18 100644 --- a/pkg/client/istio/listers/networking/v1beta1/workloadentry.go +++ b/pkg/client/istio/listers/networking/v1alpha3/workloadentry.go @@ -16,10 +16,10 @@ limitations under the License. // Code generated by lister-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/tools/cache" @@ -28,7 +28,7 @@ import ( // WorkloadEntryLister helps list WorkloadEntries. type WorkloadEntryLister interface { // List lists all WorkloadEntries in the indexer. - List(selector labels.Selector) (ret []*v1beta1.WorkloadEntry, err error) + List(selector labels.Selector) (ret []*v1alpha3.WorkloadEntry, err error) // WorkloadEntries returns an object that can list and get WorkloadEntries. WorkloadEntries(namespace string) WorkloadEntryNamespaceLister WorkloadEntryListerExpansion @@ -45,9 +45,9 @@ func NewWorkloadEntryLister(indexer cache.Indexer) WorkloadEntryLister { } // List lists all WorkloadEntries in the indexer. -func (s *workloadEntryLister) List(selector labels.Selector) (ret []*v1beta1.WorkloadEntry, err error) { +func (s *workloadEntryLister) List(selector labels.Selector) (ret []*v1alpha3.WorkloadEntry, err error) { err = cache.ListAll(s.indexer, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.WorkloadEntry)) + ret = append(ret, m.(*v1alpha3.WorkloadEntry)) }) return ret, err } @@ -60,9 +60,9 @@ func (s *workloadEntryLister) WorkloadEntries(namespace string) WorkloadEntryNam // WorkloadEntryNamespaceLister helps list and get WorkloadEntries. type WorkloadEntryNamespaceLister interface { // List lists all WorkloadEntries in the indexer for a given namespace. - List(selector labels.Selector) (ret []*v1beta1.WorkloadEntry, err error) + List(selector labels.Selector) (ret []*v1alpha3.WorkloadEntry, err error) // Get retrieves the WorkloadEntry from the indexer for a given namespace and name. - Get(name string) (*v1beta1.WorkloadEntry, error) + Get(name string) (*v1alpha3.WorkloadEntry, error) WorkloadEntryNamespaceListerExpansion } @@ -74,21 +74,21 @@ type workloadEntryNamespaceLister struct { } // List lists all WorkloadEntries in the indexer for a given namespace. -func (s workloadEntryNamespaceLister) List(selector labels.Selector) (ret []*v1beta1.WorkloadEntry, err error) { +func (s workloadEntryNamespaceLister) List(selector labels.Selector) (ret []*v1alpha3.WorkloadEntry, err error) { err = cache.ListAllByNamespace(s.indexer, s.namespace, selector, func(m interface{}) { - ret = append(ret, m.(*v1beta1.WorkloadEntry)) + ret = append(ret, m.(*v1alpha3.WorkloadEntry)) }) return ret, err } // Get retrieves the WorkloadEntry from the indexer for a given namespace and name. -func (s workloadEntryNamespaceLister) Get(name string) (*v1beta1.WorkloadEntry, error) { +func (s workloadEntryNamespaceLister) Get(name string) (*v1alpha3.WorkloadEntry, error) { obj, exists, err := s.indexer.GetByKey(s.namespace + "/" + name) if err != nil { return nil, err } if !exists { - return nil, errors.NewNotFound(v1beta1.Resource("workloadentry"), name) + return nil, errors.NewNotFound(v1alpha3.Resource("workloadentry"), name) } - return obj.(*v1beta1.WorkloadEntry), nil + return obj.(*v1alpha3.WorkloadEntry), nil } diff --git a/pkg/reconciler/accessor/istio/virtualservice.go b/pkg/reconciler/accessor/istio/virtualservice.go index 7b436640d4..e9dbbf0852 100644 --- a/pkg/reconciler/accessor/istio/virtualservice.go +++ b/pkg/reconciler/accessor/istio/virtualservice.go @@ -20,13 +20,13 @@ import ( "context" "fmt" - "istio.io/client-go/pkg/apis/networking/v1beta1" + "istio.io/client-go/pkg/apis/networking/v1alpha3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/equality" apierrs "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" istioclientset "knative.dev/net-istio/pkg/client/istio/clientset/versioned" - istiolisters "knative.dev/net-istio/pkg/client/istio/listers/networking/v1beta1" + istiolisters "knative.dev/net-istio/pkg/client/istio/listers/networking/v1alpha3" kaccessor "knative.dev/net-istio/pkg/reconciler/accessor" "knative.dev/pkg/controller" "knative.dev/pkg/kmeta" @@ -38,15 +38,15 @@ type VirtualServiceAccessor interface { GetVirtualServiceLister() istiolisters.VirtualServiceLister } -func hasDesiredDiff(current, desired *v1beta1.VirtualService) bool { +func hasDesiredDiff(current, desired *v1alpha3.VirtualService) bool { return !equality.Semantic.DeepEqual(current.Spec, desired.Spec) || !equality.Semantic.DeepEqual(current.Labels, desired.Labels) || !equality.Semantic.DeepEqual(current.Annotations, desired.Annotations) } // ReconcileVirtualService reconciles VirtualService to the desired status. -func ReconcileVirtualService(ctx context.Context, owner kmeta.Accessor, desired *v1beta1.VirtualService, - vsAccessor VirtualServiceAccessor) (*v1beta1.VirtualService, error) { +func ReconcileVirtualService(ctx context.Context, owner kmeta.Accessor, desired *v1alpha3.VirtualService, + vsAccessor VirtualServiceAccessor) (*v1alpha3.VirtualService, error) { recorder := controller.GetEventRecorder(ctx) if recorder == nil { @@ -56,7 +56,7 @@ func ReconcileVirtualService(ctx context.Context, owner kmeta.Accessor, desired name := desired.Name vs, err := vsAccessor.GetVirtualServiceLister().VirtualServices(ns).Get(name) if apierrs.IsNotFound(err) { - vs, err = vsAccessor.GetIstioClient().NetworkingV1beta1().VirtualServices(ns).Create(desired) + vs, err = vsAccessor.GetIstioClient().NetworkingV1alpha3().VirtualServices(ns).Create(desired) if err != nil { recorder.Eventf(owner, corev1.EventTypeWarning, "CreationFailed", "Failed to create VirtualService %s/%s: %v", ns, name, err) @@ -76,7 +76,7 @@ func ReconcileVirtualService(ctx context.Context, owner kmeta.Accessor, desired existing.Spec = desired.Spec existing.Labels = desired.Labels existing.Annotations = desired.Annotations - vs, err = vsAccessor.GetIstioClient().NetworkingV1beta1().VirtualServices(ns).Update(existing) + vs, err = vsAccessor.GetIstioClient().NetworkingV1alpha3().VirtualServices(ns).Update(existing) if err != nil { return nil, fmt.Errorf("failed to update VirtualService: %w", err) } diff --git a/pkg/reconciler/accessor/istio/virtualservice_test.go b/pkg/reconciler/accessor/istio/virtualservice_test.go index ecd4b7ba76..7011164eb8 100644 --- a/pkg/reconciler/accessor/istio/virtualservice_test.go +++ b/pkg/reconciler/accessor/istio/virtualservice_test.go @@ -22,8 +22,8 @@ import ( "time" "github.com/google/go-cmp/cmp" - istiov1beta1 "istio.io/api/networking/v1beta1" - "istio.io/client-go/pkg/apis/networking/v1beta1" + istiov1alpha3 "istio.io/api/networking/v1alpha3" + "istio.io/client-go/pkg/apis/networking/v1alpha3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -31,7 +31,7 @@ import ( istiofake "knative.dev/net-istio/pkg/client/istio/clientset/versioned/fake" istioinformers "knative.dev/net-istio/pkg/client/istio/informers/externalversions" fakeistioclient "knative.dev/net-istio/pkg/client/istio/injection/client/fake" - istiolisters "knative.dev/net-istio/pkg/client/istio/listers/networking/v1beta1" + istiolisters "knative.dev/net-istio/pkg/client/istio/listers/networking/v1alpha3" "knative.dev/pkg/controller" "knative.dev/pkg/ptr" @@ -54,24 +54,24 @@ var ( Controller: ptr.Bool(true), } - origin = &v1beta1.VirtualService{ + origin = &v1alpha3.VirtualService{ ObjectMeta: metav1.ObjectMeta{ Name: "vs", Namespace: "default", OwnerReferences: []metav1.OwnerReference{ownerRef}, }, - Spec: istiov1beta1.VirtualService{ + Spec: istiov1alpha3.VirtualService{ Hosts: []string{"origin.example.com"}, }, } - desired = &v1beta1.VirtualService{ + desired = &v1alpha3.VirtualService{ ObjectMeta: metav1.ObjectMeta{ Name: "vs", Namespace: "default", OwnerReferences: []metav1.OwnerReference{ownerRef}, }, - Spec: istiov1beta1.VirtualService{ + Spec: istiov1alpha3.VirtualService{ Hosts: []string{"desired.example.com"}, }, } @@ -98,7 +98,7 @@ func TestReconcileVirtualService_Create(t *testing.T) { h := NewHooks() h.OnCreate(&istioClient.Fake, "virtualservices", func(obj runtime.Object) HookResult { - got := obj.(*v1beta1.VirtualService) + got := obj.(*v1alpha3.VirtualService) if diff := cmp.Diff(got, desired); diff != "" { t.Logf("Unexpected VirtualService (-want, +got): %v", diff) return HookIncomplete @@ -106,7 +106,7 @@ func TestReconcileVirtualService_Create(t *testing.T) { return HookComplete }) - accessor, waitInformers := setup(ctx, []*v1beta1.VirtualService{}, istioClient, t) + accessor, waitInformers := setup(ctx, []*v1alpha3.VirtualService{}, istioClient, t) defer func() { cancel() waitInformers() @@ -124,7 +124,7 @@ func TestReconcileVirtualService_Update(t *testing.T) { ctx, cancel := context.WithCancel(ctx) istioClient := fakeistioclient.Get(ctx) - accessor, waitInformers := setup(ctx, []*v1beta1.VirtualService{origin}, istioClient, t) + accessor, waitInformers := setup(ctx, []*v1alpha3.VirtualService{origin}, istioClient, t) defer func() { cancel() waitInformers() @@ -132,7 +132,7 @@ func TestReconcileVirtualService_Update(t *testing.T) { h := NewHooks() h.OnUpdate(&istioClient.Fake, "virtualservices", func(obj runtime.Object) HookResult { - got := obj.(*v1beta1.VirtualService) + got := obj.(*v1alpha3.VirtualService) if diff := cmp.Diff(got, desired); diff != "" { t.Logf("Unexpected VirtualService (-want, +got): %v", diff) return HookIncomplete @@ -146,15 +146,15 @@ func TestReconcileVirtualService_Update(t *testing.T) { } } -func setup(ctx context.Context, vses []*v1beta1.VirtualService, +func setup(ctx context.Context, vses []*v1alpha3.VirtualService, istioClient istioclientset.Interface, t *testing.T) (*FakeAccessor, func()) { fake := istiofake.NewSimpleClientset() informer := istioinformers.NewSharedInformerFactory(fake, 0) - vsInformer := informer.Networking().V1beta1().VirtualServices() + vsInformer := informer.Networking().V1alpha3().VirtualServices() for _, vs := range vses { - fake.NetworkingV1beta1().VirtualServices(vs.Namespace).Create(vs) + fake.NetworkingV1alpha3().VirtualServices(vs.Namespace).Create(vs) vsInformer.Informer().GetIndexer().Add(vs) } diff --git a/pkg/reconciler/ingress/controller.go b/pkg/reconciler/ingress/controller.go index 23e253252f..4509065b7a 100644 --- a/pkg/reconciler/ingress/controller.go +++ b/pkg/reconciler/ingress/controller.go @@ -21,8 +21,8 @@ import ( "go.uber.org/zap" istioclient "knative.dev/net-istio/pkg/client/istio/injection/client" - gatewayinformer "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1beta1/gateway" - virtualserviceinformer "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1beta1/virtualservice" + gatewayinformer "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1alpha3/gateway" + virtualserviceinformer "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1alpha3/virtualservice" "knative.dev/net-istio/pkg/reconciler/ingress/config" network "knative.dev/networking/pkg" "knative.dev/networking/pkg/apis/networking" @@ -42,7 +42,7 @@ import ( "knative.dev/pkg/reconciler" "knative.dev/pkg/tracker" - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/tools/cache" @@ -158,7 +158,7 @@ func newControllerWithOptions( gatewayInformer.Informer().AddEventHandler(controller.HandleAll( controller.EnsureTypeMeta( tracker.OnChanged, - v1beta1.SchemeGroupVersion.WithKind("Gateway"), + v1alpha3.SchemeGroupVersion.WithKind("Gateway"), ), )) diff --git a/pkg/reconciler/ingress/ingress.go b/pkg/reconciler/ingress/ingress.go index e8c79e3557..4f9e6e69b5 100644 --- a/pkg/reconciler/ingress/ingress.go +++ b/pkg/reconciler/ingress/ingress.go @@ -21,12 +21,12 @@ import ( "fmt" "sort" - istiov1beta1 "istio.io/api/networking/v1beta1" - "istio.io/client-go/pkg/apis/networking/v1beta1" + istiov1alpha3 "istio.io/api/networking/v1alpha3" + "istio.io/client-go/pkg/apis/networking/v1alpha3" "knative.dev/pkg/controller" "knative.dev/pkg/logging" - istiolisters "knative.dev/net-istio/pkg/client/istio/listers/networking/v1beta1" + istiolisters "knative.dev/net-istio/pkg/client/istio/listers/networking/v1alpha3" pkgreconciler "knative.dev/pkg/reconciler" "knative.dev/pkg/tracker" @@ -226,7 +226,7 @@ func (r *Reconciler) reconcileCertSecrets(ctx context.Context, ing *v1alpha1.Ing return nil } -func (r *Reconciler) reconcileWildcardGateways(ctx context.Context, gateways []*v1beta1.Gateway, ing *v1alpha1.Ingress) error { +func (r *Reconciler) reconcileWildcardGateways(ctx context.Context, gateways []*v1alpha3.Gateway, ing *v1alpha1.Ingress) error { for _, gateway := range gateways { r.tracker.Track(resources.GatewayRef(gateway), ing) if err := r.reconcileSystemGeneratedGateway(ctx, gateway); err != nil { @@ -236,10 +236,10 @@ func (r *Reconciler) reconcileWildcardGateways(ctx context.Context, gateways []* return nil } -func (r *Reconciler) reconcileSystemGeneratedGateway(ctx context.Context, desired *v1beta1.Gateway) error { +func (r *Reconciler) reconcileSystemGeneratedGateway(ctx context.Context, desired *v1alpha3.Gateway) error { existing, err := r.gatewayLister.Gateways(desired.Namespace).Get(desired.Name) if apierrs.IsNotFound(err) { - if _, err := r.istioClientSet.NetworkingV1beta1().Gateways(desired.Namespace).Create(desired); err != nil { + if _, err := r.istioClientSet.NetworkingV1alpha3().Gateways(desired.Namespace).Create(desired); err != nil { return err } } else if err != nil { @@ -247,7 +247,7 @@ func (r *Reconciler) reconcileSystemGeneratedGateway(ctx context.Context, desire } else if !equality.Semantic.DeepEqual(existing.Spec, desired.Spec) { copy := existing.DeepCopy() copy.Spec = desired.Spec - if _, err := r.istioClientSet.NetworkingV1beta1().Gateways(desired.Namespace).Update(copy); err != nil { + if _, err := r.istioClientSet.NetworkingV1alpha3().Gateways(desired.Namespace).Update(copy); err != nil { return err } } @@ -255,7 +255,7 @@ func (r *Reconciler) reconcileSystemGeneratedGateway(ctx context.Context, desire } func (r *Reconciler) reconcileVirtualServices(ctx context.Context, ing *v1alpha1.Ingress, - desired []*v1beta1.VirtualService) error { + desired []*v1alpha3.VirtualService) error { // First, create all needed VirtualServices. kept := sets.NewString() for _, d := range desired { @@ -299,7 +299,7 @@ func (r *Reconciler) reconcileVirtualServices(ctx context.Context, ing *v1alpha1 // We shouldn't remove resources not controlled by us. continue } - if err = r.istioClientSet.NetworkingV1beta1().VirtualServices(ns).Delete(n, &metav1.DeleteOptions{}); err != nil { + if err = r.istioClientSet.NetworkingV1alpha3().VirtualServices(ns).Delete(n, &metav1.DeleteOptions{}); err != nil { return fmt.Errorf("failed to delete VirtualService: %w", err) } } @@ -313,7 +313,7 @@ func (r *Reconciler) FinalizeKind(ctx context.Context, ing *v1alpha1.Ingress) pk logger.Info("Cleaning up Gateway Servers") for _, gws := range [][]config.Gateway{istiocfg.IngressGateways, istiocfg.LocalGateways} { for _, gw := range gws { - if err := r.reconcileIngressServers(ctx, ing, gw, []*istiov1beta1.Server{}); err != nil { + if err := r.reconcileIngressServers(ctx, ing, gw, []*istiov1alpha3.Server{}); err != nil { return err } } @@ -351,7 +351,7 @@ func (r *Reconciler) reconcileDeletion(ctx context.Context, ing *v1alpha1.Ingres return errors.NewAggregate(errs) } -func (r *Reconciler) reconcileIngressServers(ctx context.Context, ing *v1alpha1.Ingress, gw config.Gateway, desired []*istiov1beta1.Server) error { +func (r *Reconciler) reconcileIngressServers(ctx context.Context, ing *v1alpha1.Ingress, gw config.Gateway, desired []*istiov1alpha3.Server) error { gateway, err := r.gatewayLister.Gateways(gw.Namespace).Get(gw.Name) if err != nil { // Unlike VirtualService, a default gateway needs to be existent. @@ -362,32 +362,32 @@ func (r *Reconciler) reconcileIngressServers(ctx context.Context, ing *v1alpha1. return r.reconcileGateway(ctx, ing, gateway, existing, desired) } -func (r *Reconciler) reconcileHTTPServer(ctx context.Context, ing *v1alpha1.Ingress, gw config.Gateway, desiredHTTP *istiov1beta1.Server) error { +func (r *Reconciler) reconcileHTTPServer(ctx context.Context, ing *v1alpha1.Ingress, gw config.Gateway, desiredHTTP *istiov1alpha3.Server) error { gateway, err := r.gatewayLister.Gateways(gw.Namespace).Get(gw.Name) if err != nil { // Unlike VirtualService, a default gateway needs to be existent. // It should be installed when installing Knative. return fmt.Errorf("failed to get Gateway: %w", err) } - existing := []*istiov1beta1.Server{} + existing := []*istiov1alpha3.Server{} if e := resources.GetHTTPServer(gateway); e != nil { existing = append(existing, e) } - desired := []*istiov1beta1.Server{} + desired := []*istiov1alpha3.Server{} if desiredHTTP != nil { desired = append(desired, desiredHTTP) } return r.reconcileGateway(ctx, ing, gateway, existing, desired) } -func (r *Reconciler) reconcileGateway(ctx context.Context, ing *v1alpha1.Ingress, gateway *v1beta1.Gateway, existing []*istiov1beta1.Server, desired []*istiov1beta1.Server) error { +func (r *Reconciler) reconcileGateway(ctx context.Context, ing *v1alpha1.Ingress, gateway *v1alpha3.Gateway, existing []*istiov1alpha3.Server, desired []*istiov1alpha3.Server) error { if equality.Semantic.DeepEqual(existing, desired) { return nil } copy := gateway.DeepCopy() copy = resources.UpdateGateway(copy, desired, existing) - if _, err := r.istioClientSet.NetworkingV1beta1().Gateways(copy.Namespace).Update(copy); err != nil { + if _, err := r.istioClientSet.NetworkingV1alpha3().Gateways(copy.Namespace).Update(copy); err != nil { return fmt.Errorf("failed to update Gateway: %w", err) } controller.GetEventRecorder(ctx).Eventf(ing, corev1.EventTypeNormal, diff --git a/pkg/reconciler/ingress/ingress_test.go b/pkg/reconciler/ingress/ingress_test.go index 0bf8bf3241..369d21cfca 100644 --- a/pkg/reconciler/ingress/ingress_test.go +++ b/pkg/reconciler/ingress/ingress_test.go @@ -26,8 +26,8 @@ import ( // Inject our fakes istioclient "knative.dev/net-istio/pkg/client/istio/injection/client" fakeistioclient "knative.dev/net-istio/pkg/client/istio/injection/client/fake" - _ "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1beta1/gateway/fake" - _ "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1beta1/virtualservice/fake" + _ "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1alpha3/gateway/fake" + _ "knative.dev/net-istio/pkg/client/istio/injection/informers/networking/v1alpha3/virtualservice/fake" fakenetworkingclient "knative.dev/networking/pkg/client/injection/client/fake" fakeingressclient "knative.dev/networking/pkg/client/injection/informers/networking/v1alpha1/ingress/fake" "knative.dev/networking/pkg/ingress" @@ -42,8 +42,8 @@ import ( proto "github.com/gogo/protobuf/proto" "github.com/google/go-cmp/cmp" "golang.org/x/sync/errgroup" - istiov1beta1 "istio.io/api/networking/v1beta1" - "istio.io/client-go/pkg/apis/networking/v1beta1" + istiov1alpha3 "istio.io/api/networking/v1alpha3" + "istio.io/client-go/pkg/apis/networking/v1alpha3" corev1 "k8s.io/api/core/v1" apierrs "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -106,15 +106,15 @@ var ( Selector: selector, }, } - wildcardTLSServer = &istiov1beta1.Server{ + wildcardTLSServer = &istiov1alpha3.Server{ Hosts: []string{"*.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "https", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, CredentialName: "secret0", @@ -169,51 +169,51 @@ var ( }} // The gateway server according to ingressTLS. - ingressTLSServer = &istiov1beta1.Server{ + ingressTLSServer = &istiov1alpha3.Server{ Hosts: []string{"host-tls.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "test-ns/reconciling-ingress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: "tls.crt", PrivateKey: "tls.key", CredentialName: "secret0", }, } - ingressHTTPRedirectServer = &istiov1beta1.Server{ + ingressHTTPRedirectServer = &istiov1alpha3.Server{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "http-server", Number: 80, Protocol: "HTTP", }, - Tls: &istiov1beta1.ServerTLSSettings{ + Tls: &istiov1alpha3.ServerTLSSettings{ HttpsRedirect: true, }, } // The gateway server irrelevant to ingressTLS. - irrelevantServer = &istiov1beta1.Server{ + irrelevantServer = &istiov1alpha3.Server{ Hosts: []string{"test.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "test:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: "tls.crt", PrivateKey: "tls.key", CredentialName: "other-secret", }, } - irrelevantServer1 = &istiov1beta1.Server{ + irrelevantServer1 = &istiov1alpha3.Server{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "http-server", Number: 80, Protocol: "HTTP", @@ -241,8 +241,8 @@ func TestReconcile(t *testing.T) { Name: "create VirtualService matching Ingress, with retry", Objects: []runtime.Object{ ing("no-virtualservice-yet", 1234), - gateway("knative-ingress-gateway", system.Namespace(), []*istiov1beta1.Server{irrelevantServer1}), - gateway("knative-test-gateway", system.Namespace(), []*istiov1beta1.Server{irrelevantServer1}), + gateway("knative-ingress-gateway", system.Namespace(), []*istiov1alpha3.Server{irrelevantServer1}), + gateway("knative-test-gateway", system.Namespace(), []*istiov1alpha3.Server{irrelevantServer1}), }, WithReactors: []clientgotesting.ReactionFunc{ func(action clientgotesting.Action) (handled bool, ret runtime.Object, err error) { @@ -362,7 +362,7 @@ func TestReconcile(t *testing.T) { }, }, ), - &v1beta1.VirtualService{ + &v1alpha3.VirtualService{ ObjectMeta: metav1.ObjectMeta{ Name: "reconcile-failed-ingress", Namespace: testNS, @@ -371,7 +371,7 @@ func TestReconcile(t *testing.T) { }, OwnerReferences: []metav1.OwnerReference{*kmeta.NewControllerRef(ing("reconcile-failed", 1234))}, }, - Spec: istiov1beta1.VirtualService{}, + Spec: istiov1alpha3.VirtualService{}, }, }, WantCreates: []runtime.Object{ @@ -418,9 +418,9 @@ func TestReconcile(t *testing.T) { Name: "reconcile VirtualService to match desired one", Objects: []runtime.Object{ ing("reconcile-virtualservice", 1234), - gateway("knative-ingress-gateway", system.Namespace(), []*istiov1beta1.Server{irrelevantServer1}), - gateway("knative-test-gateway", system.Namespace(), []*istiov1beta1.Server{irrelevantServer1}), - &v1beta1.VirtualService{ + gateway("knative-ingress-gateway", system.Namespace(), []*istiov1alpha3.Server{irrelevantServer1}), + gateway("knative-test-gateway", system.Namespace(), []*istiov1alpha3.Server{irrelevantServer1}), + &v1alpha3.VirtualService{ ObjectMeta: metav1.ObjectMeta{ Name: "reconcile-virtualservice-ingress", Namespace: testNS, @@ -429,9 +429,9 @@ func TestReconcile(t *testing.T) { }, OwnerReferences: []metav1.OwnerReference{*kmeta.NewControllerRef(ing("reconcile-virtualservice", 1234))}, }, - Spec: istiov1beta1.VirtualService{}, + Spec: istiov1alpha3.VirtualService{}, }, - &v1beta1.VirtualService{ + &v1alpha3.VirtualService{ ObjectMeta: metav1.ObjectMeta{ Name: "reconcile-virtualservice-extra", Namespace: testNS, @@ -440,7 +440,7 @@ func TestReconcile(t *testing.T) { }, OwnerReferences: []metav1.OwnerReference{*kmeta.NewControllerRef(ing("reconcile-virtualservice", 1234))}, }, - Spec: istiov1beta1.VirtualService{}, + Spec: istiov1alpha3.VirtualService{}, }, }, WantUpdates: []clientgotesting.UpdateActionImpl{{ @@ -534,12 +534,12 @@ func TestReconcile_EnableAutoTLS(t *testing.T) { Objects: []runtime.Object{ ingressWithTLS("reconciling-ingress", 1234, ingressTLS), // No Gateway servers match the given TLS of Ingress. - gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1beta1.Server{irrelevantServer}), + gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1alpha3.Server{irrelevantServer}), originSecret("istio-system", "secret0"), }, WantCreates: []runtime.Object{ // The creation of gateways are triggered when setting up the test. - gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1beta1.Server{irrelevantServer}), + gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1alpha3.Server{irrelevantServer}), resources.MakeMeshVirtualService(context.Background(), insertProbe(ingressWithTLS("reconciling-ingress", 1234, ingressTLS)), ingressGateway), resources.MakeIngressVirtualService(context.Background(), insertProbe(ingressWithTLS("reconciling-ingress", 1234, ingressTLS)), @@ -547,7 +547,7 @@ func TestReconcile_EnableAutoTLS(t *testing.T) { }, WantUpdates: []clientgotesting.UpdateActionImpl{{ // ingressTLSServer needs to be added into Gateway. - Object: gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1beta1.Server{ingressTLSServer, irrelevantServer}), + Object: gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1alpha3.Server{ingressTLSServer, irrelevantServer}), }}, WantPatches: []clientgotesting.PatchActionImpl{ patchAddFinalizerAction("reconciling-ingress", ingressFinalizer), @@ -602,15 +602,15 @@ func TestReconcile_EnableAutoTLS(t *testing.T) { Objects: []runtime.Object{ ingressWithTLS("reconciling-ingress", 1234, ingressTLS), // No Gateway servers match the given TLS of Ingress. - gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1beta1.Server{irrelevantServer}), + gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1alpha3.Server{irrelevantServer}), wildcardCert, ingressService, }, WantCreates: []runtime.Object{ // The creation of gateways are triggered when setting up the test. - gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1beta1.Server{irrelevantServer}), + gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1alpha3.Server{irrelevantServer}), wildcardGateway(resources.WildcardGatewayName(wildcardCert.Name, ingressService.Namespace, ingressService.Name), "istio-system", - []*istiov1beta1.Server{wildcardTLSServer}, selector), + []*istiov1alpha3.Server{wildcardTLSServer}, selector), resources.MakeMeshVirtualService(context.Background(), insertProbe(ingressWithTLS("reconciling-ingress", 1234, ingressTLS)), ingressGateway), resources.MakeIngressVirtualService(context.Background(), insertProbe(ingressWithTLS("reconciling-ingress", 1234, ingressTLS)), @@ -708,14 +708,14 @@ func TestReconcile_EnableAutoTLS(t *testing.T) { Objects: []runtime.Object{ ingressWithFinalizers("reconciling-ingress", 1234, ingressTLS, []string{ingressFinalizer}, &deletionTime), // ingressHTTPRedirectServer should not be deleted when deleting ingress related TLS server.. - gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1beta1.Server{irrelevantServer, ingressTLSServer, ingressHTTPRedirectServer}), + gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1alpha3.Server{irrelevantServer, ingressTLSServer, ingressHTTPRedirectServer}), }, WantCreates: []runtime.Object{ // The creation of gateways are triggered when setting up the test. - gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1beta1.Server{irrelevantServer, ingressTLSServer, ingressHTTPRedirectServer}), + gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1alpha3.Server{irrelevantServer, ingressTLSServer, ingressHTTPRedirectServer}), }, WantUpdates: []clientgotesting.UpdateActionImpl{{ - Object: gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1beta1.Server{ingressHTTPRedirectServer, irrelevantServer}), + Object: gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1alpha3.Server{ingressHTTPRedirectServer, irrelevantServer}), }}, WantPatches: []clientgotesting.PatchActionImpl{ patchAddFinalizerAction("reconciling-ingress", ""), @@ -731,15 +731,15 @@ func TestReconcile_EnableAutoTLS(t *testing.T) { Objects: []runtime.Object{ ingressWithFinalizers("reconciling-ingress", 1234, ingressTLS, []string{ingressFinalizer}, &deletionTime), // ingressHTTPRedirectServer should not be deleted when deleting ingress related TLS server.. - gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1beta1.Server{irrelevantServer, ingressTLSServer, ingressHTTPRedirectServer}), + gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1alpha3.Server{irrelevantServer, ingressTLSServer, ingressHTTPRedirectServer}), targetSecret("istio-system", "targetSecret", resources.MakeTargetSecretLabels("secret0", "istio-system")), }, WantCreates: []runtime.Object{ // The creation of gateways are triggered when setting up the test. - gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1beta1.Server{irrelevantServer, ingressTLSServer, ingressHTTPRedirectServer}), + gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1alpha3.Server{irrelevantServer, ingressTLSServer, ingressHTTPRedirectServer}), }, WantUpdates: []clientgotesting.UpdateActionImpl{{ - Object: gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1beta1.Server{ingressHTTPRedirectServer, irrelevantServer}), + Object: gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1alpha3.Server{ingressHTTPRedirectServer, irrelevantServer}), }}, WantPatches: []clientgotesting.PatchActionImpl{ patchAddFinalizerAction("reconciling-ingress", ""), @@ -762,14 +762,14 @@ func TestReconcile_EnableAutoTLS(t *testing.T) { Objects: []runtime.Object{ ingressWithTLS("reconciling-ingress", 1234, ingressTLSWithSecretNamespace("knative-serving")), // No Gateway servers match the given TLS of Ingress. - gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1beta1.Server{irrelevantServer}), + gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1alpha3.Server{irrelevantServer}), // The namespace (`knative-serving`) of the origin secret is different // from the namespace (`istio-system`) of Istio gateway service. originSecret("knative-serving", "secret0"), }, WantCreates: []runtime.Object{ // The creation of gateways are triggered when setting up the test. - gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1beta1.Server{irrelevantServer}), + gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1alpha3.Server{irrelevantServer}), resources.MakeMeshVirtualService(context.Background(), insertProbe(ingressWithTLS("reconciling-ingress", 1234, ingressTLSWithSecretNamespace("knative-serving"))), ingressGateway), resources.MakeIngressVirtualService(context.Background(), insertProbe(ingressWithTLS("reconciling-ingress", 1234, ingressTLSWithSecretNamespace("knative-serving"))), @@ -783,7 +783,7 @@ func TestReconcile_EnableAutoTLS(t *testing.T) { }, WantUpdates: []clientgotesting.UpdateActionImpl{{ // ingressTLSServer with the name of the secret copy needs to be added into Gateway. - Object: gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1beta1.Server{withCredentialName(deepCopy(ingressTLSServer), targetSecretName), irrelevantServer}), + Object: gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1alpha3.Server{withCredentialName(deepCopy(ingressTLSServer), targetSecretName), irrelevantServer}), }}, WantPatches: []clientgotesting.PatchActionImpl{ patchAddFinalizerAction("reconciling-ingress", ingressFinalizer), @@ -839,7 +839,7 @@ func TestReconcile_EnableAutoTLS(t *testing.T) { Objects: []runtime.Object{ ingressWithTLS("reconciling-ingress", 1234, ingressTLSWithSecretNamespace("knative-serving")), - gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1beta1.Server{withCredentialName(deepCopy(ingressTLSServer), targetSecretName), irrelevantServer}), + gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1alpha3.Server{withCredentialName(deepCopy(ingressTLSServer), targetSecretName), irrelevantServer}), // The origin secret. originSecret("knative-serving", "secret0"), @@ -860,7 +860,7 @@ func TestReconcile_EnableAutoTLS(t *testing.T) { }, WantCreates: []runtime.Object{ // The creation of gateways are triggered when setting up the test. - gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1beta1.Server{withCredentialName(deepCopy(ingressTLSServer), targetSecretName), irrelevantServer}), + gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1alpha3.Server{withCredentialName(deepCopy(ingressTLSServer), targetSecretName), irrelevantServer}), resources.MakeMeshVirtualService(context.Background(), insertProbe(ingressWithTLS("reconciling-ingress", 1234, ingressTLSWithSecretNamespace("knative-serving"))), ingressGateway), resources.MakeIngressVirtualService(context.Background(), insertProbe(ingressWithTLS("reconciling-ingress", 1234, ingressTLSWithSecretNamespace("knative-serving"))), makeGatewayMap([]string{"knative-testing/" + networking.KnativeIngressGateway}, nil)), @@ -932,12 +932,12 @@ func TestReconcile_EnableAutoTLS(t *testing.T) { Objects: []runtime.Object{ ingressWithTLSClusterLocal("reconciling-ingress", 1234, ingressTLS), // No Gateway servers match the given TLS of Ingress. - gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1beta1.Server{irrelevantServer}), + gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1alpha3.Server{irrelevantServer}), originSecret("istio-system", "secret0"), }, WantCreates: []runtime.Object{ // The creation of gateways are triggered when setting up the test. - gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1beta1.Server{irrelevantServer}), + gateway(networking.KnativeIngressGateway, system.Namespace(), []*istiov1alpha3.Server{irrelevantServer}), resources.MakeMeshVirtualService(context.Background(), insertProbe(ingressWithTLSClusterLocal("reconciling-ingress", 1234, ingressTLS)), ingressGateway), }, WantStatusUpdates: []clientgotesting.UpdateActionImpl{{ @@ -992,7 +992,7 @@ func TestReconcile_EnableAutoTLS(t *testing.T) { // https://github.com/knative/serving/blob/a6852fc3b6cdce72b99c5d578dd64f2e03dabb8b/vendor/k8s.io/client-go/testing/fixture.go#L292 gateways := getGatewaysFromObjects(listers.GetIstioObjects()) for _, gateway := range gateways { - fakeistioclient.Get(ctx).NetworkingV1beta1().Gateways(gateway.Namespace).Create(gateway) + fakeistioclient.Get(ctx).NetworkingV1alpha3().Gateways(gateway.Namespace).Create(gateway) } r := &Reconciler{ @@ -1032,29 +1032,29 @@ func TestReconcile_EnableAutoTLS(t *testing.T) { })) } -func getGatewaysFromObjects(objects []runtime.Object) []*v1beta1.Gateway { - gateways := []*v1beta1.Gateway{} +func getGatewaysFromObjects(objects []runtime.Object) []*v1alpha3.Gateway { + gateways := []*v1alpha3.Gateway{} for _, object := range objects { - if gateway, ok := object.(*v1beta1.Gateway); ok { + if gateway, ok := object.(*v1alpha3.Gateway); ok { gateways = append(gateways, gateway) } } return gateways } -func gateway(name, namespace string, servers []*istiov1beta1.Server) *v1beta1.Gateway { - return &v1beta1.Gateway{ +func gateway(name, namespace string, servers []*istiov1alpha3.Server) *v1alpha3.Gateway { + return &v1alpha3.Gateway{ ObjectMeta: metav1.ObjectMeta{ Name: name, Namespace: namespace, }, - Spec: istiov1beta1.Gateway{ + Spec: istiov1alpha3.Gateway{ Servers: servers, }, } } -func wildcardGateway(name, namespace string, servers []*istiov1beta1.Server, selector map[string]string) *v1beta1.Gateway { +func wildcardGateway(name, namespace string, servers []*istiov1alpha3.Server, selector map[string]string) *v1alpha3.Gateway { gw := gateway(name, namespace, servers) gvk := schema.GroupVersionKind{Version: "v1", Kind: "Secret"} gw.OwnerReferences = []metav1.OwnerReference{*metav1.NewControllerRef(wildcardCert, gvk)} @@ -1083,14 +1083,14 @@ func secret(namespace, name string, labels map[string]string) *corev1.Secret { return &secret } -func withCredentialName(tlsServer *istiov1beta1.Server, credentialName string) *istiov1beta1.Server { +func withCredentialName(tlsServer *istiov1alpha3.Server, credentialName string) *istiov1alpha3.Server { tlsServer.Tls.CredentialName = credentialName return tlsServer } // Open-coded deepCopy since istio.io/api's Server doesn't provide one currently -func deepCopy(server *istiov1beta1.Server) *istiov1beta1.Server { - return proto.Clone(server).(*istiov1beta1.Server) +func deepCopy(server *istiov1alpha3.Server) *istiov1alpha3.Server { + return proto.Clone(server).(*istiov1alpha3.Server) } func ingressTLSWithSecretNamespace(namespace string) []v1alpha1.IngressTLS { @@ -1384,9 +1384,9 @@ func TestGlobalResyncOnUpdateNetwork(t *testing.T) { // Check for Gateway created as a signal that syncHandler ran h.OnUpdate(&istioClient.Fake, "gateways", func(obj runtime.Object) HookResult { - updatedGateway := obj.(*v1beta1.Gateway) + updatedGateway := obj.(*v1alpha3.Gateway) // The expected gateway should include the Istio TLS server. - expectedGateway := gateway("knative-test-gateway", system.Namespace(), []*istiov1beta1.Server{ingressTLSServer}) + expectedGateway := gateway("knative-test-gateway", system.Namespace(), []*istiov1alpha3.Server{ingressTLSServer}) expectedGateway.Spec.Servers = append(expectedGateway.Spec.Servers, ingressHTTPRedirectServer) expectedGateway.Spec.Servers = resources.SortServers(expectedGateway.Spec.Servers) @@ -1444,9 +1444,9 @@ func TestGlobalResyncOnUpdateNetwork(t *testing.T) { // Create a ingress. ingressClient.Create(ingress) - gatewayClient := istioClient.NetworkingV1beta1().Gateways(system.Namespace()) + gatewayClient := istioClient.NetworkingV1alpha3().Gateways(system.Namespace()) // Create a Gateway - if _, err := gatewayClient.Create(gateway("knative-test-gateway", system.Namespace(), []*istiov1beta1.Server{})); err != nil { + if _, err := gatewayClient.Create(gateway("knative-test-gateway", system.Namespace(), []*istiov1alpha3.Server{})); err != nil { t.Fatalf("Error creating gateway: %v", err) } diff --git a/pkg/reconciler/ingress/lister.go b/pkg/reconciler/ingress/lister.go index ddaea4fde1..690bd2f357 100644 --- a/pkg/reconciler/ingress/lister.go +++ b/pkg/reconciler/ingress/lister.go @@ -24,13 +24,13 @@ import ( "strconv" "go.uber.org/zap" - istiov1beta1 "istio.io/api/networking/v1beta1" - "istio.io/client-go/pkg/apis/networking/v1beta1" + istiov1alpha3 "istio.io/api/networking/v1alpha3" + "istio.io/client-go/pkg/apis/networking/v1alpha3" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/sets" corev1listers "k8s.io/client-go/listers/core/v1" "k8s.io/client-go/tools/cache" - istiolisters "knative.dev/net-istio/pkg/client/istio/listers/networking/v1beta1" + istiolisters "knative.dev/net-istio/pkg/client/istio/listers/networking/v1alpha3" network "knative.dev/networking/pkg" "knative.dev/networking/pkg/apis/networking/v1alpha1" "knative.dev/networking/pkg/ingress" @@ -106,7 +106,7 @@ func (l *gatewayPodTargetLister) ListProbeTargets(ctx context.Context, ing *v1al return results, nil } -func (l *gatewayPodTargetLister) getGateway(name string) (*v1beta1.Gateway, error) { +func (l *gatewayPodTargetLister) getGateway(name string) (*v1alpha3.Gateway, error) { namespace, name, err := cache.SplitMetaNamespaceKey(name) if err != nil { return nil, fmt.Errorf("failed to parse Gateway name %q: %w", name, err) @@ -118,7 +118,7 @@ func (l *gatewayPodTargetLister) getGateway(name string) (*v1beta1.Gateway, erro } // listGatewayPodsURLs returns a probe targets for a given Gateway. -func (l *gatewayPodTargetLister) listGatewayTargets(gateway *v1beta1.Gateway) ([]status.ProbeTarget, error) { +func (l *gatewayPodTargetLister) listGatewayTargets(gateway *v1alpha3.Gateway) ([]status.ProbeTarget, error) { selector := labels.SelectorFromSet(gateway.Spec.Selector) services, err := l.serviceLister.List(selector) @@ -148,7 +148,7 @@ func (l *gatewayPodTargetLister) listGatewayTargets(gateway *v1beta1.Gateway) ([ } tURL.Scheme = "http" case "HTTPS": - if server.GetTls().GetMode() == istiov1beta1.ServerTLSSettings_MUTUAL { + if server.GetTls().GetMode() == istiov1alpha3.ServerTLSSettings_MUTUAL { l.logger.Infof("Skipping Server %q because HTTPS with TLS mode MUTUAL is not supported", server.Port.Name) continue } diff --git a/pkg/reconciler/ingress/lister_test.go b/pkg/reconciler/ingress/lister_test.go index f403358a98..2414295724 100644 --- a/pkg/reconciler/ingress/lister_test.go +++ b/pkg/reconciler/ingress/lister_test.go @@ -26,8 +26,8 @@ import ( "testing" "github.com/google/go-cmp/cmp" - istiov1beta1 "istio.io/api/networking/v1beta1" - v1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + istiov1alpha3 "istio.io/api/networking/v1alpha3" + v1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" "knative.dev/net-istio/pkg/reconciler/ingress/config" "knative.dev/networking/pkg/apis/networking/v1alpha1" "knative.dev/networking/pkg/status" @@ -38,7 +38,7 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/util/sets" corev1listers "k8s.io/client-go/listers/core/v1" - istiolisters "knative.dev/net-istio/pkg/client/istio/listers/networking/v1beta1" + istiolisters "knative.dev/net-istio/pkg/client/istio/listers/networking/v1alpha3" ) func TestListProbeTargets(t *testing.T) { @@ -101,15 +101,15 @@ func TestListProbeTargets(t *testing.T) { Namespace: "default", }}, gatewayLister: &fakeGatewayLister{ - gateways: []*v1beta1.Gateway{{ + gateways: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "gateway", }, - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Number: 80, Protocol: "HTTP", }, @@ -143,15 +143,15 @@ func TestListProbeTargets(t *testing.T) { Namespace: "default", }}, gatewayLister: &fakeGatewayLister{ - gateways: []*v1beta1.Gateway{{ + gateways: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "gateway", }, - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Number: 80, Protocol: "HTTP", }, @@ -196,15 +196,15 @@ func TestListProbeTargets(t *testing.T) { Namespace: "default", }}, gatewayLister: &fakeGatewayLister{ - gateways: []*v1beta1.Gateway{{ + gateways: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "gateway", }, - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Number: 80, Protocol: "HTTP", }, @@ -258,15 +258,15 @@ func TestListProbeTargets(t *testing.T) { Namespace: "default", }}, gatewayLister: &fakeGatewayLister{ - gateways: []*v1beta1.Gateway{{ + gateways: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "gateway", }, - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Number: 80, Protocol: "HTTP", }, @@ -321,15 +321,15 @@ func TestListProbeTargets(t *testing.T) { Namespace: "default", }}, gatewayLister: &fakeGatewayLister{ - gateways: []*v1beta1.Gateway{{ + gateways: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "gateway", }, - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Number: 80, Protocol: "HTTP", }, @@ -363,15 +363,15 @@ func TestListProbeTargets(t *testing.T) { Namespace: "default", }}, gatewayLister: &fakeGatewayLister{ - gateways: []*v1beta1.Gateway{{ + gateways: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "gateway", }, - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Number: 80, Protocol: "Mongo", }, @@ -418,15 +418,15 @@ func TestListProbeTargets(t *testing.T) { Namespace: "default", }}, gatewayLister: &fakeGatewayLister{ - gateways: []*v1beta1.Gateway{{ + gateways: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "gateway", }, - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "http", Number: 8080, Protocol: "HTTP", @@ -505,15 +505,15 @@ func TestListProbeTargets(t *testing.T) { Namespace: "default", }}, gatewayLister: &fakeGatewayLister{ - gateways: []*v1beta1.Gateway{{ + gateways: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "gateway", }, - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "https", Number: 8443, Protocol: "HTTPS", @@ -592,21 +592,21 @@ func TestListProbeTargets(t *testing.T) { Namespace: "default", }}, gatewayLister: &fakeGatewayLister{ - gateways: []*v1beta1.Gateway{{ + gateways: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "gateway", }, - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "https", Number: 8443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_MUTUAL, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_MUTUAL, }, }}, Selector: map[string]string{ @@ -679,22 +679,22 @@ func TestListProbeTargets(t *testing.T) { Namespace: "default", }}, gatewayLister: &fakeGatewayLister{ - gateways: []*v1beta1.Gateway{{ + gateways: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "gateway", }, - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "http", Number: 80, Protocol: "HTTP", }, }, { Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "https", Number: 443, Protocol: "HTTPS", @@ -773,25 +773,25 @@ func TestListProbeTargets(t *testing.T) { Namespace: "default", }}, gatewayLister: &fakeGatewayLister{ - gateways: []*v1beta1.Gateway{{ + gateways: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "gateway", }, - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "http", Number: 80, Protocol: "HTTP", }, - Tls: &istiov1beta1.ServerTLSSettings{ + Tls: &istiov1alpha3.ServerTLSSettings{ HttpsRedirect: true, }, }, { Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "https", Number: 443, Protocol: "HTTPS", @@ -865,15 +865,15 @@ func TestListProbeTargets(t *testing.T) { Namespace: "default", }}, gatewayLister: &fakeGatewayLister{ - gateways: []*v1beta1.Gateway{{ + gateways: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "gateway", }, - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "http", Number: 80, Protocol: "GRPC", @@ -947,15 +947,15 @@ func TestListProbeTargets(t *testing.T) { Namespace: "default", }}, gatewayLister: &fakeGatewayLister{ - gateways: []*v1beta1.Gateway{{ + gateways: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "gateway", }, - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "http", Number: 80, Protocol: "HTTP", @@ -1029,15 +1029,15 @@ func TestListProbeTargets(t *testing.T) { Namespace: "default", }}, gatewayLister: &fakeGatewayLister{ - gateways: []*v1beta1.Gateway{{ + gateways: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "gateway", }, - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "http", Number: 80, Protocol: "HTTP", @@ -1052,10 +1052,10 @@ func TestListProbeTargets(t *testing.T) { Namespace: "default", Name: "gateway-two", }, - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "http", Number: 90, Protocol: "HTTP", @@ -1175,15 +1175,15 @@ func TestListProbeTargets(t *testing.T) { Namespace: "default", }}, gatewayLister: &fakeGatewayLister{ - gateways: []*v1beta1.Gateway{{ + gateways: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "ingress-gateway", }, - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "http", Number: 80, Protocol: "HTTP", @@ -1258,22 +1258,22 @@ func TestListProbeTargets(t *testing.T) { Namespace: "default", }}, gatewayLister: &fakeGatewayLister{ - gateways: []*v1beta1.Gateway{{ + gateways: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "gateway", }, - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "http", Number: 80, Protocol: "HTTP", }, }, { Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "https", Number: 443, Protocol: "HTTPS", @@ -1288,10 +1288,10 @@ func TestListProbeTargets(t *testing.T) { Namespace: "default", Name: "local-gateway", }, - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "http", Number: 80, Protocol: "HTTP", @@ -1407,22 +1407,22 @@ func TestListProbeTargets(t *testing.T) { Namespace: "default", }}, gatewayLister: &fakeGatewayLister{ - gateways: []*v1beta1.Gateway{{ + gateways: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "gateway", }, - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "http", Number: 80, Protocol: "HTTP", }, }, { Hosts: []string{"foo.bar.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "http", Number: 80, Protocol: "HTTP", @@ -1498,15 +1498,15 @@ func TestListProbeTargets(t *testing.T) { Namespace: "default", }}, gatewayLister: &fakeGatewayLister{ - gateways: []*v1beta1.Gateway{{ + gateways: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Namespace: "default", Name: "gateway", }, - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "http", Number: 8080, Protocol: "HTTP", @@ -1614,7 +1614,7 @@ func TestListProbeTargets(t *testing.T) { } type fakeGatewayLister struct { - gateways []*v1beta1.Gateway + gateways []*v1alpha3.Gateway fails bool } @@ -1623,7 +1623,7 @@ func (l *fakeGatewayLister) Gateways(namespace string) istiolisters.GatewayNames return &fakeGatewayNamespaceLister{fails: true} } - var matches []*v1beta1.Gateway + var matches []*v1alpha3.Gateway for _, gateway := range l.gateways { if gateway.Namespace == namespace { matches = append(matches, gateway) @@ -1634,22 +1634,22 @@ func (l *fakeGatewayLister) Gateways(namespace string) istiolisters.GatewayNames } } -func (l *fakeGatewayLister) List(selector labels.Selector) ([]*v1beta1.Gateway, error) { +func (l *fakeGatewayLister) List(selector labels.Selector) ([]*v1alpha3.Gateway, error) { log.Panic("not implemented") return nil, nil } type fakeGatewayNamespaceLister struct { - gateways []*v1beta1.Gateway + gateways []*v1alpha3.Gateway fails bool } -func (l *fakeGatewayNamespaceLister) List(selector labels.Selector) ([]*v1beta1.Gateway, error) { +func (l *fakeGatewayNamespaceLister) List(selector labels.Selector) ([]*v1alpha3.Gateway, error) { log.Panic("not implemented") return nil, nil } -func (l *fakeGatewayNamespaceLister) Get(name string) (*v1beta1.Gateway, error) { +func (l *fakeGatewayNamespaceLister) Get(name string) (*v1alpha3.Gateway, error) { if l.fails { return nil, errors.New("failed to get Gateway") } diff --git a/pkg/reconciler/ingress/resources/gateway.go b/pkg/reconciler/ingress/resources/gateway.go index bc7f62f608..43d06f642c 100644 --- a/pkg/reconciler/ingress/resources/gateway.go +++ b/pkg/reconciler/ingress/resources/gateway.go @@ -23,8 +23,8 @@ import ( "sort" "strings" - istiov1beta1 "istio.io/api/networking/v1beta1" - "istio.io/client-go/pkg/apis/networking/v1beta1" + istiov1alpha3 "istio.io/api/networking/v1alpha3" + "istio.io/client-go/pkg/apis/networking/v1alpha3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/equality" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -41,13 +41,13 @@ import ( var httpServerPortName = "http-server" -var gatewayGvk = v1beta1.SchemeGroupVersion.WithKind("Gateway") +var gatewayGvk = v1alpha3.SchemeGroupVersion.WithKind("Gateway") // Istio Gateway requires to have at least one server. This placeholderServer is used when // all of the real servers are deleted. -var placeholderServer = istiov1beta1.Server{ +var placeholderServer = istiov1alpha3.Server{ Hosts: []string{"place-holder.place-holder"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "place-holder", Number: 9999, Protocol: "HTTP", @@ -55,8 +55,8 @@ var placeholderServer = istiov1beta1.Server{ } // GetServers gets the `Servers` from `Gateway` that belongs to the given Ingress. -func GetServers(gateway *v1beta1.Gateway, ing *v1alpha1.Ingress) []*istiov1beta1.Server { - servers := []*istiov1beta1.Server{} +func GetServers(gateway *v1alpha3.Gateway, ing *v1alpha1.Ingress) []*istiov1alpha3.Server { + servers := []*istiov1alpha3.Server{} for i := range gateway.Spec.Servers { if belongsToIngress(gateway.Spec.Servers[i], ing) { servers = append(servers, gateway.Spec.Servers[i]) @@ -66,7 +66,7 @@ func GetServers(gateway *v1beta1.Gateway, ing *v1alpha1.Ingress) []*istiov1beta1 } // GetHTTPServer gets the HTTP `Server` from `Gateway`. -func GetHTTPServer(gateway *v1beta1.Gateway) *istiov1beta1.Server { +func GetHTTPServer(gateway *v1alpha3.Gateway) *istiov1alpha3.Server { for _, server := range gateway.Spec.Servers { // The server with "http" port is the default HTTP server. if server.Port.Name == httpServerPortName || server.Port.Name == "http" { @@ -76,7 +76,7 @@ func GetHTTPServer(gateway *v1beta1.Gateway) *istiov1beta1.Server { return nil } -func belongsToIngress(server *istiov1beta1.Server, ing *v1alpha1.Ingress) bool { +func belongsToIngress(server *istiov1alpha3.Server, ing *v1alpha1.Ingress) bool { // The format of the portName should be "/:". // For example, default/routetest:0. portNameSplits := strings.Split(server.Port.Name, ":") @@ -87,7 +87,7 @@ func belongsToIngress(server *istiov1beta1.Server, ing *v1alpha1.Ingress) bool { } // SortServers sorts `Server` according to its port name. -func SortServers(servers []*istiov1beta1.Server) []*istiov1beta1.Server { +func SortServers(servers []*istiov1alpha3.Server) []*istiov1alpha3.Server { sort.Slice(servers, func(i, j int) bool { return strings.Compare(servers[i].Port.Name, servers[j].Port.Name) < 0 }) @@ -95,12 +95,12 @@ func SortServers(servers []*istiov1beta1.Server) []*istiov1beta1.Server { } // MakeIngressGateways creates Gateways for a given Ingress. -func MakeIngressGateways(ctx context.Context, ing *v1alpha1.Ingress, originSecrets map[string]*corev1.Secret, svcLister corev1listers.ServiceLister) ([]*v1beta1.Gateway, error) { +func MakeIngressGateways(ctx context.Context, ing *v1alpha1.Ingress, originSecrets map[string]*corev1.Secret, svcLister corev1listers.ServiceLister) ([]*v1alpha3.Gateway, error) { gatewayServices, err := getGatewayServices(ctx, svcLister) if err != nil { return nil, err } - gateways := make([]*v1beta1.Gateway, len(gatewayServices)) + gateways := make([]*v1alpha3.Gateway, len(gatewayServices)) for i, gatewayService := range gatewayServices { gateway, err := makeIngressGateway(ctx, ing, originSecrets, gatewayService.Spec.Selector, gatewayService) if err != nil { @@ -114,15 +114,15 @@ func MakeIngressGateways(ctx context.Context, ing *v1alpha1.Ingress, originSecre // MakeWildcardGateways creates gateways with wildcard hosts based on the wildcard secret information. // For each public ingress service, we will create a list of Gateways. Each Gateway of the list corresponds to a wildcard cert secret. func MakeWildcardGateways(ctx context.Context, originWildcardSecrets map[string]*corev1.Secret, - svcLister corev1listers.ServiceLister) ([]*v1beta1.Gateway, error) { + svcLister corev1listers.ServiceLister) ([]*v1alpha3.Gateway, error) { if len(originWildcardSecrets) == 0 { - return []*v1beta1.Gateway{}, nil + return []*v1alpha3.Gateway{}, nil } gatewayServices, err := getGatewayServices(ctx, svcLister) if err != nil { return nil, err } - gateways := []*v1beta1.Gateway{} + gateways := []*v1alpha3.Gateway{} for _, gatewayService := range gatewayServices { gws, err := makeWildcardGateways(ctx, originWildcardSecrets, gatewayService) if err != nil { @@ -134,8 +134,8 @@ func MakeWildcardGateways(ctx context.Context, originWildcardSecrets map[string] } func makeWildcardGateways(ctx context.Context, originWildcardSecrets map[string]*corev1.Secret, - gatewayService *corev1.Service) ([]*v1beta1.Gateway, error) { - gateways := make([]*v1beta1.Gateway, 0, len(originWildcardSecrets)) + gatewayService *corev1.Service) ([]*v1alpha3.Gateway, error) { + gateways := make([]*v1alpha3.Gateway, 0, len(originWildcardSecrets)) for _, secret := range originWildcardSecrets { hosts, err := GetHostsFromCertSecret(secret) if err != nil { @@ -147,15 +147,15 @@ func makeWildcardGateways(ctx context.Context, originWildcardSecrets map[string] if secret.Namespace == gatewayService.Namespace { credentialName = secret.Name } - servers := []*istiov1beta1.Server{{ + servers := []*istiov1alpha3.Server{{ Hosts: hosts, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "https", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, CredentialName: credentialName, @@ -166,13 +166,13 @@ func makeWildcardGateways(ctx context.Context, originWildcardSecrets map[string] servers = append(servers, httpServer) } gvk := schema.GroupVersionKind{Version: "v1", Kind: "Secret"} - gateways = append(gateways, &v1beta1.Gateway{ + gateways = append(gateways, &v1alpha3.Gateway{ ObjectMeta: metav1.ObjectMeta{ Name: WildcardGatewayName(secret.Name, gatewayService.Namespace, gatewayService.Name), Namespace: secret.Namespace, OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(secret, gvk)}, }, - Spec: istiov1beta1.Gateway{ + Spec: istiov1alpha3.Gateway{ Selector: gatewayService.Spec.Selector, Servers: servers, }, @@ -187,7 +187,7 @@ func WildcardGatewayName(secretName, gatewayServiceNamespace, gatewayServiceName } // GetQualifiedGatewayNames return the qualified Gateway names for the given Gateways. -func GetQualifiedGatewayNames(gateways []*v1beta1.Gateway) []string { +func GetQualifiedGatewayNames(gateways []*v1alpha3.Gateway) []string { result := make([]string, 0, len(gateways)) for _, gw := range gateways { result = append(result, gw.Namespace+"/"+gw.Name) @@ -196,7 +196,7 @@ func GetQualifiedGatewayNames(gateways []*v1beta1.Gateway) []string { } // GatewayRef returns the ObjectReference for a give Gateway. -func GatewayRef(gw *v1beta1.Gateway) corev1.ObjectReference { +func GatewayRef(gw *v1alpha3.Gateway) corev1.ObjectReference { apiVersion, kind := gatewayGvk.ToAPIVersionAndKind() return corev1.ObjectReference{ APIVersion: apiVersion, @@ -206,7 +206,7 @@ func GatewayRef(gw *v1beta1.Gateway) corev1.ObjectReference { } } -func makeIngressGateway(ctx context.Context, ing *v1alpha1.Ingress, originSecrets map[string]*corev1.Secret, selector map[string]string, gatewayService *corev1.Service) (*v1beta1.Gateway, error) { +func makeIngressGateway(ctx context.Context, ing *v1alpha1.Ingress, originSecrets map[string]*corev1.Secret, selector map[string]string, gatewayService *corev1.Service) (*v1alpha3.Gateway, error) { ns := ing.GetNamespace() if len(ns) == 0 { ns = system.Namespace() @@ -223,7 +223,7 @@ func makeIngressGateway(ctx context.Context, ing *v1alpha1.Ingress, originSecret if httpServer != nil { servers = append(servers, httpServer) } - return &v1beta1.Gateway{ + return &v1alpha3.Gateway{ ObjectMeta: metav1.ObjectMeta{ Name: GatewayName(ing, gatewayService), Namespace: ns, @@ -233,7 +233,7 @@ func makeIngressGateway(ctx context.Context, ing *v1alpha1.Ingress, originSecret networking.IngressLabelKey: ing.GetName(), }, }, - Spec: istiov1beta1.Gateway{ + Spec: istiov1alpha3.Gateway{ Selector: selector, Servers: servers, }, @@ -264,8 +264,8 @@ func GatewayName(accessor kmeta.Accessor, gatewaySvc *corev1.Service) string { } // MakeTLSServers creates the expected Gateway TLS `Servers` based on the given IngressTLS. -func MakeTLSServers(ing *v1alpha1.Ingress, ingressTLS []v1alpha1.IngressTLS, gatewayServiceNamespace string, originSecrets map[string]*corev1.Secret) ([]*istiov1beta1.Server, error) { - servers := make([]*istiov1beta1.Server, len(ingressTLS)) +func MakeTLSServers(ing *v1alpha1.Ingress, ingressTLS []v1alpha1.IngressTLS, gatewayServiceNamespace string, originSecrets map[string]*corev1.Secret) ([]*istiov1alpha3.Server, error) { + servers := make([]*istiov1alpha3.Server, len(ingressTLS)) // TODO(zhiminx): for the hosts that does not included in the IngressTLS but listed in the IngressRule, // do we consider them as hosts for HTTP? for i, tls := range ingressTLS { @@ -282,15 +282,15 @@ func MakeTLSServers(ing *v1alpha1.Ingress, ingressTLS []v1alpha1.IngressTLS, gat port := ing.GetNamespace() + "/" + ing.GetName() - servers[i] = &istiov1beta1.Server{ + servers[i] = &istiov1alpha3.Server{ Hosts: tls.Hosts, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: fmt.Sprintf("%s:%d", port, i), Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, CredentialName: credentialName, @@ -302,20 +302,20 @@ func MakeTLSServers(ing *v1alpha1.Ingress, ingressTLS []v1alpha1.IngressTLS, gat // MakeHTTPServer creates a HTTP Gateway `Server` based on the HTTPProtocol // configuration. -func MakeHTTPServer(httpProtocol network.HTTPProtocol, hosts []string) *istiov1beta1.Server { +func MakeHTTPServer(httpProtocol network.HTTPProtocol, hosts []string) *istiov1alpha3.Server { if httpProtocol == network.HTTPDisabled { return nil } - server := &istiov1beta1.Server{ + server := &istiov1alpha3.Server{ Hosts: hosts, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: httpServerPortName, Number: 80, Protocol: "HTTP", }, } if httpProtocol == network.HTTPRedirected { - server.Tls = &istiov1beta1.ServerTLSSettings{ + server.Tls = &istiov1alpha3.ServerTLSSettings{ HttpsRedirect: true, } } @@ -362,13 +362,13 @@ func GetIngressGatewaySvcNameNamespaces(ctx context.Context) ([]metav1.ObjectMet } // UpdateGateway replaces the existing servers with the wanted servers. -func UpdateGateway(gateway *v1beta1.Gateway, want []*istiov1beta1.Server, existing []*istiov1beta1.Server) *v1beta1.Gateway { +func UpdateGateway(gateway *v1alpha3.Gateway, want []*istiov1alpha3.Server, existing []*istiov1alpha3.Server) *v1alpha3.Gateway { existingServers := sets.String{} for i := range existing { existingServers.Insert(existing[i].Port.Name) } - servers := []*istiov1beta1.Server{} + servers := []*istiov1alpha3.Server{} for _, server := range gateway.Spec.Servers { // We remove // 1) the existing servers @@ -391,6 +391,6 @@ func UpdateGateway(gateway *v1beta1.Gateway, want []*istiov1beta1.Server, existi return gateway } -func isPlaceHolderServer(server *istiov1beta1.Server) bool { +func isPlaceHolderServer(server *istiov1alpha3.Server) bool { return equality.Semantic.DeepEqual(server, &placeholderServer) } diff --git a/pkg/reconciler/ingress/resources/gateway_test.go b/pkg/reconciler/ingress/resources/gateway_test.go index d0ba919d7c..8ab2b98bc3 100644 --- a/pkg/reconciler/ingress/resources/gateway_test.go +++ b/pkg/reconciler/ingress/resources/gateway_test.go @@ -29,8 +29,8 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" corev1listers "k8s.io/client-go/listers/core/v1" - istiov1beta1 "istio.io/api/networking/v1beta1" - "istio.io/client-go/pkg/apis/networking/v1beta1" + istiov1alpha3 "istio.io/api/networking/v1alpha3" + "istio.io/client-go/pkg/apis/networking/v1alpha3" "knative.dev/net-istio/pkg/reconciler/ingress/config" network "knative.dev/networking/pkg" "knative.dev/networking/pkg/apis/networking" @@ -68,68 +68,68 @@ var selector = map[string]string{ "istio": "ingressgateway", } -var gateway = v1beta1.Gateway{ - Spec: istiov1beta1.Gateway{ +var gateway = v1alpha3.Gateway{ + Spec: istiov1alpha3.Gateway{ Servers: servers, }, } -var servers = []*istiov1beta1.Server{{ +var servers = []*istiov1alpha3.Server{{ Hosts: []string{"host1.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "test-ns/ingress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, }, }, { Hosts: []string{"host2.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "test-ns/non-ingress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, }, }} -var httpServer = istiov1beta1.Server{ +var httpServer = istiov1alpha3.Server{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: httpServerPortName, Number: 80, Protocol: "HTTP", }, } -var gatewayWithPlaceholderServer = v1beta1.Gateway{ - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{&placeholderServer}, +var gatewayWithPlaceholderServer = v1alpha3.Gateway{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{&placeholderServer}, }, } -var gatewayWithModifiedWildcardTLSServer = v1beta1.Gateway{ - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{&modifiedDefaultTLSServer}, +var gatewayWithModifiedWildcardTLSServer = v1alpha3.Gateway{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{&modifiedDefaultTLSServer}, }, } -var modifiedDefaultTLSServer = istiov1beta1.Server{ +var modifiedDefaultTLSServer = istiov1alpha3.Server{ Hosts: []string{"added.by.user.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "https", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, }, @@ -156,15 +156,15 @@ var ingressResource = v1alpha1.Ingress{ func TestGetServers(t *testing.T) { servers := GetServers(&gateway, &ingressResource) - expected := []*istiov1beta1.Server{{ + expected := []*istiov1alpha3.Server{{ Hosts: []string{"host1.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "test-ns/ingress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, }, @@ -179,9 +179,9 @@ func TestGetHTTPServer(t *testing.T) { newGateway := gateway newGateway.Spec.Servers = append(newGateway.Spec.Servers, &httpServer) server := GetHTTPServer(&newGateway) - expected := &istiov1beta1.Server{ + expected := &istiov1alpha3.Server{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: httpServerPortName, Number: 80, Protocol: "HTTP", @@ -198,7 +198,7 @@ func TestMakeTLSServers(t *testing.T) { ci *v1alpha1.Ingress gatewayServiceNamespace string originSecrets map[string]*corev1.Secret - expected []*istiov1beta1.Server + expected []*istiov1alpha3.Server wantErr bool }{{ name: "secret namespace is the different from the gateway service namespace", @@ -206,15 +206,15 @@ func TestMakeTLSServers(t *testing.T) { // gateway service namespace is "istio-system", while the secret namespace is system.Namespace()("knative-testing"). gatewayServiceNamespace: "istio-system", originSecrets: originSecrets, - expected: []*istiov1beta1.Server{{ + expected: []*istiov1alpha3.Server{{ Hosts: []string{"host1.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "test-ns/ingress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, CredentialName: targetSecret(&secret, &ingressResource), @@ -226,15 +226,15 @@ func TestMakeTLSServers(t *testing.T) { // gateway service namespace and the secret namespace are both in system.Namespace(). gatewayServiceNamespace: system.Namespace(), originSecrets: originSecrets, - expected: []*istiov1beta1.Server{{ + expected: []*istiov1alpha3.Server{{ Hosts: []string{"host1.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "test-ns/ingress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, CredentialName: "secret0", @@ -245,16 +245,16 @@ func TestMakeTLSServers(t *testing.T) { ci: &ingressResource, gatewayServiceNamespace: system.Namespace(), originSecrets: originSecrets, - expected: []*istiov1beta1.Server{{ + expected: []*istiov1alpha3.Server{{ Hosts: []string{"host1.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ // port name is created with / Name: "test-ns/ingress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, CredentialName: "secret0", @@ -284,7 +284,7 @@ func TestMakeHTTPServer(t *testing.T) { cases := []struct { name string httpProtocol network.HTTPProtocol - expected *istiov1beta1.Server + expected *istiov1alpha3.Server }{{ name: "nil HTTP Server", httpProtocol: network.HTTPDisabled, @@ -292,9 +292,9 @@ func TestMakeHTTPServer(t *testing.T) { }, { name: "HTTP server", httpProtocol: network.HTTPEnabled, - expected: &istiov1beta1.Server{ + expected: &istiov1alpha3.Server{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: httpServerPortName, Number: 80, Protocol: "HTTP", @@ -303,14 +303,14 @@ func TestMakeHTTPServer(t *testing.T) { }, { name: "Redirect HTTP server", httpProtocol: network.HTTPRedirected, - expected: &istiov1beta1.Server{ + expected: &istiov1alpha3.Server{ Hosts: []string{"*"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: httpServerPortName, Number: 80, Protocol: "HTTP", }, - Tls: &istiov1beta1.ServerTLSSettings{ + Tls: &istiov1alpha3.ServerTLSSettings{ HttpsRedirect: true, }, }, @@ -328,63 +328,63 @@ func TestMakeHTTPServer(t *testing.T) { func TestUpdateGateway(t *testing.T) { cases := []struct { name string - existingServers []*istiov1beta1.Server - newServers []*istiov1beta1.Server - original v1beta1.Gateway - expected v1beta1.Gateway + existingServers []*istiov1alpha3.Server + newServers []*istiov1alpha3.Server + original v1alpha3.Gateway + expected v1alpha3.Gateway }{{ name: "Update Gateway servers.", - existingServers: []*istiov1beta1.Server{{ + existingServers: []*istiov1alpha3.Server{{ Hosts: []string{"host1.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "test-ns/ingress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, }, }}, - newServers: []*istiov1beta1.Server{{ + newServers: []*istiov1alpha3.Server{{ Hosts: []string{"host-new.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "test-ns/ingress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, }, }}, original: gateway, - expected: v1beta1.Gateway{ - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + expected: v1alpha3.Gateway{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ // The host name was updated to the one in "newServers". Hosts: []string{"host-new.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "test-ns/ingress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, }, }, { Hosts: []string{"host2.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "test-ns/non-ingress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, }, @@ -393,33 +393,33 @@ func TestUpdateGateway(t *testing.T) { }, }, { name: "Delete servers from Gateway", - existingServers: []*istiov1beta1.Server{{ + existingServers: []*istiov1alpha3.Server{{ Hosts: []string{"host1.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "test-ns/ingress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, }, }}, - newServers: []*istiov1beta1.Server{}, + newServers: []*istiov1alpha3.Server{}, original: gateway, - expected: v1beta1.Gateway{ - Spec: istiov1beta1.Gateway{ + expected: v1alpha3.Gateway{ + Spec: istiov1alpha3.Gateway{ // Only one server is left. The other one is deleted. - Servers: []*istiov1beta1.Server{{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"host2.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "test-ns/non-ingress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, }, @@ -430,63 +430,63 @@ func TestUpdateGateway(t *testing.T) { name: "Delete servers from Gateway and no real servers are left", // All of the servers in the original gateway will be deleted. - existingServers: []*istiov1beta1.Server{{ + existingServers: []*istiov1alpha3.Server{{ Hosts: []string{"host1.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "test-ns/ingress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, }, }, { Hosts: []string{"host2.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "test-ns/non-ingress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, }, }}, - newServers: []*istiov1beta1.Server{}, + newServers: []*istiov1alpha3.Server{}, original: gateway, expected: gatewayWithPlaceholderServer, }, { name: "Add servers to the gateway with only placeholder server", - existingServers: []*istiov1beta1.Server{}, - newServers: []*istiov1beta1.Server{{ + existingServers: []*istiov1alpha3.Server{}, + newServers: []*istiov1alpha3.Server{{ Hosts: []string{"host1.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "test-ns/ingress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, }, }}, original: gatewayWithPlaceholderServer, // The placeholder server should be deleted. - expected: v1beta1.Gateway{ - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{{ + expected: v1alpha3.Gateway{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"host1.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "test-ns/ingress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, }, @@ -495,33 +495,33 @@ func TestUpdateGateway(t *testing.T) { }, }, { name: "Do not delete modified wildcard servers from gateway", - existingServers: []*istiov1beta1.Server{}, - newServers: []*istiov1beta1.Server{{ + existingServers: []*istiov1alpha3.Server{}, + newServers: []*istiov1alpha3.Server{{ Hosts: []string{"host1.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "clusteringress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, }, }}, original: gatewayWithModifiedWildcardTLSServer, - expected: v1beta1.Gateway{ - Spec: istiov1beta1.Gateway{ - Servers: []*istiov1beta1.Server{ + expected: v1alpha3.Gateway{ + Spec: istiov1alpha3.Gateway{ + Servers: []*istiov1alpha3.Server{ { Hosts: []string{"host1.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "clusteringress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, }, @@ -547,7 +547,7 @@ func TestMakeWildcardGateways(t *testing.T) { name string wildcardSecrets map[string]*corev1.Secret gatewayService *corev1.Service - want []*v1beta1.Gateway + want []*v1alpha3.Gateway wantErr bool }{{ name: "happy path: secret namespace is the different from the gateway service namespace", @@ -561,30 +561,30 @@ func TestMakeWildcardGateways(t *testing.T) { Selector: selector, }, }, - want: []*v1beta1.Gateway{{ + want: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Name: WildcardGatewayName(wildcardSecret.Name, "istio-system", "istio-ingressgateway"), Namespace: system.Namespace(), OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(wildcardSecret, secretGVK)}, }, - Spec: istiov1beta1.Gateway{ + Spec: istiov1alpha3.Gateway{ Selector: selector, - Servers: []*istiov1beta1.Server{{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "https", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, CredentialName: targetWildcardSecretName(wildcardSecret.Name, wildcardSecret.Namespace), }, }, { Hosts: []string{"*.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: httpServerPortName, Number: 80, Protocol: "HTTP", @@ -604,30 +604,30 @@ func TestMakeWildcardGateways(t *testing.T) { Selector: selector, }, }, - want: []*v1beta1.Gateway{{ + want: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Name: WildcardGatewayName(wildcardSecret.Name, system.Namespace(), "istio-ingressgateway"), Namespace: system.Namespace(), OwnerReferences: []metav1.OwnerReference{*metav1.NewControllerRef(wildcardSecret, secretGVK)}, }, - Spec: istiov1beta1.Gateway{ + Spec: istiov1alpha3.Gateway{ Selector: selector, - Servers: []*istiov1beta1.Server{{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"*.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "https", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, CredentialName: wildcardSecret.Name, }, }, { Hosts: []string{"*.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: httpServerPortName, Number: 80, Protocol: "HTTP", @@ -678,14 +678,14 @@ func TestMakeWildcardGateways(t *testing.T) { } func TestGatewayRef(t *testing.T) { - gw := &v1beta1.Gateway{ + gw := &v1alpha3.Gateway{ ObjectMeta: metav1.ObjectMeta{ Name: "istio-ingress-gateway", Namespace: "knative-serving", }, } want := corev1.ObjectReference{ - APIVersion: "networking.istio.io/v1beta1", + APIVersion: "networking.istio.io/v1alpha3", Kind: "Gateway", Name: "istio-ingress-gateway", Namespace: "knative-serving", @@ -697,7 +697,7 @@ func TestGatewayRef(t *testing.T) { } func TestGetQualifiedGatewayNames(t *testing.T) { - gateways := []*v1beta1.Gateway{{ + gateways := []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Name: "istio-ingress-gateway", Namespace: "knative-serving", @@ -715,7 +715,7 @@ func TestMakeIngressGateways(t *testing.T) { ia *v1alpha1.Ingress originSecrets map[string]*corev1.Secret gatewayService *corev1.Service - want []*v1beta1.Gateway + want []*v1alpha3.Gateway wantErr bool }{{ name: "happy path: secret namespace is the different from the gateway service namespace", @@ -730,7 +730,7 @@ func TestMakeIngressGateways(t *testing.T) { Selector: selector, }, }, - want: []*v1beta1.Gateway{{ + want: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("ingress-%d", adler32.Checksum([]byte("istio-system/istio-ingressgateway"))), Namespace: "test-ns", @@ -739,24 +739,24 @@ func TestMakeIngressGateways(t *testing.T) { networking.IngressLabelKey: "ingress", }, }, - Spec: istiov1beta1.Gateway{ + Spec: istiov1alpha3.Gateway{ Selector: selector, - Servers: []*istiov1beta1.Server{{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"host1.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "test-ns/ingress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, CredentialName: targetSecret(&secret, &ingressResource), }, }, { Hosts: []string{"host1.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: httpServerPortName, Number: 80, Protocol: "HTTP", @@ -778,7 +778,7 @@ func TestMakeIngressGateways(t *testing.T) { Selector: selector, }, }, - want: []*v1beta1.Gateway{{ + want: []*v1alpha3.Gateway{{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf("ingress-%d", adler32.Checksum([]byte(system.Namespace()+"/istio-ingressgateway"))), Namespace: "test-ns", @@ -787,24 +787,24 @@ func TestMakeIngressGateways(t *testing.T) { networking.IngressLabelKey: "ingress", }, }, - Spec: istiov1beta1.Gateway{ + Spec: istiov1alpha3.Gateway{ Selector: selector, - Servers: []*istiov1beta1.Server{{ + Servers: []*istiov1alpha3.Server{{ Hosts: []string{"host1.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: "test-ns/ingress:0", Number: 443, Protocol: "HTTPS", }, - Tls: &istiov1beta1.ServerTLSSettings{ - Mode: istiov1beta1.ServerTLSSettings_SIMPLE, + Tls: &istiov1alpha3.ServerTLSSettings{ + Mode: istiov1alpha3.ServerTLSSettings_SIMPLE, ServerCertificate: corev1.TLSCertKey, PrivateKey: corev1.TLSPrivateKeyKey, CredentialName: secret.Name, }, }, { Hosts: []string{"host1.example.com"}, - Port: &istiov1beta1.Port{ + Port: &istiov1alpha3.Port{ Name: httpServerPortName, Number: 80, Protocol: "HTTP", diff --git a/pkg/reconciler/ingress/resources/virtual_service.go b/pkg/reconciler/ingress/resources/virtual_service.go index 2800aa4c82..a97c58d86f 100644 --- a/pkg/reconciler/ingress/resources/virtual_service.go +++ b/pkg/reconciler/ingress/resources/virtual_service.go @@ -25,8 +25,8 @@ import ( "k8s.io/apimachinery/pkg/util/sets" "github.com/gogo/protobuf/types" - istiov1beta1 "istio.io/api/networking/v1beta1" - "istio.io/client-go/pkg/apis/networking/v1beta1" + istiov1alpha3 "istio.io/api/networking/v1alpha3" + "istio.io/client-go/pkg/apis/networking/v1alpha3" "knative.dev/net-istio/pkg/reconciler/ingress/config" "knative.dev/net-istio/pkg/reconciler/ingress/resources/names" "knative.dev/networking/pkg/apis/networking" @@ -56,8 +56,8 @@ func VirtualServiceNamespace(ing *v1alpha1.Ingress) string { // MakeIngressVirtualService creates Istio VirtualService as network // programming for Istio Gateways other than 'mesh'. -func MakeIngressVirtualService(ctx context.Context, ing *v1alpha1.Ingress, gateways map[v1alpha1.IngressVisibility]sets.String) *v1beta1.VirtualService { - vs := &v1beta1.VirtualService{ +func MakeIngressVirtualService(ctx context.Context, ing *v1alpha1.Ingress, gateways map[v1alpha1.IngressVisibility]sets.String) *v1alpha3.VirtualService { + vs := &v1alpha3.VirtualService{ ObjectMeta: metav1.ObjectMeta{ Name: names.IngressVirtualService(ing), Namespace: VirtualServiceNamespace(ing), @@ -76,7 +76,7 @@ func MakeIngressVirtualService(ctx context.Context, ing *v1alpha1.Ingress, gatew } // MakeMeshVirtualService creates a mesh Virtual Service -func MakeMeshVirtualService(ctx context.Context, ing *v1alpha1.Ingress, gateways map[v1alpha1.IngressVisibility]sets.String) *v1beta1.VirtualService { +func MakeMeshVirtualService(ctx context.Context, ing *v1alpha1.Ingress, gateways map[v1alpha1.IngressVisibility]sets.String) *v1alpha3.VirtualService { hosts := keepLocalHostnames(getHosts(ing)) // If cluster local gateway is configured, we need to expand hosts because of // https://github.com/knative/serving/issues/6488#issuecomment-573513768. @@ -86,7 +86,7 @@ func MakeMeshVirtualService(ctx context.Context, ing *v1alpha1.Ingress, gateways if len(hosts) == 0 { return nil } - vs := &v1beta1.VirtualService{ + vs := &v1alpha3.VirtualService{ ObjectMeta: metav1.ObjectMeta{ Name: names.MeshVirtualService(ing), Namespace: VirtualServiceNamespace(ing), @@ -107,13 +107,13 @@ func MakeMeshVirtualService(ctx context.Context, ing *v1alpha1.Ingress, gateways } // MakeVirtualServices creates a mesh VirtualService and a virtual service for each gateway -func MakeVirtualServices(ctx context.Context, ing *v1alpha1.Ingress, gateways map[v1alpha1.IngressVisibility]sets.String) ([]*v1beta1.VirtualService, error) { +func MakeVirtualServices(ctx context.Context, ing *v1alpha1.Ingress, gateways map[v1alpha1.IngressVisibility]sets.String) ([]*v1alpha3.VirtualService, error) { // Insert probe header ing = ing.DeepCopy() if _, err := ingress.InsertProbe(ing); err != nil { return nil, fmt.Errorf("failed to insert a probe into the Ingress: %w", err) } - vss := []*v1beta1.VirtualService{} + vss := []*v1alpha3.VirtualService{} if meshVs := MakeMeshVirtualService(ctx, ing, gateways); meshVs != nil { vss = append(vss, meshVs) } @@ -133,8 +133,8 @@ func MakeVirtualServices(ctx context.Context, ing *v1alpha1.Ingress, gateways ma return vss, nil } -func makeVirtualServiceSpec(ctx context.Context, ing *v1alpha1.Ingress, gateways map[v1alpha1.IngressVisibility]sets.String, hosts sets.String) *istiov1beta1.VirtualService { - spec := istiov1beta1.VirtualService{ +func makeVirtualServiceSpec(ctx context.Context, ing *v1alpha1.Ingress, gateways map[v1alpha1.IngressVisibility]sets.String, hosts sets.String) *istiov1alpha3.VirtualService { + spec := istiov1alpha3.VirtualService{ Hosts: hosts.List(), } @@ -159,8 +159,8 @@ func makeVirtualServiceSpec(ctx context.Context, ing *v1alpha1.Ingress, gateways return &spec } -func makeVirtualServiceRoute(ctx context.Context, hosts sets.String, http *v1alpha1.HTTPIngressPath, gateways map[v1alpha1.IngressVisibility]sets.String, visibility v1alpha1.IngressVisibility) *istiov1beta1.HTTPRoute { - matches := []*istiov1beta1.HTTPMatchRequest{} +func makeVirtualServiceRoute(ctx context.Context, hosts sets.String, http *v1alpha1.HTTPIngressPath, gateways map[v1alpha1.IngressVisibility]sets.String, visibility v1alpha1.IngressVisibility) *istiov1alpha3.HTTPRoute { + matches := []*istiov1alpha3.HTTPMatchRequest{} clusterDomainName := network.GetClusterDomainName() for _, host := range hosts.List() { g := gateways[visibility] @@ -171,22 +171,22 @@ func makeVirtualServiceRoute(ctx context.Context, hosts sets.String, http *v1alp matches = append(matches, makeMatch(host, http.Path, http.Headers, g)) } - weights := []*istiov1beta1.HTTPRouteDestination{} + weights := []*istiov1alpha3.HTTPRouteDestination{} for _, split := range http.Splits { - var h *istiov1beta1.Headers + var h *istiov1alpha3.Headers if len(split.AppendHeaders) > 0 { - h = &istiov1beta1.Headers{ - Request: &istiov1beta1.Headers_HeaderOperations{ + h = &istiov1alpha3.Headers{ + Request: &istiov1alpha3.Headers_HeaderOperations{ Set: split.AppendHeaders, }, } } - weights = append(weights, &istiov1beta1.HTTPRouteDestination{ - Destination: &istiov1beta1.Destination{ + weights = append(weights, &istiov1alpha3.HTTPRouteDestination{ + Destination: &istiov1alpha3.Destination{ Host: network.GetServiceHostname( split.ServiceName, split.ServiceNamespace), - Port: &istiov1beta1.PortSelector{ + Port: &istiov1alpha3.PortSelector{ Number: uint32(split.ServicePort.IntValue()), }, }, @@ -195,30 +195,30 @@ func makeVirtualServiceRoute(ctx context.Context, hosts sets.String, http *v1alp }) } - var h *istiov1beta1.Headers + var h *istiov1alpha3.Headers if len(http.AppendHeaders) > 0 { - h = &istiov1beta1.Headers{ - Request: &istiov1beta1.Headers_HeaderOperations{ + h = &istiov1alpha3.Headers{ + Request: &istiov1alpha3.Headers_HeaderOperations{ Set: http.AppendHeaders, }, } } - var rewrite *istiov1beta1.HTTPRewrite + var rewrite *istiov1alpha3.HTTPRewrite if http.RewriteHost != "" { - rewrite = &istiov1beta1.HTTPRewrite{ + rewrite = &istiov1alpha3.HTTPRewrite{ Authority: http.RewriteHost, } - weights = []*istiov1beta1.HTTPRouteDestination{{ + weights = []*istiov1alpha3.HTTPRouteDestination{{ Weight: 100, - Destination: &istiov1beta1.Destination{ + Destination: &istiov1alpha3.Destination{ Host: privateGatewayServiceURLFromContext(ctx), }, }} } - route := &istiov1beta1.HTTPRoute{ + route := &istiov1alpha3.HTTPRoute{ Match: matches, Route: weights, Rewrite: rewrite, @@ -227,9 +227,9 @@ func makeVirtualServiceRoute(ctx context.Context, hosts sets.String, http *v1alp if http.Timeout != nil { route.Timeout = types.DurationProto(http.Timeout.Duration) } - route.Retries = &istiov1beta1.HTTPRetry{} + route.Retries = &istiov1alpha3.HTTPRetry{} if http.Retries != nil && http.Retries.Attempts > 0 { - route.Retries = &istiov1beta1.HTTPRetry{ + route.Retries = &istiov1alpha3.HTTPRetry{ RetryOn: retriableConditions, Attempts: int32(http.Retries.Attempts), } @@ -251,26 +251,26 @@ func keepLocalHostnames(hosts sets.String) sets.String { return retained } -func makeMatch(host string, pathRegExp string, headers map[string]v1alpha1.HeaderMatch, gateways sets.String) *istiov1beta1.HTTPMatchRequest { - match := &istiov1beta1.HTTPMatchRequest{ +func makeMatch(host string, pathRegExp string, headers map[string]v1alpha1.HeaderMatch, gateways sets.String) *istiov1alpha3.HTTPMatchRequest { + match := &istiov1alpha3.HTTPMatchRequest{ Gateways: gateways.List(), - Authority: &istiov1beta1.StringMatch{ + Authority: &istiov1alpha3.StringMatch{ // Do not use Regex as Istio 1.4 or later has 100 bytes limitation. - MatchType: &istiov1beta1.StringMatch_Prefix{Prefix: hostPrefix(host)}, + MatchType: &istiov1alpha3.StringMatch_Prefix{Prefix: hostPrefix(host)}, }, } // Empty pathRegExp is considered match all path. We only need to // consider pathRegExp when it's non-empty. if pathRegExp != "" { - match.Uri = &istiov1beta1.StringMatch{ - MatchType: &istiov1beta1.StringMatch_Regex{Regex: pathRegExp}, + match.Uri = &istiov1alpha3.StringMatch{ + MatchType: &istiov1alpha3.StringMatch_Regex{Regex: pathRegExp}, } } for k, v := range headers { - match.Headers = map[string]*istiov1beta1.StringMatch{ + match.Headers = map[string]*istiov1alpha3.StringMatch{ k: { - MatchType: &istiov1beta1.StringMatch_Exact{ + MatchType: &istiov1alpha3.StringMatch_Exact{ Exact: v.Exact, }, }, diff --git a/pkg/reconciler/ingress/resources/virtual_service_test.go b/pkg/reconciler/ingress/resources/virtual_service_test.go index cd97a48e44..34eec8098f 100644 --- a/pkg/reconciler/ingress/resources/virtual_service_test.go +++ b/pkg/reconciler/ingress/resources/virtual_service_test.go @@ -23,7 +23,7 @@ import ( "github.com/gogo/protobuf/types" "github.com/google/go-cmp/cmp" - istiov1beta1 "istio.io/api/networking/v1beta1" + istiov1alpha3 "istio.io/api/networking/v1alpha3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" "k8s.io/apimachinery/pkg/util/sets" @@ -372,7 +372,7 @@ func TestMakeMeshVirtualServiceSpec_CorrectRetries(t *testing.T) { for _, tc := range []struct { name string ci *v1alpha1.Ingress - expected *istiov1beta1.HTTPRetry + expected *istiov1alpha3.HTTPRetry }{{ name: "default retries", ci: &v1alpha1.Ingress{ @@ -401,7 +401,7 @@ func TestMakeMeshVirtualServiceSpec_CorrectRetries(t *testing.T) { }, }}}, }, - expected: &istiov1beta1.HTTPRetry{ + expected: &istiov1alpha3.HTTPRetry{ RetryOn: retriableConditions, Attempts: int32(networking.DefaultRetryCount), PerTryTimeout: types.DurationProto(defaultMaxRevisionTimeout), @@ -433,7 +433,7 @@ func TestMakeMeshVirtualServiceSpec_CorrectRetries(t *testing.T) { }, }}}, }, - expected: &istiov1beta1.HTTPRetry{ + expected: &istiov1alpha3.HTTPRetry{ RetryOn: retriableConditions, Attempts: int32(networking.DefaultRetryCount), }, @@ -465,7 +465,7 @@ func TestMakeMeshVirtualServiceSpec_CorrectRetries(t *testing.T) { }, }}}, }, - expected: &istiov1beta1.HTTPRetry{}, + expected: &istiov1alpha3.HTTPRetry{}, }, { name: "disabling retries", ci: &v1alpha1.Ingress{ @@ -490,7 +490,7 @@ func TestMakeMeshVirtualServiceSpec_CorrectRetries(t *testing.T) { }, }}}, }, - expected: &istiov1beta1.HTTPRetry{}, + expected: &istiov1alpha3.HTTPRetry{}, }} { t.Run(tc.name, func(t *testing.T) { for _, h := range MakeMeshVirtualService(context.Background(), tc.ci, defaultGateways).Spec.Http { @@ -565,39 +565,39 @@ func TestMakeMeshVirtualServiceSpec_CorrectRoutes(t *testing.T) { }}, }, } - expected := []*istiov1beta1.HTTPRoute{{ - Match: []*istiov1beta1.HTTPMatchRequest{{ - Uri: &istiov1beta1.StringMatch{ - MatchType: &istiov1beta1.StringMatch_Regex{Regex: "^/pets/(.*?)?"}, + expected := []*istiov1alpha3.HTTPRoute{{ + Match: []*istiov1alpha3.HTTPMatchRequest{{ + Uri: &istiov1alpha3.StringMatch{ + MatchType: &istiov1alpha3.StringMatch_Regex{Regex: "^/pets/(.*?)?"}, }, - Authority: &istiov1beta1.StringMatch{ - MatchType: &istiov1beta1.StringMatch_Prefix{Prefix: `test-route.test-ns`}, + Authority: &istiov1alpha3.StringMatch{ + MatchType: &istiov1alpha3.StringMatch_Prefix{Prefix: `test-route.test-ns`}, }, Gateways: []string{"mesh"}, }}, - Route: []*istiov1beta1.HTTPRouteDestination{{ - Destination: &istiov1beta1.Destination{ + Route: []*istiov1alpha3.HTTPRouteDestination{{ + Destination: &istiov1alpha3.Destination{ Host: "v2-service.test-ns.svc.cluster.local", - Port: &istiov1beta1.PortSelector{Number: 80}, + Port: &istiov1alpha3.PortSelector{Number: 80}, }, Weight: 100, - Headers: &istiov1beta1.Headers{ - Request: &istiov1beta1.Headers_HeaderOperations{ + Headers: &istiov1alpha3.Headers{ + Request: &istiov1alpha3.Headers_HeaderOperations{ Set: map[string]string{ "ugh": "blah", }, }, }, }}, - Headers: &istiov1beta1.Headers{ - Request: &istiov1beta1.Headers_HeaderOperations{ + Headers: &istiov1alpha3.Headers{ + Request: &istiov1alpha3.Headers_HeaderOperations{ Set: map[string]string{ "foo": "bar", }, }, }, Timeout: types.DurationProto(defaultMaxRevisionTimeout), - Retries: &istiov1beta1.HTTPRetry{ + Retries: &istiov1alpha3.HTTPRetry{ RetryOn: retriableConditions, Attempts: int32(networking.DefaultRetryCount), PerTryTimeout: types.DurationProto(defaultMaxRevisionTimeout), @@ -689,77 +689,77 @@ func TestMakeIngressVirtualServiceSpec_CorrectRoutes(t *testing.T) { }, } - expected := []*istiov1beta1.HTTPRoute{{ - Match: []*istiov1beta1.HTTPMatchRequest{{ - Uri: &istiov1beta1.StringMatch{ - MatchType: &istiov1beta1.StringMatch_Regex{Regex: "^/pets/(.*?)?"}, + expected := []*istiov1alpha3.HTTPRoute{{ + Match: []*istiov1alpha3.HTTPMatchRequest{{ + Uri: &istiov1alpha3.StringMatch{ + MatchType: &istiov1alpha3.StringMatch_Regex{Regex: "^/pets/(.*?)?"}, }, - Authority: &istiov1beta1.StringMatch{ - MatchType: &istiov1beta1.StringMatch_Prefix{Prefix: `domain.com`}, + Authority: &istiov1alpha3.StringMatch{ + MatchType: &istiov1alpha3.StringMatch_Prefix{Prefix: `domain.com`}, }, Gateways: []string{"gateway.public"}, }, { - Uri: &istiov1beta1.StringMatch{ - MatchType: &istiov1beta1.StringMatch_Regex{Regex: "^/pets/(.*?)?"}, + Uri: &istiov1alpha3.StringMatch{ + MatchType: &istiov1alpha3.StringMatch_Regex{Regex: "^/pets/(.*?)?"}, }, - Authority: &istiov1beta1.StringMatch{ - MatchType: &istiov1beta1.StringMatch_Prefix{Prefix: `test-route.test-ns`}, + Authority: &istiov1alpha3.StringMatch{ + MatchType: &istiov1alpha3.StringMatch_Prefix{Prefix: `test-route.test-ns`}, }, Gateways: []string{"gateway.private"}, }}, - Route: []*istiov1beta1.HTTPRouteDestination{{ - Destination: &istiov1beta1.Destination{ + Route: []*istiov1alpha3.HTTPRouteDestination{{ + Destination: &istiov1alpha3.Destination{ Host: "v2-service.test-ns.svc.cluster.local", - Port: &istiov1beta1.PortSelector{Number: 80}, + Port: &istiov1alpha3.PortSelector{Number: 80}, }, Weight: 100, - Headers: &istiov1beta1.Headers{ - Request: &istiov1beta1.Headers_HeaderOperations{ + Headers: &istiov1alpha3.Headers{ + Request: &istiov1alpha3.Headers_HeaderOperations{ Set: map[string]string{ "ugh": "blah", }, }, }, }}, - Headers: &istiov1beta1.Headers{ - Request: &istiov1beta1.Headers_HeaderOperations{ + Headers: &istiov1alpha3.Headers{ + Request: &istiov1alpha3.Headers_HeaderOperations{ Set: map[string]string{ "foo": "bar", }, }, }, Timeout: types.DurationProto(defaultMaxRevisionTimeout), - Retries: &istiov1beta1.HTTPRetry{ + Retries: &istiov1alpha3.HTTPRetry{ RetryOn: retriableConditions, Attempts: int32(networking.DefaultRetryCount), PerTryTimeout: types.DurationProto(defaultMaxRevisionTimeout), }, }, { - Match: []*istiov1beta1.HTTPMatchRequest{{ - Uri: &istiov1beta1.StringMatch{ - MatchType: &istiov1beta1.StringMatch_Regex{Regex: "^/pets/(.*?)?"}, + Match: []*istiov1alpha3.HTTPMatchRequest{{ + Uri: &istiov1alpha3.StringMatch{ + MatchType: &istiov1alpha3.StringMatch_Regex{Regex: "^/pets/(.*?)?"}, }, - Authority: &istiov1beta1.StringMatch{ - MatchType: &istiov1beta1.StringMatch_Prefix{Prefix: `v1.domain.com`}, + Authority: &istiov1alpha3.StringMatch{ + MatchType: &istiov1alpha3.StringMatch_Prefix{Prefix: `v1.domain.com`}, }, Gateways: []string{}, }}, - Route: []*istiov1beta1.HTTPRouteDestination{{ - Destination: &istiov1beta1.Destination{ + Route: []*istiov1alpha3.HTTPRouteDestination{{ + Destination: &istiov1alpha3.Destination{ Host: "v1-service.test-ns.svc.cluster.local", - Port: &istiov1beta1.PortSelector{Number: 80}, + Port: &istiov1alpha3.PortSelector{Number: 80}, }, Weight: 100, }}, - Headers: &istiov1beta1.Headers{ - Request: &istiov1beta1.Headers_HeaderOperations{ + Headers: &istiov1alpha3.Headers{ + Request: &istiov1alpha3.Headers_HeaderOperations{ Set: map[string]string{ "foo": "baz", }, }, }, Timeout: types.DurationProto(defaultMaxRevisionTimeout), - Retries: &istiov1beta1.HTTPRetry{ + Retries: &istiov1alpha3.HTTPRetry{ RetryOn: retriableConditions, Attempts: int32(networking.DefaultRetryCount), PerTryTimeout: types.DurationProto(defaultMaxRevisionTimeout), @@ -789,29 +789,29 @@ func TestMakeVirtualServiceRoute_RewriteHost(t *testing.T) { }, }) route := makeVirtualServiceRoute(ctx, sets.NewString("a.vanity.url", "another.vanity.url"), ingressPath, makeGatewayMap([]string{"gateway-1"}, nil), v1alpha1.IngressVisibilityExternalIP) - expected := &istiov1beta1.HTTPRoute{ - Match: []*istiov1beta1.HTTPMatchRequest{{ + expected := &istiov1alpha3.HTTPRoute{ + Match: []*istiov1alpha3.HTTPMatchRequest{{ Gateways: []string{"gateway-1"}, - Authority: &istiov1beta1.StringMatch{ - MatchType: &istiov1beta1.StringMatch_Prefix{Prefix: `a.vanity.url`}, + Authority: &istiov1alpha3.StringMatch{ + MatchType: &istiov1alpha3.StringMatch_Prefix{Prefix: `a.vanity.url`}, }, }, { Gateways: []string{"gateway-1"}, - Authority: &istiov1beta1.StringMatch{ - MatchType: &istiov1beta1.StringMatch_Prefix{Prefix: `another.vanity.url`}, + Authority: &istiov1alpha3.StringMatch{ + MatchType: &istiov1alpha3.StringMatch_Prefix{Prefix: `another.vanity.url`}, }, }}, - Rewrite: &istiov1beta1.HTTPRewrite{ + Rewrite: &istiov1alpha3.HTTPRewrite{ Authority: "the.target.host", }, - Route: []*istiov1beta1.HTTPRouteDestination{{ - Destination: &istiov1beta1.Destination{ + Route: []*istiov1alpha3.HTTPRouteDestination{{ + Destination: &istiov1alpha3.Destination{ Host: "the-local-gateway.svc.url", }, Weight: 100, }}, Timeout: types.DurationProto(defaultMaxRevisionTimeout), - Retries: &istiov1beta1.HTTPRetry{ + Retries: &istiov1alpha3.HTTPRetry{ RetryOn: retriableConditions, Attempts: int32(networking.DefaultRetryCount), PerTryTimeout: types.DurationProto(defaultMaxRevisionTimeout), @@ -846,41 +846,41 @@ func TestMakeVirtualServiceRoute_Vanilla(t *testing.T) { }, } route := makeVirtualServiceRoute(context.Background(), sets.NewString("a.com", "b.org"), ingressPath, makeGatewayMap([]string{"gateway-1"}, nil), v1alpha1.IngressVisibilityExternalIP) - expected := &istiov1beta1.HTTPRoute{ - Match: []*istiov1beta1.HTTPMatchRequest{{ + expected := &istiov1alpha3.HTTPRoute{ + Match: []*istiov1alpha3.HTTPMatchRequest{{ Gateways: []string{"gateway-1"}, - Authority: &istiov1beta1.StringMatch{ - MatchType: &istiov1beta1.StringMatch_Prefix{Prefix: `a.com`}, + Authority: &istiov1alpha3.StringMatch{ + MatchType: &istiov1alpha3.StringMatch_Prefix{Prefix: `a.com`}, }, - Headers: map[string]*istiov1beta1.StringMatch{ + Headers: map[string]*istiov1alpha3.StringMatch{ "my-header": { - MatchType: &istiov1beta1.StringMatch_Exact{ + MatchType: &istiov1alpha3.StringMatch_Exact{ Exact: "my-header-value", }, }, }, }, { Gateways: []string{"gateway-1"}, - Authority: &istiov1beta1.StringMatch{ - MatchType: &istiov1beta1.StringMatch_Prefix{Prefix: `b.org`}, + Authority: &istiov1alpha3.StringMatch{ + MatchType: &istiov1alpha3.StringMatch_Prefix{Prefix: `b.org`}, }, - Headers: map[string]*istiov1beta1.StringMatch{ + Headers: map[string]*istiov1alpha3.StringMatch{ "my-header": { - MatchType: &istiov1beta1.StringMatch_Exact{ + MatchType: &istiov1alpha3.StringMatch_Exact{ Exact: "my-header-value", }, }, }, }}, - Route: []*istiov1beta1.HTTPRouteDestination{{ - Destination: &istiov1beta1.Destination{ + Route: []*istiov1alpha3.HTTPRouteDestination{{ + Destination: &istiov1alpha3.Destination{ Host: "revision-service.test-ns.svc.cluster.local", - Port: &istiov1beta1.PortSelector{Number: 80}, + Port: &istiov1alpha3.PortSelector{Number: 80}, }, Weight: 100, }}, Timeout: types.DurationProto(defaultMaxRevisionTimeout), - Retries: &istiov1beta1.HTTPRetry{ + Retries: &istiov1alpha3.HTTPRetry{ RetryOn: retriableConditions, Attempts: int32(networking.DefaultRetryCount), PerTryTimeout: types.DurationProto(defaultMaxRevisionTimeout), @@ -916,28 +916,28 @@ func TestMakeVirtualServiceRoute_TwoTargets(t *testing.T) { }, } route := makeVirtualServiceRoute(context.Background(), sets.NewString("test.org"), ingressPath, makeGatewayMap([]string{"knative-testing/gateway-1"}, nil), v1alpha1.IngressVisibilityExternalIP) - expected := &istiov1beta1.HTTPRoute{ - Match: []*istiov1beta1.HTTPMatchRequest{{ + expected := &istiov1alpha3.HTTPRoute{ + Match: []*istiov1alpha3.HTTPMatchRequest{{ Gateways: []string{"knative-testing/gateway-1"}, - Authority: &istiov1beta1.StringMatch{ - MatchType: &istiov1beta1.StringMatch_Prefix{Prefix: `test.org`}, + Authority: &istiov1alpha3.StringMatch{ + MatchType: &istiov1alpha3.StringMatch_Prefix{Prefix: `test.org`}, }, }}, - Route: []*istiov1beta1.HTTPRouteDestination{{ - Destination: &istiov1beta1.Destination{ + Route: []*istiov1alpha3.HTTPRouteDestination{{ + Destination: &istiov1alpha3.Destination{ Host: "revision-service.test-ns.svc.cluster.local", - Port: &istiov1beta1.PortSelector{Number: 80}, + Port: &istiov1alpha3.PortSelector{Number: 80}, }, Weight: 90, }, { - Destination: &istiov1beta1.Destination{ + Destination: &istiov1alpha3.Destination{ Host: "new-revision-service.test-ns.svc.cluster.local", - Port: &istiov1beta1.PortSelector{Number: 81}, + Port: &istiov1alpha3.PortSelector{Number: 81}, }, Weight: 10, }}, Timeout: types.DurationProto(defaultMaxRevisionTimeout), - Retries: &istiov1beta1.HTTPRetry{ + Retries: &istiov1alpha3.HTTPRetry{ RetryOn: retriableConditions, Attempts: int32(networking.DefaultRetryCount), PerTryTimeout: types.DurationProto(defaultMaxRevisionTimeout), diff --git a/pkg/reconciler/testing/listers.go b/pkg/reconciler/testing/listers.go index fdee472023..25c5a2f7b5 100644 --- a/pkg/reconciler/testing/listers.go +++ b/pkg/reconciler/testing/listers.go @@ -17,14 +17,14 @@ limitations under the License. package istio import ( - istiov1beta1 "istio.io/client-go/pkg/apis/networking/v1beta1" + istiov1alpha3 "istio.io/client-go/pkg/apis/networking/v1alpha3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/runtime" fakekubeclientset "k8s.io/client-go/kubernetes/fake" corev1listers "k8s.io/client-go/listers/core/v1" "k8s.io/client-go/tools/cache" fakeistioclientset "knative.dev/net-istio/pkg/client/istio/clientset/versioned/fake" - istiolisters "knative.dev/net-istio/pkg/client/istio/listers/networking/v1beta1" + istiolisters "knative.dev/net-istio/pkg/client/istio/listers/networking/v1alpha3" networking "knative.dev/networking/pkg/apis/networking/v1alpha1" fakenetworkingclientset "knative.dev/networking/pkg/client/clientset/versioned/fake" networkinglisters "knative.dev/networking/pkg/client/listers/networking/v1alpha1" @@ -90,12 +90,12 @@ func (l *Listers) GetIngressLister() networkinglisters.IngressLister { // GetGatewayLister get lister for Gateway resource. func (l *Listers) GetGatewayLister() istiolisters.GatewayLister { - return istiolisters.NewGatewayLister(l.IndexerFor(&istiov1beta1.Gateway{})) + return istiolisters.NewGatewayLister(l.IndexerFor(&istiov1alpha3.Gateway{})) } // GetVirtualServiceLister get lister for istio VirtualService resource. func (l *Listers) GetVirtualServiceLister() istiolisters.VirtualServiceLister { - return istiolisters.NewVirtualServiceLister(l.IndexerFor(&istiov1beta1.VirtualService{})) + return istiolisters.NewVirtualServiceLister(l.IndexerFor(&istiov1alpha3.VirtualService{})) } // GetK8sServiceLister get lister for K8s Service resource. diff --git a/third_party/VENDOR-LICENSE/istio.io/client-go/pkg/apis/networking/v1beta1/LICENSE b/third_party/VENDOR-LICENSE/istio.io/client-go/pkg/apis/networking/v1alpha3/LICENSE similarity index 100% rename from third_party/VENDOR-LICENSE/istio.io/client-go/pkg/apis/networking/v1beta1/LICENSE rename to third_party/VENDOR-LICENSE/istio.io/client-go/pkg/apis/networking/v1alpha3/LICENSE diff --git a/vendor/istio.io/api/networking/v1alpha3/destination_rule.gen.json b/vendor/istio.io/api/networking/v1alpha3/destination_rule.gen.json new file mode 100644 index 0000000000..64064b556e --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/destination_rule.gen.json @@ -0,0 +1,554 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Configuration affecting load balancing, outlier detection, etc.", + "version": "v1alpha3" + }, + "components": { + "schemas": { + "istio.networking.v1alpha3.DestinationRule": { + "description": "DestinationRule defines policies that apply to traffic intended for a service after routing has occurred.", + "type": "object", + "properties": { + "host": { + "description": "The name of a service from the service registry. Service names are looked up from the platform's service registry (e.g., Kubernetes services, Consul services, etc.) and from the hosts declared by [ServiceEntries](https://istio.io/docs/reference/config/networking/service-entry/#ServiceEntry). Rules defined for services that do not exist in the service registry will be ignored.", + "type": "string", + "format": "string" + }, + "trafficPolicy": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.TrafficPolicy" + }, + "subsets": { + "description": "One or more named sets that represent individual versions of a service. Traffic policies can be overridden at subset level.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.Subset" + } + }, + "exportTo": { + "description": "A list of namespaces to which this destination rule is exported. The resolution of a destination rule to apply to a service occurs in the context of a hierarchy of namespaces. Exporting a destination rule allows it to be included in the resolution hierarchy for services in other namespaces. This feature provides a mechanism for service owners and mesh administrators to control the visibility of destination rules across namespace boundaries.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + } + } + }, + "istio.networking.v1alpha3.TrafficPolicy": { + "description": "Traffic policies to apply for a specific destination, across all destination ports. See DestinationRule for examples.", + "type": "object", + "properties": { + "loadBalancer": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.LoadBalancerSettings" + }, + "connectionPool": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ConnectionPoolSettings" + }, + "outlierDetection": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.OutlierDetection" + }, + "tls": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ClientTLSSettings" + }, + "portLevelSettings": { + "description": "Traffic policies specific to individual ports. Note that port level settings will override the destination-level settings. Traffic settings specified at the destination-level will not be inherited when overridden by port-level settings, i.e. default values will be applied to fields omitted in port-level traffic policies.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.TrafficPolicy.PortTrafficPolicy" + } + } + } + }, + "istio.networking.v1alpha3.Subset": { + "description": "A subset of endpoints of a service. Subsets can be used for scenarios like A/B testing, or routing to a specific version of a service. Refer to [VirtualService](https://istio.io/docs/reference/config/networking/virtual-service/#VirtualService) documentation for examples of using subsets in these scenarios. In addition, traffic policies defined at the service-level can be overridden at a subset-level. The following rule uses a round robin load balancing policy for all traffic going to a subset named testversion that is composed of endpoints (e.g., pods) with labels (version:v3).", + "type": "object", + "properties": { + "name": { + "description": "Name of the subset. The service name and the subset name can be used for traffic splitting in a route rule.", + "type": "string", + "format": "string" + }, + "trafficPolicy": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.TrafficPolicy" + }, + "labels": { + "description": "Labels apply a filter over the endpoints of a service in the service registry. See route rules for examples of usage.", + "type": "object", + "additionalProperties": { + "type": "string", + "format": "string" + } + } + } + }, + "istio.networking.v1alpha3.LoadBalancerSettings": { + "description": "Load balancing policies to apply for a specific destination. See Envoy's load balancing [documentation](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/load_balancing) for more details.", + "type": "object", + "properties": { + "localityLbSetting": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.LocalityLoadBalancerSetting" + } + }, + "oneOf": [ + { + "not": { + "anyOf": [ + { + "required": [ + "simple" + ], + "properties": { + "simple": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.LoadBalancerSettings.SimpleLB" + } + } + }, + { + "required": [ + "consistentHash" + ], + "properties": { + "consistentHash": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB" + } + } + } + ] + } + }, + { + "required": [ + "simple" + ], + "properties": { + "simple": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.LoadBalancerSettings.SimpleLB" + } + } + }, + { + "required": [ + "consistentHash" + ], + "properties": { + "consistentHash": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB" + } + } + } + ] + }, + "istio.networking.v1alpha3.ConnectionPoolSettings": { + "description": "Connection pool settings for an upstream host. The settings apply to each individual host in the upstream service. See Envoy's [circuit breaker](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/circuit_breaking) for more details. Connection pool settings can be applied at the TCP level as well as at HTTP level.", + "type": "object", + "properties": { + "tcp": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ConnectionPoolSettings.TCPSettings" + }, + "http": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ConnectionPoolSettings.HTTPSettings" + } + } + }, + "istio.networking.v1alpha3.OutlierDetection": { + "description": "A Circuit breaker implementation that tracks the status of each individual host in the upstream service. Applicable to both HTTP and TCP services. For HTTP services, hosts that continually return 5xx errors for API calls are ejected from the pool for a pre-defined period of time. For TCP services, connection timeouts or connection failures to a given host counts as an error when measuring the consecutive errors metric. See Envoy's [outlier detection](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/outlier) for more details.", + "type": "object", + "properties": { + "interval": { + "description": "Time interval between ejection sweep analysis. format: 1h/1m/1s/1ms. MUST BE \u003e=1ms. Default is 10s.", + "type": "string" + }, + "consecutiveErrors": { + "description": "Number of errors before a host is ejected from the connection pool. Defaults to 5. When the upstream host is accessed over HTTP, a 502, 503, or 504 return code qualifies as an error. When the upstream host is accessed over an opaque TCP connection, connect timeouts and connection error/failure events qualify as an error. $hide_from_docs", + "type": "integer", + "format": "int32", + "deprecated": true + }, + "consecutiveGatewayErrors": { + "description": "Number of gateway errors before a host is ejected from the connection pool. When the upstream host is accessed over HTTP, a 502, 503, or 504 return code qualifies as a gateway error. When the upstream host is accessed over an opaque TCP connection, connect timeouts and connection error/failure events qualify as a gateway error. This feature is disabled by default or when set to the value 0.", + "type": "integer", + "nullable": true + }, + "consecutive5xxErrors": { + "description": "Number of 5xx errors before a host is ejected from the connection pool. When the upstream host is accessed over an opaque TCP connection, connect timeouts, connection error/failure and request failure events qualify as a 5xx error. This feature defaults to 5 but can be disabled by setting the value to 0.", + "type": "integer", + "nullable": true + }, + "baseEjectionTime": { + "description": "Minimum ejection duration. A host will remain ejected for a period equal to the product of minimum ejection duration and the number of times the host has been ejected. This technique allows the system to automatically increase the ejection period for unhealthy upstream servers. format: 1h/1m/1s/1ms. MUST BE \u003e=1ms. Default is 30s.", + "type": "string" + }, + "maxEjectionPercent": { + "description": "Maximum % of hosts in the load balancing pool for the upstream service that can be ejected. Defaults to 10%.", + "type": "integer", + "format": "int32" + }, + "minHealthPercent": { + "description": "Outlier detection will be enabled as long as the associated load balancing pool has at least min_health_percent hosts in healthy mode. When the percentage of healthy hosts in the load balancing pool drops below this threshold, outlier detection will be disabled and the proxy will load balance across all hosts in the pool (healthy and unhealthy). The threshold can be disabled by setting it to 0%. The default is 0% as it's not typically applicable in k8s environments with few pods per service.", + "type": "integer", + "format": "int32" + } + } + }, + "istio.networking.v1alpha3.ClientTLSSettings": { + "description": "SSL/TLS related settings for upstream connections. See Envoy's [TLS context](https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/auth/cert.proto.html) for more details. These settings are common to both HTTP and TCP upstreams.", + "type": "object", + "properties": { + "mode": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ClientTLSSettings.TLSmode" + }, + "clientCertificate": { + "description": "REQUIRED if mode is `MUTUAL`. The path to the file holding the client-side TLS certificate to use. Should be empty if mode is `ISTIO_MUTUAL`.", + "type": "string", + "format": "string" + }, + "privateKey": { + "description": "REQUIRED if mode is `MUTUAL`. The path to the file holding the client's private key. Should be empty if mode is `ISTIO_MUTUAL`.", + "type": "string", + "format": "string" + }, + "caCertificates": { + "description": "OPTIONAL: The path to the file containing certificate authority certificates to use in verifying a presented server certificate. If omitted, the proxy will not verify the server's certificate. Should be empty if mode is `ISTIO_MUTUAL`.", + "type": "string", + "format": "string" + }, + "credentialName": { + "description": "The name of the secret that holds the TLS certs for the client including the CA certificates. Applicable only on Kubernetes. Secret must exist in the same namespace with the proxy using the certificates. The secret (of type `generic`)should contain the following keys and values: `key: \u003cprivateKey\u003e`, `cert: \u003cserverCert\u003e`, `cacert: \u003cCACertificate\u003e`. Secret of type tls for client certificates along with ca.crt key for CA certificates is also supported. Only one of client certificates and CA certificate or credentialName can be specified.", + "type": "string", + "format": "string" + }, + "subjectAltNames": { + "description": "A list of alternate names to verify the subject identity in the certificate. If specified, the proxy will verify that the server certificate's subject alt name matches one of the specified values. If specified, this list overrides the value of subject_alt_names from the ServiceEntry.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "sni": { + "description": "SNI string to present to the server during TLS handshake.", + "type": "string", + "format": "string" + } + } + }, + "istio.networking.v1alpha3.TrafficPolicy.PortTrafficPolicy": { + "description": "Traffic policies that apply to specific ports of the service", + "type": "object", + "properties": { + "loadBalancer": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.LoadBalancerSettings" + }, + "connectionPool": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ConnectionPoolSettings" + }, + "outlierDetection": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.OutlierDetection" + }, + "tls": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ClientTLSSettings" + }, + "port": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.PortSelector" + } + } + }, + "istio.networking.v1alpha3.PortSelector": { + "description": "PortSelector specifies the number of a port to be used for matching or selection for final routing.", + "type": "object", + "properties": { + "number": { + "description": "Valid port number", + "type": "integer" + } + } + }, + "istio.networking.v1alpha3.LocalityLoadBalancerSetting": { + "description": "Locality-weighted load balancing allows administrators to control the distribution of traffic to endpoints based on the localities of where the traffic originates and where it will terminate. These localities are specified using arbitrary labels that designate a hierarchy of localities in {region}/{zone}/{sub-zone} form. For additional detail refer to [Locality Weight](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/locality_weight) The following example shows how to setup locality weights mesh-wide.", + "type": "object", + "properties": { + "distribute": { + "description": "Optional: only one of distribute or failover can be set. Explicitly specify loadbalancing weight across different zones and geographical locations. Refer to [Locality weighted load balancing](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/locality_weight) If empty, the locality weight is set according to the endpoints number within it.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.LocalityLoadBalancerSetting.Distribute" + } + }, + "failover": { + "description": "Optional: only failover or distribute can be set. Explicitly specify the region traffic will land on when endpoints in local region becomes unhealthy. Should be used together with OutlierDetection to detect unhealthy endpoints. Note: if no OutlierDetection specified, this will not take effect.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.LocalityLoadBalancerSetting.Failover" + } + }, + "enabled": { + "description": "enable locality load balancing, this is DestinationRule-level and will override mesh wide settings in entirety. e.g. true means that turn on locality load balancing for this DestinationRule no matter what mesh wide settings is.", + "type": "boolean", + "nullable": true + } + } + }, + "istio.networking.v1alpha3.LoadBalancerSettings.SimpleLB": { + "description": "Standard load balancing algorithms that require no tuning.", + "type": "string", + "enum": [ + "ROUND_ROBIN", + "LEAST_CONN", + "RANDOM", + "PASSTHROUGH" + ] + }, + "istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB": { + "description": "Consistent Hash-based load balancing can be used to provide soft session affinity based on HTTP headers, cookies or other properties. This load balancing policy is applicable only for HTTP connections. The affinity to a particular destination host will be lost when one or more hosts are added/removed from the destination service.", + "type": "object", + "properties": { + "minimumRingSize": { + "description": "The minimum number of virtual nodes to use for the hash ring. Defaults to 1024. Larger ring sizes result in more granular load distributions. If the number of hosts in the load balancing pool is larger than the ring size, each host will be assigned a single virtual node.", + "type": "integer" + } + }, + "oneOf": [ + { + "not": { + "anyOf": [ + { + "required": [ + "httpHeaderName" + ], + "properties": { + "httpHeaderName": { + "description": "Hash based on a specific HTTP header.", + "type": "string", + "format": "string" + } + } + }, + { + "required": [ + "httpCookie" + ], + "properties": { + "httpCookie": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB.HTTPCookie" + } + } + }, + { + "required": [ + "useSourceIp" + ], + "properties": { + "useSourceIp": { + "description": "Hash based on the source IP address.", + "type": "boolean" + } + } + }, + { + "required": [ + "httpQueryParameterName" + ], + "properties": { + "httpQueryParameterName": { + "description": "Hash based on a specific HTTP query parameter.", + "type": "string", + "format": "string" + } + } + } + ] + } + }, + { + "required": [ + "httpHeaderName" + ], + "properties": { + "httpHeaderName": { + "description": "Hash based on a specific HTTP header.", + "type": "string", + "format": "string" + } + } + }, + { + "required": [ + "httpCookie" + ], + "properties": { + "httpCookie": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB.HTTPCookie" + } + } + }, + { + "required": [ + "useSourceIp" + ], + "properties": { + "useSourceIp": { + "description": "Hash based on the source IP address.", + "type": "boolean" + } + } + }, + { + "required": [ + "httpQueryParameterName" + ], + "properties": { + "httpQueryParameterName": { + "description": "Hash based on a specific HTTP query parameter.", + "type": "string", + "format": "string" + } + } + } + ] + }, + "istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB.HTTPCookie": { + "description": "Describes a HTTP cookie that will be used as the hash key for the Consistent Hash load balancer. If the cookie is not present, it will be generated.", + "type": "object", + "properties": { + "path": { + "description": "Path to set for the cookie.", + "type": "string", + "format": "string" + }, + "name": { + "description": "Name of the cookie.", + "type": "string", + "format": "string" + }, + "ttl": { + "description": "Lifetime of the cookie.", + "type": "string" + } + } + }, + "istio.networking.v1alpha3.ConnectionPoolSettings.TCPSettings": { + "description": "Settings common to both HTTP and TCP upstream connections.", + "type": "object", + "properties": { + "maxConnections": { + "description": "Maximum number of HTTP1 /TCP connections to a destination host. Default 2^32-1.", + "type": "integer", + "format": "int32" + }, + "connectTimeout": { + "description": "TCP connection timeout. format: 1h/1m/1s/1ms. MUST BE \u003e=1ms. Default is 10s.", + "type": "string" + }, + "tcpKeepalive": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ConnectionPoolSettings.TCPSettings.TcpKeepalive" + } + } + }, + "istio.networking.v1alpha3.ConnectionPoolSettings.HTTPSettings": { + "description": "Settings applicable to HTTP1.1/HTTP2/GRPC connections.", + "type": "object", + "properties": { + "http1MaxPendingRequests": { + "description": "Maximum number of pending HTTP requests to a destination. Default 2^32-1.", + "type": "integer", + "format": "int32" + }, + "http2MaxRequests": { + "description": "Maximum number of requests to a backend. Default 2^32-1.", + "type": "integer", + "format": "int32" + }, + "maxRequestsPerConnection": { + "description": "Maximum number of requests per connection to a backend. Setting this parameter to 1 disables keep alive. Default 0, meaning \"unlimited\", up to 2^29.", + "type": "integer", + "format": "int32" + }, + "maxRetries": { + "description": "Maximum number of retries that can be outstanding to all hosts in a cluster at a given time. Defaults to 2^32-1.", + "type": "integer", + "format": "int32" + }, + "idleTimeout": { + "description": "The idle timeout for upstream connection pool connections. The idle timeout is defined as the period in which there are no active requests. If not set, the default is 1 hour. When the idle timeout is reached the connection will be closed. Note that request based timeouts mean that HTTP/2 PINGs will not keep the connection alive. Applies to both HTTP1.1 and HTTP2 connections.", + "type": "string" + }, + "h2UpgradePolicy": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ConnectionPoolSettings.HTTPSettings.H2UpgradePolicy" + } + } + }, + "istio.networking.v1alpha3.ConnectionPoolSettings.TCPSettings.TcpKeepalive": { + "description": "TCP keepalive.", + "type": "object", + "properties": { + "time": { + "description": "The time duration a connection needs to be idle before keep-alive probes start being sent. Default is to use the OS level configuration (unless overridden, Linux defaults to 7200s (ie 2 hours.)", + "type": "string" + }, + "probes": { + "description": "Maximum number of keepalive probes to send without response before deciding the connection is dead. Default is to use the OS level configuration (unless overridden, Linux defaults to 9.)", + "type": "integer" + }, + "interval": { + "description": "The time duration between keep-alive probes. Default is to use the OS level configuration (unless overridden, Linux defaults to 75s.)", + "type": "string" + } + } + }, + "istio.networking.v1alpha3.ConnectionPoolSettings.HTTPSettings.H2UpgradePolicy": { + "description": "Policy for upgrading http1.1 connections to http2.", + "type": "string", + "enum": [ + "DEFAULT", + "DO_NOT_UPGRADE", + "UPGRADE" + ] + }, + "istio.networking.v1alpha3.ClientTLSSettings.TLSmode": { + "description": "TLS connection mode", + "type": "string", + "enum": [ + "DISABLE", + "SIMPLE", + "MUTUAL", + "ISTIO_MUTUAL" + ] + }, + "istio.networking.v1alpha3.LocalityLoadBalancerSetting.Distribute": { + "description": "Describes how traffic originating in the 'from' zone or sub-zone is distributed over a set of 'to' zones. Syntax for specifying a zone is {region}/{zone}/{sub-zone} and terminal wildcards are allowed on any segment of the specification. Examples: * - matches all localities us-west/* - all zones and sub-zones within the us-west region us-west/zone-1/* - all sub-zones within us-west/zone-1", + "type": "object", + "properties": { + "from": { + "description": "Originating locality, '/' separated, e.g. 'region/zone/sub_zone'.", + "type": "string", + "format": "string" + }, + "to": { + "description": "Map of upstream localities to traffic distribution weights. The sum of all weights should be == 100. Any locality not assigned a weight will receive no traffic.", + "type": "object", + "additionalProperties": { + "type": "integer" + } + } + } + }, + "istio.networking.v1alpha3.LocalityLoadBalancerSetting.Failover": { + "description": "Specify the traffic failover policy across regions. Since zone and sub-zone failover is supported by default this only needs to be specified for regions when the operator needs to constrain traffic failover so that the default behavior of failing over to any endpoint globally does not apply. This is useful when failing over traffic across regions would not improve service health or may need to be restricted for other reasons like regulatory controls.", + "type": "object", + "properties": { + "from": { + "description": "Originating region.", + "type": "string", + "format": "string" + }, + "to": { + "description": "Destination region the traffic will fail over to when endpoints in the 'from' region becomes unhealthy.", + "type": "string", + "format": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/vendor/istio.io/api/networking/v1alpha3/destination_rule.pb.go b/vendor/istio.io/api/networking/v1alpha3/destination_rule.pb.go new file mode 100644 index 0000000000..f091d2cf57 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/destination_rule.pb.go @@ -0,0 +1,7016 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/destination_rule.proto + +// `DestinationRule` defines policies that apply to traffic intended for a +// service after routing has occurred. These rules specify configuration +// for load balancing, connection pool size from the sidecar, and outlier +// detection settings to detect and evict unhealthy hosts from the load +// balancing pool. For example, a simple load balancing policy for the +// ratings service would look as follows: +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// ``` +// {{}} +// {{}} +// +// Version specific policies can be specified by defining a named +// `subset` and overriding the settings specified at the service level. The +// following rule uses a round robin load balancing policy for all traffic +// going to a subset named testversion that is composed of endpoints (e.g., +// pods) with labels (version:v3). +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// subsets: +// - name: testversion +// labels: +// version: v3 +// trafficPolicy: +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// subsets: +// - name: testversion +// labels: +// version: v3 +// trafficPolicy: +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// {{}} +// +// **Note:** Policies specified for subsets will not take effect until +// a route rule explicitly sends traffic to this subset. +// +// Traffic policies can be customized to specific ports as well. The +// following rule uses the least connection load balancing policy for all +// traffic to port 80, while uses a round robin load balancing setting for +// traffic to the port 9080. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings-port +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: # Apply to all ports +// portLevelSettings: +// - port: +// number: 80 +// loadBalancer: +// simple: LEAST_CONN +// - port: +// number: 9080 +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings-port +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: # Apply to all ports +// portLevelSettings: +// - port: +// number: 80 +// loadBalancer: +// simple: LEAST_CONN +// - port: +// number: 9080 +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// {{}} +// + +package v1alpha3 + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + types "github.com/gogo/protobuf/types" + io "io" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Standard load balancing algorithms that require no tuning. +type LoadBalancerSettings_SimpleLB int32 + +const ( + // Round Robin policy. Default + LoadBalancerSettings_ROUND_ROBIN LoadBalancerSettings_SimpleLB = 0 + // The least request load balancer uses an O(1) algorithm which selects + // two random healthy hosts and picks the host which has fewer active + // requests. + LoadBalancerSettings_LEAST_CONN LoadBalancerSettings_SimpleLB = 1 + // The random load balancer selects a random healthy host. The random + // load balancer generally performs better than round robin if no health + // checking policy is configured. + LoadBalancerSettings_RANDOM LoadBalancerSettings_SimpleLB = 2 + // This option will forward the connection to the original IP address + // requested by the caller without doing any form of load + // balancing. This option must be used with care. It is meant for + // advanced use cases. Refer to Original Destination load balancer in + // Envoy for further details. + LoadBalancerSettings_PASSTHROUGH LoadBalancerSettings_SimpleLB = 3 +) + +var LoadBalancerSettings_SimpleLB_name = map[int32]string{ + 0: "ROUND_ROBIN", + 1: "LEAST_CONN", + 2: "RANDOM", + 3: "PASSTHROUGH", +} + +var LoadBalancerSettings_SimpleLB_value = map[string]int32{ + "ROUND_ROBIN": 0, + "LEAST_CONN": 1, + "RANDOM": 2, + "PASSTHROUGH": 3, +} + +func (x LoadBalancerSettings_SimpleLB) String() string { + return proto.EnumName(LoadBalancerSettings_SimpleLB_name, int32(x)) +} + +func (LoadBalancerSettings_SimpleLB) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_12899beb695152c8, []int{3, 0} +} + +// Policy for upgrading http1.1 connections to http2. +type ConnectionPoolSettings_HTTPSettings_H2UpgradePolicy int32 + +const ( + // Use the global default. + ConnectionPoolSettings_HTTPSettings_DEFAULT ConnectionPoolSettings_HTTPSettings_H2UpgradePolicy = 0 + // Do not upgrade the connection to http2. + // This opt-out option overrides the default. + ConnectionPoolSettings_HTTPSettings_DO_NOT_UPGRADE ConnectionPoolSettings_HTTPSettings_H2UpgradePolicy = 1 + // Upgrade the connection to http2. + // This opt-in option overrides the default. + ConnectionPoolSettings_HTTPSettings_UPGRADE ConnectionPoolSettings_HTTPSettings_H2UpgradePolicy = 2 +) + +var ConnectionPoolSettings_HTTPSettings_H2UpgradePolicy_name = map[int32]string{ + 0: "DEFAULT", + 1: "DO_NOT_UPGRADE", + 2: "UPGRADE", +} + +var ConnectionPoolSettings_HTTPSettings_H2UpgradePolicy_value = map[string]int32{ + "DEFAULT": 0, + "DO_NOT_UPGRADE": 1, + "UPGRADE": 2, +} + +func (x ConnectionPoolSettings_HTTPSettings_H2UpgradePolicy) String() string { + return proto.EnumName(ConnectionPoolSettings_HTTPSettings_H2UpgradePolicy_name, int32(x)) +} + +func (ConnectionPoolSettings_HTTPSettings_H2UpgradePolicy) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_12899beb695152c8, []int{4, 1, 0} +} + +// TLS connection mode +type ClientTLSSettings_TLSmode int32 + +const ( + // Do not setup a TLS connection to the upstream endpoint. + ClientTLSSettings_DISABLE ClientTLSSettings_TLSmode = 0 + // Originate a TLS connection to the upstream endpoint. + ClientTLSSettings_SIMPLE ClientTLSSettings_TLSmode = 1 + // Secure connections to the upstream using mutual TLS by presenting + // client certificates for authentication. + ClientTLSSettings_MUTUAL ClientTLSSettings_TLSmode = 2 + // Secure connections to the upstream using mutual TLS by presenting + // client certificates for authentication. + // Compared to Mutual mode, this mode uses certificates generated + // automatically by Istio for mTLS authentication. When this mode is + // used, all other fields in `ClientTLSSettings` should be empty. + ClientTLSSettings_ISTIO_MUTUAL ClientTLSSettings_TLSmode = 3 +) + +var ClientTLSSettings_TLSmode_name = map[int32]string{ + 0: "DISABLE", + 1: "SIMPLE", + 2: "MUTUAL", + 3: "ISTIO_MUTUAL", +} + +var ClientTLSSettings_TLSmode_value = map[string]int32{ + "DISABLE": 0, + "SIMPLE": 1, + "MUTUAL": 2, + "ISTIO_MUTUAL": 3, +} + +func (x ClientTLSSettings_TLSmode) String() string { + return proto.EnumName(ClientTLSSettings_TLSmode_name, int32(x)) +} + +func (ClientTLSSettings_TLSmode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_12899beb695152c8, []int{6, 0} +} + +// DestinationRule defines policies that apply to traffic intended for a service +// after routing has occurred. +// +// +// +// +type DestinationRule struct { + // The name of a service from the service registry. Service + // names are looked up from the platform's service registry (e.g., + // Kubernetes services, Consul services, etc.) and from the hosts + // declared by [ServiceEntries](https://istio.io/docs/reference/config/networking/service-entry/#ServiceEntry). Rules defined for + // services that do not exist in the service registry will be ignored. + // + // *Note for Kubernetes users*: When short names are used (e.g. "reviews" + // instead of "reviews.default.svc.cluster.local"), Istio will interpret + // the short name based on the namespace of the rule, not the service. A + // rule in the "default" namespace containing a host "reviews" will be + // interpreted as "reviews.default.svc.cluster.local", irrespective of + // the actual namespace associated with the reviews service. _To avoid + // potential misconfigurations, it is recommended to always use fully + // qualified domain names over short names._ + // + // Note that the host field applies to both HTTP and TCP services. + Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` + // Traffic policies to apply (load balancing policy, connection pool + // sizes, outlier detection). + TrafficPolicy *TrafficPolicy `protobuf:"bytes,2,opt,name=traffic_policy,json=trafficPolicy,proto3" json:"traffic_policy,omitempty"` + // One or more named sets that represent individual versions of a + // service. Traffic policies can be overridden at subset level. + Subsets []*Subset `protobuf:"bytes,3,rep,name=subsets,proto3" json:"subsets,omitempty"` + // A list of namespaces to which this destination rule is exported. + // The resolution of a destination rule to apply to a service occurs in the + // context of a hierarchy of namespaces. Exporting a destination rule allows + // it to be included in the resolution hierarchy for services in + // other namespaces. This feature provides a mechanism for service owners + // and mesh administrators to control the visibility of destination rules + // across namespace boundaries. + // + // If no namespaces are specified then the destination rule is exported to all + // namespaces by default. + // + // The value "." is reserved and defines an export to the same namespace that + // the destination rule is declared in. Similarly, the value "*" is reserved and + // defines an export to all namespaces. + // + // NOTE: in the current release, the `exportTo` value is restricted to + // "." or "*" (i.e., the current namespace or all namespaces). + ExportTo []string `protobuf:"bytes,4,rep,name=export_to,json=exportTo,proto3" json:"export_to,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DestinationRule) Reset() { *m = DestinationRule{} } +func (m *DestinationRule) String() string { return proto.CompactTextString(m) } +func (*DestinationRule) ProtoMessage() {} +func (*DestinationRule) Descriptor() ([]byte, []int) { + return fileDescriptor_12899beb695152c8, []int{0} +} +func (m *DestinationRule) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *DestinationRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_DestinationRule.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *DestinationRule) XXX_Merge(src proto.Message) { + xxx_messageInfo_DestinationRule.Merge(m, src) +} +func (m *DestinationRule) XXX_Size() int { + return m.Size() +} +func (m *DestinationRule) XXX_DiscardUnknown() { + xxx_messageInfo_DestinationRule.DiscardUnknown(m) +} + +var xxx_messageInfo_DestinationRule proto.InternalMessageInfo + +func (m *DestinationRule) GetHost() string { + if m != nil { + return m.Host + } + return "" +} + +func (m *DestinationRule) GetTrafficPolicy() *TrafficPolicy { + if m != nil { + return m.TrafficPolicy + } + return nil +} + +func (m *DestinationRule) GetSubsets() []*Subset { + if m != nil { + return m.Subsets + } + return nil +} + +func (m *DestinationRule) GetExportTo() []string { + if m != nil { + return m.ExportTo + } + return nil +} + +// Traffic policies to apply for a specific destination, across all +// destination ports. See DestinationRule for examples. +type TrafficPolicy struct { + // Settings controlling the load balancer algorithms. + LoadBalancer *LoadBalancerSettings `protobuf:"bytes,1,opt,name=load_balancer,json=loadBalancer,proto3" json:"load_balancer,omitempty"` + // Settings controlling the volume of connections to an upstream service + ConnectionPool *ConnectionPoolSettings `protobuf:"bytes,2,opt,name=connection_pool,json=connectionPool,proto3" json:"connection_pool,omitempty"` + // Settings controlling eviction of unhealthy hosts from the load balancing pool + OutlierDetection *OutlierDetection `protobuf:"bytes,3,opt,name=outlier_detection,json=outlierDetection,proto3" json:"outlier_detection,omitempty"` + // TLS related settings for connections to the upstream service. + Tls *ClientTLSSettings `protobuf:"bytes,4,opt,name=tls,proto3" json:"tls,omitempty"` + // Traffic policies specific to individual ports. Note that port level + // settings will override the destination-level settings. Traffic + // settings specified at the destination-level will not be inherited when + // overridden by port-level settings, i.e. default values will be applied + // to fields omitted in port-level traffic policies. + PortLevelSettings []*TrafficPolicy_PortTrafficPolicy `protobuf:"bytes,5,rep,name=port_level_settings,json=portLevelSettings,proto3" json:"port_level_settings,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TrafficPolicy) Reset() { *m = TrafficPolicy{} } +func (m *TrafficPolicy) String() string { return proto.CompactTextString(m) } +func (*TrafficPolicy) ProtoMessage() {} +func (*TrafficPolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_12899beb695152c8, []int{1} +} +func (m *TrafficPolicy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TrafficPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TrafficPolicy.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TrafficPolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_TrafficPolicy.Merge(m, src) +} +func (m *TrafficPolicy) XXX_Size() int { + return m.Size() +} +func (m *TrafficPolicy) XXX_DiscardUnknown() { + xxx_messageInfo_TrafficPolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_TrafficPolicy proto.InternalMessageInfo + +func (m *TrafficPolicy) GetLoadBalancer() *LoadBalancerSettings { + if m != nil { + return m.LoadBalancer + } + return nil +} + +func (m *TrafficPolicy) GetConnectionPool() *ConnectionPoolSettings { + if m != nil { + return m.ConnectionPool + } + return nil +} + +func (m *TrafficPolicy) GetOutlierDetection() *OutlierDetection { + if m != nil { + return m.OutlierDetection + } + return nil +} + +func (m *TrafficPolicy) GetTls() *ClientTLSSettings { + if m != nil { + return m.Tls + } + return nil +} + +func (m *TrafficPolicy) GetPortLevelSettings() []*TrafficPolicy_PortTrafficPolicy { + if m != nil { + return m.PortLevelSettings + } + return nil +} + +// Traffic policies that apply to specific ports of the service +type TrafficPolicy_PortTrafficPolicy struct { + // Specifies the number of a port on the destination service + // on which this policy is being applied. + // + Port *PortSelector `protobuf:"bytes,1,opt,name=port,proto3" json:"port,omitempty"` + // Settings controlling the load balancer algorithms. + LoadBalancer *LoadBalancerSettings `protobuf:"bytes,2,opt,name=load_balancer,json=loadBalancer,proto3" json:"load_balancer,omitempty"` + // Settings controlling the volume of connections to an upstream service + ConnectionPool *ConnectionPoolSettings `protobuf:"bytes,3,opt,name=connection_pool,json=connectionPool,proto3" json:"connection_pool,omitempty"` + // Settings controlling eviction of unhealthy hosts from the load balancing pool + OutlierDetection *OutlierDetection `protobuf:"bytes,4,opt,name=outlier_detection,json=outlierDetection,proto3" json:"outlier_detection,omitempty"` + // TLS related settings for connections to the upstream service. + Tls *ClientTLSSettings `protobuf:"bytes,5,opt,name=tls,proto3" json:"tls,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TrafficPolicy_PortTrafficPolicy) Reset() { *m = TrafficPolicy_PortTrafficPolicy{} } +func (m *TrafficPolicy_PortTrafficPolicy) String() string { return proto.CompactTextString(m) } +func (*TrafficPolicy_PortTrafficPolicy) ProtoMessage() {} +func (*TrafficPolicy_PortTrafficPolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_12899beb695152c8, []int{1, 0} +} +func (m *TrafficPolicy_PortTrafficPolicy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TrafficPolicy_PortTrafficPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TrafficPolicy_PortTrafficPolicy.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TrafficPolicy_PortTrafficPolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_TrafficPolicy_PortTrafficPolicy.Merge(m, src) +} +func (m *TrafficPolicy_PortTrafficPolicy) XXX_Size() int { + return m.Size() +} +func (m *TrafficPolicy_PortTrafficPolicy) XXX_DiscardUnknown() { + xxx_messageInfo_TrafficPolicy_PortTrafficPolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_TrafficPolicy_PortTrafficPolicy proto.InternalMessageInfo + +func (m *TrafficPolicy_PortTrafficPolicy) GetPort() *PortSelector { + if m != nil { + return m.Port + } + return nil +} + +func (m *TrafficPolicy_PortTrafficPolicy) GetLoadBalancer() *LoadBalancerSettings { + if m != nil { + return m.LoadBalancer + } + return nil +} + +func (m *TrafficPolicy_PortTrafficPolicy) GetConnectionPool() *ConnectionPoolSettings { + if m != nil { + return m.ConnectionPool + } + return nil +} + +func (m *TrafficPolicy_PortTrafficPolicy) GetOutlierDetection() *OutlierDetection { + if m != nil { + return m.OutlierDetection + } + return nil +} + +func (m *TrafficPolicy_PortTrafficPolicy) GetTls() *ClientTLSSettings { + if m != nil { + return m.Tls + } + return nil +} + +// A subset of endpoints of a service. Subsets can be used for scenarios +// like A/B testing, or routing to a specific version of a service. Refer +// to [VirtualService](https://istio.io/docs/reference/config/networking/virtual-service/#VirtualService) documentation for examples of using +// subsets in these scenarios. In addition, traffic policies defined at the +// service-level can be overridden at a subset-level. The following rule +// uses a round robin load balancing policy for all traffic going to a +// subset named testversion that is composed of endpoints (e.g., pods) with +// labels (version:v3). +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// subsets: +// - name: testversion +// labels: +// version: v3 +// trafficPolicy: +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// subsets: +// - name: testversion +// labels: +// version: v3 +// trafficPolicy: +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// {{}} +// +// **Note:** Policies specified for subsets will not take effect until +// a route rule explicitly sends traffic to this subset. +// +// One or more labels are typically required to identify the subset destination, +// however, when the corresponding DestinationRule represents a host that +// supports multiple SNI hosts (e.g., an egress gateway), a subset without labels +// may be meaningful. In this case a traffic policy with [ClientTLSSettings](#ClientTLSSettings) +// can be used to identify a specific SNI host corresponding to the named subset. +type Subset struct { + // Name of the subset. The service name and the subset name can + // be used for traffic splitting in a route rule. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Labels apply a filter over the endpoints of a service in the + // service registry. See route rules for examples of usage. + Labels map[string]string `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Traffic policies that apply to this subset. Subsets inherit the + // traffic policies specified at the DestinationRule level. Settings + // specified at the subset level will override the corresponding settings + // specified at the DestinationRule level. + TrafficPolicy *TrafficPolicy `protobuf:"bytes,3,opt,name=traffic_policy,json=trafficPolicy,proto3" json:"traffic_policy,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Subset) Reset() { *m = Subset{} } +func (m *Subset) String() string { return proto.CompactTextString(m) } +func (*Subset) ProtoMessage() {} +func (*Subset) Descriptor() ([]byte, []int) { + return fileDescriptor_12899beb695152c8, []int{2} +} +func (m *Subset) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Subset) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Subset.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Subset) XXX_Merge(src proto.Message) { + xxx_messageInfo_Subset.Merge(m, src) +} +func (m *Subset) XXX_Size() int { + return m.Size() +} +func (m *Subset) XXX_DiscardUnknown() { + xxx_messageInfo_Subset.DiscardUnknown(m) +} + +var xxx_messageInfo_Subset proto.InternalMessageInfo + +func (m *Subset) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Subset) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func (m *Subset) GetTrafficPolicy() *TrafficPolicy { + if m != nil { + return m.TrafficPolicy + } + return nil +} + +// Load balancing policies to apply for a specific destination. See Envoy's +// load balancing +// [documentation](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/load_balancing) +// for more details. +// +// For example, the following rule uses a round robin load balancing policy +// for all traffic going to the ratings service. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// {{}} +// +// The following example sets up sticky sessions for the ratings service +// hashing-based load balancer for the same ratings service using the +// the User cookie as the hash key. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// consistentHash: +// httpCookie: +// name: user +// ttl: 0s +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// consistentHash: +// httpCookie: +// name: user +// ttl: 0s +// ``` +// {{}} +// {{}} +// +type LoadBalancerSettings struct { + // Upstream load balancing policy. + // + // Types that are valid to be assigned to LbPolicy: + // *LoadBalancerSettings_Simple + // *LoadBalancerSettings_ConsistentHash + LbPolicy isLoadBalancerSettings_LbPolicy `protobuf_oneof:"lb_policy"` + // Locality load balancer settings, this will override mesh wide settings in entirety, meaning no merging would be performed + // between this object and the object one in MeshConfig + LocalityLbSetting *LocalityLoadBalancerSetting `protobuf:"bytes,3,opt,name=locality_lb_setting,json=localityLbSetting,proto3" json:"locality_lb_setting,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LoadBalancerSettings) Reset() { *m = LoadBalancerSettings{} } +func (m *LoadBalancerSettings) String() string { return proto.CompactTextString(m) } +func (*LoadBalancerSettings) ProtoMessage() {} +func (*LoadBalancerSettings) Descriptor() ([]byte, []int) { + return fileDescriptor_12899beb695152c8, []int{3} +} +func (m *LoadBalancerSettings) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LoadBalancerSettings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LoadBalancerSettings.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LoadBalancerSettings) XXX_Merge(src proto.Message) { + xxx_messageInfo_LoadBalancerSettings.Merge(m, src) +} +func (m *LoadBalancerSettings) XXX_Size() int { + return m.Size() +} +func (m *LoadBalancerSettings) XXX_DiscardUnknown() { + xxx_messageInfo_LoadBalancerSettings.DiscardUnknown(m) +} + +var xxx_messageInfo_LoadBalancerSettings proto.InternalMessageInfo + +type isLoadBalancerSettings_LbPolicy interface { + isLoadBalancerSettings_LbPolicy() + MarshalTo([]byte) (int, error) + Size() int +} + +type LoadBalancerSettings_Simple struct { + Simple LoadBalancerSettings_SimpleLB `protobuf:"varint,1,opt,name=simple,proto3,enum=istio.networking.v1alpha3.LoadBalancerSettings_SimpleLB,oneof"` +} +type LoadBalancerSettings_ConsistentHash struct { + ConsistentHash *LoadBalancerSettings_ConsistentHashLB `protobuf:"bytes,2,opt,name=consistent_hash,json=consistentHash,proto3,oneof"` +} + +func (*LoadBalancerSettings_Simple) isLoadBalancerSettings_LbPolicy() {} +func (*LoadBalancerSettings_ConsistentHash) isLoadBalancerSettings_LbPolicy() {} + +func (m *LoadBalancerSettings) GetLbPolicy() isLoadBalancerSettings_LbPolicy { + if m != nil { + return m.LbPolicy + } + return nil +} + +func (m *LoadBalancerSettings) GetSimple() LoadBalancerSettings_SimpleLB { + if x, ok := m.GetLbPolicy().(*LoadBalancerSettings_Simple); ok { + return x.Simple + } + return LoadBalancerSettings_ROUND_ROBIN +} + +func (m *LoadBalancerSettings) GetConsistentHash() *LoadBalancerSettings_ConsistentHashLB { + if x, ok := m.GetLbPolicy().(*LoadBalancerSettings_ConsistentHash); ok { + return x.ConsistentHash + } + return nil +} + +func (m *LoadBalancerSettings) GetLocalityLbSetting() *LocalityLoadBalancerSetting { + if m != nil { + return m.LocalityLbSetting + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*LoadBalancerSettings) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*LoadBalancerSettings_Simple)(nil), + (*LoadBalancerSettings_ConsistentHash)(nil), + } +} + +// Consistent Hash-based load balancing can be used to provide soft +// session affinity based on HTTP headers, cookies or other +// properties. This load balancing policy is applicable only for HTTP +// connections. The affinity to a particular destination host will be +// lost when one or more hosts are added/removed from the destination +// service. +type LoadBalancerSettings_ConsistentHashLB struct { + // The hash key to use. + // + // Types that are valid to be assigned to HashKey: + // *LoadBalancerSettings_ConsistentHashLB_HttpHeaderName + // *LoadBalancerSettings_ConsistentHashLB_HttpCookie + // *LoadBalancerSettings_ConsistentHashLB_UseSourceIp + // *LoadBalancerSettings_ConsistentHashLB_HttpQueryParameterName + HashKey isLoadBalancerSettings_ConsistentHashLB_HashKey `protobuf_oneof:"hash_key"` + // The minimum number of virtual nodes to use for the hash + // ring. Defaults to 1024. Larger ring sizes result in more granular + // load distributions. If the number of hosts in the load balancing + // pool is larger than the ring size, each host will be assigned a + // single virtual node. + MinimumRingSize uint64 `protobuf:"varint,4,opt,name=minimum_ring_size,json=minimumRingSize,proto3" json:"minimum_ring_size,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LoadBalancerSettings_ConsistentHashLB) Reset() { *m = LoadBalancerSettings_ConsistentHashLB{} } +func (m *LoadBalancerSettings_ConsistentHashLB) String() string { return proto.CompactTextString(m) } +func (*LoadBalancerSettings_ConsistentHashLB) ProtoMessage() {} +func (*LoadBalancerSettings_ConsistentHashLB) Descriptor() ([]byte, []int) { + return fileDescriptor_12899beb695152c8, []int{3, 0} +} +func (m *LoadBalancerSettings_ConsistentHashLB) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LoadBalancerSettings_ConsistentHashLB) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LoadBalancerSettings_ConsistentHashLB.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LoadBalancerSettings_ConsistentHashLB) XXX_Merge(src proto.Message) { + xxx_messageInfo_LoadBalancerSettings_ConsistentHashLB.Merge(m, src) +} +func (m *LoadBalancerSettings_ConsistentHashLB) XXX_Size() int { + return m.Size() +} +func (m *LoadBalancerSettings_ConsistentHashLB) XXX_DiscardUnknown() { + xxx_messageInfo_LoadBalancerSettings_ConsistentHashLB.DiscardUnknown(m) +} + +var xxx_messageInfo_LoadBalancerSettings_ConsistentHashLB proto.InternalMessageInfo + +type isLoadBalancerSettings_ConsistentHashLB_HashKey interface { + isLoadBalancerSettings_ConsistentHashLB_HashKey() + MarshalTo([]byte) (int, error) + Size() int +} + +type LoadBalancerSettings_ConsistentHashLB_HttpHeaderName struct { + HttpHeaderName string `protobuf:"bytes,1,opt,name=http_header_name,json=httpHeaderName,proto3,oneof"` +} +type LoadBalancerSettings_ConsistentHashLB_HttpCookie struct { + HttpCookie *LoadBalancerSettings_ConsistentHashLB_HTTPCookie `protobuf:"bytes,2,opt,name=http_cookie,json=httpCookie,proto3,oneof"` +} +type LoadBalancerSettings_ConsistentHashLB_UseSourceIp struct { + UseSourceIp bool `protobuf:"varint,3,opt,name=use_source_ip,json=useSourceIp,proto3,oneof"` +} +type LoadBalancerSettings_ConsistentHashLB_HttpQueryParameterName struct { + HttpQueryParameterName string `protobuf:"bytes,5,opt,name=http_query_parameter_name,json=httpQueryParameterName,proto3,oneof"` +} + +func (*LoadBalancerSettings_ConsistentHashLB_HttpHeaderName) isLoadBalancerSettings_ConsistentHashLB_HashKey() { +} +func (*LoadBalancerSettings_ConsistentHashLB_HttpCookie) isLoadBalancerSettings_ConsistentHashLB_HashKey() { +} +func (*LoadBalancerSettings_ConsistentHashLB_UseSourceIp) isLoadBalancerSettings_ConsistentHashLB_HashKey() { +} +func (*LoadBalancerSettings_ConsistentHashLB_HttpQueryParameterName) isLoadBalancerSettings_ConsistentHashLB_HashKey() { +} + +func (m *LoadBalancerSettings_ConsistentHashLB) GetHashKey() isLoadBalancerSettings_ConsistentHashLB_HashKey { + if m != nil { + return m.HashKey + } + return nil +} + +func (m *LoadBalancerSettings_ConsistentHashLB) GetHttpHeaderName() string { + if x, ok := m.GetHashKey().(*LoadBalancerSettings_ConsistentHashLB_HttpHeaderName); ok { + return x.HttpHeaderName + } + return "" +} + +func (m *LoadBalancerSettings_ConsistentHashLB) GetHttpCookie() *LoadBalancerSettings_ConsistentHashLB_HTTPCookie { + if x, ok := m.GetHashKey().(*LoadBalancerSettings_ConsistentHashLB_HttpCookie); ok { + return x.HttpCookie + } + return nil +} + +func (m *LoadBalancerSettings_ConsistentHashLB) GetUseSourceIp() bool { + if x, ok := m.GetHashKey().(*LoadBalancerSettings_ConsistentHashLB_UseSourceIp); ok { + return x.UseSourceIp + } + return false +} + +func (m *LoadBalancerSettings_ConsistentHashLB) GetHttpQueryParameterName() string { + if x, ok := m.GetHashKey().(*LoadBalancerSettings_ConsistentHashLB_HttpQueryParameterName); ok { + return x.HttpQueryParameterName + } + return "" +} + +func (m *LoadBalancerSettings_ConsistentHashLB) GetMinimumRingSize() uint64 { + if m != nil { + return m.MinimumRingSize + } + return 0 +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*LoadBalancerSettings_ConsistentHashLB) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*LoadBalancerSettings_ConsistentHashLB_HttpHeaderName)(nil), + (*LoadBalancerSettings_ConsistentHashLB_HttpCookie)(nil), + (*LoadBalancerSettings_ConsistentHashLB_UseSourceIp)(nil), + (*LoadBalancerSettings_ConsistentHashLB_HttpQueryParameterName)(nil), + } +} + +// Describes a HTTP cookie that will be used as the hash key for the +// Consistent Hash load balancer. If the cookie is not present, it will +// be generated. +type LoadBalancerSettings_ConsistentHashLB_HTTPCookie struct { + // Name of the cookie. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Path to set for the cookie. + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + // Lifetime of the cookie. + Ttl *types.Duration `protobuf:"bytes,3,opt,name=ttl,proto3" json:"ttl,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) Reset() { + *m = LoadBalancerSettings_ConsistentHashLB_HTTPCookie{} +} +func (m *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) String() string { + return proto.CompactTextString(m) +} +func (*LoadBalancerSettings_ConsistentHashLB_HTTPCookie) ProtoMessage() {} +func (*LoadBalancerSettings_ConsistentHashLB_HTTPCookie) Descriptor() ([]byte, []int) { + return fileDescriptor_12899beb695152c8, []int{3, 0, 0} +} +func (m *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LoadBalancerSettings_ConsistentHashLB_HTTPCookie.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) XXX_Merge(src proto.Message) { + xxx_messageInfo_LoadBalancerSettings_ConsistentHashLB_HTTPCookie.Merge(m, src) +} +func (m *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) XXX_Size() int { + return m.Size() +} +func (m *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) XXX_DiscardUnknown() { + xxx_messageInfo_LoadBalancerSettings_ConsistentHashLB_HTTPCookie.DiscardUnknown(m) +} + +var xxx_messageInfo_LoadBalancerSettings_ConsistentHashLB_HTTPCookie proto.InternalMessageInfo + +func (m *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) GetPath() string { + if m != nil { + return m.Path + } + return "" +} + +func (m *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) GetTtl() *types.Duration { + if m != nil { + return m.Ttl + } + return nil +} + +// Connection pool settings for an upstream host. The settings apply to +// each individual host in the upstream service. See Envoy's [circuit +// breaker](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/circuit_breaking) +// for more details. Connection pool settings can be applied at the TCP +// level as well as at HTTP level. +// +// For example, the following rule sets a limit of 100 connections to redis +// service called myredissrv with a connect timeout of 30ms +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-redis +// spec: +// host: myredissrv.prod.svc.cluster.local +// trafficPolicy: +// connectionPool: +// tcp: +// maxConnections: 100 +// connectTimeout: 30ms +// tcpKeepalive: +// time: 7200s +// interval: 75s +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: bookinfo-redis +// spec: +// host: myredissrv.prod.svc.cluster.local +// trafficPolicy: +// connectionPool: +// tcp: +// maxConnections: 100 +// connectTimeout: 30ms +// tcpKeepalive: +// time: 7200s +// interval: 75s +// ``` +// {{}} +// {{}} +// +type ConnectionPoolSettings struct { + // Settings common to both HTTP and TCP upstream connections. + Tcp *ConnectionPoolSettings_TCPSettings `protobuf:"bytes,1,opt,name=tcp,proto3" json:"tcp,omitempty"` + // HTTP connection pool settings. + Http *ConnectionPoolSettings_HTTPSettings `protobuf:"bytes,2,opt,name=http,proto3" json:"http,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConnectionPoolSettings) Reset() { *m = ConnectionPoolSettings{} } +func (m *ConnectionPoolSettings) String() string { return proto.CompactTextString(m) } +func (*ConnectionPoolSettings) ProtoMessage() {} +func (*ConnectionPoolSettings) Descriptor() ([]byte, []int) { + return fileDescriptor_12899beb695152c8, []int{4} +} +func (m *ConnectionPoolSettings) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConnectionPoolSettings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConnectionPoolSettings.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ConnectionPoolSettings) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConnectionPoolSettings.Merge(m, src) +} +func (m *ConnectionPoolSettings) XXX_Size() int { + return m.Size() +} +func (m *ConnectionPoolSettings) XXX_DiscardUnknown() { + xxx_messageInfo_ConnectionPoolSettings.DiscardUnknown(m) +} + +var xxx_messageInfo_ConnectionPoolSettings proto.InternalMessageInfo + +func (m *ConnectionPoolSettings) GetTcp() *ConnectionPoolSettings_TCPSettings { + if m != nil { + return m.Tcp + } + return nil +} + +func (m *ConnectionPoolSettings) GetHttp() *ConnectionPoolSettings_HTTPSettings { + if m != nil { + return m.Http + } + return nil +} + +// Settings common to both HTTP and TCP upstream connections. +type ConnectionPoolSettings_TCPSettings struct { + // Maximum number of HTTP1 /TCP connections to a destination host. Default 2^32-1. + MaxConnections int32 `protobuf:"varint,1,opt,name=max_connections,json=maxConnections,proto3" json:"max_connections,omitempty"` + // TCP connection timeout. format: + // 1h/1m/1s/1ms. MUST BE >=1ms. Default is 10s. + ConnectTimeout *types.Duration `protobuf:"bytes,2,opt,name=connect_timeout,json=connectTimeout,proto3" json:"connect_timeout,omitempty"` + // If set then set SO_KEEPALIVE on the socket to enable TCP Keepalives. + TcpKeepalive *ConnectionPoolSettings_TCPSettings_TcpKeepalive `protobuf:"bytes,3,opt,name=tcp_keepalive,json=tcpKeepalive,proto3" json:"tcp_keepalive,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConnectionPoolSettings_TCPSettings) Reset() { *m = ConnectionPoolSettings_TCPSettings{} } +func (m *ConnectionPoolSettings_TCPSettings) String() string { return proto.CompactTextString(m) } +func (*ConnectionPoolSettings_TCPSettings) ProtoMessage() {} +func (*ConnectionPoolSettings_TCPSettings) Descriptor() ([]byte, []int) { + return fileDescriptor_12899beb695152c8, []int{4, 0} +} +func (m *ConnectionPoolSettings_TCPSettings) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConnectionPoolSettings_TCPSettings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConnectionPoolSettings_TCPSettings.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ConnectionPoolSettings_TCPSettings) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConnectionPoolSettings_TCPSettings.Merge(m, src) +} +func (m *ConnectionPoolSettings_TCPSettings) XXX_Size() int { + return m.Size() +} +func (m *ConnectionPoolSettings_TCPSettings) XXX_DiscardUnknown() { + xxx_messageInfo_ConnectionPoolSettings_TCPSettings.DiscardUnknown(m) +} + +var xxx_messageInfo_ConnectionPoolSettings_TCPSettings proto.InternalMessageInfo + +func (m *ConnectionPoolSettings_TCPSettings) GetMaxConnections() int32 { + if m != nil { + return m.MaxConnections + } + return 0 +} + +func (m *ConnectionPoolSettings_TCPSettings) GetConnectTimeout() *types.Duration { + if m != nil { + return m.ConnectTimeout + } + return nil +} + +func (m *ConnectionPoolSettings_TCPSettings) GetTcpKeepalive() *ConnectionPoolSettings_TCPSettings_TcpKeepalive { + if m != nil { + return m.TcpKeepalive + } + return nil +} + +// TCP keepalive. +type ConnectionPoolSettings_TCPSettings_TcpKeepalive struct { + // Maximum number of keepalive probes to send without response before + // deciding the connection is dead. Default is to use the OS level configuration + // (unless overridden, Linux defaults to 9.) + Probes uint32 `protobuf:"varint,1,opt,name=probes,proto3" json:"probes,omitempty"` + // The time duration a connection needs to be idle before keep-alive + // probes start being sent. Default is to use the OS level configuration + // (unless overridden, Linux defaults to 7200s (ie 2 hours.) + Time *types.Duration `protobuf:"bytes,2,opt,name=time,proto3" json:"time,omitempty"` + // The time duration between keep-alive probes. + // Default is to use the OS level configuration + // (unless overridden, Linux defaults to 75s.) + Interval *types.Duration `protobuf:"bytes,3,opt,name=interval,proto3" json:"interval,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConnectionPoolSettings_TCPSettings_TcpKeepalive) Reset() { + *m = ConnectionPoolSettings_TCPSettings_TcpKeepalive{} +} +func (m *ConnectionPoolSettings_TCPSettings_TcpKeepalive) String() string { + return proto.CompactTextString(m) +} +func (*ConnectionPoolSettings_TCPSettings_TcpKeepalive) ProtoMessage() {} +func (*ConnectionPoolSettings_TCPSettings_TcpKeepalive) Descriptor() ([]byte, []int) { + return fileDescriptor_12899beb695152c8, []int{4, 0, 0} +} +func (m *ConnectionPoolSettings_TCPSettings_TcpKeepalive) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConnectionPoolSettings_TCPSettings_TcpKeepalive) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConnectionPoolSettings_TCPSettings_TcpKeepalive.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ConnectionPoolSettings_TCPSettings_TcpKeepalive) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConnectionPoolSettings_TCPSettings_TcpKeepalive.Merge(m, src) +} +func (m *ConnectionPoolSettings_TCPSettings_TcpKeepalive) XXX_Size() int { + return m.Size() +} +func (m *ConnectionPoolSettings_TCPSettings_TcpKeepalive) XXX_DiscardUnknown() { + xxx_messageInfo_ConnectionPoolSettings_TCPSettings_TcpKeepalive.DiscardUnknown(m) +} + +var xxx_messageInfo_ConnectionPoolSettings_TCPSettings_TcpKeepalive proto.InternalMessageInfo + +func (m *ConnectionPoolSettings_TCPSettings_TcpKeepalive) GetProbes() uint32 { + if m != nil { + return m.Probes + } + return 0 +} + +func (m *ConnectionPoolSettings_TCPSettings_TcpKeepalive) GetTime() *types.Duration { + if m != nil { + return m.Time + } + return nil +} + +func (m *ConnectionPoolSettings_TCPSettings_TcpKeepalive) GetInterval() *types.Duration { + if m != nil { + return m.Interval + } + return nil +} + +// Settings applicable to HTTP1.1/HTTP2/GRPC connections. +type ConnectionPoolSettings_HTTPSettings struct { + // Maximum number of pending HTTP requests to a destination. Default 2^32-1. + Http1MaxPendingRequests int32 `protobuf:"varint,1,opt,name=http1_max_pending_requests,json=http1MaxPendingRequests,proto3" json:"http1_max_pending_requests,omitempty"` + // Maximum number of requests to a backend. Default 2^32-1. + Http2MaxRequests int32 `protobuf:"varint,2,opt,name=http2_max_requests,json=http2MaxRequests,proto3" json:"http2_max_requests,omitempty"` + // Maximum number of requests per connection to a backend. Setting this + // parameter to 1 disables keep alive. Default 0, meaning "unlimited", + // up to 2^29. + MaxRequestsPerConnection int32 `protobuf:"varint,3,opt,name=max_requests_per_connection,json=maxRequestsPerConnection,proto3" json:"max_requests_per_connection,omitempty"` + // Maximum number of retries that can be outstanding to all hosts in a + // cluster at a given time. Defaults to 2^32-1. + MaxRetries int32 `protobuf:"varint,4,opt,name=max_retries,json=maxRetries,proto3" json:"max_retries,omitempty"` + // The idle timeout for upstream connection pool connections. The idle timeout is defined as the period in which there are no active requests. + // If not set, the default is 1 hour. When the idle timeout is reached the connection will be closed. + // Note that request based timeouts mean that HTTP/2 PINGs will not keep the connection alive. Applies to both HTTP1.1 and HTTP2 connections. + IdleTimeout *types.Duration `protobuf:"bytes,5,opt,name=idle_timeout,json=idleTimeout,proto3" json:"idle_timeout,omitempty"` + // Specify if http1.1 connection should be upgraded to http2 for the associated destination. + H2UpgradePolicy ConnectionPoolSettings_HTTPSettings_H2UpgradePolicy `protobuf:"varint,6,opt,name=h2_upgrade_policy,json=h2UpgradePolicy,proto3,enum=istio.networking.v1alpha3.ConnectionPoolSettings_HTTPSettings_H2UpgradePolicy" json:"h2_upgrade_policy,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ConnectionPoolSettings_HTTPSettings) Reset() { *m = ConnectionPoolSettings_HTTPSettings{} } +func (m *ConnectionPoolSettings_HTTPSettings) String() string { return proto.CompactTextString(m) } +func (*ConnectionPoolSettings_HTTPSettings) ProtoMessage() {} +func (*ConnectionPoolSettings_HTTPSettings) Descriptor() ([]byte, []int) { + return fileDescriptor_12899beb695152c8, []int{4, 1} +} +func (m *ConnectionPoolSettings_HTTPSettings) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConnectionPoolSettings_HTTPSettings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConnectionPoolSettings_HTTPSettings.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ConnectionPoolSettings_HTTPSettings) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConnectionPoolSettings_HTTPSettings.Merge(m, src) +} +func (m *ConnectionPoolSettings_HTTPSettings) XXX_Size() int { + return m.Size() +} +func (m *ConnectionPoolSettings_HTTPSettings) XXX_DiscardUnknown() { + xxx_messageInfo_ConnectionPoolSettings_HTTPSettings.DiscardUnknown(m) +} + +var xxx_messageInfo_ConnectionPoolSettings_HTTPSettings proto.InternalMessageInfo + +func (m *ConnectionPoolSettings_HTTPSettings) GetHttp1MaxPendingRequests() int32 { + if m != nil { + return m.Http1MaxPendingRequests + } + return 0 +} + +func (m *ConnectionPoolSettings_HTTPSettings) GetHttp2MaxRequests() int32 { + if m != nil { + return m.Http2MaxRequests + } + return 0 +} + +func (m *ConnectionPoolSettings_HTTPSettings) GetMaxRequestsPerConnection() int32 { + if m != nil { + return m.MaxRequestsPerConnection + } + return 0 +} + +func (m *ConnectionPoolSettings_HTTPSettings) GetMaxRetries() int32 { + if m != nil { + return m.MaxRetries + } + return 0 +} + +func (m *ConnectionPoolSettings_HTTPSettings) GetIdleTimeout() *types.Duration { + if m != nil { + return m.IdleTimeout + } + return nil +} + +func (m *ConnectionPoolSettings_HTTPSettings) GetH2UpgradePolicy() ConnectionPoolSettings_HTTPSettings_H2UpgradePolicy { + if m != nil { + return m.H2UpgradePolicy + } + return ConnectionPoolSettings_HTTPSettings_DEFAULT +} + +// A Circuit breaker implementation that tracks the status of each +// individual host in the upstream service. Applicable to both HTTP and +// TCP services. For HTTP services, hosts that continually return 5xx +// errors for API calls are ejected from the pool for a pre-defined period +// of time. For TCP services, connection timeouts or connection +// failures to a given host counts as an error when measuring the +// consecutive errors metric. See Envoy's [outlier +// detection](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/outlier) +// for more details. +// +// The following rule sets a connection pool size of 100 HTTP1 connections +// with no more than 10 req/connection to the "reviews" service. In addition, +// it sets a limit of 1000 concurrent HTTP2 requests and configures upstream +// hosts to be scanned every 5 mins so that any host that fails 7 consecutive +// times with a 502, 503, or 504 error code will be ejected for 15 minutes. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: reviews-cb-policy +// spec: +// host: reviews.prod.svc.cluster.local +// trafficPolicy: +// connectionPool: +// tcp: +// maxConnections: 100 +// http: +// http2MaxRequests: 1000 +// maxRequestsPerConnection: 10 +// outlierDetection: +// consecutiveErrors: 7 +// interval: 5m +// baseEjectionTime: 15m +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: reviews-cb-policy +// spec: +// host: reviews.prod.svc.cluster.local +// trafficPolicy: +// connectionPool: +// tcp: +// maxConnections: 100 +// http: +// http2MaxRequests: 1000 +// maxRequestsPerConnection: 10 +// outlierDetection: +// consecutiveErrors: 7 +// interval: 5m +// baseEjectionTime: 15m +// ``` +// {{}} +// {{}} +// +type OutlierDetection struct { + // Number of errors before a host is ejected from the connection + // pool. Defaults to 5. When the upstream host is accessed over HTTP, a + // 502, 503, or 504 return code qualifies as an error. When the upstream host + // is accessed over an opaque TCP connection, connect timeouts and + // connection error/failure events qualify as an error. + // $hide_from_docs + ConsecutiveErrors int32 `protobuf:"varint,1,opt,name=consecutive_errors,json=consecutiveErrors,proto3" json:"consecutive_errors,omitempty"` // Deprecated: Do not use. + // Number of gateway errors before a host is ejected from the connection pool. + // When the upstream host is accessed over HTTP, a 502, 503, or 504 return + // code qualifies as a gateway error. When the upstream host is accessed over + // an opaque TCP connection, connect timeouts and connection error/failure + // events qualify as a gateway error. + // This feature is disabled by default or when set to the value 0. + // + // Note that consecutive_gateway_errors and consecutive_5xx_errors can be + // used separately or together. Because the errors counted by + // consecutive_gateway_errors are also included in consecutive_5xx_errors, + // if the value of consecutive_gateway_errors is greater than or equal to + // the value of consecutive_5xx_errors, consecutive_gateway_errors will have + // no effect. + ConsecutiveGatewayErrors *types.UInt32Value `protobuf:"bytes,6,opt,name=consecutive_gateway_errors,json=consecutiveGatewayErrors,proto3" json:"consecutive_gateway_errors,omitempty"` + // Number of 5xx errors before a host is ejected from the connection pool. + // When the upstream host is accessed over an opaque TCP connection, connect + // timeouts, connection error/failure and request failure events qualify as a + // 5xx error. + // This feature defaults to 5 but can be disabled by setting the value to 0. + // + // Note that consecutive_gateway_errors and consecutive_5xx_errors can be + // used separately or together. Because the errors counted by + // consecutive_gateway_errors are also included in consecutive_5xx_errors, + // if the value of consecutive_gateway_errors is greater than or equal to + // the value of consecutive_5xx_errors, consecutive_gateway_errors will have + // no effect. + Consecutive_5XxErrors *types.UInt32Value `protobuf:"bytes,7,opt,name=consecutive_5xx_errors,json=consecutive5xxErrors,proto3" json:"consecutive_5xx_errors,omitempty"` + // Time interval between ejection sweep analysis. format: + // 1h/1m/1s/1ms. MUST BE >=1ms. Default is 10s. + Interval *types.Duration `protobuf:"bytes,2,opt,name=interval,proto3" json:"interval,omitempty"` + // Minimum ejection duration. A host will remain ejected for a period + // equal to the product of minimum ejection duration and the number of + // times the host has been ejected. This technique allows the system to + // automatically increase the ejection period for unhealthy upstream + // servers. format: 1h/1m/1s/1ms. MUST BE >=1ms. Default is 30s. + BaseEjectionTime *types.Duration `protobuf:"bytes,3,opt,name=base_ejection_time,json=baseEjectionTime,proto3" json:"base_ejection_time,omitempty"` + // Maximum % of hosts in the load balancing pool for the upstream + // service that can be ejected. Defaults to 10%. + MaxEjectionPercent int32 `protobuf:"varint,4,opt,name=max_ejection_percent,json=maxEjectionPercent,proto3" json:"max_ejection_percent,omitempty"` + // Outlier detection will be enabled as long as the associated load balancing + // pool has at least min_health_percent hosts in healthy mode. When the + // percentage of healthy hosts in the load balancing pool drops below this + // threshold, outlier detection will be disabled and the proxy will load balance + // across all hosts in the pool (healthy and unhealthy). The threshold can be + // disabled by setting it to 0%. The default is 0% as it's not typically + // applicable in k8s environments with few pods per service. + MinHealthPercent int32 `protobuf:"varint,5,opt,name=min_health_percent,json=minHealthPercent,proto3" json:"min_health_percent,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *OutlierDetection) Reset() { *m = OutlierDetection{} } +func (m *OutlierDetection) String() string { return proto.CompactTextString(m) } +func (*OutlierDetection) ProtoMessage() {} +func (*OutlierDetection) Descriptor() ([]byte, []int) { + return fileDescriptor_12899beb695152c8, []int{5} +} +func (m *OutlierDetection) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OutlierDetection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OutlierDetection.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OutlierDetection) XXX_Merge(src proto.Message) { + xxx_messageInfo_OutlierDetection.Merge(m, src) +} +func (m *OutlierDetection) XXX_Size() int { + return m.Size() +} +func (m *OutlierDetection) XXX_DiscardUnknown() { + xxx_messageInfo_OutlierDetection.DiscardUnknown(m) +} + +var xxx_messageInfo_OutlierDetection proto.InternalMessageInfo + +// Deprecated: Do not use. +func (m *OutlierDetection) GetConsecutiveErrors() int32 { + if m != nil { + return m.ConsecutiveErrors + } + return 0 +} + +func (m *OutlierDetection) GetConsecutiveGatewayErrors() *types.UInt32Value { + if m != nil { + return m.ConsecutiveGatewayErrors + } + return nil +} + +func (m *OutlierDetection) GetConsecutive_5XxErrors() *types.UInt32Value { + if m != nil { + return m.Consecutive_5XxErrors + } + return nil +} + +func (m *OutlierDetection) GetInterval() *types.Duration { + if m != nil { + return m.Interval + } + return nil +} + +func (m *OutlierDetection) GetBaseEjectionTime() *types.Duration { + if m != nil { + return m.BaseEjectionTime + } + return nil +} + +func (m *OutlierDetection) GetMaxEjectionPercent() int32 { + if m != nil { + return m.MaxEjectionPercent + } + return 0 +} + +func (m *OutlierDetection) GetMinHealthPercent() int32 { + if m != nil { + return m.MinHealthPercent + } + return 0 +} + +// SSL/TLS related settings for upstream connections. See Envoy's [TLS +// context](https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/auth/cert.proto.html) +// for more details. These settings are common to both HTTP and TCP upstreams. +// +// For example, the following rule configures a client to use mutual TLS +// for connections to upstream database cluster. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: db-mtls +// spec: +// host: mydbserver.prod.svc.cluster.local +// trafficPolicy: +// tls: +// mode: MUTUAL +// clientCertificate: /etc/certs/myclientcert.pem +// privateKey: /etc/certs/client_private_key.pem +// caCertificates: /etc/certs/rootcacerts.pem +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: db-mtls +// spec: +// host: mydbserver.prod.svc.cluster.local +// trafficPolicy: +// tls: +// mode: MUTUAL +// clientCertificate: /etc/certs/myclientcert.pem +// privateKey: /etc/certs/client_private_key.pem +// caCertificates: /etc/certs/rootcacerts.pem +// ``` +// {{}} +// {{}} +// +// The following rule configures a client to use TLS when talking to a +// foreign service whose domain matches *.foo.com. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: tls-foo +// spec: +// host: "*.foo.com" +// trafficPolicy: +// tls: +// mode: SIMPLE +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: tls-foo +// spec: +// host: "*.foo.com" +// trafficPolicy: +// tls: +// mode: SIMPLE +// ``` +// {{}} +// {{}} +// +// The following rule configures a client to use Istio mutual TLS when talking +// to rating services. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: ratings-istio-mtls +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// tls: +// mode: ISTIO_MUTUAL +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: ratings-istio-mtls +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// tls: +// mode: ISTIO_MUTUAL +// ``` +// {{}} +// {{}} +// +type ClientTLSSettings struct { + // Indicates whether connections to this port should be secured + // using TLS. The value of this field determines how TLS is enforced. + Mode ClientTLSSettings_TLSmode `protobuf:"varint,1,opt,name=mode,proto3,enum=istio.networking.v1alpha3.ClientTLSSettings_TLSmode" json:"mode,omitempty"` + // REQUIRED if mode is `MUTUAL`. The path to the file holding the + // client-side TLS certificate to use. + // Should be empty if mode is `ISTIO_MUTUAL`. + ClientCertificate string `protobuf:"bytes,2,opt,name=client_certificate,json=clientCertificate,proto3" json:"client_certificate,omitempty"` + // REQUIRED if mode is `MUTUAL`. The path to the file holding the + // client's private key. + // Should be empty if mode is `ISTIO_MUTUAL`. + PrivateKey string `protobuf:"bytes,3,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"` + // OPTIONAL: The path to the file containing certificate authority + // certificates to use in verifying a presented server certificate. If + // omitted, the proxy will not verify the server's certificate. + // Should be empty if mode is `ISTIO_MUTUAL`. + CaCertificates string `protobuf:"bytes,4,opt,name=ca_certificates,json=caCertificates,proto3" json:"ca_certificates,omitempty"` + // The name of the secret that holds the TLS certs for the + // client including the CA certificates. Applicable + // only on Kubernetes. Secret must exist in the same + // namespace with the proxy using the certificates. + // The secret (of type `generic`)should contain the + // following keys and values: `key: `, + // `cert: `, `cacert: `. + // Secret of type tls for client certificates along with + // ca.crt key for CA certificates is also supported. + // Only one of client certificates and CA certificate + // or credentialName can be specified. + CredentialName string `protobuf:"bytes,7,opt,name=credential_name,json=credentialName,proto3" json:"credential_name,omitempty"` + // A list of alternate names to verify the subject identity in the + // certificate. If specified, the proxy will verify that the server + // certificate's subject alt name matches one of the specified values. + // If specified, this list overrides the value of subject_alt_names + // from the ServiceEntry. + SubjectAltNames []string `protobuf:"bytes,5,rep,name=subject_alt_names,json=subjectAltNames,proto3" json:"subject_alt_names,omitempty"` + // SNI string to present to the server during TLS handshake. + Sni string `protobuf:"bytes,6,opt,name=sni,proto3" json:"sni,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ClientTLSSettings) Reset() { *m = ClientTLSSettings{} } +func (m *ClientTLSSettings) String() string { return proto.CompactTextString(m) } +func (*ClientTLSSettings) ProtoMessage() {} +func (*ClientTLSSettings) Descriptor() ([]byte, []int) { + return fileDescriptor_12899beb695152c8, []int{6} +} +func (m *ClientTLSSettings) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ClientTLSSettings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ClientTLSSettings.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ClientTLSSettings) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClientTLSSettings.Merge(m, src) +} +func (m *ClientTLSSettings) XXX_Size() int { + return m.Size() +} +func (m *ClientTLSSettings) XXX_DiscardUnknown() { + xxx_messageInfo_ClientTLSSettings.DiscardUnknown(m) +} + +var xxx_messageInfo_ClientTLSSettings proto.InternalMessageInfo + +func (m *ClientTLSSettings) GetMode() ClientTLSSettings_TLSmode { + if m != nil { + return m.Mode + } + return ClientTLSSettings_DISABLE +} + +func (m *ClientTLSSettings) GetClientCertificate() string { + if m != nil { + return m.ClientCertificate + } + return "" +} + +func (m *ClientTLSSettings) GetPrivateKey() string { + if m != nil { + return m.PrivateKey + } + return "" +} + +func (m *ClientTLSSettings) GetCaCertificates() string { + if m != nil { + return m.CaCertificates + } + return "" +} + +func (m *ClientTLSSettings) GetCredentialName() string { + if m != nil { + return m.CredentialName + } + return "" +} + +func (m *ClientTLSSettings) GetSubjectAltNames() []string { + if m != nil { + return m.SubjectAltNames + } + return nil +} + +func (m *ClientTLSSettings) GetSni() string { + if m != nil { + return m.Sni + } + return "" +} + +// Locality-weighted load balancing allows administrators to control the +// distribution of traffic to endpoints based on the localities of where the +// traffic originates and where it will terminate. These localities are +// specified using arbitrary labels that designate a hierarchy of localities in +// {region}/{zone}/{sub-zone} form. For additional detail refer to +// [Locality Weight](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/locality_weight) +// The following example shows how to setup locality weights mesh-wide. +// +// Given a mesh with workloads and their service deployed to "us-west/zone1/*" +// and "us-west/zone2/*". This example specifies that when traffic accessing a +// service originates from workloads in "us-west/zone1/*", 80% of the traffic +// will be sent to endpoints in "us-west/zone1/*", i.e the same zone, and the +// remaining 20% will go to endpoints in "us-west/zone2/*". This setup is +// intended to favor routing traffic to endpoints in the same locality. +// A similar setting is specified for traffic originating in "us-west/zone2/*". +// +// ```yaml +// distribute: +// - from: us-west/zone1/* +// to: +// "us-west/zone1/*": 80 +// "us-west/zone2/*": 20 +// - from: us-west/zone2/* +// to: +// "us-west/zone1/*": 20 +// "us-west/zone2/*": 80 +// ``` +// +// If the goal of the operator is not to distribute load across zones and +// regions but rather to restrict the regionality of failover to meet other +// operational requirements an operator can set a 'failover' policy instead of +// a 'distribute' policy. +// +// The following example sets up a locality failover policy for regions. +// Assume a service resides in zones within us-east, us-west & eu-west +// this example specifies that when endpoints within us-east become unhealthy +// traffic should failover to endpoints in any zone or sub-zone within eu-west +// and similarly us-west should failover to us-east. +// +// ```yaml +// failover: +// - from: us-east +// to: eu-west +// - from: us-west +// to: us-east +// ``` +// Locality load balancing settings. +type LocalityLoadBalancerSetting struct { + // Optional: only one of distribute or failover can be set. + // Explicitly specify loadbalancing weight across different zones and geographical locations. + // Refer to [Locality weighted load balancing](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/locality_weight) + // If empty, the locality weight is set according to the endpoints number within it. + Distribute []*LocalityLoadBalancerSetting_Distribute `protobuf:"bytes,1,rep,name=distribute,proto3" json:"distribute,omitempty"` + // Optional: only failover or distribute can be set. + // Explicitly specify the region traffic will land on when endpoints in local region becomes unhealthy. + // Should be used together with OutlierDetection to detect unhealthy endpoints. + // Note: if no OutlierDetection specified, this will not take effect. + Failover []*LocalityLoadBalancerSetting_Failover `protobuf:"bytes,2,rep,name=failover,proto3" json:"failover,omitempty"` + // enable locality load balancing, this is DestinationRule-level and will override mesh wide settings in entirety. + // e.g. true means that turn on locality load balancing for this DestinationRule no matter what mesh wide settings is. + Enabled *types.BoolValue `protobuf:"bytes,3,opt,name=enabled,proto3" json:"enabled,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LocalityLoadBalancerSetting) Reset() { *m = LocalityLoadBalancerSetting{} } +func (m *LocalityLoadBalancerSetting) String() string { return proto.CompactTextString(m) } +func (*LocalityLoadBalancerSetting) ProtoMessage() {} +func (*LocalityLoadBalancerSetting) Descriptor() ([]byte, []int) { + return fileDescriptor_12899beb695152c8, []int{7} +} +func (m *LocalityLoadBalancerSetting) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LocalityLoadBalancerSetting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LocalityLoadBalancerSetting.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LocalityLoadBalancerSetting) XXX_Merge(src proto.Message) { + xxx_messageInfo_LocalityLoadBalancerSetting.Merge(m, src) +} +func (m *LocalityLoadBalancerSetting) XXX_Size() int { + return m.Size() +} +func (m *LocalityLoadBalancerSetting) XXX_DiscardUnknown() { + xxx_messageInfo_LocalityLoadBalancerSetting.DiscardUnknown(m) +} + +var xxx_messageInfo_LocalityLoadBalancerSetting proto.InternalMessageInfo + +func (m *LocalityLoadBalancerSetting) GetDistribute() []*LocalityLoadBalancerSetting_Distribute { + if m != nil { + return m.Distribute + } + return nil +} + +func (m *LocalityLoadBalancerSetting) GetFailover() []*LocalityLoadBalancerSetting_Failover { + if m != nil { + return m.Failover + } + return nil +} + +func (m *LocalityLoadBalancerSetting) GetEnabled() *types.BoolValue { + if m != nil { + return m.Enabled + } + return nil +} + +// Describes how traffic originating in the 'from' zone or sub-zone is +// distributed over a set of 'to' zones. Syntax for specifying a zone is +// {region}/{zone}/{sub-zone} and terminal wildcards are allowed on any +// segment of the specification. Examples: +// * - matches all localities +// us-west/* - all zones and sub-zones within the us-west region +// us-west/zone-1/* - all sub-zones within us-west/zone-1 +type LocalityLoadBalancerSetting_Distribute struct { + // Originating locality, '/' separated, e.g. 'region/zone/sub_zone'. + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + // Map of upstream localities to traffic distribution weights. The sum of + // all weights should be == 100. Any locality not assigned a weight will + // receive no traffic. + To map[string]uint32 `protobuf:"bytes,2,rep,name=to,proto3" json:"to,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LocalityLoadBalancerSetting_Distribute) Reset() { + *m = LocalityLoadBalancerSetting_Distribute{} +} +func (m *LocalityLoadBalancerSetting_Distribute) String() string { return proto.CompactTextString(m) } +func (*LocalityLoadBalancerSetting_Distribute) ProtoMessage() {} +func (*LocalityLoadBalancerSetting_Distribute) Descriptor() ([]byte, []int) { + return fileDescriptor_12899beb695152c8, []int{7, 0} +} +func (m *LocalityLoadBalancerSetting_Distribute) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LocalityLoadBalancerSetting_Distribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LocalityLoadBalancerSetting_Distribute.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LocalityLoadBalancerSetting_Distribute) XXX_Merge(src proto.Message) { + xxx_messageInfo_LocalityLoadBalancerSetting_Distribute.Merge(m, src) +} +func (m *LocalityLoadBalancerSetting_Distribute) XXX_Size() int { + return m.Size() +} +func (m *LocalityLoadBalancerSetting_Distribute) XXX_DiscardUnknown() { + xxx_messageInfo_LocalityLoadBalancerSetting_Distribute.DiscardUnknown(m) +} + +var xxx_messageInfo_LocalityLoadBalancerSetting_Distribute proto.InternalMessageInfo + +func (m *LocalityLoadBalancerSetting_Distribute) GetFrom() string { + if m != nil { + return m.From + } + return "" +} + +func (m *LocalityLoadBalancerSetting_Distribute) GetTo() map[string]uint32 { + if m != nil { + return m.To + } + return nil +} + +// Specify the traffic failover policy across regions. Since zone and sub-zone +// failover is supported by default this only needs to be specified for +// regions when the operator needs to constrain traffic failover so that +// the default behavior of failing over to any endpoint globally does not +// apply. This is useful when failing over traffic across regions would not +// improve service health or may need to be restricted for other reasons +// like regulatory controls. +type LocalityLoadBalancerSetting_Failover struct { + // Originating region. + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` + // Destination region the traffic will fail over to when endpoints in + // the 'from' region becomes unhealthy. + To string `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LocalityLoadBalancerSetting_Failover) Reset() { *m = LocalityLoadBalancerSetting_Failover{} } +func (m *LocalityLoadBalancerSetting_Failover) String() string { return proto.CompactTextString(m) } +func (*LocalityLoadBalancerSetting_Failover) ProtoMessage() {} +func (*LocalityLoadBalancerSetting_Failover) Descriptor() ([]byte, []int) { + return fileDescriptor_12899beb695152c8, []int{7, 1} +} +func (m *LocalityLoadBalancerSetting_Failover) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LocalityLoadBalancerSetting_Failover) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LocalityLoadBalancerSetting_Failover.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *LocalityLoadBalancerSetting_Failover) XXX_Merge(src proto.Message) { + xxx_messageInfo_LocalityLoadBalancerSetting_Failover.Merge(m, src) +} +func (m *LocalityLoadBalancerSetting_Failover) XXX_Size() int { + return m.Size() +} +func (m *LocalityLoadBalancerSetting_Failover) XXX_DiscardUnknown() { + xxx_messageInfo_LocalityLoadBalancerSetting_Failover.DiscardUnknown(m) +} + +var xxx_messageInfo_LocalityLoadBalancerSetting_Failover proto.InternalMessageInfo + +func (m *LocalityLoadBalancerSetting_Failover) GetFrom() string { + if m != nil { + return m.From + } + return "" +} + +func (m *LocalityLoadBalancerSetting_Failover) GetTo() string { + if m != nil { + return m.To + } + return "" +} + +func init() { + proto.RegisterEnum("istio.networking.v1alpha3.LoadBalancerSettings_SimpleLB", LoadBalancerSettings_SimpleLB_name, LoadBalancerSettings_SimpleLB_value) + proto.RegisterEnum("istio.networking.v1alpha3.ConnectionPoolSettings_HTTPSettings_H2UpgradePolicy", ConnectionPoolSettings_HTTPSettings_H2UpgradePolicy_name, ConnectionPoolSettings_HTTPSettings_H2UpgradePolicy_value) + proto.RegisterEnum("istio.networking.v1alpha3.ClientTLSSettings_TLSmode", ClientTLSSettings_TLSmode_name, ClientTLSSettings_TLSmode_value) + proto.RegisterType((*DestinationRule)(nil), "istio.networking.v1alpha3.DestinationRule") + proto.RegisterType((*TrafficPolicy)(nil), "istio.networking.v1alpha3.TrafficPolicy") + proto.RegisterType((*TrafficPolicy_PortTrafficPolicy)(nil), "istio.networking.v1alpha3.TrafficPolicy.PortTrafficPolicy") + proto.RegisterType((*Subset)(nil), "istio.networking.v1alpha3.Subset") + proto.RegisterMapType((map[string]string)(nil), "istio.networking.v1alpha3.Subset.LabelsEntry") + proto.RegisterType((*LoadBalancerSettings)(nil), "istio.networking.v1alpha3.LoadBalancerSettings") + proto.RegisterType((*LoadBalancerSettings_ConsistentHashLB)(nil), "istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB") + proto.RegisterType((*LoadBalancerSettings_ConsistentHashLB_HTTPCookie)(nil), "istio.networking.v1alpha3.LoadBalancerSettings.ConsistentHashLB.HTTPCookie") + proto.RegisterType((*ConnectionPoolSettings)(nil), "istio.networking.v1alpha3.ConnectionPoolSettings") + proto.RegisterType((*ConnectionPoolSettings_TCPSettings)(nil), "istio.networking.v1alpha3.ConnectionPoolSettings.TCPSettings") + proto.RegisterType((*ConnectionPoolSettings_TCPSettings_TcpKeepalive)(nil), "istio.networking.v1alpha3.ConnectionPoolSettings.TCPSettings.TcpKeepalive") + proto.RegisterType((*ConnectionPoolSettings_HTTPSettings)(nil), "istio.networking.v1alpha3.ConnectionPoolSettings.HTTPSettings") + proto.RegisterType((*OutlierDetection)(nil), "istio.networking.v1alpha3.OutlierDetection") + proto.RegisterType((*ClientTLSSettings)(nil), "istio.networking.v1alpha3.ClientTLSSettings") + proto.RegisterType((*LocalityLoadBalancerSetting)(nil), "istio.networking.v1alpha3.LocalityLoadBalancerSetting") + proto.RegisterType((*LocalityLoadBalancerSetting_Distribute)(nil), "istio.networking.v1alpha3.LocalityLoadBalancerSetting.Distribute") + proto.RegisterMapType((map[string]uint32)(nil), "istio.networking.v1alpha3.LocalityLoadBalancerSetting.Distribute.ToEntry") + proto.RegisterType((*LocalityLoadBalancerSetting_Failover)(nil), "istio.networking.v1alpha3.LocalityLoadBalancerSetting.Failover") +} + +func init() { + proto.RegisterFile("networking/v1alpha3/destination_rule.proto", fileDescriptor_12899beb695152c8) +} + +var fileDescriptor_12899beb695152c8 = []byte{ + // 1798 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4f, 0x73, 0x1b, 0xb7, + 0x15, 0x17, 0xb9, 0x14, 0x25, 0x3d, 0xea, 0x0f, 0x85, 0x78, 0x1c, 0x9a, 0xee, 0x38, 0x2a, 0xa7, + 0x33, 0x51, 0xdd, 0x78, 0x15, 0xcb, 0x71, 0x27, 0x8d, 0x9b, 0x3f, 0xa4, 0xc8, 0x98, 0xaa, 0x29, + 0x91, 0x05, 0xa9, 0x4e, 0xeb, 0x1e, 0x76, 0xc0, 0x25, 0x44, 0x22, 0x5a, 0x2e, 0x36, 0x58, 0x2c, + 0x4d, 0xf9, 0xdc, 0x63, 0x2f, 0xbd, 0xf7, 0x53, 0xf4, 0xd0, 0xcf, 0xd0, 0x5b, 0x7b, 0x68, 0xee, + 0x19, 0x1f, 0xfa, 0x09, 0x7a, 0xe8, 0xf4, 0xd4, 0x01, 0x16, 0x4b, 0xae, 0x2c, 0x59, 0xb2, 0xac, + 0xe6, 0xb6, 0x78, 0xef, 0xf7, 0x7e, 0x00, 0x1e, 0x7e, 0x0f, 0x78, 0x24, 0xdc, 0xf7, 0xa9, 0x7c, + 0xc1, 0xc5, 0x09, 0xf3, 0x87, 0x3b, 0x93, 0x87, 0xc4, 0x0b, 0x46, 0xe4, 0xd1, 0xce, 0x80, 0x86, + 0x92, 0xf9, 0x44, 0x32, 0xee, 0x3b, 0x22, 0xf2, 0xa8, 0x1d, 0x08, 0x2e, 0x39, 0xba, 0xc3, 0x42, + 0xc9, 0xb8, 0x3d, 0x8f, 0xb0, 0x93, 0x88, 0xf2, 0x07, 0x43, 0xce, 0x87, 0x1e, 0xdd, 0x21, 0x01, + 0xdb, 0x39, 0x66, 0xd4, 0x1b, 0x38, 0x7d, 0x3a, 0x22, 0x13, 0xc6, 0x45, 0x1c, 0x5b, 0xbe, 0x67, + 0x00, 0x7a, 0xd4, 0x8f, 0x8e, 0x77, 0x06, 0x91, 0xd0, 0x13, 0xbc, 0xc9, 0xff, 0x42, 0x90, 0x20, + 0xa0, 0x22, 0x34, 0xfe, 0x9f, 0x5e, 0xb4, 0xce, 0x09, 0x13, 0x32, 0x22, 0x9e, 0x13, 0x52, 0x31, + 0x61, 0xae, 0x59, 0x66, 0xf9, 0xd6, 0x90, 0x0f, 0xb9, 0xfe, 0xdc, 0x51, 0x5f, 0xb1, 0xb5, 0xf2, + 0x5d, 0x06, 0x36, 0xea, 0xf3, 0x7d, 0xe1, 0xc8, 0xa3, 0xe8, 0x7d, 0xc8, 0x8d, 0x78, 0x28, 0x4b, + 0x99, 0xad, 0xcc, 0xf6, 0x4a, 0xcd, 0xfa, 0xbe, 0x9a, 0xc5, 0xda, 0x80, 0xda, 0xb0, 0x2e, 0x05, + 0x39, 0x3e, 0x66, 0xae, 0x13, 0x70, 0x8f, 0xb9, 0xa7, 0xa5, 0xec, 0x56, 0x66, 0xbb, 0xb0, 0xbb, + 0x6d, 0xbf, 0x31, 0x05, 0x76, 0x2f, 0x0e, 0xe8, 0x68, 0x3c, 0x5e, 0x93, 0xe9, 0x21, 0x7a, 0x02, + 0x4b, 0x61, 0xd4, 0x0f, 0xa9, 0x0c, 0x4b, 0xd6, 0x96, 0xb5, 0x5d, 0xd8, 0xfd, 0xf1, 0x25, 0x4c, + 0x5d, 0x8d, 0xc4, 0x49, 0x04, 0xba, 0x0b, 0x2b, 0x74, 0x1a, 0x70, 0x21, 0x1d, 0xc9, 0x4b, 0xb9, + 0x2d, 0x6b, 0x7b, 0x05, 0x2f, 0xc7, 0x86, 0x1e, 0xaf, 0xfc, 0x2b, 0x0f, 0x6b, 0x67, 0xa6, 0x46, + 0x3d, 0x58, 0xf3, 0x38, 0x19, 0x38, 0x7d, 0xe2, 0x11, 0xdf, 0xa5, 0x42, 0x6f, 0xaf, 0xb0, 0xbb, + 0x73, 0xc9, 0x8c, 0x2d, 0x4e, 0x06, 0x35, 0x03, 0xef, 0x52, 0x29, 0x99, 0x3f, 0x0c, 0xf1, 0xaa, + 0x97, 0xb2, 0xa2, 0xe7, 0xb0, 0xe1, 0x72, 0xdf, 0xa7, 0xae, 0x56, 0x45, 0xc0, 0xb9, 0x67, 0x72, + 0xf2, 0xf0, 0x12, 0xde, 0xbd, 0x59, 0x44, 0x87, 0x73, 0x6f, 0xc6, 0xbc, 0xee, 0x9e, 0xb1, 0xa3, + 0xdf, 0xc2, 0x26, 0x8f, 0xa4, 0xc7, 0xa8, 0x70, 0x06, 0x54, 0xc6, 0x8e, 0x92, 0xa5, 0xd9, 0x7f, + 0x76, 0x09, 0x7b, 0x3b, 0x8e, 0xa9, 0x27, 0x21, 0xb8, 0xc8, 0x5f, 0xb3, 0xa0, 0x2f, 0xc0, 0x92, + 0x5e, 0x58, 0xca, 0x69, 0xae, 0x8f, 0x2e, 0x5b, 0xa9, 0xc7, 0xa8, 0x2f, 0x7b, 0xad, 0xee, 0x6c, + 0x91, 0x2a, 0x10, 0x7d, 0x03, 0xef, 0xe9, 0xc4, 0x7b, 0x74, 0x42, 0x95, 0xce, 0x62, 0x5f, 0x69, + 0x51, 0x9f, 0xe1, 0x67, 0x6f, 0xab, 0x06, 0xbb, 0xa3, 0xce, 0xea, 0x8c, 0x3e, 0x36, 0x15, 0x6d, + 0x4b, 0xb1, 0x26, 0x13, 0x96, 0xff, 0x6c, 0xc1, 0xe6, 0x39, 0x20, 0x7a, 0x02, 0x39, 0x05, 0x35, + 0x87, 0xf8, 0xe1, 0x25, 0x53, 0xaa, 0xd8, 0x2e, 0xf5, 0xa8, 0x2b, 0xb9, 0xc0, 0x3a, 0xe8, 0xbc, + 0x14, 0xb2, 0x3f, 0x90, 0x14, 0xac, 0x1f, 0x54, 0x0a, 0xb9, 0xff, 0xa3, 0x14, 0x16, 0xdf, 0x51, + 0x0a, 0x95, 0x7f, 0x67, 0x20, 0x1f, 0x57, 0xa6, 0xba, 0x37, 0x7c, 0x32, 0xa6, 0x67, 0xee, 0x0d, + 0x65, 0x40, 0x0d, 0xc8, 0x7b, 0xa4, 0x4f, 0xbd, 0xb0, 0x94, 0xd5, 0x0a, 0x79, 0x70, 0x65, 0x95, + 0xdb, 0x2d, 0x8d, 0x6f, 0xf8, 0x52, 0x9c, 0x62, 0x13, 0x7c, 0xc1, 0xf5, 0x63, 0xdd, 0xe8, 0xfa, + 0x29, 0xff, 0x02, 0x0a, 0xa9, 0x79, 0x50, 0x11, 0xac, 0x13, 0x7a, 0x1a, 0x2f, 0x1f, 0xab, 0x4f, + 0x74, 0x0b, 0x16, 0x27, 0xc4, 0x8b, 0xa8, 0x16, 0xc8, 0x0a, 0x8e, 0x07, 0x9f, 0x65, 0x3f, 0xcd, + 0x54, 0xfe, 0x9e, 0x87, 0x5b, 0x17, 0x69, 0x02, 0x61, 0xc8, 0x87, 0x6c, 0x1c, 0x78, 0x71, 0x1a, + 0xd6, 0x77, 0x3f, 0xbd, 0xa6, 0xa8, 0xec, 0xae, 0x8e, 0x6e, 0xd5, 0x9a, 0x0b, 0xd8, 0x30, 0xa1, + 0x13, 0xad, 0xac, 0x90, 0x85, 0x92, 0xfa, 0xd2, 0x19, 0x91, 0x70, 0x64, 0x14, 0xfb, 0xd5, 0x75, + 0xc9, 0xf7, 0x66, 0x34, 0x4d, 0x12, 0x8e, 0xf4, 0x24, 0xeb, 0xee, 0x19, 0x1b, 0x3a, 0x86, 0xf7, + 0x3c, 0xee, 0x12, 0x8f, 0xc9, 0x53, 0xc7, 0xeb, 0x27, 0xc5, 0x6d, 0x52, 0xfd, 0xf3, 0x4b, 0x27, + 0x8c, 0xa3, 0x2e, 0x98, 0x18, 0x6f, 0x26, 0x94, 0xad, 0xbe, 0x31, 0x95, 0xff, 0x6a, 0x41, 0xf1, + 0xf5, 0xe5, 0xa0, 0xfb, 0x50, 0x1c, 0x49, 0x19, 0x38, 0x23, 0x4a, 0x06, 0x54, 0x38, 0x73, 0x39, + 0xa9, 0x85, 0x2a, 0x4f, 0x53, 0x3b, 0x0e, 0x95, 0xaa, 0x7c, 0x28, 0x68, 0xac, 0xcb, 0xf9, 0x09, + 0xa3, 0x26, 0x23, 0xcf, 0x6e, 0x9a, 0x11, 0xbb, 0xd9, 0xeb, 0x75, 0xf6, 0x34, 0x65, 0x73, 0x01, + 0x83, 0x9a, 0x21, 0x1e, 0xa1, 0x9f, 0xc0, 0x5a, 0x14, 0x52, 0x27, 0xe4, 0x91, 0x70, 0xa9, 0xc3, + 0x02, 0x9d, 0x92, 0xe5, 0xe6, 0x02, 0x2e, 0x44, 0x21, 0xed, 0x6a, 0xeb, 0x7e, 0x80, 0x9e, 0xc0, + 0x1d, 0xbd, 0xaa, 0x6f, 0x23, 0x2a, 0x4e, 0x9d, 0x80, 0x08, 0x32, 0xa6, 0x32, 0xd9, 0xca, 0xa2, + 0xd9, 0xca, 0x6d, 0x05, 0xf9, 0xb5, 0x42, 0x74, 0x12, 0x80, 0xde, 0xd2, 0x7d, 0xd8, 0x1c, 0x33, + 0x9f, 0x8d, 0xa3, 0xb1, 0x23, 0x98, 0x3f, 0x74, 0x42, 0xf6, 0x92, 0xea, 0x32, 0xcf, 0xe1, 0x0d, + 0xe3, 0xc0, 0xcc, 0x1f, 0x76, 0xd9, 0x4b, 0x5a, 0x3e, 0x01, 0x98, 0x2f, 0xf5, 0xcd, 0xb5, 0x87, + 0x20, 0x17, 0x10, 0x39, 0x32, 0x0a, 0xd6, 0xdf, 0xe8, 0x63, 0xb0, 0xa4, 0x4c, 0x6e, 0xa7, 0x3b, + 0x76, 0xdc, 0x63, 0xd8, 0x49, 0x8f, 0x61, 0xd7, 0x4d, 0x0f, 0x12, 0xd3, 0x28, 0x68, 0x0d, 0x60, + 0x59, 0xc9, 0xce, 0x39, 0xa1, 0xa7, 0x95, 0x26, 0x2c, 0x27, 0x1a, 0x45, 0x1b, 0x50, 0xc0, 0xed, + 0xa3, 0xc3, 0xba, 0x83, 0xdb, 0xb5, 0xfd, 0xc3, 0xe2, 0x02, 0x5a, 0x07, 0x68, 0x35, 0xaa, 0xdd, + 0x9e, 0xb3, 0xd7, 0x3e, 0x3c, 0x2c, 0x66, 0x10, 0x40, 0x1e, 0x57, 0x0f, 0xeb, 0xed, 0x83, 0x62, + 0x56, 0x81, 0x3b, 0xd5, 0x6e, 0xb7, 0xd7, 0xc4, 0xed, 0xa3, 0xa7, 0xcd, 0xa2, 0x55, 0x2b, 0xc0, + 0x8a, 0xd7, 0x37, 0xb5, 0x5c, 0xf9, 0xd3, 0x32, 0xdc, 0xbe, 0xf8, 0x36, 0x44, 0x6d, 0xb0, 0xa4, + 0x1b, 0x98, 0xbb, 0xfe, 0xf3, 0x6b, 0xdf, 0xa6, 0x76, 0x6f, 0xaf, 0x93, 0xba, 0xb4, 0xdc, 0x00, + 0x61, 0xc8, 0xa9, 0x13, 0x30, 0x9a, 0xf9, 0xe2, 0xfa, 0x8c, 0x2a, 0xf3, 0x33, 0x4a, 0xcd, 0x55, + 0xfe, 0x6f, 0x16, 0x0a, 0xa9, 0x89, 0xd0, 0x87, 0xb0, 0x31, 0x26, 0x53, 0x67, 0x7e, 0x91, 0x87, + 0x7a, 0x03, 0x8b, 0x78, 0x7d, 0x4c, 0xa6, 0x73, 0xda, 0x10, 0xd5, 0x66, 0xef, 0x86, 0x23, 0xd9, + 0x98, 0xf2, 0x48, 0x9a, 0x75, 0xbd, 0xf9, 0x64, 0x66, 0xef, 0x43, 0x2f, 0x0e, 0x40, 0x1c, 0xd6, + 0xa4, 0x1b, 0x38, 0x27, 0x94, 0x06, 0xc4, 0x63, 0x13, 0x6a, 0xce, 0xf6, 0x57, 0x37, 0xca, 0x95, + 0xdd, 0x73, 0x83, 0x67, 0x09, 0x23, 0x5e, 0x95, 0xa9, 0x51, 0xf9, 0x8f, 0x19, 0x58, 0x4d, 0xbb, + 0xd1, 0x6d, 0xc8, 0x07, 0x82, 0xf7, 0x69, 0xbc, 0xcb, 0x35, 0x6c, 0x46, 0xe8, 0x01, 0xe4, 0xd4, + 0xae, 0xae, 0xde, 0x92, 0x86, 0xa1, 0xc7, 0xb0, 0xcc, 0x7c, 0x49, 0xc5, 0x84, 0x5c, 0xad, 0x4f, + 0x3c, 0x83, 0x96, 0xff, 0x69, 0xc1, 0x6a, 0xfa, 0x4c, 0xd0, 0x13, 0x28, 0xab, 0x53, 0x79, 0xe8, + 0xa8, 0x33, 0x08, 0xa8, 0x3f, 0x50, 0xe5, 0x24, 0xe8, 0xb7, 0x11, 0x0d, 0x65, 0x72, 0x10, 0xef, + 0x6b, 0xc4, 0x01, 0x99, 0x76, 0x62, 0x3f, 0x36, 0x6e, 0xf4, 0x11, 0x20, 0xe5, 0xda, 0xd5, 0xc1, + 0xb3, 0xa0, 0xac, 0x0e, 0xd2, 0xf7, 0xd3, 0xee, 0x01, 0x99, 0xce, 0xd0, 0x9f, 0xc3, 0xdd, 0x34, + 0xce, 0x09, 0xa8, 0x48, 0x9d, 0xba, 0xde, 0xc5, 0x22, 0x2e, 0x8d, 0xe7, 0x11, 0x1d, 0x2a, 0xe6, + 0xc9, 0x47, 0x1f, 0x40, 0x21, 0x0e, 0x97, 0x82, 0xd1, 0xb8, 0x27, 0x5b, 0xc4, 0xa0, 0xe1, 0xda, + 0x82, 0x7e, 0x09, 0xab, 0x6c, 0xe0, 0xd1, 0x99, 0x38, 0x16, 0xaf, 0x4a, 0x4b, 0x41, 0xc1, 0x13, + 0x65, 0xbc, 0x84, 0xcd, 0xd1, 0xae, 0x13, 0x05, 0x43, 0x41, 0x06, 0x34, 0x79, 0x37, 0xf3, 0xfa, + 0x69, 0x3a, 0xbc, 0x99, 0xee, 0xed, 0xe6, 0xee, 0x51, 0x4c, 0x6b, 0x5e, 0xd7, 0x8d, 0xd1, 0x59, + 0x43, 0xe5, 0x4b, 0xd8, 0x78, 0x0d, 0x83, 0x0a, 0xb0, 0x54, 0x6f, 0x7c, 0x5d, 0x3d, 0x6a, 0xf5, + 0x8a, 0x0b, 0x08, 0xc1, 0x7a, 0xbd, 0xed, 0x1c, 0xb6, 0x7b, 0xce, 0x51, 0xe7, 0x29, 0xae, 0xd6, + 0x1b, 0xc5, 0x8c, 0x02, 0x24, 0x83, 0x6c, 0xe5, 0x3b, 0x0b, 0x8a, 0xaf, 0xf7, 0x30, 0xe8, 0x21, + 0x20, 0xf5, 0x64, 0x51, 0x37, 0x92, 0x6c, 0x42, 0x1d, 0x2a, 0x04, 0x17, 0xe6, 0x48, 0x6b, 0xd9, + 0x52, 0x06, 0x6f, 0xa6, 0xbc, 0x0d, 0xed, 0x44, 0xcf, 0xa1, 0x9c, 0x0e, 0x19, 0x12, 0x49, 0x5f, + 0x90, 0xd3, 0x24, 0x34, 0xaf, 0x13, 0xfa, 0xa3, 0x73, 0x09, 0x3d, 0xda, 0xf7, 0xe5, 0xa3, 0xdd, + 0xdf, 0xa8, 0x37, 0x1f, 0x97, 0x52, 0xf1, 0x4f, 0xe3, 0x70, 0xc3, 0x8d, 0xe1, 0x76, 0x9a, 0xfb, + 0xf1, 0x74, 0x9a, 0xf0, 0x2e, 0xbd, 0x05, 0xef, 0xad, 0x54, 0xec, 0xe3, 0xe9, 0xd4, 0x70, 0xa6, + 0xab, 0x20, 0xfb, 0xd6, 0x55, 0x80, 0x9e, 0x02, 0xea, 0x93, 0x90, 0x3a, 0xf4, 0x1b, 0xd3, 0x84, + 0xea, 0xca, 0xbb, 0xb2, 0x8c, 0x8a, 0x2a, 0xa8, 0x61, 0x62, 0x94, 0x6e, 0xd0, 0xc7, 0x70, 0x4b, + 0x69, 0x72, 0xc6, 0x13, 0x50, 0xe1, 0x52, 0x5f, 0x1a, 0x71, 0xa2, 0x31, 0x99, 0x26, 0xf0, 0x4e, + 0xec, 0x51, 0x25, 0x33, 0x66, 0xbe, 0x7a, 0xb7, 0x3d, 0x39, 0x9a, 0xe1, 0x17, 0xe3, 0x92, 0x19, + 0x33, 0xbf, 0xa9, 0x1d, 0x06, 0x5d, 0xf9, 0x83, 0x05, 0x9b, 0xe7, 0xfa, 0x49, 0x74, 0x00, 0xb9, + 0x31, 0x1f, 0x24, 0x8d, 0xd3, 0x27, 0xd7, 0xe9, 0x45, 0xed, 0x5e, 0xab, 0xab, 0x62, 0xcd, 0xcb, + 0xa7, 0x3e, 0xd1, 0x03, 0x40, 0xae, 0xc6, 0x39, 0x2e, 0x15, 0x92, 0x1d, 0x33, 0x97, 0xc8, 0xa4, + 0x93, 0xdb, 0x8c, 0x3d, 0x7b, 0x73, 0x87, 0xaa, 0xc3, 0x40, 0xb0, 0x09, 0x91, 0x54, 0xbd, 0x72, + 0x3a, 0x6b, 0x2b, 0x18, 0x8c, 0xe9, 0x19, 0x3d, 0x55, 0x17, 0xba, 0x4b, 0xd2, 0x5c, 0x71, 0xb1, + 0xae, 0xe0, 0x75, 0x97, 0xa4, 0x88, 0xf4, 0xcd, 0xef, 0x0a, 0x3a, 0xa0, 0xbe, 0x64, 0xc4, 0x8b, + 0x1f, 0xfe, 0x25, 0x03, 0x9c, 0x99, 0x93, 0xe7, 0x3e, 0x8c, 0xfa, 0x2a, 0x93, 0x0e, 0xf1, 0xa4, + 0x46, 0xc6, 0x3f, 0xa2, 0x56, 0xf0, 0x86, 0x71, 0x54, 0x3d, 0xa9, 0xa0, 0xa1, 0x6a, 0x4e, 0x43, + 0x9f, 0x69, 0xad, 0xae, 0x60, 0xf5, 0x59, 0xf9, 0x0a, 0x96, 0xcc, 0xae, 0x75, 0x55, 0xed, 0x77, + 0xab, 0xb5, 0x56, 0xa3, 0xb8, 0xa0, 0x9e, 0xdc, 0xee, 0xfe, 0x41, 0xa7, 0xd5, 0x88, 0x9f, 0xdf, + 0x83, 0xa3, 0xde, 0x51, 0xb5, 0x55, 0xcc, 0xa2, 0x22, 0xac, 0xee, 0x77, 0x7b, 0xfb, 0x6d, 0xc7, + 0x58, 0xac, 0xca, 0x7f, 0x2c, 0xb8, 0x7b, 0x49, 0xd7, 0x86, 0x08, 0xc0, 0x80, 0x85, 0x52, 0xb0, + 0x7e, 0x24, 0xd5, 0xb1, 0xa8, 0xde, 0xbd, 0xfa, 0x6e, 0x1d, 0xa0, 0x5d, 0x9f, 0x11, 0xe1, 0x14, + 0x29, 0xfa, 0x3d, 0x2c, 0x1f, 0x13, 0xe6, 0xf1, 0x89, 0xfe, 0x15, 0xa6, 0x26, 0xf8, 0xf2, 0x1d, + 0x27, 0xf8, 0xda, 0xd0, 0xe0, 0x19, 0x21, 0xfa, 0x04, 0x96, 0xa8, 0x4f, 0xfa, 0x1e, 0x1d, 0x98, + 0x22, 0x28, 0x9f, 0x2b, 0x82, 0x1a, 0xe7, 0x5e, 0x5c, 0x89, 0x09, 0xb4, 0xfc, 0x97, 0x0c, 0xc0, + 0x7c, 0xb5, 0xaa, 0x81, 0x3a, 0x16, 0x7c, 0x6c, 0x7e, 0x16, 0xe8, 0x6f, 0xf4, 0x3b, 0xc8, 0x4a, + 0x6e, 0xd6, 0xbb, 0x7f, 0xe3, 0x84, 0xd8, 0x3d, 0x1e, 0xff, 0xd0, 0xc9, 0x4a, 0x5e, 0x7e, 0x0c, + 0x4b, 0x66, 0x78, 0xd5, 0xef, 0x91, 0xb5, 0xd4, 0xef, 0x91, 0xb2, 0x0d, 0xcb, 0x49, 0x02, 0x2e, + 0x5c, 0xf1, 0xba, 0x59, 0xb1, 0xb2, 0x64, 0x25, 0xaf, 0xd9, 0x7f, 0x7b, 0x75, 0x2f, 0xf3, 0x8f, + 0x57, 0xf7, 0x32, 0xdf, 0xbf, 0xba, 0x97, 0x79, 0xbe, 0x15, 0x6f, 0x81, 0x71, 0xfd, 0x4f, 0xd5, + 0x05, 0xff, 0x29, 0xf5, 0xf3, 0x3a, 0x63, 0x8f, 0xfe, 0x17, 0x00, 0x00, 0xff, 0xff, 0x52, 0x4c, + 0x7e, 0xe4, 0x19, 0x13, 0x00, 0x00, +} + +func (m *DestinationRule) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *DestinationRule) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DestinationRule) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.ExportTo) > 0 { + for iNdEx := len(m.ExportTo) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ExportTo[iNdEx]) + copy(dAtA[i:], m.ExportTo[iNdEx]) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.ExportTo[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.Subsets) > 0 { + for iNdEx := len(m.Subsets) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Subsets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if m.TrafficPolicy != nil { + { + size, err := m.TrafficPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Host) > 0 { + i -= len(m.Host) + copy(dAtA[i:], m.Host) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.Host))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TrafficPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TrafficPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TrafficPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.PortLevelSettings) > 0 { + for iNdEx := len(m.PortLevelSettings) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PortLevelSettings[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if m.Tls != nil { + { + size, err := m.Tls.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.OutlierDetection != nil { + { + size, err := m.OutlierDetection.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.ConnectionPool != nil { + { + size, err := m.ConnectionPool.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.LoadBalancer != nil { + { + size, err := m.LoadBalancer.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *TrafficPolicy_PortTrafficPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TrafficPolicy_PortTrafficPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TrafficPolicy_PortTrafficPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Tls != nil { + { + size, err := m.Tls.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.OutlierDetection != nil { + { + size, err := m.OutlierDetection.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.ConnectionPool != nil { + { + size, err := m.ConnectionPool.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.LoadBalancer != nil { + { + size, err := m.LoadBalancer.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Port != nil { + { + size, err := m.Port.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Subset) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Subset) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Subset) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.TrafficPolicy != nil { + { + size, err := m.TrafficPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Labels) > 0 { + for k := range m.Labels { + v := m.Labels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintDestinationRule(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LoadBalancerSettings) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LoadBalancerSettings) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LoadBalancerSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.LocalityLbSetting != nil { + { + size, err := m.LocalityLbSetting.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.LbPolicy != nil { + { + size := m.LbPolicy.Size() + i -= size + if _, err := m.LbPolicy.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *LoadBalancerSettings_Simple) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *LoadBalancerSettings_Simple) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintDestinationRule(dAtA, i, uint64(m.Simple)) + i-- + dAtA[i] = 0x8 + return len(dAtA) - i, nil +} +func (m *LoadBalancerSettings_ConsistentHash) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *LoadBalancerSettings_ConsistentHash) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ConsistentHash != nil { + { + size, err := m.ConsistentHash.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *LoadBalancerSettings_ConsistentHashLB) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LoadBalancerSettings_ConsistentHashLB) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LoadBalancerSettings_ConsistentHashLB) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.HashKey != nil { + { + size := m.HashKey.Size() + i -= size + if _, err := m.HashKey.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.MinimumRingSize != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.MinimumRingSize)) + i-- + dAtA[i] = 0x20 + } + return len(dAtA) - i, nil +} + +func (m *LoadBalancerSettings_ConsistentHashLB_HttpHeaderName) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *LoadBalancerSettings_ConsistentHashLB_HttpHeaderName) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.HttpHeaderName) + copy(dAtA[i:], m.HttpHeaderName) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.HttpHeaderName))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} +func (m *LoadBalancerSettings_ConsistentHashLB_HttpCookie) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *LoadBalancerSettings_ConsistentHashLB_HttpCookie) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.HttpCookie != nil { + { + size, err := m.HttpCookie.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *LoadBalancerSettings_ConsistentHashLB_UseSourceIp) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *LoadBalancerSettings_ConsistentHashLB_UseSourceIp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i-- + if m.UseSourceIp { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + return len(dAtA) - i, nil +} +func (m *LoadBalancerSettings_ConsistentHashLB_HttpQueryParameterName) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *LoadBalancerSettings_ConsistentHashLB_HttpQueryParameterName) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.HttpQueryParameterName) + copy(dAtA[i:], m.HttpQueryParameterName) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.HttpQueryParameterName))) + i-- + dAtA[i] = 0x2a + return len(dAtA) - i, nil +} +func (m *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Ttl != nil { + { + size, err := m.Ttl.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Path) > 0 { + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ConnectionPoolSettings) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConnectionPoolSettings) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConnectionPoolSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Http != nil { + { + size, err := m.Http.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Tcp != nil { + { + size, err := m.Tcp.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ConnectionPoolSettings_TCPSettings) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConnectionPoolSettings_TCPSettings) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConnectionPoolSettings_TCPSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.TcpKeepalive != nil { + { + size, err := m.TcpKeepalive.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.ConnectTimeout != nil { + { + size, err := m.ConnectTimeout.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.MaxConnections != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.MaxConnections)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ConnectionPoolSettings_TCPSettings_TcpKeepalive) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConnectionPoolSettings_TCPSettings_TcpKeepalive) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConnectionPoolSettings_TCPSettings_TcpKeepalive) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Interval != nil { + { + size, err := m.Interval.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Time != nil { + { + size, err := m.Time.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Probes != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.Probes)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ConnectionPoolSettings_HTTPSettings) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConnectionPoolSettings_HTTPSettings) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConnectionPoolSettings_HTTPSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.H2UpgradePolicy != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.H2UpgradePolicy)) + i-- + dAtA[i] = 0x30 + } + if m.IdleTimeout != nil { + { + size, err := m.IdleTimeout.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.MaxRetries != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.MaxRetries)) + i-- + dAtA[i] = 0x20 + } + if m.MaxRequestsPerConnection != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.MaxRequestsPerConnection)) + i-- + dAtA[i] = 0x18 + } + if m.Http2MaxRequests != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.Http2MaxRequests)) + i-- + dAtA[i] = 0x10 + } + if m.Http1MaxPendingRequests != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.Http1MaxPendingRequests)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *OutlierDetection) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OutlierDetection) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OutlierDetection) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Consecutive_5XxErrors != nil { + { + size, err := m.Consecutive_5XxErrors.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.ConsecutiveGatewayErrors != nil { + { + size, err := m.ConsecutiveGatewayErrors.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.MinHealthPercent != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.MinHealthPercent)) + i-- + dAtA[i] = 0x28 + } + if m.MaxEjectionPercent != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.MaxEjectionPercent)) + i-- + dAtA[i] = 0x20 + } + if m.BaseEjectionTime != nil { + { + size, err := m.BaseEjectionTime.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Interval != nil { + { + size, err := m.Interval.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ConsecutiveErrors != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.ConsecutiveErrors)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ClientTLSSettings) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ClientTLSSettings) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ClientTLSSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.CredentialName) > 0 { + i -= len(m.CredentialName) + copy(dAtA[i:], m.CredentialName) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.CredentialName))) + i-- + dAtA[i] = 0x3a + } + if len(m.Sni) > 0 { + i -= len(m.Sni) + copy(dAtA[i:], m.Sni) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.Sni))) + i-- + dAtA[i] = 0x32 + } + if len(m.SubjectAltNames) > 0 { + for iNdEx := len(m.SubjectAltNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SubjectAltNames[iNdEx]) + copy(dAtA[i:], m.SubjectAltNames[iNdEx]) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.SubjectAltNames[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.CaCertificates) > 0 { + i -= len(m.CaCertificates) + copy(dAtA[i:], m.CaCertificates) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.CaCertificates))) + i-- + dAtA[i] = 0x22 + } + if len(m.PrivateKey) > 0 { + i -= len(m.PrivateKey) + copy(dAtA[i:], m.PrivateKey) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.PrivateKey))) + i-- + dAtA[i] = 0x1a + } + if len(m.ClientCertificate) > 0 { + i -= len(m.ClientCertificate) + copy(dAtA[i:], m.ClientCertificate) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.ClientCertificate))) + i-- + dAtA[i] = 0x12 + } + if m.Mode != 0 { + i = encodeVarintDestinationRule(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *LocalityLoadBalancerSetting) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LocalityLoadBalancerSetting) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LocalityLoadBalancerSetting) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Enabled != nil { + { + size, err := m.Enabled.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Failover) > 0 { + for iNdEx := len(m.Failover) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Failover[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Distribute) > 0 { + for iNdEx := len(m.Distribute) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Distribute[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDestinationRule(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *LocalityLoadBalancerSetting_Distribute) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LocalityLoadBalancerSetting_Distribute) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LocalityLoadBalancerSetting_Distribute) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.To) > 0 { + for k := range m.To { + v := m.To[k] + baseI := i + i = encodeVarintDestinationRule(dAtA, i, uint64(v)) + i-- + dAtA[i] = 0x10 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintDestinationRule(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.From) > 0 { + i -= len(m.From) + copy(dAtA[i:], m.From) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.From))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *LocalityLoadBalancerSetting_Failover) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *LocalityLoadBalancerSetting_Failover) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LocalityLoadBalancerSetting_Failover) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.To) > 0 { + i -= len(m.To) + copy(dAtA[i:], m.To) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.To))) + i-- + dAtA[i] = 0x12 + } + if len(m.From) > 0 { + i -= len(m.From) + copy(dAtA[i:], m.From) + i = encodeVarintDestinationRule(dAtA, i, uint64(len(m.From))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintDestinationRule(dAtA []byte, offset int, v uint64) int { + offset -= sovDestinationRule(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *DestinationRule) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Host) + if l > 0 { + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.TrafficPolicy != nil { + l = m.TrafficPolicy.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if len(m.Subsets) > 0 { + for _, e := range m.Subsets { + l = e.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + } + if len(m.ExportTo) > 0 { + for _, s := range m.ExportTo { + l = len(s) + n += 1 + l + sovDestinationRule(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *TrafficPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.LoadBalancer != nil { + l = m.LoadBalancer.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.ConnectionPool != nil { + l = m.ConnectionPool.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.OutlierDetection != nil { + l = m.OutlierDetection.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.Tls != nil { + l = m.Tls.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if len(m.PortLevelSettings) > 0 { + for _, e := range m.PortLevelSettings { + l = e.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *TrafficPolicy_PortTrafficPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Port != nil { + l = m.Port.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.LoadBalancer != nil { + l = m.LoadBalancer.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.ConnectionPool != nil { + l = m.ConnectionPool.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.OutlierDetection != nil { + l = m.OutlierDetection.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.Tls != nil { + l = m.Tls.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Subset) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovDestinationRule(uint64(l)) + } + if len(m.Labels) > 0 { + for k, v := range m.Labels { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovDestinationRule(uint64(len(k))) + 1 + len(v) + sovDestinationRule(uint64(len(v))) + n += mapEntrySize + 1 + sovDestinationRule(uint64(mapEntrySize)) + } + } + if m.TrafficPolicy != nil { + l = m.TrafficPolicy.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *LoadBalancerSettings) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.LbPolicy != nil { + n += m.LbPolicy.Size() + } + if m.LocalityLbSetting != nil { + l = m.LocalityLbSetting.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *LoadBalancerSettings_Simple) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovDestinationRule(uint64(m.Simple)) + return n +} +func (m *LoadBalancerSettings_ConsistentHash) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ConsistentHash != nil { + l = m.ConsistentHash.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + return n +} +func (m *LoadBalancerSettings_ConsistentHashLB) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HashKey != nil { + n += m.HashKey.Size() + } + if m.MinimumRingSize != 0 { + n += 1 + sovDestinationRule(uint64(m.MinimumRingSize)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *LoadBalancerSettings_ConsistentHashLB_HttpHeaderName) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.HttpHeaderName) + n += 1 + l + sovDestinationRule(uint64(l)) + return n +} +func (m *LoadBalancerSettings_ConsistentHashLB_HttpCookie) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HttpCookie != nil { + l = m.HttpCookie.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + return n +} +func (m *LoadBalancerSettings_ConsistentHashLB_UseSourceIp) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 2 + return n +} +func (m *LoadBalancerSettings_ConsistentHashLB_HttpQueryParameterName) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.HttpQueryParameterName) + n += 1 + l + sovDestinationRule(uint64(l)) + return n +} +func (m *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovDestinationRule(uint64(l)) + } + l = len(m.Path) + if l > 0 { + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.Ttl != nil { + l = m.Ttl.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ConnectionPoolSettings) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Tcp != nil { + l = m.Tcp.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.Http != nil { + l = m.Http.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ConnectionPoolSettings_TCPSettings) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MaxConnections != 0 { + n += 1 + sovDestinationRule(uint64(m.MaxConnections)) + } + if m.ConnectTimeout != nil { + l = m.ConnectTimeout.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.TcpKeepalive != nil { + l = m.TcpKeepalive.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ConnectionPoolSettings_TCPSettings_TcpKeepalive) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Probes != 0 { + n += 1 + sovDestinationRule(uint64(m.Probes)) + } + if m.Time != nil { + l = m.Time.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.Interval != nil { + l = m.Interval.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ConnectionPoolSettings_HTTPSettings) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Http1MaxPendingRequests != 0 { + n += 1 + sovDestinationRule(uint64(m.Http1MaxPendingRequests)) + } + if m.Http2MaxRequests != 0 { + n += 1 + sovDestinationRule(uint64(m.Http2MaxRequests)) + } + if m.MaxRequestsPerConnection != 0 { + n += 1 + sovDestinationRule(uint64(m.MaxRequestsPerConnection)) + } + if m.MaxRetries != 0 { + n += 1 + sovDestinationRule(uint64(m.MaxRetries)) + } + if m.IdleTimeout != nil { + l = m.IdleTimeout.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.H2UpgradePolicy != 0 { + n += 1 + sovDestinationRule(uint64(m.H2UpgradePolicy)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *OutlierDetection) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ConsecutiveErrors != 0 { + n += 1 + sovDestinationRule(uint64(m.ConsecutiveErrors)) + } + if m.Interval != nil { + l = m.Interval.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.BaseEjectionTime != nil { + l = m.BaseEjectionTime.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.MaxEjectionPercent != 0 { + n += 1 + sovDestinationRule(uint64(m.MaxEjectionPercent)) + } + if m.MinHealthPercent != 0 { + n += 1 + sovDestinationRule(uint64(m.MinHealthPercent)) + } + if m.ConsecutiveGatewayErrors != nil { + l = m.ConsecutiveGatewayErrors.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.Consecutive_5XxErrors != nil { + l = m.Consecutive_5XxErrors.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ClientTLSSettings) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Mode != 0 { + n += 1 + sovDestinationRule(uint64(m.Mode)) + } + l = len(m.ClientCertificate) + if l > 0 { + n += 1 + l + sovDestinationRule(uint64(l)) + } + l = len(m.PrivateKey) + if l > 0 { + n += 1 + l + sovDestinationRule(uint64(l)) + } + l = len(m.CaCertificates) + if l > 0 { + n += 1 + l + sovDestinationRule(uint64(l)) + } + if len(m.SubjectAltNames) > 0 { + for _, s := range m.SubjectAltNames { + l = len(s) + n += 1 + l + sovDestinationRule(uint64(l)) + } + } + l = len(m.Sni) + if l > 0 { + n += 1 + l + sovDestinationRule(uint64(l)) + } + l = len(m.CredentialName) + if l > 0 { + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *LocalityLoadBalancerSetting) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Distribute) > 0 { + for _, e := range m.Distribute { + l = e.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + } + if len(m.Failover) > 0 { + for _, e := range m.Failover { + l = e.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + } + if m.Enabled != nil { + l = m.Enabled.Size() + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *LocalityLoadBalancerSetting_Distribute) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovDestinationRule(uint64(l)) + } + if len(m.To) > 0 { + for k, v := range m.To { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovDestinationRule(uint64(len(k))) + 1 + sovDestinationRule(uint64(v)) + n += mapEntrySize + 1 + sovDestinationRule(uint64(mapEntrySize)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *LocalityLoadBalancerSetting_Failover) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.From) + if l > 0 { + n += 1 + l + sovDestinationRule(uint64(l)) + } + l = len(m.To) + if l > 0 { + n += 1 + l + sovDestinationRule(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovDestinationRule(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozDestinationRule(x uint64) (n int) { + return sovDestinationRule(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *DestinationRule) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: DestinationRule: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: DestinationRule: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Host", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Host = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TrafficPolicy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TrafficPolicy == nil { + m.TrafficPolicy = &TrafficPolicy{} + } + if err := m.TrafficPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subsets", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subsets = append(m.Subsets, &Subset{}) + if err := m.Subsets[len(m.Subsets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExportTo", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExportTo = append(m.ExportTo, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDestinationRule(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TrafficPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TrafficPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TrafficPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LoadBalancer", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LoadBalancer == nil { + m.LoadBalancer = &LoadBalancerSettings{} + } + if err := m.LoadBalancer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionPool", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionPool == nil { + m.ConnectionPool = &ConnectionPoolSettings{} + } + if err := m.ConnectionPool.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutlierDetection", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.OutlierDetection == nil { + m.OutlierDetection = &OutlierDetection{} + } + if err := m.OutlierDetection.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tls", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Tls == nil { + m.Tls = &ClientTLSSettings{} + } + if err := m.Tls.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortLevelSettings", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortLevelSettings = append(m.PortLevelSettings, &TrafficPolicy_PortTrafficPolicy{}) + if err := m.PortLevelSettings[len(m.PortLevelSettings)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDestinationRule(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TrafficPolicy_PortTrafficPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PortTrafficPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PortTrafficPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Port == nil { + m.Port = &PortSelector{} + } + if err := m.Port.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LoadBalancer", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LoadBalancer == nil { + m.LoadBalancer = &LoadBalancerSettings{} + } + if err := m.LoadBalancer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectionPool", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectionPool == nil { + m.ConnectionPool = &ConnectionPoolSettings{} + } + if err := m.ConnectionPool.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutlierDetection", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.OutlierDetection == nil { + m.OutlierDetection = &OutlierDetection{} + } + if err := m.OutlierDetection.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tls", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Tls == nil { + m.Tls = &ClientTLSSettings{} + } + if err := m.Tls.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDestinationRule(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Subset) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Subset: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Subset: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Labels == nil { + m.Labels = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthDestinationRule + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthDestinationRule + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthDestinationRule + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthDestinationRule + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipDestinationRule(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Labels[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TrafficPolicy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TrafficPolicy == nil { + m.TrafficPolicy = &TrafficPolicy{} + } + if err := m.TrafficPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDestinationRule(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LoadBalancerSettings) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LoadBalancerSettings: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LoadBalancerSettings: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Simple", wireType) + } + var v LoadBalancerSettings_SimpleLB + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= LoadBalancerSettings_SimpleLB(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.LbPolicy = &LoadBalancerSettings_Simple{v} + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsistentHash", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &LoadBalancerSettings_ConsistentHashLB{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.LbPolicy = &LoadBalancerSettings_ConsistentHash{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LocalityLbSetting", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LocalityLbSetting == nil { + m.LocalityLbSetting = &LocalityLoadBalancerSetting{} + } + if err := m.LocalityLbSetting.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDestinationRule(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LoadBalancerSettings_ConsistentHashLB) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConsistentHashLB: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConsistentHashLB: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HttpHeaderName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HashKey = &LoadBalancerSettings_ConsistentHashLB_HttpHeaderName{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HttpCookie", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &LoadBalancerSettings_ConsistentHashLB_HTTPCookie{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.HashKey = &LoadBalancerSettings_ConsistentHashLB_HttpCookie{v} + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UseSourceIp", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + b := bool(v != 0) + m.HashKey = &LoadBalancerSettings_ConsistentHashLB_UseSourceIp{b} + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinimumRingSize", wireType) + } + m.MinimumRingSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinimumRingSize |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field HttpQueryParameterName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.HashKey = &LoadBalancerSettings_ConsistentHashLB_HttpQueryParameterName{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDestinationRule(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HTTPCookie: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HTTPCookie: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ttl", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Ttl == nil { + m.Ttl = &types.Duration{} + } + if err := m.Ttl.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDestinationRule(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConnectionPoolSettings) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConnectionPoolSettings: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConnectionPoolSettings: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tcp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Tcp == nil { + m.Tcp = &ConnectionPoolSettings_TCPSettings{} + } + if err := m.Tcp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Http", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Http == nil { + m.Http = &ConnectionPoolSettings_HTTPSettings{} + } + if err := m.Http.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDestinationRule(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConnectionPoolSettings_TCPSettings) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TCPSettings: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TCPSettings: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxConnections", wireType) + } + m.MaxConnections = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxConnections |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConnectTimeout", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConnectTimeout == nil { + m.ConnectTimeout = &types.Duration{} + } + if err := m.ConnectTimeout.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TcpKeepalive", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TcpKeepalive == nil { + m.TcpKeepalive = &ConnectionPoolSettings_TCPSettings_TcpKeepalive{} + } + if err := m.TcpKeepalive.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDestinationRule(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConnectionPoolSettings_TCPSettings_TcpKeepalive) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TcpKeepalive: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TcpKeepalive: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Probes", wireType) + } + m.Probes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Probes |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Time", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Time == nil { + m.Time = &types.Duration{} + } + if err := m.Time.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Interval == nil { + m.Interval = &types.Duration{} + } + if err := m.Interval.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDestinationRule(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConnectionPoolSettings_HTTPSettings) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HTTPSettings: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HTTPSettings: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Http1MaxPendingRequests", wireType) + } + m.Http1MaxPendingRequests = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Http1MaxPendingRequests |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Http2MaxRequests", wireType) + } + m.Http2MaxRequests = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Http2MaxRequests |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxRequestsPerConnection", wireType) + } + m.MaxRequestsPerConnection = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxRequestsPerConnection |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxRetries", wireType) + } + m.MaxRetries = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxRetries |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field IdleTimeout", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.IdleTimeout == nil { + m.IdleTimeout = &types.Duration{} + } + if err := m.IdleTimeout.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field H2UpgradePolicy", wireType) + } + m.H2UpgradePolicy = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.H2UpgradePolicy |= ConnectionPoolSettings_HTTPSettings_H2UpgradePolicy(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipDestinationRule(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OutlierDetection) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OutlierDetection: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OutlierDetection: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsecutiveErrors", wireType) + } + m.ConsecutiveErrors = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ConsecutiveErrors |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Interval", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Interval == nil { + m.Interval = &types.Duration{} + } + if err := m.Interval.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BaseEjectionTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.BaseEjectionTime == nil { + m.BaseEjectionTime = &types.Duration{} + } + if err := m.BaseEjectionTime.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxEjectionPercent", wireType) + } + m.MaxEjectionPercent = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxEjectionPercent |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinHealthPercent", wireType) + } + m.MinHealthPercent = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinHealthPercent |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsecutiveGatewayErrors", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConsecutiveGatewayErrors == nil { + m.ConsecutiveGatewayErrors = &types.UInt32Value{} + } + if err := m.ConsecutiveGatewayErrors.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Consecutive_5XxErrors", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Consecutive_5XxErrors == nil { + m.Consecutive_5XxErrors = &types.UInt32Value{} + } + if err := m.Consecutive_5XxErrors.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDestinationRule(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClientTLSSettings) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ClientTLSSettings: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClientTLSSettings: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) + } + m.Mode = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Mode |= ClientTLSSettings_TLSmode(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientCertificate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientCertificate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PrivateKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PrivateKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CaCertificates", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CaCertificates = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubjectAltNames", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubjectAltNames = append(m.SubjectAltNames, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sni", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sni = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CredentialName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CredentialName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDestinationRule(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LocalityLoadBalancerSetting) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: LocalityLoadBalancerSetting: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LocalityLoadBalancerSetting: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Distribute", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Distribute = append(m.Distribute, &LocalityLoadBalancerSetting_Distribute{}) + if err := m.Distribute[len(m.Distribute)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Failover", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Failover = append(m.Failover, &LocalityLoadBalancerSetting_Failover{}) + if err := m.Failover[len(m.Failover)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Enabled", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Enabled == nil { + m.Enabled = &types.BoolValue{} + } + if err := m.Enabled.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDestinationRule(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LocalityLoadBalancerSetting_Distribute) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Distribute: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Distribute: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.From = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.To == nil { + m.To = make(map[string]uint32) + } + var mapkey string + var mapvalue uint32 + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthDestinationRule + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthDestinationRule + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapvalue |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + } else { + iNdEx = entryPreIndex + skippy, err := skipDestinationRule(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.To[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDestinationRule(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *LocalityLoadBalancerSetting_Failover) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Failover: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Failover: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field From", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.From = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field To", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDestinationRule + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDestinationRule + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.To = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDestinationRule(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDestinationRule + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipDestinationRule(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthDestinationRule + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthDestinationRule + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowDestinationRule + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipDestinationRule(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthDestinationRule + } + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthDestinationRule = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowDestinationRule = fmt.Errorf("proto: integer overflow") +) diff --git a/vendor/istio.io/api/networking/v1alpha3/destination_rule.pb.html b/vendor/istio.io/api/networking/v1alpha3/destination_rule.pb.html new file mode 100644 index 0000000000..43fbebf22d --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/destination_rule.pb.html @@ -0,0 +1,1831 @@ +--- +title: Destination Rule +description: Configuration affecting load balancing, outlier detection, etc. +location: https://istio.io/docs/reference/config/networking/destination-rule.html +layout: protoc-gen-docs +generator: protoc-gen-docs +schema: istio.networking.v1alpha3.DestinationRule +aliases: [/docs/reference/config/networking/v1alpha3/destination-rule] +number_of_entries: 20 +--- +

DestinationRule defines policies that apply to traffic intended for a +service after routing has occurred. These rules specify configuration +for load balancing, connection pool size from the sidecar, and outlier +detection settings to detect and evict unhealthy hosts from the load +balancing pool. For example, a simple load balancing policy for the +ratings service would look as follows:

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: DestinationRule
+metadata:
+  name: bookinfo-ratings
+spec:
+  host: ratings.prod.svc.cluster.local
+  trafficPolicy:
+    loadBalancer:
+      simple: LEAST_CONN
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: DestinationRule
+metadata:
+  name: bookinfo-ratings
+spec:
+  host: ratings.prod.svc.cluster.local
+  trafficPolicy:
+    loadBalancer:
+      simple: LEAST_CONN
+
+ +

{{}} +{{}}

+ +

Version specific policies can be specified by defining a named +subset and overriding the settings specified at the service level. The +following rule uses a round robin load balancing policy for all traffic +going to a subset named testversion that is composed of endpoints (e.g., +pods) with labels (version:v3).

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: DestinationRule
+metadata:
+  name: bookinfo-ratings
+spec:
+  host: ratings.prod.svc.cluster.local
+  trafficPolicy:
+    loadBalancer:
+      simple: LEAST_CONN
+  subsets:
+  - name: testversion
+    labels:
+      version: v3
+    trafficPolicy:
+      loadBalancer:
+        simple: ROUND_ROBIN
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: DestinationRule
+metadata:
+  name: bookinfo-ratings
+spec:
+  host: ratings.prod.svc.cluster.local
+  trafficPolicy:
+    loadBalancer:
+      simple: LEAST_CONN
+  subsets:
+  - name: testversion
+    labels:
+      version: v3
+    trafficPolicy:
+      loadBalancer:
+        simple: ROUND_ROBIN
+
+ +

{{}} +{{}}

+ +

Note: Policies specified for subsets will not take effect until +a route rule explicitly sends traffic to this subset.

+ +

Traffic policies can be customized to specific ports as well. The +following rule uses the least connection load balancing policy for all +traffic to port 80, while uses a round robin load balancing setting for +traffic to the port 9080.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: DestinationRule
+metadata:
+  name: bookinfo-ratings-port
+spec:
+  host: ratings.prod.svc.cluster.local
+  trafficPolicy: # Apply to all ports
+    portLevelSettings:
+    - port:
+        number: 80
+      loadBalancer:
+        simple: LEAST_CONN
+    - port:
+        number: 9080
+      loadBalancer:
+        simple: ROUND_ROBIN
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: DestinationRule
+metadata:
+  name: bookinfo-ratings-port
+spec:
+  host: ratings.prod.svc.cluster.local
+  trafficPolicy: # Apply to all ports
+    portLevelSettings:
+    - port:
+        number: 80
+      loadBalancer:
+        simple: LEAST_CONN
+    - port:
+        number: 9080
+      loadBalancer:
+        simple: ROUND_ROBIN
+
+ +

{{}} +{{}}

+ +

DestinationRule

+
+

DestinationRule defines policies that apply to traffic intended for a service +after routing has occurred.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
hoststring +

The name of a service from the service registry. Service +names are looked up from the platform’s service registry (e.g., +Kubernetes services, Consul services, etc.) and from the hosts +declared by ServiceEntries. Rules defined for +services that do not exist in the service registry will be ignored.

+ +

Note for Kubernetes users: When short names are used (e.g. “reviews” +instead of “reviews.default.svc.cluster.local”), Istio will interpret +the short name based on the namespace of the rule, not the service. A +rule in the “default” namespace containing a host “reviews” will be +interpreted as “reviews.default.svc.cluster.local”, irrespective of +the actual namespace associated with the reviews service. To avoid +potential misconfigurations, it is recommended to always use fully +qualified domain names over short names.

+ +

Note that the host field applies to both HTTP and TCP services.

+ +
+Yes +
trafficPolicyTrafficPolicy +

Traffic policies to apply (load balancing policy, connection pool +sizes, outlier detection).

+ +
+No +
subsetsSubset[] +

One or more named sets that represent individual versions of a +service. Traffic policies can be overridden at subset level.

+ +
+No +
exportTostring[] +

A list of namespaces to which this destination rule is exported. +The resolution of a destination rule to apply to a service occurs in the +context of a hierarchy of namespaces. Exporting a destination rule allows +it to be included in the resolution hierarchy for services in +other namespaces. This feature provides a mechanism for service owners +and mesh administrators to control the visibility of destination rules +across namespace boundaries.

+ +

If no namespaces are specified then the destination rule is exported to all +namespaces by default.

+ +

The value “.” is reserved and defines an export to the same namespace that +the destination rule is declared in. Similarly, the value “*” is reserved and +defines an export to all namespaces.

+ +

NOTE: in the current release, the exportTo value is restricted to +“.” or “*” (i.e., the current namespace or all namespaces).

+ +
+No +
+
+

TrafficPolicy

+
+

Traffic policies to apply for a specific destination, across all +destination ports. See DestinationRule for examples.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
loadBalancerLoadBalancerSettings +

Settings controlling the load balancer algorithms.

+ +
+No +
connectionPoolConnectionPoolSettings +

Settings controlling the volume of connections to an upstream service

+ +
+No +
outlierDetectionOutlierDetection +

Settings controlling eviction of unhealthy hosts from the load balancing pool

+ +
+No +
tlsClientTLSSettings +

TLS related settings for connections to the upstream service.

+ +
+No +
portLevelSettingsPortTrafficPolicy[] +

Traffic policies specific to individual ports. Note that port level +settings will override the destination-level settings. Traffic +settings specified at the destination-level will not be inherited when +overridden by port-level settings, i.e. default values will be applied +to fields omitted in port-level traffic policies.

+ +
+No +
+
+

Subset

+
+

A subset of endpoints of a service. Subsets can be used for scenarios +like A/B testing, or routing to a specific version of a service. Refer +to VirtualService documentation for examples of using +subsets in these scenarios. In addition, traffic policies defined at the +service-level can be overridden at a subset-level. The following rule +uses a round robin load balancing policy for all traffic going to a +subset named testversion that is composed of endpoints (e.g., pods) with +labels (version:v3).

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: DestinationRule
+metadata:
+  name: bookinfo-ratings
+spec:
+  host: ratings.prod.svc.cluster.local
+  trafficPolicy:
+    loadBalancer:
+      simple: LEAST_CONN
+  subsets:
+  - name: testversion
+    labels:
+      version: v3
+    trafficPolicy:
+      loadBalancer:
+        simple: ROUND_ROBIN
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: DestinationRule
+metadata:
+  name: bookinfo-ratings
+spec:
+  host: ratings.prod.svc.cluster.local
+  trafficPolicy:
+    loadBalancer:
+      simple: LEAST_CONN
+  subsets:
+  - name: testversion
+    labels:
+      version: v3
+    trafficPolicy:
+      loadBalancer:
+        simple: ROUND_ROBIN
+
+ +

{{}} +{{}}

+ +

Note: Policies specified for subsets will not take effect until +a route rule explicitly sends traffic to this subset.

+ +

One or more labels are typically required to identify the subset destination, +however, when the corresponding DestinationRule represents a host that +supports multiple SNI hosts (e.g., an egress gateway), a subset without labels +may be meaningful. In this case a traffic policy with ClientTLSSettings +can be used to identify a specific SNI host corresponding to the named subset.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
namestring +

Name of the subset. The service name and the subset name can +be used for traffic splitting in a route rule.

+ +
+Yes +
labelsmap<string, string> +

Labels apply a filter over the endpoints of a service in the +service registry. See route rules for examples of usage.

+ +
+No +
trafficPolicyTrafficPolicy +

Traffic policies that apply to this subset. Subsets inherit the +traffic policies specified at the DestinationRule level. Settings +specified at the subset level will override the corresponding settings +specified at the DestinationRule level.

+ +
+No +
+
+

LoadBalancerSettings

+
+

Load balancing policies to apply for a specific destination. See Envoy’s +load balancing +documentation +for more details.

+ +

For example, the following rule uses a round robin load balancing policy +for all traffic going to the ratings service.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: DestinationRule
+metadata:
+  name: bookinfo-ratings
+spec:
+  host: ratings.prod.svc.cluster.local
+  trafficPolicy:
+    loadBalancer:
+      simple: ROUND_ROBIN
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: DestinationRule
+metadata:
+  name: bookinfo-ratings
+spec:
+  host: ratings.prod.svc.cluster.local
+  trafficPolicy:
+    loadBalancer:
+      simple: ROUND_ROBIN
+
+ +

{{}} +{{}}

+ +

The following example sets up sticky sessions for the ratings service +hashing-based load balancer for the same ratings service using the +the User cookie as the hash key.

+ +

{{}} +{{}}

+ +
 apiVersion: networking.istio.io/v1alpha3
+ kind: DestinationRule
+ metadata:
+   name: bookinfo-ratings
+ spec:
+   host: ratings.prod.svc.cluster.local
+   trafficPolicy:
+     loadBalancer:
+       consistentHash:
+         httpCookie:
+           name: user
+           ttl: 0s
+
+ +

{{}}

+ +

{{}}

+ +
 apiVersion: networking.istio.io/v1beta1
+ kind: DestinationRule
+ metadata:
+   name: bookinfo-ratings
+ spec:
+   host: ratings.prod.svc.cluster.local
+   trafficPolicy:
+     loadBalancer:
+       consistentHash:
+         httpCookie:
+           name: user
+           ttl: 0s
+
+ +

{{}} +{{}}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
simpleSimpleLB (oneof) + +No +
consistentHashConsistentHashLB (oneof) + +No +
localityLbSettingLocalityLoadBalancerSetting +

Locality load balancer settings, this will override mesh wide settings in entirety, meaning no merging would be performed +between this object and the object one in MeshConfig

+ +
+No +
+
+

ConnectionPoolSettings

+
+

Connection pool settings for an upstream host. The settings apply to +each individual host in the upstream service. See Envoy’s circuit +breaker +for more details. Connection pool settings can be applied at the TCP +level as well as at HTTP level.

+ +

For example, the following rule sets a limit of 100 connections to redis +service called myredissrv with a connect timeout of 30ms

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: DestinationRule
+metadata:
+  name: bookinfo-redis
+spec:
+  host: myredissrv.prod.svc.cluster.local
+  trafficPolicy:
+    connectionPool:
+      tcp:
+        maxConnections: 100
+        connectTimeout: 30ms
+        tcpKeepalive:
+          time: 7200s
+          interval: 75s
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: DestinationRule
+metadata:
+  name: bookinfo-redis
+spec:
+  host: myredissrv.prod.svc.cluster.local
+  trafficPolicy:
+    connectionPool:
+      tcp:
+        maxConnections: 100
+        connectTimeout: 30ms
+        tcpKeepalive:
+          time: 7200s
+          interval: 75s
+
+ +

{{}} +{{}}

+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
tcpTCPSettings +

Settings common to both HTTP and TCP upstream connections.

+ +
+No +
httpHTTPSettings +

HTTP connection pool settings.

+ +
+No +
+
+

OutlierDetection

+
+

A Circuit breaker implementation that tracks the status of each +individual host in the upstream service. Applicable to both HTTP and +TCP services. For HTTP services, hosts that continually return 5xx +errors for API calls are ejected from the pool for a pre-defined period +of time. For TCP services, connection timeouts or connection +failures to a given host counts as an error when measuring the +consecutive errors metric. See Envoy’s outlier +detection +for more details.

+ +

The following rule sets a connection pool size of 100 HTTP1 connections +with no more than 10 req/connection to the “reviews” service. In addition, +it sets a limit of 1000 concurrent HTTP2 requests and configures upstream +hosts to be scanned every 5 mins so that any host that fails 7 consecutive +times with a 502, 503, or 504 error code will be ejected for 15 minutes.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: DestinationRule
+metadata:
+  name: reviews-cb-policy
+spec:
+  host: reviews.prod.svc.cluster.local
+  trafficPolicy:
+    connectionPool:
+      tcp:
+        maxConnections: 100
+      http:
+        http2MaxRequests: 1000
+        maxRequestsPerConnection: 10
+    outlierDetection:
+      consecutiveErrors: 7
+      interval: 5m
+      baseEjectionTime: 15m
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: DestinationRule
+metadata:
+  name: reviews-cb-policy
+spec:
+  host: reviews.prod.svc.cluster.local
+  trafficPolicy:
+    connectionPool:
+      tcp:
+        maxConnections: 100
+      http:
+        http2MaxRequests: 1000
+        maxRequestsPerConnection: 10
+    outlierDetection:
+      consecutiveErrors: 7
+      interval: 5m
+      baseEjectionTime: 15m
+
+ +

{{}} +{{}}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
consecutiveGatewayErrorsUInt32Value +

Number of gateway errors before a host is ejected from the connection pool. +When the upstream host is accessed over HTTP, a 502, 503, or 504 return +code qualifies as a gateway error. When the upstream host is accessed over +an opaque TCP connection, connect timeouts and connection error/failure +events qualify as a gateway error. +This feature is disabled by default or when set to the value 0.

+ +

Note that consecutivegatewayerrors and consecutive5xxerrors can be +used separately or together. Because the errors counted by +consecutivegatewayerrors are also included in consecutive5xxerrors, +if the value of consecutivegatewayerrors is greater than or equal to +the value of consecutive5xxerrors, consecutivegatewayerrors will have +no effect.

+ +
+No +
consecutive5xxErrorsUInt32Value +

Number of 5xx errors before a host is ejected from the connection pool. +When the upstream host is accessed over an opaque TCP connection, connect +timeouts, connection error/failure and request failure events qualify as a +5xx error. +This feature defaults to 5 but can be disabled by setting the value to 0.

+ +

Note that consecutivegatewayerrors and consecutive5xxerrors can be +used separately or together. Because the errors counted by +consecutivegatewayerrors are also included in consecutive5xxerrors, +if the value of consecutivegatewayerrors is greater than or equal to +the value of consecutive5xxerrors, consecutivegatewayerrors will have +no effect.

+ +
+No +
intervalDuration +

Time interval between ejection sweep analysis. format: +1h/1m/1s/1ms. MUST BE >=1ms. Default is 10s.

+ +
+No +
baseEjectionTimeDuration +

Minimum ejection duration. A host will remain ejected for a period +equal to the product of minimum ejection duration and the number of +times the host has been ejected. This technique allows the system to +automatically increase the ejection period for unhealthy upstream +servers. format: 1h/1m/1s/1ms. MUST BE >=1ms. Default is 30s.

+ +
+No +
maxEjectionPercentint32 +

Maximum % of hosts in the load balancing pool for the upstream +service that can be ejected. Defaults to 10%.

+ +
+No +
minHealthPercentint32 +

Outlier detection will be enabled as long as the associated load balancing +pool has at least minhealthpercent hosts in healthy mode. When the +percentage of healthy hosts in the load balancing pool drops below this +threshold, outlier detection will be disabled and the proxy will load balance +across all hosts in the pool (healthy and unhealthy). The threshold can be +disabled by setting it to 0%. The default is 0% as it’s not typically +applicable in k8s environments with few pods per service.

+ +
+No +
+
+

ClientTLSSettings

+
+

SSL/TLS related settings for upstream connections. See Envoy’s TLS +context +for more details. These settings are common to both HTTP and TCP upstreams.

+ +

For example, the following rule configures a client to use mutual TLS +for connections to upstream database cluster.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: DestinationRule
+metadata:
+  name: db-mtls
+spec:
+  host: mydbserver.prod.svc.cluster.local
+  trafficPolicy:
+    tls:
+      mode: MUTUAL
+      clientCertificate: /etc/certs/myclientcert.pem
+      privateKey: /etc/certs/client_private_key.pem
+      caCertificates: /etc/certs/rootcacerts.pem
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: DestinationRule
+metadata:
+  name: db-mtls
+spec:
+  host: mydbserver.prod.svc.cluster.local
+  trafficPolicy:
+    tls:
+      mode: MUTUAL
+      clientCertificate: /etc/certs/myclientcert.pem
+      privateKey: /etc/certs/client_private_key.pem
+      caCertificates: /etc/certs/rootcacerts.pem
+
+ +

{{}} +{{}}

+ +

The following rule configures a client to use TLS when talking to a +foreign service whose domain matches *.foo.com.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: DestinationRule
+metadata:
+  name: tls-foo
+spec:
+  host: "*.foo.com"
+  trafficPolicy:
+    tls:
+      mode: SIMPLE
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: DestinationRule
+metadata:
+  name: tls-foo
+spec:
+  host: "*.foo.com"
+  trafficPolicy:
+    tls:
+      mode: SIMPLE
+
+ +

{{}} +{{}}

+ +

The following rule configures a client to use Istio mutual TLS when talking +to rating services.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: DestinationRule
+metadata:
+  name: ratings-istio-mtls
+spec:
+  host: ratings.prod.svc.cluster.local
+  trafficPolicy:
+    tls:
+      mode: ISTIO_MUTUAL
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: DestinationRule
+metadata:
+  name: ratings-istio-mtls
+spec:
+  host: ratings.prod.svc.cluster.local
+  trafficPolicy:
+    tls:
+      mode: ISTIO_MUTUAL
+
+ +

{{}} +{{}}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
modeTLSmode +

Indicates whether connections to this port should be secured +using TLS. The value of this field determines how TLS is enforced.

+ +
+Yes +
clientCertificatestring +

REQUIRED if mode is MUTUAL. The path to the file holding the +client-side TLS certificate to use. +Should be empty if mode is ISTIO_MUTUAL.

+ +
+No +
privateKeystring +

REQUIRED if mode is MUTUAL. The path to the file holding the +client’s private key. +Should be empty if mode is ISTIO_MUTUAL.

+ +
+No +
caCertificatesstring +

OPTIONAL: The path to the file containing certificate authority +certificates to use in verifying a presented server certificate. If +omitted, the proxy will not verify the server’s certificate. +Should be empty if mode is ISTIO_MUTUAL.

+ +
+No +
credentialNamestring +

The name of the secret that holds the TLS certs for the +client including the CA certificates. Applicable +only on Kubernetes. Secret must exist in the same +namespace with the proxy using the certificates. +The secret (of type generic)should contain the +following keys and values: key: <privateKey>, +cert: <serverCert>, cacert: <CACertificate>. +Secret of type tls for client certificates along with +ca.crt key for CA certificates is also supported. +Only one of client certificates and CA certificate +or credentialName can be specified.

+ +
+No +
subjectAltNamesstring[] +

A list of alternate names to verify the subject identity in the +certificate. If specified, the proxy will verify that the server +certificate’s subject alt name matches one of the specified values. +If specified, this list overrides the value of subjectaltnames +from the ServiceEntry.

+ +
+No +
snistring +

SNI string to present to the server during TLS handshake.

+ +
+No +
+
+

LocalityLoadBalancerSetting

+
+

Locality-weighted load balancing allows administrators to control the +distribution of traffic to endpoints based on the localities of where the +traffic originates and where it will terminate. These localities are +specified using arbitrary labels that designate a hierarchy of localities in +{region}/{zone}/{sub-zone} form. For additional detail refer to +Locality Weight +The following example shows how to setup locality weights mesh-wide.

+ +

Given a mesh with workloads and their service deployed to “us-west/zone1/” +and “us-west/zone2/”. This example specifies that when traffic accessing a +service originates from workloads in “us-west/zone1/”, 80% of the traffic +will be sent to endpoints in “us-west/zone1/”, i.e the same zone, and the +remaining 20% will go to endpoints in “us-west/zone2/”. This setup is +intended to favor routing traffic to endpoints in the same locality. +A similar setting is specified for traffic originating in “us-west/zone2/”.

+ +
  distribute:
+    - from: us-west/zone1/*
+      to:
+        "us-west/zone1/*": 80
+        "us-west/zone2/*": 20
+    - from: us-west/zone2/*
+      to:
+        "us-west/zone1/*": 20
+        "us-west/zone2/*": 80
+
+ +

If the goal of the operator is not to distribute load across zones and +regions but rather to restrict the regionality of failover to meet other +operational requirements an operator can set a ‘failover’ policy instead of +a ‘distribute’ policy.

+ +

The following example sets up a locality failover policy for regions. +Assume a service resides in zones within us-east, us-west & eu-west +this example specifies that when endpoints within us-east become unhealthy +traffic should failover to endpoints in any zone or sub-zone within eu-west +and similarly us-west should failover to us-east.

+ +
 failover:
+   - from: us-east
+     to: eu-west
+   - from: us-west
+     to: us-east
+
+ +

Locality load balancing settings.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
distributeDistribute[] +

Optional: only one of distribute or failover can be set. +Explicitly specify loadbalancing weight across different zones and geographical locations. +Refer to Locality weighted load balancing +If empty, the locality weight is set according to the endpoints number within it.

+ +
+No +
failoverFailover[] +

Optional: only failover or distribute can be set. +Explicitly specify the region traffic will land on when endpoints in local region becomes unhealthy. +Should be used together with OutlierDetection to detect unhealthy endpoints. +Note: if no OutlierDetection specified, this will not take effect.

+ +
+No +
enabledBoolValue +

enable locality load balancing, this is DestinationRule-level and will override mesh wide settings in entirety. +e.g. true means that turn on locality load balancing for this DestinationRule no matter what mesh wide settings is.

+ +
+No +
+
+

TrafficPolicy.PortTrafficPolicy

+
+

Traffic policies that apply to specific ports of the service

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
portPortSelector +

Specifies the number of a port on the destination service +on which this policy is being applied.

+ +
+No +
loadBalancerLoadBalancerSettings +

Settings controlling the load balancer algorithms.

+ +
+No +
connectionPoolConnectionPoolSettings +

Settings controlling the volume of connections to an upstream service

+ +
+No +
outlierDetectionOutlierDetection +

Settings controlling eviction of unhealthy hosts from the load balancing pool

+ +
+No +
tlsClientTLSSettings +

TLS related settings for connections to the upstream service.

+ +
+No +
+
+

LoadBalancerSettings.ConsistentHashLB

+
+

Consistent Hash-based load balancing can be used to provide soft +session affinity based on HTTP headers, cookies or other +properties. This load balancing policy is applicable only for HTTP +connections. The affinity to a particular destination host will be +lost when one or more hosts are added/removed from the destination +service.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
httpHeaderNamestring (oneof) +

Hash based on a specific HTTP header.

+ +
+No +
useSourceIpbool (oneof) +

Hash based on the source IP address.

+ +
+No +
httpQueryParameterNamestring (oneof) +

Hash based on a specific HTTP query parameter.

+ +
+No +
minimumRingSizeuint64 +

The minimum number of virtual nodes to use for the hash +ring. Defaults to 1024. Larger ring sizes result in more granular +load distributions. If the number of hosts in the load balancing +pool is larger than the ring size, each host will be assigned a +single virtual node.

+ +
+No +
+
+

LoadBalancerSettings.ConsistentHashLB.HTTPCookie

+
+

Describes a HTTP cookie that will be used as the hash key for the +Consistent Hash load balancer. If the cookie is not present, it will +be generated.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
namestring +

Name of the cookie.

+ +
+Yes +
pathstring +

Path to set for the cookie.

+ +
+No +
ttlDuration +

Lifetime of the cookie.

+ +
+Yes +
+
+

ConnectionPoolSettings.TCPSettings

+
+

Settings common to both HTTP and TCP upstream connections.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
maxConnectionsint32 +

Maximum number of HTTP1 /TCP connections to a destination host. Default 2^32-1.

+ +
+No +
connectTimeoutDuration +

TCP connection timeout. format: +1h/1m/1s/1ms. MUST BE >=1ms. Default is 10s.

+ +
+No +
tcpKeepaliveTcpKeepalive +

If set then set SO_KEEPALIVE on the socket to enable TCP Keepalives.

+ +
+No +
+
+

ConnectionPoolSettings.HTTPSettings

+
+

Settings applicable to HTTP1.1/HTTP2/GRPC connections.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
http1MaxPendingRequestsint32 +

Maximum number of pending HTTP requests to a destination. Default 2^32-1.

+ +
+No +
http2MaxRequestsint32 +

Maximum number of requests to a backend. Default 2^32-1.

+ +
+No +
maxRequestsPerConnectionint32 +

Maximum number of requests per connection to a backend. Setting this +parameter to 1 disables keep alive. Default 0, meaning “unlimited”, +up to 2^29.

+ +
+No +
maxRetriesint32 +

Maximum number of retries that can be outstanding to all hosts in a +cluster at a given time. Defaults to 2^32-1.

+ +
+No +
idleTimeoutDuration +

The idle timeout for upstream connection pool connections. The idle timeout is defined as the period in which there are no active requests. +If not set, the default is 1 hour. When the idle timeout is reached the connection will be closed. +Note that request based timeouts mean that HTTP/2 PINGs will not keep the connection alive. Applies to both HTTP1.1 and HTTP2 connections.

+ +
+No +
h2UpgradePolicyH2UpgradePolicy +

Specify if http1.1 connection should be upgraded to http2 for the associated destination.

+ +
+No +
+
+

ConnectionPoolSettings.TCPSettings.TcpKeepalive

+
+

TCP keepalive.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
probesuint32 +

Maximum number of keepalive probes to send without response before +deciding the connection is dead. Default is to use the OS level configuration +(unless overridden, Linux defaults to 9.)

+ +
+No +
timeDuration +

The time duration a connection needs to be idle before keep-alive +probes start being sent. Default is to use the OS level configuration +(unless overridden, Linux defaults to 7200s (ie 2 hours.)

+ +
+No +
intervalDuration +

The time duration between keep-alive probes. +Default is to use the OS level configuration +(unless overridden, Linux defaults to 75s.)

+ +
+No +
+
+

LocalityLoadBalancerSetting.Distribute

+
+

Describes how traffic originating in the ‘from’ zone or sub-zone is +distributed over a set of ‘to’ zones. Syntax for specifying a zone is +{region}/{zone}/{sub-zone} and terminal wildcards are allowed on any +segment of the specification. Examples: +* - matches all localities +us-west/* - all zones and sub-zones within the us-west region +us-west/zone-1/* - all sub-zones within us-west/zone-1

+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
fromstring +

Originating locality, ‘/’ separated, e.g. ‘region/zone/sub_zone’.

+ +
+No +
tomap<string, uint32> +

Map of upstream localities to traffic distribution weights. The sum of +all weights should be == 100. Any locality not assigned a weight will +receive no traffic.

+ +
+No +
+
+

LocalityLoadBalancerSetting.Failover

+
+

Specify the traffic failover policy across regions. Since zone and sub-zone +failover is supported by default this only needs to be specified for +regions when the operator needs to constrain traffic failover so that +the default behavior of failing over to any endpoint globally does not +apply. This is useful when failing over traffic across regions would not +improve service health or may need to be restricted for other reasons +like regulatory controls.

+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
fromstring +

Originating region.

+ +
+No +
tostring +

Destination region the traffic will fail over to when endpoints in +the ‘from’ region becomes unhealthy.

+ +
+No +
+
+

google.protobuf.UInt32Value

+
+

Wrapper message for uint32.

+ +

The JSON representation for UInt32Value is JSON number.

+ + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
valueuint32 +

The uint32 value.

+ +
+No +
+
+

LoadBalancerSettings.SimpleLB

+
+

Standard load balancing algorithms that require no tuning.

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
ROUND_ROBIN +

Round Robin policy. Default

+ +
LEAST_CONN +

The least request load balancer uses an O(1) algorithm which selects +two random healthy hosts and picks the host which has fewer active +requests.

+ +
RANDOM +

The random load balancer selects a random healthy host. The random +load balancer generally performs better than round robin if no health +checking policy is configured.

+ +
PASSTHROUGH +

This option will forward the connection to the original IP address +requested by the caller without doing any form of load +balancing. This option must be used with care. It is meant for +advanced use cases. Refer to Original Destination load balancer in +Envoy for further details.

+ +
+
+

ConnectionPoolSettings.HTTPSettings.H2UpgradePolicy

+
+

Policy for upgrading http1.1 connections to http2.

+ + + + + + + + + + + + + + + + + + + + + + +
NameDescription
DEFAULT +

Use the global default.

+ +
DO_NOT_UPGRADE +

Do not upgrade the connection to http2. +This opt-out option overrides the default.

+ +
UPGRADE +

Upgrade the connection to http2. +This opt-in option overrides the default.

+ +
+
+

ClientTLSSettings.TLSmode

+
+

TLS connection mode

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
DISABLE +

Do not setup a TLS connection to the upstream endpoint.

+ +
SIMPLE +

Originate a TLS connection to the upstream endpoint.

+ +
MUTUAL +

Secure connections to the upstream using mutual TLS by presenting +client certificates for authentication.

+ +
ISTIO_MUTUAL +

Secure connections to the upstream using mutual TLS by presenting +client certificates for authentication. +Compared to Mutual mode, this mode uses certificates generated +automatically by Istio for mTLS authentication. When this mode is +used, all other fields in ClientTLSSettings should be empty.

+ +
+
diff --git a/vendor/istio.io/api/networking/v1alpha3/destination_rule.proto b/vendor/istio.io/api/networking/v1alpha3/destination_rule.proto new file mode 100644 index 0000000000..36e71f9667 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/destination_rule.proto @@ -0,0 +1,1042 @@ +// Copyright 2018 Istio Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +syntax = "proto3"; + +import "google/api/field_behavior.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/wrappers.proto"; +import "networking/v1alpha3/virtual_service.proto"; +import "gogoproto/gogo.proto"; + +// $schema: istio.networking.v1alpha3.DestinationRule +// $title: Destination Rule +// $description: Configuration affecting load balancing, outlier detection, etc. +// $location: https://istio.io/docs/reference/config/networking/destination-rule.html +// $aliases: [/docs/reference/config/networking/v1alpha3/destination-rule] + +// `DestinationRule` defines policies that apply to traffic intended for a +// service after routing has occurred. These rules specify configuration +// for load balancing, connection pool size from the sidecar, and outlier +// detection settings to detect and evict unhealthy hosts from the load +// balancing pool. For example, a simple load balancing policy for the +// ratings service would look as follows: +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// ``` +// {{}} +// {{}} +// +// Version specific policies can be specified by defining a named +// `subset` and overriding the settings specified at the service level. The +// following rule uses a round robin load balancing policy for all traffic +// going to a subset named testversion that is composed of endpoints (e.g., +// pods) with labels (version:v3). +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// subsets: +// - name: testversion +// labels: +// version: v3 +// trafficPolicy: +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// subsets: +// - name: testversion +// labels: +// version: v3 +// trafficPolicy: +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// {{}} +// +// **Note:** Policies specified for subsets will not take effect until +// a route rule explicitly sends traffic to this subset. +// +// Traffic policies can be customized to specific ports as well. The +// following rule uses the least connection load balancing policy for all +// traffic to port 80, while uses a round robin load balancing setting for +// traffic to the port 9080. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings-port +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: # Apply to all ports +// portLevelSettings: +// - port: +// number: 80 +// loadBalancer: +// simple: LEAST_CONN +// - port: +// number: 9080 +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings-port +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: # Apply to all ports +// portLevelSettings: +// - port: +// number: 80 +// loadBalancer: +// simple: LEAST_CONN +// - port: +// number: 9080 +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// {{}} +// +package istio.networking.v1alpha3; + +option go_package = "istio.io/api/networking/v1alpha3"; + +// DestinationRule defines policies that apply to traffic intended for a service +// after routing has occurred. +// +// +// +// +message DestinationRule { + // The name of a service from the service registry. Service + // names are looked up from the platform's service registry (e.g., + // Kubernetes services, Consul services, etc.) and from the hosts + // declared by [ServiceEntries](https://istio.io/docs/reference/config/networking/service-entry/#ServiceEntry). Rules defined for + // services that do not exist in the service registry will be ignored. + // + // *Note for Kubernetes users*: When short names are used (e.g. "reviews" + // instead of "reviews.default.svc.cluster.local"), Istio will interpret + // the short name based on the namespace of the rule, not the service. A + // rule in the "default" namespace containing a host "reviews" will be + // interpreted as "reviews.default.svc.cluster.local", irrespective of + // the actual namespace associated with the reviews service. _To avoid + // potential misconfigurations, it is recommended to always use fully + // qualified domain names over short names._ + // + // Note that the host field applies to both HTTP and TCP services. + string host = 1 [(google.api.field_behavior) = REQUIRED]; + + // Traffic policies to apply (load balancing policy, connection pool + // sizes, outlier detection). + TrafficPolicy traffic_policy = 2; + + // One or more named sets that represent individual versions of a + // service. Traffic policies can be overridden at subset level. + repeated Subset subsets = 3; + + // A list of namespaces to which this destination rule is exported. + // The resolution of a destination rule to apply to a service occurs in the + // context of a hierarchy of namespaces. Exporting a destination rule allows + // it to be included in the resolution hierarchy for services in + // other namespaces. This feature provides a mechanism for service owners + // and mesh administrators to control the visibility of destination rules + // across namespace boundaries. + // + // If no namespaces are specified then the destination rule is exported to all + // namespaces by default. + // + // The value "." is reserved and defines an export to the same namespace that + // the destination rule is declared in. Similarly, the value "*" is reserved and + // defines an export to all namespaces. + // + // NOTE: in the current release, the `exportTo` value is restricted to + // "." or "*" (i.e., the current namespace or all namespaces). + repeated string export_to = 4; +} + +// Traffic policies to apply for a specific destination, across all +// destination ports. See DestinationRule for examples. +message TrafficPolicy { + // Settings controlling the load balancer algorithms. + LoadBalancerSettings load_balancer = 1; + + // Settings controlling the volume of connections to an upstream service + ConnectionPoolSettings connection_pool = 2; + + // Settings controlling eviction of unhealthy hosts from the load balancing pool + OutlierDetection outlier_detection = 3; + + // TLS related settings for connections to the upstream service. + ClientTLSSettings tls = 4; + + // Traffic policies that apply to specific ports of the service + message PortTrafficPolicy { + // Specifies the number of a port on the destination service + // on which this policy is being applied. + // + PortSelector port = 1; + + // Settings controlling the load balancer algorithms. + LoadBalancerSettings load_balancer = 2; + + // Settings controlling the volume of connections to an upstream service + ConnectionPoolSettings connection_pool = 3; + + // Settings controlling eviction of unhealthy hosts from the load balancing pool + OutlierDetection outlier_detection = 4; + + // TLS related settings for connections to the upstream service. + ClientTLSSettings tls = 5; + } + + // Traffic policies specific to individual ports. Note that port level + // settings will override the destination-level settings. Traffic + // settings specified at the destination-level will not be inherited when + // overridden by port-level settings, i.e. default values will be applied + // to fields omitted in port-level traffic policies. + repeated PortTrafficPolicy port_level_settings = 5; +} + +// A subset of endpoints of a service. Subsets can be used for scenarios +// like A/B testing, or routing to a specific version of a service. Refer +// to [VirtualService](https://istio.io/docs/reference/config/networking/virtual-service/#VirtualService) documentation for examples of using +// subsets in these scenarios. In addition, traffic policies defined at the +// service-level can be overridden at a subset-level. The following rule +// uses a round robin load balancing policy for all traffic going to a +// subset named testversion that is composed of endpoints (e.g., pods) with +// labels (version:v3). +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// subsets: +// - name: testversion +// labels: +// version: v3 +// trafficPolicy: +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// subsets: +// - name: testversion +// labels: +// version: v3 +// trafficPolicy: +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// {{}} +// +// **Note:** Policies specified for subsets will not take effect until +// a route rule explicitly sends traffic to this subset. +// +// One or more labels are typically required to identify the subset destination, +// however, when the corresponding DestinationRule represents a host that +// supports multiple SNI hosts (e.g., an egress gateway), a subset without labels +// may be meaningful. In this case a traffic policy with [ClientTLSSettings](#ClientTLSSettings) +// can be used to identify a specific SNI host corresponding to the named subset. +message Subset { + // Name of the subset. The service name and the subset name can + // be used for traffic splitting in a route rule. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Labels apply a filter over the endpoints of a service in the + // service registry. See route rules for examples of usage. + map labels = 2; + + // Traffic policies that apply to this subset. Subsets inherit the + // traffic policies specified at the DestinationRule level. Settings + // specified at the subset level will override the corresponding settings + // specified at the DestinationRule level. + TrafficPolicy traffic_policy = 3; +} + +// Load balancing policies to apply for a specific destination. See Envoy's +// load balancing +// [documentation](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/load_balancing) +// for more details. +// +// For example, the following rule uses a round robin load balancing policy +// for all traffic going to the ratings service. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// {{}} +// +// The following example sets up sticky sessions for the ratings service +// hashing-based load balancer for the same ratings service using the +// the User cookie as the hash key. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// consistentHash: +// httpCookie: +// name: user +// ttl: 0s +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// consistentHash: +// httpCookie: +// name: user +// ttl: 0s +// ``` +// {{}} +// {{}} +// +message LoadBalancerSettings { + // Standard load balancing algorithms that require no tuning. + enum SimpleLB { + // Round Robin policy. Default + ROUND_ROBIN = 0; + + // The least request load balancer uses an O(1) algorithm which selects + // two random healthy hosts and picks the host which has fewer active + // requests. + LEAST_CONN = 1; + + // The random load balancer selects a random healthy host. The random + // load balancer generally performs better than round robin if no health + // checking policy is configured. + RANDOM = 2; + + // This option will forward the connection to the original IP address + // requested by the caller without doing any form of load + // balancing. This option must be used with care. It is meant for + // advanced use cases. Refer to Original Destination load balancer in + // Envoy for further details. + PASSTHROUGH = 3; + }; + + // Consistent Hash-based load balancing can be used to provide soft + // session affinity based on HTTP headers, cookies or other + // properties. This load balancing policy is applicable only for HTTP + // connections. The affinity to a particular destination host will be + // lost when one or more hosts are added/removed from the destination + // service. + message ConsistentHashLB { + // Describes a HTTP cookie that will be used as the hash key for the + // Consistent Hash load balancer. If the cookie is not present, it will + // be generated. + message HTTPCookie { + // Name of the cookie. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + // Path to set for the cookie. + string path = 2; + // Lifetime of the cookie. + google.protobuf.Duration ttl = 3 [(google.api.field_behavior) = REQUIRED]; + }; + + // The hash key to use. + oneof hash_key { + // Hash based on a specific HTTP header. + string http_header_name = 1; + + // Hash based on HTTP cookie. + HTTPCookie http_cookie = 2; + + // Hash based on the source IP address. + bool use_source_ip = 3; + + // Hash based on a specific HTTP query parameter. + string http_query_parameter_name = 5; + }; + + // The minimum number of virtual nodes to use for the hash + // ring. Defaults to 1024. Larger ring sizes result in more granular + // load distributions. If the number of hosts in the load balancing + // pool is larger than the ring size, each host will be assigned a + // single virtual node. + uint64 minimum_ring_size = 4; + }; + + // (-- TODO: Enable Subset load balancing after moving to v2 API Also + // look into enabling Priotity based load balancing for spilling over + // from one priority pool to another. --) + + // Upstream load balancing policy. + oneof lb_policy { + SimpleLB simple = 1; + ConsistentHashLB consistent_hash = 2; + } + + // Locality load balancer settings, this will override mesh wide settings in entirety, meaning no merging would be performed + // between this object and the object one in MeshConfig + LocalityLoadBalancerSetting locality_lb_setting = 3; +} + +// Connection pool settings for an upstream host. The settings apply to +// each individual host in the upstream service. See Envoy's [circuit +// breaker](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/circuit_breaking) +// for more details. Connection pool settings can be applied at the TCP +// level as well as at HTTP level. +// +// For example, the following rule sets a limit of 100 connections to redis +// service called myredissrv with a connect timeout of 30ms +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-redis +// spec: +// host: myredissrv.prod.svc.cluster.local +// trafficPolicy: +// connectionPool: +// tcp: +// maxConnections: 100 +// connectTimeout: 30ms +// tcpKeepalive: +// time: 7200s +// interval: 75s +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: bookinfo-redis +// spec: +// host: myredissrv.prod.svc.cluster.local +// trafficPolicy: +// connectionPool: +// tcp: +// maxConnections: 100 +// connectTimeout: 30ms +// tcpKeepalive: +// time: 7200s +// interval: 75s +// ``` +// {{}} +// {{}} +// +message ConnectionPoolSettings { + // Settings common to both HTTP and TCP upstream connections. + message TCPSettings { + // TCP keepalive. + message TcpKeepalive { + // Maximum number of keepalive probes to send without response before + // deciding the connection is dead. Default is to use the OS level configuration + // (unless overridden, Linux defaults to 9.) + uint32 probes = 1; + + // The time duration a connection needs to be idle before keep-alive + // probes start being sent. Default is to use the OS level configuration + // (unless overridden, Linux defaults to 7200s (ie 2 hours.) + google.protobuf.Duration time = 2; + + // The time duration between keep-alive probes. + // Default is to use the OS level configuration + // (unless overridden, Linux defaults to 75s.) + google.protobuf.Duration interval = 3; + }; + + // Maximum number of HTTP1 /TCP connections to a destination host. Default 2^32-1. + int32 max_connections = 1; + + // TCP connection timeout. format: + // 1h/1m/1s/1ms. MUST BE >=1ms. Default is 10s. + google.protobuf.Duration connect_timeout = 2; + + // If set then set SO_KEEPALIVE on the socket to enable TCP Keepalives. + TcpKeepalive tcp_keepalive = 3; + }; + + // Settings applicable to HTTP1.1/HTTP2/GRPC connections. + message HTTPSettings { + // Maximum number of pending HTTP requests to a destination. Default 2^32-1. + int32 http1_max_pending_requests = 1; + + // Maximum number of requests to a backend. Default 2^32-1. + int32 http2_max_requests = 2; + + // Maximum number of requests per connection to a backend. Setting this + // parameter to 1 disables keep alive. Default 0, meaning "unlimited", + // up to 2^29. + int32 max_requests_per_connection = 3; + + // Maximum number of retries that can be outstanding to all hosts in a + // cluster at a given time. Defaults to 2^32-1. + int32 max_retries = 4; + + // The idle timeout for upstream connection pool connections. The idle timeout is defined as the period in which there are no active requests. + // If not set, the default is 1 hour. When the idle timeout is reached the connection will be closed. + // Note that request based timeouts mean that HTTP/2 PINGs will not keep the connection alive. Applies to both HTTP1.1 and HTTP2 connections. + google.protobuf.Duration idle_timeout = 5; + + // Policy for upgrading http1.1 connections to http2. + enum H2UpgradePolicy { + // Use the global default. + DEFAULT = 0; + // Do not upgrade the connection to http2. + // This opt-out option overrides the default. + DO_NOT_UPGRADE = 1; + // Upgrade the connection to http2. + // This opt-in option overrides the default. + UPGRADE = 2; + }; + // Specify if http1.1 connection should be upgraded to http2 for the associated destination. + H2UpgradePolicy h2_upgrade_policy = 6; + }; + + // Settings common to both HTTP and TCP upstream connections. + TCPSettings tcp = 1; + // HTTP connection pool settings. + HTTPSettings http = 2; +} + +// A Circuit breaker implementation that tracks the status of each +// individual host in the upstream service. Applicable to both HTTP and +// TCP services. For HTTP services, hosts that continually return 5xx +// errors for API calls are ejected from the pool for a pre-defined period +// of time. For TCP services, connection timeouts or connection +// failures to a given host counts as an error when measuring the +// consecutive errors metric. See Envoy's [outlier +// detection](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/outlier) +// for more details. +// +// The following rule sets a connection pool size of 100 HTTP1 connections +// with no more than 10 req/connection to the "reviews" service. In addition, +// it sets a limit of 1000 concurrent HTTP2 requests and configures upstream +// hosts to be scanned every 5 mins so that any host that fails 7 consecutive +// times with a 502, 503, or 504 error code will be ejected for 15 minutes. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: reviews-cb-policy +// spec: +// host: reviews.prod.svc.cluster.local +// trafficPolicy: +// connectionPool: +// tcp: +// maxConnections: 100 +// http: +// http2MaxRequests: 1000 +// maxRequestsPerConnection: 10 +// outlierDetection: +// consecutiveErrors: 7 +// interval: 5m +// baseEjectionTime: 15m +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: reviews-cb-policy +// spec: +// host: reviews.prod.svc.cluster.local +// trafficPolicy: +// connectionPool: +// tcp: +// maxConnections: 100 +// http: +// http2MaxRequests: 1000 +// maxRequestsPerConnection: 10 +// outlierDetection: +// consecutiveErrors: 7 +// interval: 5m +// baseEjectionTime: 15m +// ``` +// {{}} +// {{}} +// +message OutlierDetection { + // Number of errors before a host is ejected from the connection + // pool. Defaults to 5. When the upstream host is accessed over HTTP, a + // 502, 503, or 504 return code qualifies as an error. When the upstream host + // is accessed over an opaque TCP connection, connect timeouts and + // connection error/failure events qualify as an error. + // $hide_from_docs + int32 consecutive_errors = 1 [deprecated=true]; + + // Number of gateway errors before a host is ejected from the connection pool. + // When the upstream host is accessed over HTTP, a 502, 503, or 504 return + // code qualifies as a gateway error. When the upstream host is accessed over + // an opaque TCP connection, connect timeouts and connection error/failure + // events qualify as a gateway error. + // This feature is disabled by default or when set to the value 0. + // + // Note that consecutive_gateway_errors and consecutive_5xx_errors can be + // used separately or together. Because the errors counted by + // consecutive_gateway_errors are also included in consecutive_5xx_errors, + // if the value of consecutive_gateway_errors is greater than or equal to + // the value of consecutive_5xx_errors, consecutive_gateway_errors will have + // no effect. + google.protobuf.UInt32Value consecutive_gateway_errors = 6; + + // Number of 5xx errors before a host is ejected from the connection pool. + // When the upstream host is accessed over an opaque TCP connection, connect + // timeouts, connection error/failure and request failure events qualify as a + // 5xx error. + // This feature defaults to 5 but can be disabled by setting the value to 0. + // + // Note that consecutive_gateway_errors and consecutive_5xx_errors can be + // used separately or together. Because the errors counted by + // consecutive_gateway_errors are also included in consecutive_5xx_errors, + // if the value of consecutive_gateway_errors is greater than or equal to + // the value of consecutive_5xx_errors, consecutive_gateway_errors will have + // no effect. + google.protobuf.UInt32Value consecutive_5xx_errors = 7; + + // Time interval between ejection sweep analysis. format: + // 1h/1m/1s/1ms. MUST BE >=1ms. Default is 10s. + google.protobuf.Duration interval = 2; + + // Minimum ejection duration. A host will remain ejected for a period + // equal to the product of minimum ejection duration and the number of + // times the host has been ejected. This technique allows the system to + // automatically increase the ejection period for unhealthy upstream + // servers. format: 1h/1m/1s/1ms. MUST BE >=1ms. Default is 30s. + google.protobuf.Duration base_ejection_time = 3; + + // Maximum % of hosts in the load balancing pool for the upstream + // service that can be ejected. Defaults to 10%. + int32 max_ejection_percent = 4; + + // Outlier detection will be enabled as long as the associated load balancing + // pool has at least min_health_percent hosts in healthy mode. When the + // percentage of healthy hosts in the load balancing pool drops below this + // threshold, outlier detection will be disabled and the proxy will load balance + // across all hosts in the pool (healthy and unhealthy). The threshold can be + // disabled by setting it to 0%. The default is 0% as it's not typically + // applicable in k8s environments with few pods per service. + int32 min_health_percent = 5; +} + +// SSL/TLS related settings for upstream connections. See Envoy's [TLS +// context](https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/auth/cert.proto.html) +// for more details. These settings are common to both HTTP and TCP upstreams. +// +// For example, the following rule configures a client to use mutual TLS +// for connections to upstream database cluster. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: db-mtls +// spec: +// host: mydbserver.prod.svc.cluster.local +// trafficPolicy: +// tls: +// mode: MUTUAL +// clientCertificate: /etc/certs/myclientcert.pem +// privateKey: /etc/certs/client_private_key.pem +// caCertificates: /etc/certs/rootcacerts.pem +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: db-mtls +// spec: +// host: mydbserver.prod.svc.cluster.local +// trafficPolicy: +// tls: +// mode: MUTUAL +// clientCertificate: /etc/certs/myclientcert.pem +// privateKey: /etc/certs/client_private_key.pem +// caCertificates: /etc/certs/rootcacerts.pem +// ``` +// {{}} +// {{}} +// +// The following rule configures a client to use TLS when talking to a +// foreign service whose domain matches *.foo.com. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: tls-foo +// spec: +// host: "*.foo.com" +// trafficPolicy: +// tls: +// mode: SIMPLE +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: tls-foo +// spec: +// host: "*.foo.com" +// trafficPolicy: +// tls: +// mode: SIMPLE +// ``` +// {{}} +// {{}} +// +// The following rule configures a client to use Istio mutual TLS when talking +// to rating services. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: ratings-istio-mtls +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// tls: +// mode: ISTIO_MUTUAL +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: ratings-istio-mtls +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// tls: +// mode: ISTIO_MUTUAL +// ``` +// {{}} +// {{}} +// +message ClientTLSSettings { + // TLS connection mode + enum TLSmode { + // Do not setup a TLS connection to the upstream endpoint. + DISABLE = 0; + + // Originate a TLS connection to the upstream endpoint. + SIMPLE = 1; + + // Secure connections to the upstream using mutual TLS by presenting + // client certificates for authentication. + MUTUAL = 2; + + // Secure connections to the upstream using mutual TLS by presenting + // client certificates for authentication. + // Compared to Mutual mode, this mode uses certificates generated + // automatically by Istio for mTLS authentication. When this mode is + // used, all other fields in `ClientTLSSettings` should be empty. + ISTIO_MUTUAL = 3; + }; + + // Indicates whether connections to this port should be secured + // using TLS. The value of this field determines how TLS is enforced. + TLSmode mode = 1 [(google.api.field_behavior) = REQUIRED]; + + // REQUIRED if mode is `MUTUAL`. The path to the file holding the + // client-side TLS certificate to use. + // Should be empty if mode is `ISTIO_MUTUAL`. + string client_certificate = 2; + + // REQUIRED if mode is `MUTUAL`. The path to the file holding the + // client's private key. + // Should be empty if mode is `ISTIO_MUTUAL`. + string private_key = 3; + + // OPTIONAL: The path to the file containing certificate authority + // certificates to use in verifying a presented server certificate. If + // omitted, the proxy will not verify the server's certificate. + // Should be empty if mode is `ISTIO_MUTUAL`. + string ca_certificates = 4; + + // The name of the secret that holds the TLS certs for the + // client including the CA certificates. Applicable + // only on Kubernetes. Secret must exist in the same + // namespace with the proxy using the certificates. + // The secret (of type `generic`)should contain the + // following keys and values: `key: `, + // `cert: `, `cacert: `. + // Secret of type tls for client certificates along with + // ca.crt key for CA certificates is also supported. + // Only one of client certificates and CA certificate + // or credentialName can be specified. + string credential_name = 7; + + // A list of alternate names to verify the subject identity in the + // certificate. If specified, the proxy will verify that the server + // certificate's subject alt name matches one of the specified values. + // If specified, this list overrides the value of subject_alt_names + // from the ServiceEntry. + repeated string subject_alt_names = 5; + + // SNI string to present to the server during TLS handshake. + string sni = 6; +} + +// Locality-weighted load balancing allows administrators to control the +// distribution of traffic to endpoints based on the localities of where the +// traffic originates and where it will terminate. These localities are +// specified using arbitrary labels that designate a hierarchy of localities in +// {region}/{zone}/{sub-zone} form. For additional detail refer to +// [Locality Weight](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/locality_weight) +// The following example shows how to setup locality weights mesh-wide. +// +// Given a mesh with workloads and their service deployed to "us-west/zone1/*" +// and "us-west/zone2/*". This example specifies that when traffic accessing a +// service originates from workloads in "us-west/zone1/*", 80% of the traffic +// will be sent to endpoints in "us-west/zone1/*", i.e the same zone, and the +// remaining 20% will go to endpoints in "us-west/zone2/*". This setup is +// intended to favor routing traffic to endpoints in the same locality. +// A similar setting is specified for traffic originating in "us-west/zone2/*". +// +// ```yaml +// distribute: +// - from: us-west/zone1/* +// to: +// "us-west/zone1/*": 80 +// "us-west/zone2/*": 20 +// - from: us-west/zone2/* +// to: +// "us-west/zone1/*": 20 +// "us-west/zone2/*": 80 +// ``` +// +// If the goal of the operator is not to distribute load across zones and +// regions but rather to restrict the regionality of failover to meet other +// operational requirements an operator can set a 'failover' policy instead of +// a 'distribute' policy. +// +// The following example sets up a locality failover policy for regions. +// Assume a service resides in zones within us-east, us-west & eu-west +// this example specifies that when endpoints within us-east become unhealthy +// traffic should failover to endpoints in any zone or sub-zone within eu-west +// and similarly us-west should failover to us-east. +// +// ```yaml +// failover: +// - from: us-east +// to: eu-west +// - from: us-west +// to: us-east +// ``` +// Locality load balancing settings. +message LocalityLoadBalancerSetting{ + // Describes how traffic originating in the 'from' zone or sub-zone is + // distributed over a set of 'to' zones. Syntax for specifying a zone is + // {region}/{zone}/{sub-zone} and terminal wildcards are allowed on any + // segment of the specification. Examples: + // * - matches all localities + // us-west/* - all zones and sub-zones within the us-west region + // us-west/zone-1/* - all sub-zones within us-west/zone-1 + message Distribute{ + // Originating locality, '/' separated, e.g. 'region/zone/sub_zone'. + string from = 1; + + // Map of upstream localities to traffic distribution weights. The sum of + // all weights should be == 100. Any locality not assigned a weight will + // receive no traffic. + map to = 2; + }; + + // Specify the traffic failover policy across regions. Since zone and sub-zone + // failover is supported by default this only needs to be specified for + // regions when the operator needs to constrain traffic failover so that + // the default behavior of failing over to any endpoint globally does not + // apply. This is useful when failing over traffic across regions would not + // improve service health or may need to be restricted for other reasons + // like regulatory controls. + message Failover{ + // Originating region. + string from = 1; + + // Destination region the traffic will fail over to when endpoints in + // the 'from' region becomes unhealthy. + string to = 2; + }; + + // Optional: only one of distribute or failover can be set. + // Explicitly specify loadbalancing weight across different zones and geographical locations. + // Refer to [Locality weighted load balancing](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/upstream/load_balancing/locality_weight) + // If empty, the locality weight is set according to the endpoints number within it. + repeated Distribute distribute = 1; + + // Optional: only failover or distribute can be set. + // Explicitly specify the region traffic will land on when endpoints in local region becomes unhealthy. + // Should be used together with OutlierDetection to detect unhealthy endpoints. + // Note: if no OutlierDetection specified, this will not take effect. + repeated Failover failover = 2; + + // enable locality load balancing, this is DestinationRule-level and will override mesh wide settings in entirety. + // e.g. true means that turn on locality load balancing for this DestinationRule no matter what mesh wide settings is. + google.protobuf.BoolValue enabled = 3; +} diff --git a/vendor/istio.io/api/networking/v1alpha3/destination_rule_deepcopy.gen.go b/vendor/istio.io/api/networking/v1alpha3/destination_rule_deepcopy.gen.go new file mode 100644 index 0000000000..3a71441aed --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/destination_rule_deepcopy.gen.go @@ -0,0 +1,414 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/destination_rule.proto + +// `DestinationRule` defines policies that apply to traffic intended for a +// service after routing has occurred. These rules specify configuration +// for load balancing, connection pool size from the sidecar, and outlier +// detection settings to detect and evict unhealthy hosts from the load +// balancing pool. For example, a simple load balancing policy for the +// ratings service would look as follows: +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// ``` +// {{}} +// {{}} +// +// Version specific policies can be specified by defining a named +// `subset` and overriding the settings specified at the service level. The +// following rule uses a round robin load balancing policy for all traffic +// going to a subset named testversion that is composed of endpoints (e.g., +// pods) with labels (version:v3). +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// subsets: +// - name: testversion +// labels: +// version: v3 +// trafficPolicy: +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// subsets: +// - name: testversion +// labels: +// version: v3 +// trafficPolicy: +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// {{}} +// +// **Note:** Policies specified for subsets will not take effect until +// a route rule explicitly sends traffic to this subset. +// +// Traffic policies can be customized to specific ports as well. The +// following rule uses the least connection load balancing policy for all +// traffic to port 80, while uses a round robin load balancing setting for +// traffic to the port 9080. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings-port +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: # Apply to all ports +// portLevelSettings: +// - port: +// number: 80 +// loadBalancer: +// simple: LEAST_CONN +// - port: +// number: 9080 +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings-port +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: # Apply to all ports +// portLevelSettings: +// - port: +// number: 80 +// loadBalancer: +// simple: LEAST_CONN +// - port: +// number: 9080 +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// {{}} +// + +package v1alpha3 + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// DeepCopyInto supports using DestinationRule within kubernetes types, where deepcopy-gen is used. +func (in *DestinationRule) DeepCopyInto(out *DestinationRule) { + p := proto.Clone(in).(*DestinationRule) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestinationRule. Required by controller-gen. +func (in *DestinationRule) DeepCopy() *DestinationRule { + if in == nil { + return nil + } + out := new(DestinationRule) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using TrafficPolicy within kubernetes types, where deepcopy-gen is used. +func (in *TrafficPolicy) DeepCopyInto(out *TrafficPolicy) { + p := proto.Clone(in).(*TrafficPolicy) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrafficPolicy. Required by controller-gen. +func (in *TrafficPolicy) DeepCopy() *TrafficPolicy { + if in == nil { + return nil + } + out := new(TrafficPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using TrafficPolicy_PortTrafficPolicy within kubernetes types, where deepcopy-gen is used. +func (in *TrafficPolicy_PortTrafficPolicy) DeepCopyInto(out *TrafficPolicy_PortTrafficPolicy) { + p := proto.Clone(in).(*TrafficPolicy_PortTrafficPolicy) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TrafficPolicy_PortTrafficPolicy. Required by controller-gen. +func (in *TrafficPolicy_PortTrafficPolicy) DeepCopy() *TrafficPolicy_PortTrafficPolicy { + if in == nil { + return nil + } + out := new(TrafficPolicy_PortTrafficPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using Subset within kubernetes types, where deepcopy-gen is used. +func (in *Subset) DeepCopyInto(out *Subset) { + p := proto.Clone(in).(*Subset) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subset. Required by controller-gen. +func (in *Subset) DeepCopy() *Subset { + if in == nil { + return nil + } + out := new(Subset) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using LoadBalancerSettings within kubernetes types, where deepcopy-gen is used. +func (in *LoadBalancerSettings) DeepCopyInto(out *LoadBalancerSettings) { + p := proto.Clone(in).(*LoadBalancerSettings) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerSettings. Required by controller-gen. +func (in *LoadBalancerSettings) DeepCopy() *LoadBalancerSettings { + if in == nil { + return nil + } + out := new(LoadBalancerSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using LoadBalancerSettings_ConsistentHashLB within kubernetes types, where deepcopy-gen is used. +func (in *LoadBalancerSettings_ConsistentHashLB) DeepCopyInto(out *LoadBalancerSettings_ConsistentHashLB) { + p := proto.Clone(in).(*LoadBalancerSettings_ConsistentHashLB) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerSettings_ConsistentHashLB. Required by controller-gen. +func (in *LoadBalancerSettings_ConsistentHashLB) DeepCopy() *LoadBalancerSettings_ConsistentHashLB { + if in == nil { + return nil + } + out := new(LoadBalancerSettings_ConsistentHashLB) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using LoadBalancerSettings_ConsistentHashLB_HTTPCookie within kubernetes types, where deepcopy-gen is used. +func (in *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) DeepCopyInto(out *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) { + p := proto.Clone(in).(*LoadBalancerSettings_ConsistentHashLB_HTTPCookie) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerSettings_ConsistentHashLB_HTTPCookie. Required by controller-gen. +func (in *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) DeepCopy() *LoadBalancerSettings_ConsistentHashLB_HTTPCookie { + if in == nil { + return nil + } + out := new(LoadBalancerSettings_ConsistentHashLB_HTTPCookie) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using ConnectionPoolSettings within kubernetes types, where deepcopy-gen is used. +func (in *ConnectionPoolSettings) DeepCopyInto(out *ConnectionPoolSettings) { + p := proto.Clone(in).(*ConnectionPoolSettings) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectionPoolSettings. Required by controller-gen. +func (in *ConnectionPoolSettings) DeepCopy() *ConnectionPoolSettings { + if in == nil { + return nil + } + out := new(ConnectionPoolSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using ConnectionPoolSettings_TCPSettings within kubernetes types, where deepcopy-gen is used. +func (in *ConnectionPoolSettings_TCPSettings) DeepCopyInto(out *ConnectionPoolSettings_TCPSettings) { + p := proto.Clone(in).(*ConnectionPoolSettings_TCPSettings) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectionPoolSettings_TCPSettings. Required by controller-gen. +func (in *ConnectionPoolSettings_TCPSettings) DeepCopy() *ConnectionPoolSettings_TCPSettings { + if in == nil { + return nil + } + out := new(ConnectionPoolSettings_TCPSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using ConnectionPoolSettings_TCPSettings_TcpKeepalive within kubernetes types, where deepcopy-gen is used. +func (in *ConnectionPoolSettings_TCPSettings_TcpKeepalive) DeepCopyInto(out *ConnectionPoolSettings_TCPSettings_TcpKeepalive) { + p := proto.Clone(in).(*ConnectionPoolSettings_TCPSettings_TcpKeepalive) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectionPoolSettings_TCPSettings_TcpKeepalive. Required by controller-gen. +func (in *ConnectionPoolSettings_TCPSettings_TcpKeepalive) DeepCopy() *ConnectionPoolSettings_TCPSettings_TcpKeepalive { + if in == nil { + return nil + } + out := new(ConnectionPoolSettings_TCPSettings_TcpKeepalive) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using ConnectionPoolSettings_HTTPSettings within kubernetes types, where deepcopy-gen is used. +func (in *ConnectionPoolSettings_HTTPSettings) DeepCopyInto(out *ConnectionPoolSettings_HTTPSettings) { + p := proto.Clone(in).(*ConnectionPoolSettings_HTTPSettings) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConnectionPoolSettings_HTTPSettings. Required by controller-gen. +func (in *ConnectionPoolSettings_HTTPSettings) DeepCopy() *ConnectionPoolSettings_HTTPSettings { + if in == nil { + return nil + } + out := new(ConnectionPoolSettings_HTTPSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using OutlierDetection within kubernetes types, where deepcopy-gen is used. +func (in *OutlierDetection) DeepCopyInto(out *OutlierDetection) { + p := proto.Clone(in).(*OutlierDetection) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OutlierDetection. Required by controller-gen. +func (in *OutlierDetection) DeepCopy() *OutlierDetection { + if in == nil { + return nil + } + out := new(OutlierDetection) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using ClientTLSSettings within kubernetes types, where deepcopy-gen is used. +func (in *ClientTLSSettings) DeepCopyInto(out *ClientTLSSettings) { + p := proto.Clone(in).(*ClientTLSSettings) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ClientTLSSettings. Required by controller-gen. +func (in *ClientTLSSettings) DeepCopy() *ClientTLSSettings { + if in == nil { + return nil + } + out := new(ClientTLSSettings) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using LocalityLoadBalancerSetting within kubernetes types, where deepcopy-gen is used. +func (in *LocalityLoadBalancerSetting) DeepCopyInto(out *LocalityLoadBalancerSetting) { + p := proto.Clone(in).(*LocalityLoadBalancerSetting) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalityLoadBalancerSetting. Required by controller-gen. +func (in *LocalityLoadBalancerSetting) DeepCopy() *LocalityLoadBalancerSetting { + if in == nil { + return nil + } + out := new(LocalityLoadBalancerSetting) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using LocalityLoadBalancerSetting_Distribute within kubernetes types, where deepcopy-gen is used. +func (in *LocalityLoadBalancerSetting_Distribute) DeepCopyInto(out *LocalityLoadBalancerSetting_Distribute) { + p := proto.Clone(in).(*LocalityLoadBalancerSetting_Distribute) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalityLoadBalancerSetting_Distribute. Required by controller-gen. +func (in *LocalityLoadBalancerSetting_Distribute) DeepCopy() *LocalityLoadBalancerSetting_Distribute { + if in == nil { + return nil + } + out := new(LocalityLoadBalancerSetting_Distribute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using LocalityLoadBalancerSetting_Failover within kubernetes types, where deepcopy-gen is used. +func (in *LocalityLoadBalancerSetting_Failover) DeepCopyInto(out *LocalityLoadBalancerSetting_Failover) { + p := proto.Clone(in).(*LocalityLoadBalancerSetting_Failover) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocalityLoadBalancerSetting_Failover. Required by controller-gen. +func (in *LocalityLoadBalancerSetting_Failover) DeepCopy() *LocalityLoadBalancerSetting_Failover { + if in == nil { + return nil + } + out := new(LocalityLoadBalancerSetting_Failover) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/istio.io/api/networking/v1alpha3/destination_rule_json.gen.go b/vendor/istio.io/api/networking/v1alpha3/destination_rule_json.gen.go new file mode 100644 index 0000000000..3401203285 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/destination_rule_json.gen.go @@ -0,0 +1,341 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/destination_rule.proto + +// `DestinationRule` defines policies that apply to traffic intended for a +// service after routing has occurred. These rules specify configuration +// for load balancing, connection pool size from the sidecar, and outlier +// detection settings to detect and evict unhealthy hosts from the load +// balancing pool. For example, a simple load balancing policy for the +// ratings service would look as follows: +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// ``` +// {{}} +// {{}} +// +// Version specific policies can be specified by defining a named +// `subset` and overriding the settings specified at the service level. The +// following rule uses a round robin load balancing policy for all traffic +// going to a subset named testversion that is composed of endpoints (e.g., +// pods) with labels (version:v3). +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// subsets: +// - name: testversion +// labels: +// version: v3 +// trafficPolicy: +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: +// loadBalancer: +// simple: LEAST_CONN +// subsets: +// - name: testversion +// labels: +// version: v3 +// trafficPolicy: +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// {{}} +// +// **Note:** Policies specified for subsets will not take effect until +// a route rule explicitly sends traffic to this subset. +// +// Traffic policies can be customized to specific ports as well. The +// following rule uses the least connection load balancing policy for all +// traffic to port 80, while uses a round robin load balancing setting for +// traffic to the port 9080. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings-port +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: # Apply to all ports +// portLevelSettings: +// - port: +// number: 80 +// loadBalancer: +// simple: LEAST_CONN +// - port: +// number: 9080 +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: bookinfo-ratings-port +// spec: +// host: ratings.prod.svc.cluster.local +// trafficPolicy: # Apply to all ports +// portLevelSettings: +// - port: +// number: 80 +// loadBalancer: +// simple: LEAST_CONN +// - port: +// number: 9080 +// loadBalancer: +// simple: ROUND_ROBIN +// ``` +// {{}} +// {{}} +// + +package v1alpha3 + +import ( + bytes "bytes" + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// MarshalJSON is a custom marshaler for DestinationRule +func (this *DestinationRule) MarshalJSON() ([]byte, error) { + str, err := DestinationRuleMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for DestinationRule +func (this *DestinationRule) UnmarshalJSON(b []byte) error { + return DestinationRuleUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for TrafficPolicy +func (this *TrafficPolicy) MarshalJSON() ([]byte, error) { + str, err := DestinationRuleMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for TrafficPolicy +func (this *TrafficPolicy) UnmarshalJSON(b []byte) error { + return DestinationRuleUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for TrafficPolicy_PortTrafficPolicy +func (this *TrafficPolicy_PortTrafficPolicy) MarshalJSON() ([]byte, error) { + str, err := DestinationRuleMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for TrafficPolicy_PortTrafficPolicy +func (this *TrafficPolicy_PortTrafficPolicy) UnmarshalJSON(b []byte) error { + return DestinationRuleUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for Subset +func (this *Subset) MarshalJSON() ([]byte, error) { + str, err := DestinationRuleMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for Subset +func (this *Subset) UnmarshalJSON(b []byte) error { + return DestinationRuleUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for LoadBalancerSettings +func (this *LoadBalancerSettings) MarshalJSON() ([]byte, error) { + str, err := DestinationRuleMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for LoadBalancerSettings +func (this *LoadBalancerSettings) UnmarshalJSON(b []byte) error { + return DestinationRuleUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for LoadBalancerSettings_ConsistentHashLB +func (this *LoadBalancerSettings_ConsistentHashLB) MarshalJSON() ([]byte, error) { + str, err := DestinationRuleMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for LoadBalancerSettings_ConsistentHashLB +func (this *LoadBalancerSettings_ConsistentHashLB) UnmarshalJSON(b []byte) error { + return DestinationRuleUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for LoadBalancerSettings_ConsistentHashLB_HTTPCookie +func (this *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) MarshalJSON() ([]byte, error) { + str, err := DestinationRuleMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for LoadBalancerSettings_ConsistentHashLB_HTTPCookie +func (this *LoadBalancerSettings_ConsistentHashLB_HTTPCookie) UnmarshalJSON(b []byte) error { + return DestinationRuleUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for ConnectionPoolSettings +func (this *ConnectionPoolSettings) MarshalJSON() ([]byte, error) { + str, err := DestinationRuleMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for ConnectionPoolSettings +func (this *ConnectionPoolSettings) UnmarshalJSON(b []byte) error { + return DestinationRuleUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for ConnectionPoolSettings_TCPSettings +func (this *ConnectionPoolSettings_TCPSettings) MarshalJSON() ([]byte, error) { + str, err := DestinationRuleMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for ConnectionPoolSettings_TCPSettings +func (this *ConnectionPoolSettings_TCPSettings) UnmarshalJSON(b []byte) error { + return DestinationRuleUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for ConnectionPoolSettings_TCPSettings_TcpKeepalive +func (this *ConnectionPoolSettings_TCPSettings_TcpKeepalive) MarshalJSON() ([]byte, error) { + str, err := DestinationRuleMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for ConnectionPoolSettings_TCPSettings_TcpKeepalive +func (this *ConnectionPoolSettings_TCPSettings_TcpKeepalive) UnmarshalJSON(b []byte) error { + return DestinationRuleUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for ConnectionPoolSettings_HTTPSettings +func (this *ConnectionPoolSettings_HTTPSettings) MarshalJSON() ([]byte, error) { + str, err := DestinationRuleMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for ConnectionPoolSettings_HTTPSettings +func (this *ConnectionPoolSettings_HTTPSettings) UnmarshalJSON(b []byte) error { + return DestinationRuleUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for OutlierDetection +func (this *OutlierDetection) MarshalJSON() ([]byte, error) { + str, err := DestinationRuleMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for OutlierDetection +func (this *OutlierDetection) UnmarshalJSON(b []byte) error { + return DestinationRuleUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for ClientTLSSettings +func (this *ClientTLSSettings) MarshalJSON() ([]byte, error) { + str, err := DestinationRuleMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for ClientTLSSettings +func (this *ClientTLSSettings) UnmarshalJSON(b []byte) error { + return DestinationRuleUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for LocalityLoadBalancerSetting +func (this *LocalityLoadBalancerSetting) MarshalJSON() ([]byte, error) { + str, err := DestinationRuleMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for LocalityLoadBalancerSetting +func (this *LocalityLoadBalancerSetting) UnmarshalJSON(b []byte) error { + return DestinationRuleUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for LocalityLoadBalancerSetting_Distribute +func (this *LocalityLoadBalancerSetting_Distribute) MarshalJSON() ([]byte, error) { + str, err := DestinationRuleMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for LocalityLoadBalancerSetting_Distribute +func (this *LocalityLoadBalancerSetting_Distribute) UnmarshalJSON(b []byte) error { + return DestinationRuleUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for LocalityLoadBalancerSetting_Failover +func (this *LocalityLoadBalancerSetting_Failover) MarshalJSON() ([]byte, error) { + str, err := DestinationRuleMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for LocalityLoadBalancerSetting_Failover +func (this *LocalityLoadBalancerSetting_Failover) UnmarshalJSON(b []byte) error { + return DestinationRuleUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +var ( + DestinationRuleMarshaler = &github_com_gogo_protobuf_jsonpb.Marshaler{} + DestinationRuleUnmarshaler = &github_com_gogo_protobuf_jsonpb.Unmarshaler{} +) diff --git a/vendor/istio.io/api/networking/v1alpha3/envoy_filter.gen.json b/vendor/istio.io/api/networking/v1alpha3/envoy_filter.gen.json new file mode 100644 index 0000000000..0a6870b601 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/envoy_filter.gen.json @@ -0,0 +1,374 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Customizing Envoy configuration generated by Istio.", + "version": "v1alpha3" + }, + "components": { + "schemas": { + "istio.networking.v1alpha3.EnvoyFilter": { + "description": "EnvoyFilter provides a mechanism to customize the Envoy configuration generated by Istio Pilot.", + "type": "object", + "properties": { + "workloadSelector": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.WorkloadSelector" + }, + "configPatches": { + "description": "One or more patches with match conditions.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.EnvoyFilter.EnvoyConfigObjectPatch" + } + } + } + }, + "istio.networking.v1alpha3.WorkloadSelector": { + "description": "`WorkloadSelector` specifies the criteria used to determine if the `Gateway`, `Sidecar`, or `EnvoyFilter` or `ServiceEntry` configuration can be applied to a proxy. The matching criteria includes the metadata associated with a proxy, workload instance info such as labels attached to the pod/VM, or any other info that the proxy provides to Istio during the initial handshake. If multiple conditions are specified, all conditions need to match in order for the workload instance to be selected. Currently, only label based selection mechanism is supported.", + "type": "object", + "properties": { + "labels": { + "description": "One or more labels that indicate a specific set of pods/VMs on which the configuration should be applied. The scope of label search is restricted to the configuration namespace in which the the resource is present.", + "type": "object", + "additionalProperties": { + "type": "string", + "format": "string" + } + } + } + }, + "istio.networking.v1alpha3.EnvoyFilter.EnvoyConfigObjectPatch": { + "description": "Changes to be made to various envoy config objects.", + "type": "object", + "properties": { + "applyTo": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.EnvoyFilter.ApplyTo" + }, + "match": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.EnvoyFilter.EnvoyConfigObjectMatch" + }, + "patch": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.EnvoyFilter.Patch" + } + } + }, + "istio.networking.v1alpha3.EnvoyFilter.ApplyTo": { + "description": "ApplyTo specifies where in the Envoy configuration, the given patch should be applied.", + "type": "string", + "enum": [ + "INVALID", + "LISTENER", + "FILTER_CHAIN", + "NETWORK_FILTER", + "HTTP_FILTER", + "ROUTE_CONFIGURATION", + "VIRTUAL_HOST", + "HTTP_ROUTE", + "CLUSTER" + ] + }, + "istio.networking.v1alpha3.EnvoyFilter.PatchContext": { + "description": "PatchContext selects a class of configurations based on the traffic flow direction and workload type.", + "type": "string", + "enum": [ + "ANY", + "SIDECAR_INBOUND", + "SIDECAR_OUTBOUND", + "GATEWAY" + ] + }, + "istio.networking.v1alpha3.EnvoyFilter.ProxyMatch": { + "description": "One or more properties of the proxy to match on.", + "type": "object", + "properties": { + "proxyVersion": { + "description": "A regular expression in golang regex format (RE2) that can be used to select proxies using a specific version of istio proxy. The Istio version for a given proxy is obtained from the node metadata field ISTIO_VERSION supplied by the proxy when connecting to Pilot. This value is embedded as an environment variable (ISTIO_META_ISTIO_VERSION) in the Istio proxy docker image. Custom proxy implementations should provide this metadata variable to take advantage of the Istio version check option.", + "type": "string", + "format": "string" + }, + "metadata": { + "description": "Match on the node metadata supplied by a proxy when connecting to Istio Pilot. Note that while Envoy's node metadata is of type Struct, only string key-value pairs are processed by Pilot. All keys specified in the metadata must match with exact values. The match will fail if any of the specified keys are absent or the values fail to match.", + "type": "object", + "additionalProperties": { + "type": "string", + "format": "string" + } + } + } + }, + "istio.networking.v1alpha3.EnvoyFilter.ClusterMatch": { + "description": "Conditions specified in ClusterMatch must be met for the patch to be applied to a cluster.", + "type": "object", + "properties": { + "name": { + "description": "The exact name of the cluster to match. To match a specific cluster by name, such as the internally generated \"Passthrough\" cluster, leave all fields in clusterMatch empty, except the name.", + "type": "string", + "format": "string" + }, + "portNumber": { + "description": "The service port for which this cluster was generated. If omitted, applies to clusters for any port.", + "type": "integer" + }, + "service": { + "description": "The fully qualified service name for this cluster. If omitted, applies to clusters for any service. For services defined through service entries, the service name is same as the hosts defined in the service entry.", + "type": "string", + "format": "string" + }, + "subset": { + "description": "The subset associated with the service. If omitted, applies to clusters for any subset of a service.", + "type": "string", + "format": "string" + } + } + }, + "istio.networking.v1alpha3.EnvoyFilter.RouteConfigurationMatch": { + "description": "Conditions specified in RouteConfigurationMatch must be met for the patch to be applied to a route configuration object or a specific virtual host within the route configuration.", + "type": "object", + "properties": { + "name": { + "description": "Route configuration name to match on. Can be used to match a specific route configuration by name, such as the internally generated \"http_proxy\" route configuration for all sidecars.", + "type": "string", + "format": "string" + }, + "portNumber": { + "description": "The service port number or gateway server port number for which this route configuration was generated. If omitted, applies to route configurations for all ports.", + "type": "integer" + }, + "portName": { + "description": "Applicable only for GATEWAY context. The gateway server port name for which this route configuration was generated.", + "type": "string", + "format": "string" + }, + "gateway": { + "description": "The Istio gateway config's namespace/name for which this route configuration was generated. Applies only if the context is GATEWAY. Should be in the namespace/name format. Use this field in conjunction with the portNumber and portName to accurately select the Envoy route configuration for a specific HTTPS server within a gateway config object.", + "type": "string", + "format": "string" + }, + "vhost": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.EnvoyFilter.RouteConfigurationMatch.VirtualHostMatch" + } + } + }, + "istio.networking.v1alpha3.EnvoyFilter.RouteConfigurationMatch.VirtualHostMatch": { + "description": "Match a specific virtual host inside a route configuration.", + "type": "object", + "properties": { + "name": { + "description": "The VirtualHosts objects generated by Istio are named as host:port, where the host typically corresponds to the VirtualService's host field or the hostname of a service in the registry.", + "type": "string", + "format": "string" + }, + "route": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.EnvoyFilter.RouteConfigurationMatch.RouteMatch" + } + } + }, + "istio.networking.v1alpha3.EnvoyFilter.RouteConfigurationMatch.RouteMatch": { + "description": "Match a specific route inside a virtual host in a route configuration.", + "type": "object", + "properties": { + "name": { + "description": "The Route objects generated by default are named as \"default\". Route objects generated using a virtual service will carry the name used in the virtual service's HTTP routes.", + "type": "string", + "format": "string" + }, + "action": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.EnvoyFilter.RouteConfigurationMatch.RouteMatch.Action" + } + } + }, + "istio.networking.v1alpha3.EnvoyFilter.RouteConfigurationMatch.RouteMatch.Action": { + "description": "Action refers to the route action taken by Envoy when a http route matches.", + "type": "string", + "enum": [ + "ANY", + "ROUTE", + "REDIRECT", + "DIRECT_RESPONSE" + ] + }, + "istio.networking.v1alpha3.EnvoyFilter.ListenerMatch": { + "description": "Conditions specified in a listener match must be met for the patch to be applied to a specific listener across all filter chains, or a specific filter chain inside the listener.", + "type": "object", + "properties": { + "name": { + "description": "Match a specific listener by its name. The listeners generated by Pilot are typically named as IP:Port.", + "type": "string", + "format": "string" + }, + "portNumber": { + "description": "The service port/gateway port to which traffic is being sent/received. If not specified, matches all listeners. Even though inbound listeners are generated for the instance/pod ports, only service ports should be used to match listeners.", + "type": "integer" + }, + "portName": { + "description": "Instead of using specific port numbers, a set of ports matching a given service's port name can be selected. Matching is case insensitive. Not implemented. $hide_from_docs", + "type": "string", + "format": "string" + }, + "filterChain": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.EnvoyFilter.ListenerMatch.FilterChainMatch" + } + } + }, + "istio.networking.v1alpha3.EnvoyFilter.ListenerMatch.FilterChainMatch": { + "description": "For listeners with multiple filter chains (e.g., inbound listeners on sidecars with permissive mTLS, gateway listeners with multiple SNI matches), the filter chain match can be used to select a specific filter chain to patch.", + "type": "object", + "properties": { + "name": { + "description": "The name assigned to the filter chain.", + "type": "string", + "format": "string" + }, + "sni": { + "description": "The SNI value used by a filter chain's match condition. This condition will evaluate to false if the filter chain has no sni match.", + "type": "string", + "format": "string" + }, + "transportProtocol": { + "description": "Applies only to SIDECAR_INBOUND context. If non-empty, a transport protocol to consider when determining a filter chain match. This value will be compared against the transport protocol of a new connection, when it's detected by the tls_inspector listener filter.", + "type": "string", + "format": "string" + }, + "applicationProtocols": { + "description": "Applies only to sidecars. If non-empty, a comma separated set of application protocols to consider when determining a filter chain match. This value will be compared against the application protocols of a new connection, when it's detected by one of the listener filters such as the http_inspector.", + "type": "string", + "format": "string" + }, + "filter": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.EnvoyFilter.ListenerMatch.FilterMatch" + } + } + }, + "istio.networking.v1alpha3.EnvoyFilter.ListenerMatch.FilterMatch": { + "description": "Conditions to match a specific filter within a filter chain.", + "type": "object", + "properties": { + "name": { + "description": "The filter name to match on.", + "type": "string", + "format": "string" + }, + "subFilter": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.EnvoyFilter.ListenerMatch.SubFilterMatch" + } + } + }, + "istio.networking.v1alpha3.EnvoyFilter.ListenerMatch.SubFilterMatch": { + "description": "Conditions to match a specific filter within another filter. This field is typically useful to match a HTTP filter inside the envoy.http_connection_manager network filter. This could also be applicable for thrift filters.", + "type": "object", + "properties": { + "name": { + "description": "The filter name to match on.", + "type": "string", + "format": "string" + } + } + }, + "istio.networking.v1alpha3.EnvoyFilter.Patch": { + "description": "Patch specifies how the selected object should be modified.", + "type": "object", + "properties": { + "operation": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.EnvoyFilter.Patch.Operation" + }, + "value": { + "description": "The JSON config of the object being patched. This will be merged using json merge semantics with the existing proto in the path.", + "type": "object" + } + } + }, + "istio.networking.v1alpha3.EnvoyFilter.Patch.Operation": { + "description": "Operation denotes how the patch should be applied to the selected configuration.", + "type": "string", + "enum": [ + "INVALID", + "MERGE", + "ADD", + "REMOVE", + "INSERT_BEFORE", + "INSERT_AFTER", + "INSERT_FIRST" + ] + }, + "istio.networking.v1alpha3.EnvoyFilter.EnvoyConfigObjectMatch": { + "description": "One or more match conditions to be met before a patch is applied to the generated configuration for a given proxy.", + "type": "object", + "properties": { + "context": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.EnvoyFilter.PatchContext" + }, + "proxy": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.EnvoyFilter.ProxyMatch" + } + }, + "oneOf": [ + { + "not": { + "anyOf": [ + { + "required": [ + "listener" + ], + "properties": { + "listener": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.EnvoyFilter.ListenerMatch" + } + } + }, + { + "required": [ + "routeConfiguration" + ], + "properties": { + "routeConfiguration": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.EnvoyFilter.RouteConfigurationMatch" + } + } + }, + { + "required": [ + "cluster" + ], + "properties": { + "cluster": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.EnvoyFilter.ClusterMatch" + } + } + } + ] + } + }, + { + "required": [ + "listener" + ], + "properties": { + "listener": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.EnvoyFilter.ListenerMatch" + } + } + }, + { + "required": [ + "routeConfiguration" + ], + "properties": { + "routeConfiguration": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.EnvoyFilter.RouteConfigurationMatch" + } + } + }, + { + "required": [ + "cluster" + ], + "properties": { + "cluster": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.EnvoyFilter.ClusterMatch" + } + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/vendor/istio.io/api/networking/v1alpha3/envoy_filter.pb.go b/vendor/istio.io/api/networking/v1alpha3/envoy_filter.pb.go new file mode 100644 index 0000000000..7596b5fe97 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/envoy_filter.pb.go @@ -0,0 +1,4762 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/envoy_filter.proto + +// `EnvoyFilter` provides a mechanism to customize the Envoy +// configuration generated by Istio Pilot. Use EnvoyFilter to modify +// values for certain fields, add specific filters, or even add +// entirely new listeners, clusters, etc. This feature must be used +// with care, as incorrect configurations could potentially +// destabilize the entire mesh. Unlike other Istio networking objects, +// EnvoyFilters are additively applied. Any number of EnvoyFilters can +// exist for a given workload in a specific namespace. The order of +// application of these EnvoyFilters is as follows: all EnvoyFilters +// in the config [root +// namespace](https://istio.io/docs/reference/config/istio.mesh.v1alpha1/#MeshConfig), +// followed by all matching EnvoyFilters in the workload's namespace. +// +// **NOTE 1**: Some aspects of this API is deeply tied to the internal +// implementation in Istio networking subsystem as well as Envoy's XDS +// API. While the EnvoyFilter API by itself will maintain backward +// compatibility, any envoy configuration provided through this +// mechanism should be carefully monitored across Istio proxy version +// upgrades, to ensure that deprecated fields are removed and replaced +// appropriately. +// +// **NOTE 2**: When multiple EnvoyFilters are bound to the same +// workload in a given namespace, all patches will be processed +// sequentially in order of creation time. The behavior is undefined +// if multiple EnvoyFilter configurations conflict with each other. +// +// **NOTE 3**: To apply an EnvoyFilter resource to all workloads +// (sidecars and gateways) in the system, define the resource in the +// config [root +// namespace](https://istio.io/docs/reference/config/istio.mesh.v1alpha1/#MeshConfig), +// without a workloadSelector. +// +// The example below declares a global default EnvoyFilter resource in +// the root namespace called `istio-config`, that adds a custom +// protocol filter on all sidecars in the system, for outbound port +// 9307. The filter should be added before the terminating tcp_proxy +// filter to take effect. In addition, it sets a 30s idle timeout for +// all HTTP connections in both gateays and sidecars. +// +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: EnvoyFilter +// metadata: +// name: custom-protocol +// namespace: istio-config # as defined in meshConfig resource. +// spec: +// configPatches: +// - applyTo: NETWORK_FILTER +// match: +// context: SIDECAR_OUTBOUND # will match outbound listeners in all sidecars +// listener: +// portNumber: 9307 +// filterChain: +// filter: +// name: "envoy.tcp_proxy" +// patch: +// operation: INSERT_BEFORE +// value: +// # This is the full filter config including the name and config or typed_config section. +// name: "envoy.config.filter.network.custom_protocol" +// config: +// ... +// - applyTo: NETWORK_FILTER # http connection manager is a filter in Envoy +// match: +// # context omitted so that this applies to both sidecars and gateways +// listener: +// filterChain: +// filter: +// name: "envoy.http_connection_manager" +// patch: +// operation: MERGE +// value: +// name: "envoy.http_connection_manager" +// typed_config: +// "@type": "type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager" +// common_http_protocol_options: +// idle_timeout: 30s +//``` +// +// The following example enables Envoy's Lua filter for all inbound +// HTTP calls arriving at service port 8080 of the reviews service pod +// with labels "app: reviews", in the bookinfo namespace. The lua +// filter calls out to an external service internal.org.net:8888 that +// requires a special cluster definition in envoy. The cluster is also +// added to the sidecar as part of this configuration. +// +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: EnvoyFilter +// metadata: +// name: reviews-lua +// namespace: bookinfo +// spec: +// workloadSelector: +// labels: +// app: reviews +// configPatches: +// # The first patch adds the lua filter to the listener/http connection manager +// - applyTo: HTTP_FILTER +// match: +// context: SIDECAR_INBOUND +// listener: +// portNumber: 8080 +// filterChain: +// filter: +// name: "envoy.http_connection_manager" +// subFilter: +// name: "envoy.router" +// patch: +// operation: INSERT_BEFORE +// value: # lua filter specification +// name: envoy.lua +// typed_config: +// "@type": "type.googleapis.com/envoy.config.filter.http.lua.v2.Lua" +// inlineCode: | +// function envoy_on_request(request_handle) +// -- Make an HTTP call to an upstream host with the following headers, body, and timeout. +// local headers, body = request_handle:httpCall( +// "lua_cluster", +// { +// [":method"] = "POST", +// [":path"] = "/acl", +// [":authority"] = "internal.org.net" +// }, +// "authorize call", +// 5000) +// end +// # The second patch adds the cluster that is referenced by the lua code +// # cds match is omitted as a new cluster is being added +// - applyTo: CLUSTER +// match: +// context: SIDECAR_OUTBOUND +// patch: +// operation: ADD +// value: # cluster specification +// name: "lua_cluster" +// type: STRICT_DNS +// connect_timeout: 0.5s +// lb_policy: ROUND_ROBIN +// hosts: +// - socket_address: +// protocol: TCP +// address: "internal.org.net" +// port_value: 8888 +// +// ``` +// +// The following example overwrites certain fields (HTTP idle timeout +// and X-Forward-For trusted hops) in the HTTP connection manager in a +// listener on the ingress gateway in istio-system namespace for the +// SNI host app.example.com: +// +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: EnvoyFilter +// metadata: +// name: hcm-tweaks +// namespace: istio-system +// spec: +// workloadSelector: +// labels: +// istio: ingress-gateway +// configPatches: +// - applyTo: NETWORK_FILTER # http connection manager is a filter in Envoy +// match: +// context: GATEWAY +// listener: +// filterChain: +// sni: app.example.com +// filter: +// name: "envoy.http_connection_manager" +// patch: +// operation: MERGE +// value: +// common_http_protocol_options: +// idle_timeout: 30s +// xff_num_trusted_hops: 5 +//``` +// + +package v1alpha3 + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + types "github.com/gogo/protobuf/types" + io "io" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// ApplyTo specifies where in the Envoy configuration, the given patch should be applied. +type EnvoyFilter_ApplyTo int32 + +const ( + EnvoyFilter_INVALID EnvoyFilter_ApplyTo = 0 + // Applies the patch to the listener. + EnvoyFilter_LISTENER EnvoyFilter_ApplyTo = 1 + // Applies the patch to the filter chain. + EnvoyFilter_FILTER_CHAIN EnvoyFilter_ApplyTo = 2 + // Applies the patch to the network filter chain, to modify an + // existing filter or add a new filter. + EnvoyFilter_NETWORK_FILTER EnvoyFilter_ApplyTo = 3 + // Applies the patch to the HTTP filter chain in the http + // connection manager, to modify an existing filter or add a new + // filter. + EnvoyFilter_HTTP_FILTER EnvoyFilter_ApplyTo = 4 + // Applies the patch to the Route configuration (rds output) + // inside a HTTP connection manager. This does not apply to the + // virtual host. Currently, only MERGE operation is allowed on the + // route configuration objects. + EnvoyFilter_ROUTE_CONFIGURATION EnvoyFilter_ApplyTo = 5 + // Applies the patch to a virtual host inside a route configuration. + EnvoyFilter_VIRTUAL_HOST EnvoyFilter_ApplyTo = 6 + // Applies the patch to a route object inside the matched virtual + // host in a route configuration. Currently, only MERGE operation + // is allowed on the route objects. + EnvoyFilter_HTTP_ROUTE EnvoyFilter_ApplyTo = 7 + // Applies the patch to a cluster in a CDS output. Also used to add new clusters. + EnvoyFilter_CLUSTER EnvoyFilter_ApplyTo = 8 +) + +var EnvoyFilter_ApplyTo_name = map[int32]string{ + 0: "INVALID", + 1: "LISTENER", + 2: "FILTER_CHAIN", + 3: "NETWORK_FILTER", + 4: "HTTP_FILTER", + 5: "ROUTE_CONFIGURATION", + 6: "VIRTUAL_HOST", + 7: "HTTP_ROUTE", + 8: "CLUSTER", +} + +var EnvoyFilter_ApplyTo_value = map[string]int32{ + "INVALID": 0, + "LISTENER": 1, + "FILTER_CHAIN": 2, + "NETWORK_FILTER": 3, + "HTTP_FILTER": 4, + "ROUTE_CONFIGURATION": 5, + "VIRTUAL_HOST": 6, + "HTTP_ROUTE": 7, + "CLUSTER": 8, +} + +func (x EnvoyFilter_ApplyTo) String() string { + return proto.EnumName(EnvoyFilter_ApplyTo_name, int32(x)) +} + +func (EnvoyFilter_ApplyTo) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_16d9b2922bd3e4a9, []int{0, 0} +} + +// PatchContext selects a class of configurations based on the +// traffic flow direction and workload type. +type EnvoyFilter_PatchContext int32 + +const ( + // All listeners/routes/clusters in both sidecars and gateways. + EnvoyFilter_ANY EnvoyFilter_PatchContext = 0 + // Inbound listener/route/cluster in sidecar. + EnvoyFilter_SIDECAR_INBOUND EnvoyFilter_PatchContext = 1 + // Outbound listener/route/cluster in sidecar. + EnvoyFilter_SIDECAR_OUTBOUND EnvoyFilter_PatchContext = 2 + // Gateway listener/route/cluster. + EnvoyFilter_GATEWAY EnvoyFilter_PatchContext = 3 +) + +var EnvoyFilter_PatchContext_name = map[int32]string{ + 0: "ANY", + 1: "SIDECAR_INBOUND", + 2: "SIDECAR_OUTBOUND", + 3: "GATEWAY", +} + +var EnvoyFilter_PatchContext_value = map[string]int32{ + "ANY": 0, + "SIDECAR_INBOUND": 1, + "SIDECAR_OUTBOUND": 2, + "GATEWAY": 3, +} + +func (x EnvoyFilter_PatchContext) String() string { + return proto.EnumName(EnvoyFilter_PatchContext_name, int32(x)) +} + +func (EnvoyFilter_PatchContext) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_16d9b2922bd3e4a9, []int{0, 1} +} + +// Action refers to the route action taken by Envoy when a http route matches. +type EnvoyFilter_RouteConfigurationMatch_RouteMatch_Action int32 + +const ( + // All three route actions + EnvoyFilter_RouteConfigurationMatch_RouteMatch_ANY EnvoyFilter_RouteConfigurationMatch_RouteMatch_Action = 0 + // Route traffic to a cluster / weighted clusters. + EnvoyFilter_RouteConfigurationMatch_RouteMatch_ROUTE EnvoyFilter_RouteConfigurationMatch_RouteMatch_Action = 1 + // Redirect request. + EnvoyFilter_RouteConfigurationMatch_RouteMatch_REDIRECT EnvoyFilter_RouteConfigurationMatch_RouteMatch_Action = 2 + // directly respond to a request with specific payload. + EnvoyFilter_RouteConfigurationMatch_RouteMatch_DIRECT_RESPONSE EnvoyFilter_RouteConfigurationMatch_RouteMatch_Action = 3 +) + +var EnvoyFilter_RouteConfigurationMatch_RouteMatch_Action_name = map[int32]string{ + 0: "ANY", + 1: "ROUTE", + 2: "REDIRECT", + 3: "DIRECT_RESPONSE", +} + +var EnvoyFilter_RouteConfigurationMatch_RouteMatch_Action_value = map[string]int32{ + "ANY": 0, + "ROUTE": 1, + "REDIRECT": 2, + "DIRECT_RESPONSE": 3, +} + +func (x EnvoyFilter_RouteConfigurationMatch_RouteMatch_Action) String() string { + return proto.EnumName(EnvoyFilter_RouteConfigurationMatch_RouteMatch_Action_name, int32(x)) +} + +func (EnvoyFilter_RouteConfigurationMatch_RouteMatch_Action) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_16d9b2922bd3e4a9, []int{0, 2, 0, 0} +} + +// Operation denotes how the patch should be applied to the selected +// configuration. +type EnvoyFilter_Patch_Operation int32 + +const ( + EnvoyFilter_Patch_INVALID EnvoyFilter_Patch_Operation = 0 + // Merge the provided config with the generated config using + // json merge semantics. + EnvoyFilter_Patch_MERGE EnvoyFilter_Patch_Operation = 1 + // Add the provided config to an existing list (of listeners, + // clusters, virtual hosts, network filters, or http + // filters). This operation will be ignored when applyTo is set + // to ROUTE_CONFIGURATION, or HTTP_ROUTE. + EnvoyFilter_Patch_ADD EnvoyFilter_Patch_Operation = 2 + // Remove the selected object from the list (of listeners, + // clusters, virtual hosts, network filters, or http + // filters). Does not require a value to be specified. This + // operation will be ignored when applyTo is set to + // ROUTE_CONFIGURATION, or HTTP_ROUTE. + EnvoyFilter_Patch_REMOVE EnvoyFilter_Patch_Operation = 3 + // Insert operation on an array of named objects. This operation + // is typically useful only in the context of filters, where the + // order of filters matter. For clusters and virtual hosts, + // order of the element in the array does not matter. Insert + // before the selected filter or sub filter. If no filter is + // selected, the specified filter will be inserted at the front + // of the list. + EnvoyFilter_Patch_INSERT_BEFORE EnvoyFilter_Patch_Operation = 4 + // Insert operation on an array of named objects. This operation + // is typically useful only in the context of filters, where the + // order of filters matter. For clusters and virtual hosts, + // order of the element in the array does not matter. Insert + // after the selected filter or sub filter. If no filter is + // selected, the specified filter will be inserted at the end + // of the list. + EnvoyFilter_Patch_INSERT_AFTER EnvoyFilter_Patch_Operation = 5 + // Insert operation on an array of named objects. This operation + // is typically useful only in the context of filters, where the + // order of filters matter. For clusters and virtual hosts, + // order of the element in the array does not matter. Insert + // first in the list based on the presence of selected filter or not. + // This is specifically useful when you want your filter first in the + // list based on a match condition specified in Match clause. + EnvoyFilter_Patch_INSERT_FIRST EnvoyFilter_Patch_Operation = 6 +) + +var EnvoyFilter_Patch_Operation_name = map[int32]string{ + 0: "INVALID", + 1: "MERGE", + 2: "ADD", + 3: "REMOVE", + 4: "INSERT_BEFORE", + 5: "INSERT_AFTER", + 6: "INSERT_FIRST", +} + +var EnvoyFilter_Patch_Operation_value = map[string]int32{ + "INVALID": 0, + "MERGE": 1, + "ADD": 2, + "REMOVE": 3, + "INSERT_BEFORE": 4, + "INSERT_AFTER": 5, + "INSERT_FIRST": 6, +} + +func (x EnvoyFilter_Patch_Operation) String() string { + return proto.EnumName(EnvoyFilter_Patch_Operation_name, int32(x)) +} + +func (EnvoyFilter_Patch_Operation) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_16d9b2922bd3e4a9, []int{0, 4, 0} +} + +// EnvoyFilter provides a mechanism to customize the Envoy configuration +// generated by Istio Pilot. +// +// +// +// +type EnvoyFilter struct { + // Criteria used to select the specific set of pods/VMs on which + // this patch configuration should be applied. If omitted, the set + // of patches in this configuration will be applied to all workload + // instances in the same namespace. If omitted, the EnvoyFilter + // patches will be applied to all workloads in the same + // namespace. If the EnvoyFilter is present in the config root + // namespace, it will be applied to all applicable workloads in any + // namespace. + WorkloadSelector *WorkloadSelector `protobuf:"bytes,3,opt,name=workload_selector,json=workloadSelector,proto3" json:"workload_selector,omitempty"` + // One or more patches with match conditions. + ConfigPatches []*EnvoyFilter_EnvoyConfigObjectPatch `protobuf:"bytes,4,rep,name=config_patches,json=configPatches,proto3" json:"config_patches,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EnvoyFilter) Reset() { *m = EnvoyFilter{} } +func (m *EnvoyFilter) String() string { return proto.CompactTextString(m) } +func (*EnvoyFilter) ProtoMessage() {} +func (*EnvoyFilter) Descriptor() ([]byte, []int) { + return fileDescriptor_16d9b2922bd3e4a9, []int{0} +} +func (m *EnvoyFilter) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EnvoyFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EnvoyFilter.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EnvoyFilter) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnvoyFilter.Merge(m, src) +} +func (m *EnvoyFilter) XXX_Size() int { + return m.Size() +} +func (m *EnvoyFilter) XXX_DiscardUnknown() { + xxx_messageInfo_EnvoyFilter.DiscardUnknown(m) +} + +var xxx_messageInfo_EnvoyFilter proto.InternalMessageInfo + +func (m *EnvoyFilter) GetWorkloadSelector() *WorkloadSelector { + if m != nil { + return m.WorkloadSelector + } + return nil +} + +func (m *EnvoyFilter) GetConfigPatches() []*EnvoyFilter_EnvoyConfigObjectPatch { + if m != nil { + return m.ConfigPatches + } + return nil +} + +// One or more properties of the proxy to match on. +type EnvoyFilter_ProxyMatch struct { + // A regular expression in golang regex format (RE2) that can be + // used to select proxies using a specific version of istio + // proxy. The Istio version for a given proxy is obtained from the + // node metadata field ISTIO_VERSION supplied by the proxy when + // connecting to Pilot. This value is embedded as an environment + // variable (ISTIO_META_ISTIO_VERSION) in the Istio proxy docker + // image. Custom proxy implementations should provide this metadata + // variable to take advantage of the Istio version check option. + ProxyVersion string `protobuf:"bytes,1,opt,name=proxy_version,json=proxyVersion,proto3" json:"proxy_version,omitempty"` + // Match on the node metadata supplied by a proxy when connecting + // to Istio Pilot. Note that while Envoy's node metadata is of + // type Struct, only string key-value pairs are processed by + // Pilot. All keys specified in the metadata must match with exact + // values. The match will fail if any of the specified keys are + // absent or the values fail to match. + Metadata map[string]string `protobuf:"bytes,2,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EnvoyFilter_ProxyMatch) Reset() { *m = EnvoyFilter_ProxyMatch{} } +func (m *EnvoyFilter_ProxyMatch) String() string { return proto.CompactTextString(m) } +func (*EnvoyFilter_ProxyMatch) ProtoMessage() {} +func (*EnvoyFilter_ProxyMatch) Descriptor() ([]byte, []int) { + return fileDescriptor_16d9b2922bd3e4a9, []int{0, 0} +} +func (m *EnvoyFilter_ProxyMatch) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EnvoyFilter_ProxyMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EnvoyFilter_ProxyMatch.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EnvoyFilter_ProxyMatch) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnvoyFilter_ProxyMatch.Merge(m, src) +} +func (m *EnvoyFilter_ProxyMatch) XXX_Size() int { + return m.Size() +} +func (m *EnvoyFilter_ProxyMatch) XXX_DiscardUnknown() { + xxx_messageInfo_EnvoyFilter_ProxyMatch.DiscardUnknown(m) +} + +var xxx_messageInfo_EnvoyFilter_ProxyMatch proto.InternalMessageInfo + +func (m *EnvoyFilter_ProxyMatch) GetProxyVersion() string { + if m != nil { + return m.ProxyVersion + } + return "" +} + +func (m *EnvoyFilter_ProxyMatch) GetMetadata() map[string]string { + if m != nil { + return m.Metadata + } + return nil +} + +// Conditions specified in ClusterMatch must be met for the patch +// to be applied to a cluster. +type EnvoyFilter_ClusterMatch struct { + // The service port for which this cluster was generated. If + // omitted, applies to clusters for any port. + PortNumber uint32 `protobuf:"varint,1,opt,name=port_number,json=portNumber,proto3" json:"port_number,omitempty"` + // The fully qualified service name for this cluster. If omitted, + // applies to clusters for any service. For services defined + // through service entries, the service name is same as the hosts + // defined in the service entry. + Service string `protobuf:"bytes,2,opt,name=service,proto3" json:"service,omitempty"` + // The subset associated with the service. If omitted, applies to + // clusters for any subset of a service. + Subset string `protobuf:"bytes,3,opt,name=subset,proto3" json:"subset,omitempty"` + // The exact name of the cluster to match. To match a specific + // cluster by name, such as the internally generated "Passthrough" + // cluster, leave all fields in clusterMatch empty, except the + // name. + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EnvoyFilter_ClusterMatch) Reset() { *m = EnvoyFilter_ClusterMatch{} } +func (m *EnvoyFilter_ClusterMatch) String() string { return proto.CompactTextString(m) } +func (*EnvoyFilter_ClusterMatch) ProtoMessage() {} +func (*EnvoyFilter_ClusterMatch) Descriptor() ([]byte, []int) { + return fileDescriptor_16d9b2922bd3e4a9, []int{0, 1} +} +func (m *EnvoyFilter_ClusterMatch) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EnvoyFilter_ClusterMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EnvoyFilter_ClusterMatch.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EnvoyFilter_ClusterMatch) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnvoyFilter_ClusterMatch.Merge(m, src) +} +func (m *EnvoyFilter_ClusterMatch) XXX_Size() int { + return m.Size() +} +func (m *EnvoyFilter_ClusterMatch) XXX_DiscardUnknown() { + xxx_messageInfo_EnvoyFilter_ClusterMatch.DiscardUnknown(m) +} + +var xxx_messageInfo_EnvoyFilter_ClusterMatch proto.InternalMessageInfo + +func (m *EnvoyFilter_ClusterMatch) GetPortNumber() uint32 { + if m != nil { + return m.PortNumber + } + return 0 +} + +func (m *EnvoyFilter_ClusterMatch) GetService() string { + if m != nil { + return m.Service + } + return "" +} + +func (m *EnvoyFilter_ClusterMatch) GetSubset() string { + if m != nil { + return m.Subset + } + return "" +} + +func (m *EnvoyFilter_ClusterMatch) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Conditions specified in RouteConfigurationMatch must be met for +// the patch to be applied to a route configuration object or a +// specific virtual host within the route configuration. +type EnvoyFilter_RouteConfigurationMatch struct { + // The service port number or gateway server port number for which + // this route configuration was generated. If omitted, applies to + // route configurations for all ports. + PortNumber uint32 `protobuf:"varint,1,opt,name=port_number,json=portNumber,proto3" json:"port_number,omitempty"` + // Applicable only for GATEWAY context. The gateway server port + // name for which this route configuration was generated. + PortName string `protobuf:"bytes,2,opt,name=port_name,json=portName,proto3" json:"port_name,omitempty"` + // The Istio gateway config's namespace/name for which this route + // configuration was generated. Applies only if the context is + // GATEWAY. Should be in the namespace/name format. Use this field + // in conjunction with the portNumber and portName to accurately + // select the Envoy route configuration for a specific HTTPS + // server within a gateway config object. + Gateway string `protobuf:"bytes,3,opt,name=gateway,proto3" json:"gateway,omitempty"` + // Match a specific virtual host in a route configuration and + // apply the patch to the virtual host. + Vhost *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch `protobuf:"bytes,4,opt,name=vhost,proto3" json:"vhost,omitempty"` + // Route configuration name to match on. Can be used to match a + // specific route configuration by name, such as the internally + // generated "http_proxy" route configuration for all sidecars. + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EnvoyFilter_RouteConfigurationMatch) Reset() { *m = EnvoyFilter_RouteConfigurationMatch{} } +func (m *EnvoyFilter_RouteConfigurationMatch) String() string { return proto.CompactTextString(m) } +func (*EnvoyFilter_RouteConfigurationMatch) ProtoMessage() {} +func (*EnvoyFilter_RouteConfigurationMatch) Descriptor() ([]byte, []int) { + return fileDescriptor_16d9b2922bd3e4a9, []int{0, 2} +} +func (m *EnvoyFilter_RouteConfigurationMatch) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EnvoyFilter_RouteConfigurationMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EnvoyFilter_RouteConfigurationMatch.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EnvoyFilter_RouteConfigurationMatch) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnvoyFilter_RouteConfigurationMatch.Merge(m, src) +} +func (m *EnvoyFilter_RouteConfigurationMatch) XXX_Size() int { + return m.Size() +} +func (m *EnvoyFilter_RouteConfigurationMatch) XXX_DiscardUnknown() { + xxx_messageInfo_EnvoyFilter_RouteConfigurationMatch.DiscardUnknown(m) +} + +var xxx_messageInfo_EnvoyFilter_RouteConfigurationMatch proto.InternalMessageInfo + +func (m *EnvoyFilter_RouteConfigurationMatch) GetPortNumber() uint32 { + if m != nil { + return m.PortNumber + } + return 0 +} + +func (m *EnvoyFilter_RouteConfigurationMatch) GetPortName() string { + if m != nil { + return m.PortName + } + return "" +} + +func (m *EnvoyFilter_RouteConfigurationMatch) GetGateway() string { + if m != nil { + return m.Gateway + } + return "" +} + +func (m *EnvoyFilter_RouteConfigurationMatch) GetVhost() *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch { + if m != nil { + return m.Vhost + } + return nil +} + +func (m *EnvoyFilter_RouteConfigurationMatch) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Match a specific route inside a virtual host in a route configuration. +type EnvoyFilter_RouteConfigurationMatch_RouteMatch struct { + // The Route objects generated by default are named as + // "default". Route objects generated using a virtual service + // will carry the name used in the virtual service's HTTP + // routes. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Match a route with specific action type. + Action EnvoyFilter_RouteConfigurationMatch_RouteMatch_Action `protobuf:"varint,2,opt,name=action,proto3,enum=istio.networking.v1alpha3.EnvoyFilter_RouteConfigurationMatch_RouteMatch_Action" json:"action,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EnvoyFilter_RouteConfigurationMatch_RouteMatch) Reset() { + *m = EnvoyFilter_RouteConfigurationMatch_RouteMatch{} +} +func (m *EnvoyFilter_RouteConfigurationMatch_RouteMatch) String() string { + return proto.CompactTextString(m) +} +func (*EnvoyFilter_RouteConfigurationMatch_RouteMatch) ProtoMessage() {} +func (*EnvoyFilter_RouteConfigurationMatch_RouteMatch) Descriptor() ([]byte, []int) { + return fileDescriptor_16d9b2922bd3e4a9, []int{0, 2, 0} +} +func (m *EnvoyFilter_RouteConfigurationMatch_RouteMatch) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EnvoyFilter_RouteConfigurationMatch_RouteMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EnvoyFilter_RouteConfigurationMatch_RouteMatch.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EnvoyFilter_RouteConfigurationMatch_RouteMatch) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnvoyFilter_RouteConfigurationMatch_RouteMatch.Merge(m, src) +} +func (m *EnvoyFilter_RouteConfigurationMatch_RouteMatch) XXX_Size() int { + return m.Size() +} +func (m *EnvoyFilter_RouteConfigurationMatch_RouteMatch) XXX_DiscardUnknown() { + xxx_messageInfo_EnvoyFilter_RouteConfigurationMatch_RouteMatch.DiscardUnknown(m) +} + +var xxx_messageInfo_EnvoyFilter_RouteConfigurationMatch_RouteMatch proto.InternalMessageInfo + +func (m *EnvoyFilter_RouteConfigurationMatch_RouteMatch) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *EnvoyFilter_RouteConfigurationMatch_RouteMatch) GetAction() EnvoyFilter_RouteConfigurationMatch_RouteMatch_Action { + if m != nil { + return m.Action + } + return EnvoyFilter_RouteConfigurationMatch_RouteMatch_ANY +} + +// Match a specific virtual host inside a route configuration. +type EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch struct { + // The VirtualHosts objects generated by Istio are named as + // host:port, where the host typically corresponds to the + // VirtualService's host field or the hostname of a service in the + // registry. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Match a specific route within the virtual host. + Route *EnvoyFilter_RouteConfigurationMatch_RouteMatch `protobuf:"bytes,2,opt,name=route,proto3" json:"route,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) Reset() { + *m = EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch{} +} +func (m *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) String() string { + return proto.CompactTextString(m) +} +func (*EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) ProtoMessage() {} +func (*EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) Descriptor() ([]byte, []int) { + return fileDescriptor_16d9b2922bd3e4a9, []int{0, 2, 1} +} +func (m *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch.Merge(m, src) +} +func (m *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) XXX_Size() int { + return m.Size() +} +func (m *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) XXX_DiscardUnknown() { + xxx_messageInfo_EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch.DiscardUnknown(m) +} + +var xxx_messageInfo_EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch proto.InternalMessageInfo + +func (m *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) GetRoute() *EnvoyFilter_RouteConfigurationMatch_RouteMatch { + if m != nil { + return m.Route + } + return nil +} + +// Conditions specified in a listener match must be met for the +// patch to be applied to a specific listener across all filter +// chains, or a specific filter chain inside the listener. +type EnvoyFilter_ListenerMatch struct { + // The service port/gateway port to which traffic is being + // sent/received. If not specified, matches all listeners. Even though + // inbound listeners are generated for the instance/pod ports, only + // service ports should be used to match listeners. + PortNumber uint32 `protobuf:"varint,1,opt,name=port_number,json=portNumber,proto3" json:"port_number,omitempty"` + // Instead of using specific port numbers, a set of ports matching + // a given service's port name can be selected. Matching is case + // insensitive. + // Not implemented. + // $hide_from_docs + PortName string `protobuf:"bytes,2,opt,name=port_name,json=portName,proto3" json:"port_name,omitempty"` + // Match a specific filter chain in a listener. If specified, the + // patch will be applied to the filter chain (and a specific + // filter if specified) and not to other filter chains in the + // listener. + FilterChain *EnvoyFilter_ListenerMatch_FilterChainMatch `protobuf:"bytes,3,opt,name=filter_chain,json=filterChain,proto3" json:"filter_chain,omitempty"` + // Match a specific listener by its name. The listeners generated + // by Pilot are typically named as IP:Port. + Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EnvoyFilter_ListenerMatch) Reset() { *m = EnvoyFilter_ListenerMatch{} } +func (m *EnvoyFilter_ListenerMatch) String() string { return proto.CompactTextString(m) } +func (*EnvoyFilter_ListenerMatch) ProtoMessage() {} +func (*EnvoyFilter_ListenerMatch) Descriptor() ([]byte, []int) { + return fileDescriptor_16d9b2922bd3e4a9, []int{0, 3} +} +func (m *EnvoyFilter_ListenerMatch) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EnvoyFilter_ListenerMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EnvoyFilter_ListenerMatch.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EnvoyFilter_ListenerMatch) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnvoyFilter_ListenerMatch.Merge(m, src) +} +func (m *EnvoyFilter_ListenerMatch) XXX_Size() int { + return m.Size() +} +func (m *EnvoyFilter_ListenerMatch) XXX_DiscardUnknown() { + xxx_messageInfo_EnvoyFilter_ListenerMatch.DiscardUnknown(m) +} + +var xxx_messageInfo_EnvoyFilter_ListenerMatch proto.InternalMessageInfo + +func (m *EnvoyFilter_ListenerMatch) GetPortNumber() uint32 { + if m != nil { + return m.PortNumber + } + return 0 +} + +func (m *EnvoyFilter_ListenerMatch) GetPortName() string { + if m != nil { + return m.PortName + } + return "" +} + +func (m *EnvoyFilter_ListenerMatch) GetFilterChain() *EnvoyFilter_ListenerMatch_FilterChainMatch { + if m != nil { + return m.FilterChain + } + return nil +} + +func (m *EnvoyFilter_ListenerMatch) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// For listeners with multiple filter chains (e.g., inbound +// listeners on sidecars with permissive mTLS, gateway listeners +// with multiple SNI matches), the filter chain match can be used +// to select a specific filter chain to patch. +type EnvoyFilter_ListenerMatch_FilterChainMatch struct { + // The name assigned to the filter chain. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The SNI value used by a filter chain's match condition. This + // condition will evaluate to false if the filter chain has no + // sni match. + Sni string `protobuf:"bytes,2,opt,name=sni,proto3" json:"sni,omitempty"` + // Applies only to SIDECAR_INBOUND context. If non-empty, a + // transport protocol to consider when determining a filter + // chain match. This value will be compared against the + // transport protocol of a new connection, when it's detected by + // the tls_inspector listener filter. + // + // Accepted values include: + // + // * `raw_buffer` - default, used when no transport protocol is detected. + // * `tls` - set when TLS protocol is detected by the TLS inspector. + TransportProtocol string `protobuf:"bytes,3,opt,name=transport_protocol,json=transportProtocol,proto3" json:"transport_protocol,omitempty"` + // Applies only to sidecars. If non-empty, a comma separated set + // of application protocols to consider when determining a + // filter chain match. This value will be compared against the + // application protocols of a new connection, when it's detected + // by one of the listener filters such as the http_inspector. + // + // Accepted values include: h2,http/1.1,http/1.0 + ApplicationProtocols string `protobuf:"bytes,4,opt,name=application_protocols,json=applicationProtocols,proto3" json:"application_protocols,omitempty"` + // The name of a specific filter to apply the patch to. Set this + // to envoy.http_connection_manager to add a filter or apply a + // patch to the HTTP connection manager. + Filter *EnvoyFilter_ListenerMatch_FilterMatch `protobuf:"bytes,5,opt,name=filter,proto3" json:"filter,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) Reset() { + *m = EnvoyFilter_ListenerMatch_FilterChainMatch{} +} +func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) String() string { + return proto.CompactTextString(m) +} +func (*EnvoyFilter_ListenerMatch_FilterChainMatch) ProtoMessage() {} +func (*EnvoyFilter_ListenerMatch_FilterChainMatch) Descriptor() ([]byte, []int) { + return fileDescriptor_16d9b2922bd3e4a9, []int{0, 3, 0} +} +func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EnvoyFilter_ListenerMatch_FilterChainMatch.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnvoyFilter_ListenerMatch_FilterChainMatch.Merge(m, src) +} +func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) XXX_Size() int { + return m.Size() +} +func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) XXX_DiscardUnknown() { + xxx_messageInfo_EnvoyFilter_ListenerMatch_FilterChainMatch.DiscardUnknown(m) +} + +var xxx_messageInfo_EnvoyFilter_ListenerMatch_FilterChainMatch proto.InternalMessageInfo + +func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) GetSni() string { + if m != nil { + return m.Sni + } + return "" +} + +func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) GetTransportProtocol() string { + if m != nil { + return m.TransportProtocol + } + return "" +} + +func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) GetApplicationProtocols() string { + if m != nil { + return m.ApplicationProtocols + } + return "" +} + +func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) GetFilter() *EnvoyFilter_ListenerMatch_FilterMatch { + if m != nil { + return m.Filter + } + return nil +} + +// Conditions to match a specific filter within a filter chain. +type EnvoyFilter_ListenerMatch_FilterMatch struct { + // The filter name to match on. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // The next level filter within this filter to match + // upon. Typically used for HTTP Connection Manager filters and + // Thrift filters. + SubFilter *EnvoyFilter_ListenerMatch_SubFilterMatch `protobuf:"bytes,2,opt,name=sub_filter,json=subFilter,proto3" json:"sub_filter,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EnvoyFilter_ListenerMatch_FilterMatch) Reset() { *m = EnvoyFilter_ListenerMatch_FilterMatch{} } +func (m *EnvoyFilter_ListenerMatch_FilterMatch) String() string { return proto.CompactTextString(m) } +func (*EnvoyFilter_ListenerMatch_FilterMatch) ProtoMessage() {} +func (*EnvoyFilter_ListenerMatch_FilterMatch) Descriptor() ([]byte, []int) { + return fileDescriptor_16d9b2922bd3e4a9, []int{0, 3, 1} +} +func (m *EnvoyFilter_ListenerMatch_FilterMatch) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EnvoyFilter_ListenerMatch_FilterMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EnvoyFilter_ListenerMatch_FilterMatch.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EnvoyFilter_ListenerMatch_FilterMatch) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnvoyFilter_ListenerMatch_FilterMatch.Merge(m, src) +} +func (m *EnvoyFilter_ListenerMatch_FilterMatch) XXX_Size() int { + return m.Size() +} +func (m *EnvoyFilter_ListenerMatch_FilterMatch) XXX_DiscardUnknown() { + xxx_messageInfo_EnvoyFilter_ListenerMatch_FilterMatch.DiscardUnknown(m) +} + +var xxx_messageInfo_EnvoyFilter_ListenerMatch_FilterMatch proto.InternalMessageInfo + +func (m *EnvoyFilter_ListenerMatch_FilterMatch) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *EnvoyFilter_ListenerMatch_FilterMatch) GetSubFilter() *EnvoyFilter_ListenerMatch_SubFilterMatch { + if m != nil { + return m.SubFilter + } + return nil +} + +// Conditions to match a specific filter within another +// filter. This field is typically useful to match a HTTP filter +// inside the envoy.http_connection_manager network filter. This +// could also be applicable for thrift filters. +type EnvoyFilter_ListenerMatch_SubFilterMatch struct { + // The filter name to match on. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EnvoyFilter_ListenerMatch_SubFilterMatch) Reset() { + *m = EnvoyFilter_ListenerMatch_SubFilterMatch{} +} +func (m *EnvoyFilter_ListenerMatch_SubFilterMatch) String() string { return proto.CompactTextString(m) } +func (*EnvoyFilter_ListenerMatch_SubFilterMatch) ProtoMessage() {} +func (*EnvoyFilter_ListenerMatch_SubFilterMatch) Descriptor() ([]byte, []int) { + return fileDescriptor_16d9b2922bd3e4a9, []int{0, 3, 2} +} +func (m *EnvoyFilter_ListenerMatch_SubFilterMatch) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EnvoyFilter_ListenerMatch_SubFilterMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EnvoyFilter_ListenerMatch_SubFilterMatch.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EnvoyFilter_ListenerMatch_SubFilterMatch) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnvoyFilter_ListenerMatch_SubFilterMatch.Merge(m, src) +} +func (m *EnvoyFilter_ListenerMatch_SubFilterMatch) XXX_Size() int { + return m.Size() +} +func (m *EnvoyFilter_ListenerMatch_SubFilterMatch) XXX_DiscardUnknown() { + xxx_messageInfo_EnvoyFilter_ListenerMatch_SubFilterMatch.DiscardUnknown(m) +} + +var xxx_messageInfo_EnvoyFilter_ListenerMatch_SubFilterMatch proto.InternalMessageInfo + +func (m *EnvoyFilter_ListenerMatch_SubFilterMatch) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// Patch specifies how the selected object should be modified. +type EnvoyFilter_Patch struct { + // Determines how the patch should be applied. + Operation EnvoyFilter_Patch_Operation `protobuf:"varint,1,opt,name=operation,proto3,enum=istio.networking.v1alpha3.EnvoyFilter_Patch_Operation" json:"operation,omitempty"` + // The JSON config of the object being patched. This will be merged using + // json merge semantics with the existing proto in the path. + Value *types.Struct `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EnvoyFilter_Patch) Reset() { *m = EnvoyFilter_Patch{} } +func (m *EnvoyFilter_Patch) String() string { return proto.CompactTextString(m) } +func (*EnvoyFilter_Patch) ProtoMessage() {} +func (*EnvoyFilter_Patch) Descriptor() ([]byte, []int) { + return fileDescriptor_16d9b2922bd3e4a9, []int{0, 4} +} +func (m *EnvoyFilter_Patch) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EnvoyFilter_Patch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EnvoyFilter_Patch.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EnvoyFilter_Patch) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnvoyFilter_Patch.Merge(m, src) +} +func (m *EnvoyFilter_Patch) XXX_Size() int { + return m.Size() +} +func (m *EnvoyFilter_Patch) XXX_DiscardUnknown() { + xxx_messageInfo_EnvoyFilter_Patch.DiscardUnknown(m) +} + +var xxx_messageInfo_EnvoyFilter_Patch proto.InternalMessageInfo + +func (m *EnvoyFilter_Patch) GetOperation() EnvoyFilter_Patch_Operation { + if m != nil { + return m.Operation + } + return EnvoyFilter_Patch_INVALID +} + +func (m *EnvoyFilter_Patch) GetValue() *types.Struct { + if m != nil { + return m.Value + } + return nil +} + +// One or more match conditions to be met before a patch is applied +// to the generated configuration for a given proxy. +type EnvoyFilter_EnvoyConfigObjectMatch struct { + // The specific config generation context to match on. Istio Pilot + // generates envoy configuration in the context of a gateway, + // inbound traffic to sidecar and outbound traffic from sidecar. + Context EnvoyFilter_PatchContext `protobuf:"varint,1,opt,name=context,proto3,enum=istio.networking.v1alpha3.EnvoyFilter_PatchContext" json:"context,omitempty"` + // Match on properties associated with a proxy. + Proxy *EnvoyFilter_ProxyMatch `protobuf:"bytes,2,opt,name=proxy,proto3" json:"proxy,omitempty"` + // Types that are valid to be assigned to ObjectTypes: + // *EnvoyFilter_EnvoyConfigObjectMatch_Listener + // *EnvoyFilter_EnvoyConfigObjectMatch_RouteConfiguration + // *EnvoyFilter_EnvoyConfigObjectMatch_Cluster + ObjectTypes isEnvoyFilter_EnvoyConfigObjectMatch_ObjectTypes `protobuf_oneof:"object_types"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EnvoyFilter_EnvoyConfigObjectMatch) Reset() { *m = EnvoyFilter_EnvoyConfigObjectMatch{} } +func (m *EnvoyFilter_EnvoyConfigObjectMatch) String() string { return proto.CompactTextString(m) } +func (*EnvoyFilter_EnvoyConfigObjectMatch) ProtoMessage() {} +func (*EnvoyFilter_EnvoyConfigObjectMatch) Descriptor() ([]byte, []int) { + return fileDescriptor_16d9b2922bd3e4a9, []int{0, 5} +} +func (m *EnvoyFilter_EnvoyConfigObjectMatch) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EnvoyFilter_EnvoyConfigObjectMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EnvoyFilter_EnvoyConfigObjectMatch.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EnvoyFilter_EnvoyConfigObjectMatch) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnvoyFilter_EnvoyConfigObjectMatch.Merge(m, src) +} +func (m *EnvoyFilter_EnvoyConfigObjectMatch) XXX_Size() int { + return m.Size() +} +func (m *EnvoyFilter_EnvoyConfigObjectMatch) XXX_DiscardUnknown() { + xxx_messageInfo_EnvoyFilter_EnvoyConfigObjectMatch.DiscardUnknown(m) +} + +var xxx_messageInfo_EnvoyFilter_EnvoyConfigObjectMatch proto.InternalMessageInfo + +type isEnvoyFilter_EnvoyConfigObjectMatch_ObjectTypes interface { + isEnvoyFilter_EnvoyConfigObjectMatch_ObjectTypes() + MarshalTo([]byte) (int, error) + Size() int +} + +type EnvoyFilter_EnvoyConfigObjectMatch_Listener struct { + Listener *EnvoyFilter_ListenerMatch `protobuf:"bytes,3,opt,name=listener,proto3,oneof"` +} +type EnvoyFilter_EnvoyConfigObjectMatch_RouteConfiguration struct { + RouteConfiguration *EnvoyFilter_RouteConfigurationMatch `protobuf:"bytes,4,opt,name=route_configuration,json=routeConfiguration,proto3,oneof"` +} +type EnvoyFilter_EnvoyConfigObjectMatch_Cluster struct { + Cluster *EnvoyFilter_ClusterMatch `protobuf:"bytes,5,opt,name=cluster,proto3,oneof"` +} + +func (*EnvoyFilter_EnvoyConfigObjectMatch_Listener) isEnvoyFilter_EnvoyConfigObjectMatch_ObjectTypes() { +} +func (*EnvoyFilter_EnvoyConfigObjectMatch_RouteConfiguration) isEnvoyFilter_EnvoyConfigObjectMatch_ObjectTypes() { +} +func (*EnvoyFilter_EnvoyConfigObjectMatch_Cluster) isEnvoyFilter_EnvoyConfigObjectMatch_ObjectTypes() { +} + +func (m *EnvoyFilter_EnvoyConfigObjectMatch) GetObjectTypes() isEnvoyFilter_EnvoyConfigObjectMatch_ObjectTypes { + if m != nil { + return m.ObjectTypes + } + return nil +} + +func (m *EnvoyFilter_EnvoyConfigObjectMatch) GetContext() EnvoyFilter_PatchContext { + if m != nil { + return m.Context + } + return EnvoyFilter_ANY +} + +func (m *EnvoyFilter_EnvoyConfigObjectMatch) GetProxy() *EnvoyFilter_ProxyMatch { + if m != nil { + return m.Proxy + } + return nil +} + +func (m *EnvoyFilter_EnvoyConfigObjectMatch) GetListener() *EnvoyFilter_ListenerMatch { + if x, ok := m.GetObjectTypes().(*EnvoyFilter_EnvoyConfigObjectMatch_Listener); ok { + return x.Listener + } + return nil +} + +func (m *EnvoyFilter_EnvoyConfigObjectMatch) GetRouteConfiguration() *EnvoyFilter_RouteConfigurationMatch { + if x, ok := m.GetObjectTypes().(*EnvoyFilter_EnvoyConfigObjectMatch_RouteConfiguration); ok { + return x.RouteConfiguration + } + return nil +} + +func (m *EnvoyFilter_EnvoyConfigObjectMatch) GetCluster() *EnvoyFilter_ClusterMatch { + if x, ok := m.GetObjectTypes().(*EnvoyFilter_EnvoyConfigObjectMatch_Cluster); ok { + return x.Cluster + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*EnvoyFilter_EnvoyConfigObjectMatch) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*EnvoyFilter_EnvoyConfigObjectMatch_Listener)(nil), + (*EnvoyFilter_EnvoyConfigObjectMatch_RouteConfiguration)(nil), + (*EnvoyFilter_EnvoyConfigObjectMatch_Cluster)(nil), + } +} + +// Changes to be made to various envoy config objects. +type EnvoyFilter_EnvoyConfigObjectPatch struct { + // Specifies where in the Envoy configuration, the patch should be + // applied. The match is expected to select the appropriate + // object based on applyTo. For example, an applyTo with + // HTTP_FILTER is expected to have a match condition on the + // listeners, with a network filter selection on + // envoy.http_connection_manager and a sub filter selection on the + // HTTP filter relative to which the insertion should be + // performed. Similarly, an applyTo on CLUSTER should have a match + // (if provided) on the cluster and not on a listener. + ApplyTo EnvoyFilter_ApplyTo `protobuf:"varint,1,opt,name=apply_to,json=applyTo,proto3,enum=istio.networking.v1alpha3.EnvoyFilter_ApplyTo" json:"apply_to,omitempty"` + // Match on listener/route configuration/cluster. + Match *EnvoyFilter_EnvoyConfigObjectMatch `protobuf:"bytes,2,opt,name=match,proto3" json:"match,omitempty"` + // The patch to apply along with the operation. + Patch *EnvoyFilter_Patch `protobuf:"bytes,3,opt,name=patch,proto3" json:"patch,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *EnvoyFilter_EnvoyConfigObjectPatch) Reset() { *m = EnvoyFilter_EnvoyConfigObjectPatch{} } +func (m *EnvoyFilter_EnvoyConfigObjectPatch) String() string { return proto.CompactTextString(m) } +func (*EnvoyFilter_EnvoyConfigObjectPatch) ProtoMessage() {} +func (*EnvoyFilter_EnvoyConfigObjectPatch) Descriptor() ([]byte, []int) { + return fileDescriptor_16d9b2922bd3e4a9, []int{0, 6} +} +func (m *EnvoyFilter_EnvoyConfigObjectPatch) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EnvoyFilter_EnvoyConfigObjectPatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EnvoyFilter_EnvoyConfigObjectPatch.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EnvoyFilter_EnvoyConfigObjectPatch) XXX_Merge(src proto.Message) { + xxx_messageInfo_EnvoyFilter_EnvoyConfigObjectPatch.Merge(m, src) +} +func (m *EnvoyFilter_EnvoyConfigObjectPatch) XXX_Size() int { + return m.Size() +} +func (m *EnvoyFilter_EnvoyConfigObjectPatch) XXX_DiscardUnknown() { + xxx_messageInfo_EnvoyFilter_EnvoyConfigObjectPatch.DiscardUnknown(m) +} + +var xxx_messageInfo_EnvoyFilter_EnvoyConfigObjectPatch proto.InternalMessageInfo + +func (m *EnvoyFilter_EnvoyConfigObjectPatch) GetApplyTo() EnvoyFilter_ApplyTo { + if m != nil { + return m.ApplyTo + } + return EnvoyFilter_INVALID +} + +func (m *EnvoyFilter_EnvoyConfigObjectPatch) GetMatch() *EnvoyFilter_EnvoyConfigObjectMatch { + if m != nil { + return m.Match + } + return nil +} + +func (m *EnvoyFilter_EnvoyConfigObjectPatch) GetPatch() *EnvoyFilter_Patch { + if m != nil { + return m.Patch + } + return nil +} + +func init() { + proto.RegisterEnum("istio.networking.v1alpha3.EnvoyFilter_ApplyTo", EnvoyFilter_ApplyTo_name, EnvoyFilter_ApplyTo_value) + proto.RegisterEnum("istio.networking.v1alpha3.EnvoyFilter_PatchContext", EnvoyFilter_PatchContext_name, EnvoyFilter_PatchContext_value) + proto.RegisterEnum("istio.networking.v1alpha3.EnvoyFilter_RouteConfigurationMatch_RouteMatch_Action", EnvoyFilter_RouteConfigurationMatch_RouteMatch_Action_name, EnvoyFilter_RouteConfigurationMatch_RouteMatch_Action_value) + proto.RegisterEnum("istio.networking.v1alpha3.EnvoyFilter_Patch_Operation", EnvoyFilter_Patch_Operation_name, EnvoyFilter_Patch_Operation_value) + proto.RegisterType((*EnvoyFilter)(nil), "istio.networking.v1alpha3.EnvoyFilter") + proto.RegisterType((*EnvoyFilter_ProxyMatch)(nil), "istio.networking.v1alpha3.EnvoyFilter.ProxyMatch") + proto.RegisterMapType((map[string]string)(nil), "istio.networking.v1alpha3.EnvoyFilter.ProxyMatch.MetadataEntry") + proto.RegisterType((*EnvoyFilter_ClusterMatch)(nil), "istio.networking.v1alpha3.EnvoyFilter.ClusterMatch") + proto.RegisterType((*EnvoyFilter_RouteConfigurationMatch)(nil), "istio.networking.v1alpha3.EnvoyFilter.RouteConfigurationMatch") + proto.RegisterType((*EnvoyFilter_RouteConfigurationMatch_RouteMatch)(nil), "istio.networking.v1alpha3.EnvoyFilter.RouteConfigurationMatch.RouteMatch") + proto.RegisterType((*EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch)(nil), "istio.networking.v1alpha3.EnvoyFilter.RouteConfigurationMatch.VirtualHostMatch") + proto.RegisterType((*EnvoyFilter_ListenerMatch)(nil), "istio.networking.v1alpha3.EnvoyFilter.ListenerMatch") + proto.RegisterType((*EnvoyFilter_ListenerMatch_FilterChainMatch)(nil), "istio.networking.v1alpha3.EnvoyFilter.ListenerMatch.FilterChainMatch") + proto.RegisterType((*EnvoyFilter_ListenerMatch_FilterMatch)(nil), "istio.networking.v1alpha3.EnvoyFilter.ListenerMatch.FilterMatch") + proto.RegisterType((*EnvoyFilter_ListenerMatch_SubFilterMatch)(nil), "istio.networking.v1alpha3.EnvoyFilter.ListenerMatch.SubFilterMatch") + proto.RegisterType((*EnvoyFilter_Patch)(nil), "istio.networking.v1alpha3.EnvoyFilter.Patch") + proto.RegisterType((*EnvoyFilter_EnvoyConfigObjectMatch)(nil), "istio.networking.v1alpha3.EnvoyFilter.EnvoyConfigObjectMatch") + proto.RegisterType((*EnvoyFilter_EnvoyConfigObjectPatch)(nil), "istio.networking.v1alpha3.EnvoyFilter.EnvoyConfigObjectPatch") +} + +func init() { + proto.RegisterFile("networking/v1alpha3/envoy_filter.proto", fileDescriptor_16d9b2922bd3e4a9) +} + +var fileDescriptor_16d9b2922bd3e4a9 = []byte{ + // 1258 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xdd, 0x72, 0xdb, 0x44, + 0x14, 0x8e, 0xfc, 0xef, 0x63, 0xc7, 0x51, 0x37, 0xa5, 0x31, 0x82, 0x69, 0x43, 0x60, 0x98, 0xce, + 0x40, 0x95, 0xa9, 0xc3, 0x30, 0x0c, 0x0c, 0x14, 0xc7, 0x51, 0x62, 0x95, 0xc4, 0xf2, 0xac, 0x95, + 0xb4, 0x85, 0x0b, 0x8d, 0xac, 0x6c, 0x62, 0x51, 0x45, 0x6b, 0xa4, 0xb5, 0x5b, 0x3f, 0x00, 0xc3, + 0x83, 0xf0, 0x2a, 0x5c, 0x30, 0x70, 0xc3, 0x25, 0x97, 0x9d, 0x3e, 0x02, 0x17, 0x5c, 0xc1, 0x0c, + 0xa3, 0xdd, 0x95, 0xed, 0xb4, 0x6e, 0xc7, 0x6d, 0xb9, 0xdb, 0xfd, 0x76, 0xcf, 0xe7, 0xef, 0x9c, + 0x3d, 0x3f, 0x32, 0x7c, 0x18, 0x12, 0xf6, 0x88, 0x46, 0x0f, 0xfd, 0xf0, 0x7c, 0x7b, 0x7c, 0xdb, + 0x0d, 0x86, 0x03, 0x77, 0x67, 0x9b, 0x84, 0x63, 0x3a, 0x71, 0xce, 0xfc, 0x80, 0x91, 0x48, 0x1f, + 0x46, 0x94, 0x51, 0xf4, 0xb6, 0x1f, 0x33, 0x9f, 0xea, 0xb3, 0xdb, 0x7a, 0x7a, 0x5b, 0xbb, 0x71, + 0x4e, 0xe9, 0x79, 0x40, 0xb6, 0xdd, 0xa1, 0xbf, 0x7d, 0xe6, 0x93, 0xe0, 0xd4, 0xe9, 0x93, 0x81, + 0x3b, 0xf6, 0xa9, 0xb4, 0xd5, 0xde, 0x95, 0x17, 0xf8, 0xae, 0x3f, 0x3a, 0xdb, 0x8e, 0x59, 0x34, + 0xf2, 0x98, 0x3c, 0x7d, 0x6f, 0x91, 0x82, 0xd8, 0x3f, 0x25, 0x9e, 0x2b, 0x09, 0xb6, 0x7e, 0xdb, + 0x80, 0x8a, 0x91, 0x68, 0xda, 0xe7, 0x92, 0xd0, 0x7d, 0xb8, 0x92, 0x58, 0x04, 0xd4, 0x3d, 0x75, + 0x62, 0x12, 0x10, 0x8f, 0xd1, 0xa8, 0x9e, 0xdd, 0x54, 0x6e, 0x56, 0x1a, 0x1f, 0xe9, 0x2f, 0x14, + 0xaa, 0xdf, 0x93, 0x36, 0x3d, 0x69, 0x82, 0xd5, 0x47, 0xcf, 0x20, 0xc8, 0x87, 0x9a, 0x47, 0xc3, + 0x33, 0xff, 0xdc, 0x19, 0xba, 0xcc, 0x1b, 0x90, 0xb8, 0x9e, 0xdb, 0xcc, 0xde, 0xac, 0x34, 0xbe, + 0x7c, 0x09, 0xed, 0x9c, 0x32, 0xb1, 0x6e, 0x71, 0x06, 0xab, 0xff, 0x3d, 0xf1, 0x58, 0x37, 0xa1, + 0xd9, 0xcd, 0x3e, 0x69, 0x66, 0xf0, 0xaa, 0x60, 0xee, 0x0a, 0x62, 0xed, 0x77, 0x05, 0xa0, 0x1b, + 0xd1, 0xc7, 0x93, 0xa3, 0x04, 0x40, 0xef, 0xc3, 0xea, 0x30, 0xd9, 0x39, 0x63, 0x12, 0xc5, 0x3e, + 0x0d, 0xeb, 0xca, 0xa6, 0x72, 0xb3, 0x8c, 0xab, 0x1c, 0x3c, 0x11, 0x18, 0xfa, 0x0e, 0x4a, 0x17, + 0x84, 0xb9, 0xa7, 0x2e, 0x73, 0xeb, 0x19, 0x2e, 0xec, 0xce, 0x92, 0xc2, 0x66, 0xbf, 0xa4, 0x1f, + 0x49, 0x06, 0x23, 0x64, 0xd1, 0x04, 0x4f, 0x09, 0xb5, 0x2f, 0x60, 0xf5, 0xd2, 0x11, 0x52, 0x21, + 0xfb, 0x90, 0x4c, 0xa4, 0x90, 0x64, 0x89, 0xae, 0x42, 0x7e, 0xec, 0x06, 0x23, 0x52, 0xcf, 0x70, + 0x4c, 0x6c, 0x3e, 0xcf, 0x7c, 0xa6, 0x68, 0x23, 0xa8, 0xb6, 0x82, 0x51, 0xcc, 0x48, 0x24, 0xdc, + 0xb9, 0x01, 0x95, 0x21, 0x8d, 0x98, 0x13, 0x8e, 0x2e, 0xfa, 0x24, 0xe2, 0x1c, 0xab, 0x18, 0x12, + 0xa8, 0xc3, 0x11, 0x54, 0x87, 0x62, 0x4c, 0xa2, 0xb1, 0xef, 0xa5, 0x64, 0xe9, 0x16, 0x5d, 0x83, + 0x42, 0x3c, 0xea, 0xc7, 0x84, 0xf1, 0x27, 0x2d, 0x63, 0xb9, 0x43, 0x08, 0x72, 0xa1, 0x7b, 0x41, + 0xea, 0x39, 0x8e, 0xf2, 0xb5, 0xf6, 0x4b, 0x0e, 0x36, 0x30, 0x1d, 0x31, 0x22, 0x62, 0x3e, 0x8a, + 0x5c, 0xe6, 0xd3, 0x70, 0x49, 0x09, 0xef, 0x40, 0x59, 0x5c, 0x48, 0x58, 0x85, 0x88, 0x12, 0x3f, + 0x76, 0x2f, 0x48, 0xa2, 0xef, 0xdc, 0x65, 0xe4, 0x91, 0x3b, 0x91, 0x32, 0xd2, 0x2d, 0x22, 0x90, + 0x1f, 0x0f, 0x68, 0xcc, 0xb8, 0x90, 0x4a, 0xc3, 0x5a, 0xf2, 0x05, 0x5e, 0x20, 0x53, 0x3f, 0xf1, + 0x23, 0x36, 0x72, 0x83, 0x36, 0x8d, 0x19, 0x07, 0xb0, 0x60, 0x9f, 0xba, 0x9b, 0x9f, 0x73, 0x37, + 0xc9, 0x19, 0xce, 0x23, 0x3c, 0x4c, 0xaf, 0x28, 0xb3, 0x2b, 0x68, 0x00, 0x05, 0xd7, 0x4b, 0xd8, + 0xb9, 0x47, 0xb5, 0x46, 0xf7, 0x0d, 0xe5, 0xcd, 0x7e, 0x4e, 0x6f, 0x72, 0x5e, 0x2c, 0xf9, 0xb7, + 0xee, 0x40, 0x41, 0x20, 0xa8, 0x08, 0xd9, 0x66, 0xe7, 0x81, 0xba, 0x82, 0xca, 0x90, 0xc7, 0xd6, + 0xb1, 0x6d, 0xa8, 0x0a, 0xaa, 0x42, 0x09, 0x1b, 0x7b, 0x26, 0x36, 0x5a, 0xb6, 0x9a, 0x41, 0xeb, + 0xb0, 0x26, 0xd6, 0x0e, 0x36, 0x7a, 0x5d, 0xab, 0xd3, 0x33, 0xd4, 0xac, 0xf6, 0x93, 0x02, 0xea, + 0xb3, 0xde, 0x2f, 0xf4, 0xc9, 0x81, 0x7c, 0x94, 0xc8, 0xe0, 0x2e, 0x55, 0x1a, 0xe6, 0xff, 0xe6, + 0x12, 0x16, 0xbc, 0xda, 0x5f, 0x39, 0x58, 0x3d, 0xf4, 0x63, 0x46, 0xc2, 0xa5, 0xf3, 0xf7, 0xa5, + 0xc9, 0x33, 0x80, 0xaa, 0xe8, 0x9e, 0x8e, 0x37, 0x70, 0xfd, 0x50, 0xf6, 0x26, 0x63, 0x49, 0xdd, + 0x97, 0x94, 0xe8, 0x02, 0x6c, 0x25, 0x3c, 0x42, 0x73, 0xe5, 0x6c, 0x86, 0x2c, 0x2c, 0x8a, 0xbf, + 0x15, 0x50, 0x9f, 0xb5, 0x5a, 0x18, 0x57, 0x15, 0xb2, 0x71, 0xe8, 0x4b, 0xf5, 0xc9, 0x12, 0xdd, + 0x02, 0xc4, 0x22, 0x37, 0x8c, 0xb9, 0x6b, 0xbc, 0xf9, 0x7a, 0x34, 0x90, 0x05, 0x70, 0x65, 0x7a, + 0xd2, 0x95, 0x07, 0x68, 0x07, 0xde, 0x72, 0x87, 0xc3, 0xc0, 0xf7, 0x78, 0x74, 0xa7, 0x06, 0xb1, + 0x94, 0x73, 0x75, 0xee, 0x30, 0xb5, 0x89, 0xd1, 0x7d, 0x28, 0x08, 0x0f, 0x78, 0x6a, 0x57, 0x1a, + 0x5f, 0xbf, 0x41, 0x58, 0x44, 0x44, 0x24, 0x9f, 0xf6, 0xa3, 0x02, 0x95, 0x39, 0x7c, 0xa1, 0xcf, + 0x7d, 0x80, 0x78, 0xd4, 0x97, 0xc3, 0x4d, 0x26, 0x54, 0xeb, 0xb5, 0x14, 0xf4, 0x46, 0xfd, 0x79, + 0x11, 0xe5, 0x38, 0xdd, 0x6b, 0x1f, 0x40, 0xed, 0xf2, 0xe1, 0x22, 0x25, 0xda, 0xbf, 0x0a, 0xe4, + 0xf9, 0x30, 0x40, 0x36, 0x94, 0xe9, 0x90, 0x88, 0x14, 0xe5, 0x57, 0x6a, 0x8d, 0x4f, 0x97, 0xed, + 0xeb, 0x5c, 0x8a, 0x95, 0x5a, 0xe3, 0x19, 0x11, 0xba, 0x35, 0xdf, 0xac, 0x2b, 0x8d, 0x0d, 0x5d, + 0x8c, 0x61, 0x3d, 0x1d, 0xc3, 0x7a, 0x8f, 0x8f, 0x61, 0xd9, 0xc5, 0xb7, 0x28, 0x94, 0xa7, 0x34, + 0xa8, 0x02, 0x45, 0xb3, 0x73, 0xd2, 0x3c, 0x34, 0xf7, 0x44, 0x55, 0x1f, 0x19, 0xf8, 0x20, 0xa9, + 0xea, 0xa4, 0xd2, 0xf7, 0xf6, 0xd4, 0x0c, 0x02, 0x28, 0x60, 0xe3, 0xc8, 0x3a, 0x31, 0xd4, 0x2c, + 0xba, 0x02, 0xab, 0x66, 0xa7, 0x67, 0x60, 0xdb, 0xd9, 0x35, 0xf6, 0x2d, 0x6c, 0xa8, 0x39, 0xa4, + 0x42, 0x55, 0x42, 0xcd, 0x7d, 0xdb, 0xc0, 0x6a, 0x7e, 0x0e, 0xd9, 0x37, 0x71, 0xcf, 0x56, 0x0b, + 0xda, 0x9f, 0x59, 0xb8, 0xf6, 0xdc, 0xbc, 0x14, 0xe1, 0x3a, 0x82, 0xa2, 0x47, 0x43, 0x46, 0x1e, + 0x33, 0x19, 0x8e, 0x9d, 0x57, 0x09, 0x47, 0x4b, 0x98, 0xe2, 0x94, 0x03, 0x1d, 0x40, 0x9e, 0x8f, + 0x51, 0x19, 0x89, 0xdb, 0xaf, 0x3c, 0x33, 0xb1, 0xb0, 0x47, 0x18, 0x4a, 0x81, 0xcc, 0x01, 0x59, + 0xd3, 0x9f, 0xbc, 0x4e, 0xea, 0xb4, 0x57, 0xf0, 0x94, 0x07, 0xfd, 0x00, 0xeb, 0xbc, 0x09, 0x39, + 0xde, 0x7c, 0xa7, 0x92, 0xc3, 0xe5, 0xab, 0x37, 0x6b, 0x75, 0xed, 0x15, 0x8c, 0xa2, 0xe7, 0x8e, + 0x90, 0x05, 0x45, 0x4f, 0x0c, 0x6b, 0x59, 0x82, 0xcb, 0x86, 0x77, 0x7e, 0xc4, 0xb7, 0x57, 0x70, + 0xca, 0xb2, 0x5b, 0x83, 0x2a, 0xe5, 0xcf, 0xe7, 0xb0, 0xc9, 0x90, 0xc4, 0xda, 0x3f, 0xca, 0x82, + 0xa7, 0x15, 0xb9, 0x6e, 0x42, 0x29, 0xe9, 0x0a, 0x13, 0x87, 0x51, 0xf9, 0xb6, 0xfa, 0x92, 0x3f, + 0xde, 0x4c, 0xcc, 0x6c, 0x8a, 0x8b, 0xae, 0x58, 0xa0, 0x1e, 0xe4, 0x2f, 0x12, 0x4e, 0xf9, 0xac, + 0xaf, 0xfd, 0x8d, 0x26, 0x9f, 0x98, 0x73, 0xa1, 0x5d, 0xc8, 0xf3, 0x4f, 0x3f, 0xf9, 0xbe, 0x1f, + 0xbf, 0x4a, 0xe2, 0x61, 0x61, 0xba, 0xf5, 0xb3, 0x02, 0x45, 0xa9, 0xf6, 0x72, 0x25, 0x55, 0xa1, + 0x74, 0x68, 0xf6, 0x6c, 0xa3, 0x63, 0x60, 0x55, 0x49, 0x4a, 0x62, 0xdf, 0x3c, 0xb4, 0x0d, 0xec, + 0xb4, 0xda, 0x4d, 0xb3, 0xa3, 0x66, 0x10, 0x82, 0x5a, 0xc7, 0xb0, 0xef, 0x59, 0xf8, 0x1b, 0x47, + 0x9c, 0xa8, 0x59, 0xb4, 0x06, 0x95, 0xb6, 0x6d, 0x77, 0x53, 0x20, 0x87, 0x36, 0x60, 0x9d, 0x0f, + 0x59, 0xa7, 0x65, 0x75, 0xf6, 0xcd, 0x83, 0x63, 0xdc, 0xb4, 0x4d, 0xab, 0x23, 0x4a, 0xec, 0xc4, + 0xc4, 0xf6, 0x71, 0xf3, 0xd0, 0x69, 0x5b, 0x49, 0x89, 0xa1, 0x1a, 0x00, 0xb7, 0x15, 0x43, 0xb9, + 0x98, 0x88, 0x69, 0x1d, 0x1e, 0xf7, 0x12, 0x9e, 0xd2, 0x96, 0x05, 0xd5, 0xf9, 0x72, 0x99, 0x4d, + 0xf1, 0x75, 0x58, 0xeb, 0x99, 0x7b, 0x46, 0xab, 0x89, 0x1d, 0xb3, 0xb3, 0x6b, 0x1d, 0x77, 0xf6, + 0x54, 0x05, 0x5d, 0x05, 0x35, 0x05, 0xad, 0x63, 0x5b, 0xa0, 0x99, 0x84, 0xf0, 0xa0, 0x69, 0x1b, + 0xf7, 0x9a, 0x0f, 0xd4, 0xec, 0xdd, 0x5c, 0x49, 0x51, 0x33, 0x77, 0x73, 0xa5, 0x8c, 0x9a, 0xc5, + 0x45, 0xd1, 0x60, 0x63, 0xbc, 0x36, 0xfd, 0x52, 0x0f, 0xdc, 0x3e, 0x09, 0xe2, 0x5d, 0xfd, 0xd7, + 0xa7, 0xd7, 0x95, 0x3f, 0x9e, 0x5e, 0x57, 0x9e, 0x3c, 0xbd, 0xae, 0x7c, 0xbb, 0x29, 0xc2, 0xeb, + 0x53, 0xfe, 0xf7, 0x61, 0xc1, 0x5f, 0x81, 0x7e, 0x81, 0xf7, 0xab, 0x9d, 0xff, 0x02, 0x00, 0x00, + 0xff, 0xff, 0x5f, 0x96, 0x10, 0xbc, 0xaa, 0x0c, 0x00, 0x00, +} + +func (m *EnvoyFilter) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EnvoyFilter) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.ConfigPatches) > 0 { + for iNdEx := len(m.ConfigPatches) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ConfigPatches[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if m.WorkloadSelector != nil { + { + size, err := m.WorkloadSelector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} + +func (m *EnvoyFilter_ProxyMatch) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EnvoyFilter_ProxyMatch) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_ProxyMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Metadata) > 0 { + for k := range m.Metadata { + v := m.Metadata[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintEnvoyFilter(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.ProxyVersion) > 0 { + i -= len(m.ProxyVersion) + copy(dAtA[i:], m.ProxyVersion) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.ProxyVersion))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EnvoyFilter_ClusterMatch) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EnvoyFilter_ClusterMatch) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_ClusterMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x22 + } + if len(m.Subset) > 0 { + i -= len(m.Subset) + copy(dAtA[i:], m.Subset) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Subset))) + i-- + dAtA[i] = 0x1a + } + if len(m.Service) > 0 { + i -= len(m.Service) + copy(dAtA[i:], m.Service) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Service))) + i-- + dAtA[i] = 0x12 + } + if m.PortNumber != 0 { + i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.PortNumber)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EnvoyFilter_RouteConfigurationMatch) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EnvoyFilter_RouteConfigurationMatch) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_RouteConfigurationMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x2a + } + if m.Vhost != nil { + { + size, err := m.Vhost.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Gateway) > 0 { + i -= len(m.Gateway) + copy(dAtA[i:], m.Gateway) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Gateway))) + i-- + dAtA[i] = 0x1a + } + if len(m.PortName) > 0 { + i -= len(m.PortName) + copy(dAtA[i:], m.PortName) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.PortName))) + i-- + dAtA[i] = 0x12 + } + if m.PortNumber != 0 { + i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.PortNumber)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EnvoyFilter_RouteConfigurationMatch_RouteMatch) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EnvoyFilter_RouteConfigurationMatch_RouteMatch) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_RouteConfigurationMatch_RouteMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Action != 0 { + i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.Action)) + i-- + dAtA[i] = 0x10 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Route != nil { + { + size, err := m.Route.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EnvoyFilter_ListenerMatch) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EnvoyFilter_ListenerMatch) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_ListenerMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x22 + } + if m.FilterChain != nil { + { + size, err := m.FilterChain.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.PortName) > 0 { + i -= len(m.PortName) + copy(dAtA[i:], m.PortName) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.PortName))) + i-- + dAtA[i] = 0x12 + } + if m.PortNumber != 0 { + i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.PortNumber)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Filter != nil { + { + size, err := m.Filter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.ApplicationProtocols) > 0 { + i -= len(m.ApplicationProtocols) + copy(dAtA[i:], m.ApplicationProtocols) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.ApplicationProtocols))) + i-- + dAtA[i] = 0x22 + } + if len(m.TransportProtocol) > 0 { + i -= len(m.TransportProtocol) + copy(dAtA[i:], m.TransportProtocol) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.TransportProtocol))) + i-- + dAtA[i] = 0x1a + } + if len(m.Sni) > 0 { + i -= len(m.Sni) + copy(dAtA[i:], m.Sni) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Sni))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EnvoyFilter_ListenerMatch_FilterMatch) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EnvoyFilter_ListenerMatch_FilterMatch) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_ListenerMatch_FilterMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.SubFilter != nil { + { + size, err := m.SubFilter.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EnvoyFilter_ListenerMatch_SubFilterMatch) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EnvoyFilter_ListenerMatch_SubFilterMatch) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_ListenerMatch_SubFilterMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintEnvoyFilter(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EnvoyFilter_Patch) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EnvoyFilter_Patch) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_Patch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Value != nil { + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Operation != 0 { + i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.Operation)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EnvoyFilter_EnvoyConfigObjectMatch) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EnvoyFilter_EnvoyConfigObjectMatch) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_EnvoyConfigObjectMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.ObjectTypes != nil { + { + size := m.ObjectTypes.Size() + i -= size + if _, err := m.ObjectTypes.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.Proxy != nil { + { + size, err := m.Proxy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Context != 0 { + i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.Context)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *EnvoyFilter_EnvoyConfigObjectMatch_Listener) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *EnvoyFilter_EnvoyConfigObjectMatch_Listener) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Listener != nil { + { + size, err := m.Listener.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *EnvoyFilter_EnvoyConfigObjectMatch_RouteConfiguration) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *EnvoyFilter_EnvoyConfigObjectMatch_RouteConfiguration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.RouteConfiguration != nil { + { + size, err := m.RouteConfiguration.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + return len(dAtA) - i, nil +} +func (m *EnvoyFilter_EnvoyConfigObjectMatch_Cluster) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *EnvoyFilter_EnvoyConfigObjectMatch_Cluster) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Cluster != nil { + { + size, err := m.Cluster.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + return len(dAtA) - i, nil +} +func (m *EnvoyFilter_EnvoyConfigObjectPatch) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EnvoyFilter_EnvoyConfigObjectPatch) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EnvoyFilter_EnvoyConfigObjectPatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Patch != nil { + { + size, err := m.Patch.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Match != nil { + { + size, err := m.Match.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEnvoyFilter(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ApplyTo != 0 { + i = encodeVarintEnvoyFilter(dAtA, i, uint64(m.ApplyTo)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintEnvoyFilter(dAtA []byte, offset int, v uint64) int { + offset -= sovEnvoyFilter(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EnvoyFilter) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.WorkloadSelector != nil { + l = m.WorkloadSelector.Size() + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + if len(m.ConfigPatches) > 0 { + for _, e := range m.ConfigPatches { + l = e.Size() + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *EnvoyFilter_ProxyMatch) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ProxyVersion) + if l > 0 { + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + if len(m.Metadata) > 0 { + for k, v := range m.Metadata { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovEnvoyFilter(uint64(len(k))) + 1 + len(v) + sovEnvoyFilter(uint64(len(v))) + n += mapEntrySize + 1 + sovEnvoyFilter(uint64(mapEntrySize)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *EnvoyFilter_ClusterMatch) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PortNumber != 0 { + n += 1 + sovEnvoyFilter(uint64(m.PortNumber)) + } + l = len(m.Service) + if l > 0 { + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + l = len(m.Subset) + if l > 0 { + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *EnvoyFilter_RouteConfigurationMatch) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PortNumber != 0 { + n += 1 + sovEnvoyFilter(uint64(m.PortNumber)) + } + l = len(m.PortName) + if l > 0 { + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + l = len(m.Gateway) + if l > 0 { + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + if m.Vhost != nil { + l = m.Vhost.Size() + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *EnvoyFilter_RouteConfigurationMatch_RouteMatch) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + if m.Action != 0 { + n += 1 + sovEnvoyFilter(uint64(m.Action)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + if m.Route != nil { + l = m.Route.Size() + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *EnvoyFilter_ListenerMatch) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.PortNumber != 0 { + n += 1 + sovEnvoyFilter(uint64(m.PortNumber)) + } + l = len(m.PortName) + if l > 0 { + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + if m.FilterChain != nil { + l = m.FilterChain.Size() + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + l = len(m.Sni) + if l > 0 { + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + l = len(m.TransportProtocol) + if l > 0 { + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + l = len(m.ApplicationProtocols) + if l > 0 { + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + if m.Filter != nil { + l = m.Filter.Size() + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *EnvoyFilter_ListenerMatch_FilterMatch) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + if m.SubFilter != nil { + l = m.SubFilter.Size() + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *EnvoyFilter_ListenerMatch_SubFilterMatch) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *EnvoyFilter_Patch) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Operation != 0 { + n += 1 + sovEnvoyFilter(uint64(m.Operation)) + } + if m.Value != nil { + l = m.Value.Size() + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *EnvoyFilter_EnvoyConfigObjectMatch) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Context != 0 { + n += 1 + sovEnvoyFilter(uint64(m.Context)) + } + if m.Proxy != nil { + l = m.Proxy.Size() + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + if m.ObjectTypes != nil { + n += m.ObjectTypes.Size() + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *EnvoyFilter_EnvoyConfigObjectMatch_Listener) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Listener != nil { + l = m.Listener.Size() + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + return n +} +func (m *EnvoyFilter_EnvoyConfigObjectMatch_RouteConfiguration) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RouteConfiguration != nil { + l = m.RouteConfiguration.Size() + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + return n +} +func (m *EnvoyFilter_EnvoyConfigObjectMatch_Cluster) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Cluster != nil { + l = m.Cluster.Size() + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + return n +} +func (m *EnvoyFilter_EnvoyConfigObjectPatch) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ApplyTo != 0 { + n += 1 + sovEnvoyFilter(uint64(m.ApplyTo)) + } + if m.Match != nil { + l = m.Match.Size() + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + if m.Patch != nil { + l = m.Patch.Size() + n += 1 + l + sovEnvoyFilter(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovEnvoyFilter(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEnvoyFilter(x uint64) (n int) { + return sovEnvoyFilter(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EnvoyFilter) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EnvoyFilter: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EnvoyFilter: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WorkloadSelector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.WorkloadSelector == nil { + m.WorkloadSelector = &WorkloadSelector{} + } + if err := m.WorkloadSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConfigPatches", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConfigPatches = append(m.ConfigPatches, &EnvoyFilter_EnvoyConfigObjectPatch{}) + if err := m.ConfigPatches[len(m.ConfigPatches)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEnvoyFilter(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EnvoyFilter_ProxyMatch) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ProxyMatch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProxyMatch: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProxyVersion", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProxyVersion = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthEnvoyFilter + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthEnvoyFilter + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipEnvoyFilter(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Metadata[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEnvoyFilter(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EnvoyFilter_ClusterMatch) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ClusterMatch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClusterMatch: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PortNumber", wireType) + } + m.PortNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PortNumber |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Service", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Service = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subset", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEnvoyFilter(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EnvoyFilter_RouteConfigurationMatch) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RouteConfigurationMatch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RouteConfigurationMatch: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PortNumber", wireType) + } + m.PortNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PortNumber |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gateway", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Gateway = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Vhost", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Vhost == nil { + m.Vhost = &EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch{} + } + if err := m.Vhost.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEnvoyFilter(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EnvoyFilter_RouteConfigurationMatch_RouteMatch) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RouteMatch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RouteMatch: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Action", wireType) + } + m.Action = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Action |= EnvoyFilter_RouteConfigurationMatch_RouteMatch_Action(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipEnvoyFilter(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VirtualHostMatch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VirtualHostMatch: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Route", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Route == nil { + m.Route = &EnvoyFilter_RouteConfigurationMatch_RouteMatch{} + } + if err := m.Route.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEnvoyFilter(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EnvoyFilter_ListenerMatch) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ListenerMatch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ListenerMatch: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field PortNumber", wireType) + } + m.PortNumber = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.PortNumber |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PortName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PortName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FilterChain", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.FilterChain == nil { + m.FilterChain = &EnvoyFilter_ListenerMatch_FilterChainMatch{} + } + if err := m.FilterChain.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEnvoyFilter(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EnvoyFilter_ListenerMatch_FilterChainMatch) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FilterChainMatch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FilterChainMatch: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sni", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sni = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TransportProtocol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.TransportProtocol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ApplicationProtocols", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ApplicationProtocols = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Filter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Filter == nil { + m.Filter = &EnvoyFilter_ListenerMatch_FilterMatch{} + } + if err := m.Filter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEnvoyFilter(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EnvoyFilter_ListenerMatch_FilterMatch) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FilterMatch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FilterMatch: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubFilter", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SubFilter == nil { + m.SubFilter = &EnvoyFilter_ListenerMatch_SubFilterMatch{} + } + if err := m.SubFilter.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEnvoyFilter(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EnvoyFilter_ListenerMatch_SubFilterMatch) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SubFilterMatch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SubFilterMatch: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEnvoyFilter(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EnvoyFilter_Patch) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Patch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Patch: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Operation", wireType) + } + m.Operation = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Operation |= EnvoyFilter_Patch_Operation(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Value == nil { + m.Value = &types.Struct{} + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEnvoyFilter(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EnvoyFilter_EnvoyConfigObjectMatch) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EnvoyConfigObjectMatch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EnvoyConfigObjectMatch: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType) + } + m.Context = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Context |= EnvoyFilter_PatchContext(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proxy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Proxy == nil { + m.Proxy = &EnvoyFilter_ProxyMatch{} + } + if err := m.Proxy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Listener", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &EnvoyFilter_ListenerMatch{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ObjectTypes = &EnvoyFilter_EnvoyConfigObjectMatch_Listener{v} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RouteConfiguration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &EnvoyFilter_RouteConfigurationMatch{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ObjectTypes = &EnvoyFilter_EnvoyConfigObjectMatch_RouteConfiguration{v} + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cluster", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &EnvoyFilter_ClusterMatch{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.ObjectTypes = &EnvoyFilter_EnvoyConfigObjectMatch_Cluster{v} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEnvoyFilter(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EnvoyFilter_EnvoyConfigObjectPatch) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EnvoyConfigObjectPatch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EnvoyConfigObjectPatch: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ApplyTo", wireType) + } + m.ApplyTo = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ApplyTo |= EnvoyFilter_ApplyTo(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Match", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Match == nil { + m.Match = &EnvoyFilter_EnvoyConfigObjectMatch{} + } + if err := m.Match.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Patch", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEnvoyFilter + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEnvoyFilter + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Patch == nil { + m.Patch = &EnvoyFilter_Patch{} + } + if err := m.Patch.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEnvoyFilter(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthEnvoyFilter + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEnvoyFilter(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthEnvoyFilter + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthEnvoyFilter + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEnvoyFilter + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipEnvoyFilter(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthEnvoyFilter + } + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthEnvoyFilter = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEnvoyFilter = fmt.Errorf("proto: integer overflow") +) diff --git a/vendor/istio.io/api/networking/v1alpha3/envoy_filter.pb.html b/vendor/istio.io/api/networking/v1alpha3/envoy_filter.pb.html new file mode 100644 index 0000000000..497dcbe890 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/envoy_filter.pb.html @@ -0,0 +1,1183 @@ +--- +title: Envoy Filter +description: Customizing Envoy configuration generated by Istio. +location: https://istio.io/docs/reference/config/networking/envoy-filter.html +layout: protoc-gen-docs +generator: protoc-gen-docs +schema: istio.networking.v1alpha3.EnvoyFilter +aliases: [/docs/reference/config/networking/v1alpha3/envoy-filter] +number_of_entries: 17 +--- +

EnvoyFilter provides a mechanism to customize the Envoy +configuration generated by Istio Pilot. Use EnvoyFilter to modify +values for certain fields, add specific filters, or even add +entirely new listeners, clusters, etc. This feature must be used +with care, as incorrect configurations could potentially +destabilize the entire mesh. Unlike other Istio networking objects, +EnvoyFilters are additively applied. Any number of EnvoyFilters can +exist for a given workload in a specific namespace. The order of +application of these EnvoyFilters is as follows: all EnvoyFilters +in the config root +namespace, +followed by all matching EnvoyFilters in the workload’s namespace.

+ +

NOTE 1: Some aspects of this API is deeply tied to the internal +implementation in Istio networking subsystem as well as Envoy’s XDS +API. While the EnvoyFilter API by itself will maintain backward +compatibility, any envoy configuration provided through this +mechanism should be carefully monitored across Istio proxy version +upgrades, to ensure that deprecated fields are removed and replaced +appropriately.

+ +

NOTE 2: When multiple EnvoyFilters are bound to the same +workload in a given namespace, all patches will be processed +sequentially in order of creation time. The behavior is undefined +if multiple EnvoyFilter configurations conflict with each other.

+ +

NOTE 3: To apply an EnvoyFilter resource to all workloads +(sidecars and gateways) in the system, define the resource in the +config root +namespace, +without a workloadSelector.

+ +

The example below declares a global default EnvoyFilter resource in +the root namespace called istio-config, that adds a custom +protocol filter on all sidecars in the system, for outbound port +9307. The filter should be added before the terminating tcp_proxy +filter to take effect. In addition, it sets a 30s idle timeout for +all HTTP connections in both gateays and sidecars.

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: EnvoyFilter
+metadata:
+  name: custom-protocol
+  namespace: istio-config # as defined in meshConfig resource.
+spec:
+  configPatches:
+  - applyTo: NETWORK_FILTER
+    match:
+      context: SIDECAR_OUTBOUND # will match outbound listeners in all sidecars
+      listener:
+        portNumber: 9307
+        filterChain:
+          filter:
+            name: "envoy.tcp_proxy"
+    patch:
+      operation: INSERT_BEFORE
+      value:
+        # This is the full filter config including the name and config or typed_config section.
+        name: "envoy.config.filter.network.custom_protocol"
+        config:
+         ...
+  - applyTo: NETWORK_FILTER # http connection manager is a filter in Envoy
+    match:
+      # context omitted so that this applies to both sidecars and gateways
+      listener:
+        filterChain:
+          filter:
+            name: "envoy.http_connection_manager"
+    patch:
+      operation: MERGE
+      value:
+        name: "envoy.http_connection_manager"
+        typed_config:
+          "@type": "type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager"
+          common_http_protocol_options:
+            idle_timeout: 30s
+
+ +

The following example enables Envoy’s Lua filter for all inbound +HTTP calls arriving at service port 8080 of the reviews service pod +with labels “app: reviews”, in the bookinfo namespace. The lua +filter calls out to an external service internal.org.net:8888 that +requires a special cluster definition in envoy. The cluster is also +added to the sidecar as part of this configuration.

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: EnvoyFilter
+metadata:
+  name: reviews-lua
+  namespace: bookinfo
+spec:
+  workloadSelector:
+    labels:
+      app: reviews
+  configPatches:
+    # The first patch adds the lua filter to the listener/http connection manager
+  - applyTo: HTTP_FILTER
+    match:
+      context: SIDECAR_INBOUND
+      listener:
+        portNumber: 8080
+        filterChain:
+          filter:
+            name: "envoy.http_connection_manager"
+            subFilter:
+              name: "envoy.router"
+    patch:
+      operation: INSERT_BEFORE
+      value: # lua filter specification
+        name: envoy.lua
+        typed_config:
+          "@type": "type.googleapis.com/envoy.config.filter.http.lua.v2.Lua"
+          inlineCode: |
+           function envoy_on_request(request_handle)
+             -- Make an HTTP call to an upstream host with the following headers, body, and timeout.
+             local headers, body = request_handle:httpCall(
+              "lua_cluster",
+              {
+               [":method"] = "POST",
+               [":path"] = "/acl",
+               [":authority"] = "internal.org.net"
+              },
+             "authorize call",
+             5000)
+           end
+  # The second patch adds the cluster that is referenced by the lua code
+  # cds match is omitted as a new cluster is being added
+  - applyTo: CLUSTER
+    match:
+      context: SIDECAR_OUTBOUND
+    patch:
+      operation: ADD
+      value: # cluster specification
+        name: "lua_cluster"
+        type: STRICT_DNS
+        connect_timeout: 0.5s
+        lb_policy: ROUND_ROBIN
+        hosts:
+        - socket_address:
+            protocol: TCP
+            address: "internal.org.net"
+            port_value: 8888
+
+
+ +

The following example overwrites certain fields (HTTP idle timeout +and X-Forward-For trusted hops) in the HTTP connection manager in a +listener on the ingress gateway in istio-system namespace for the +SNI host app.example.com:

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: EnvoyFilter
+metadata:
+  name: hcm-tweaks
+  namespace: istio-system
+spec:
+  workloadSelector:
+    labels:
+      istio: ingress-gateway
+  configPatches:
+  - applyTo: NETWORK_FILTER # http connection manager is a filter in Envoy
+    match:
+      context: GATEWAY
+      listener:
+        filterChain:
+          sni: app.example.com
+          filter:
+            name: "envoy.http_connection_manager"
+    patch:
+      operation: MERGE
+      value:
+        common_http_protocol_options:
+          idle_timeout: 30s
+        xff_num_trusted_hops: 5
+
+ +

EnvoyFilter

+
+

EnvoyFilter provides a mechanism to customize the Envoy configuration +generated by Istio Pilot.

+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
workloadSelectorWorkloadSelector +

Criteria used to select the specific set of pods/VMs on which +this patch configuration should be applied. If omitted, the set +of patches in this configuration will be applied to all workload +instances in the same namespace. If omitted, the EnvoyFilter +patches will be applied to all workloads in the same +namespace. If the EnvoyFilter is present in the config root +namespace, it will be applied to all applicable workloads in any +namespace.

+ +
+No +
configPatchesEnvoyConfigObjectPatch[] +

One or more patches with match conditions.

+ +
+Yes +
+
+

EnvoyFilter.ProxyMatch

+
+

One or more properties of the proxy to match on.

+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
proxyVersionstring +

A regular expression in golang regex format (RE2) that can be +used to select proxies using a specific version of istio +proxy. The Istio version for a given proxy is obtained from the +node metadata field ISTIOVERSION supplied by the proxy when +connecting to Pilot. This value is embedded as an environment +variable (ISTIOMETAISTIOVERSION) in the Istio proxy docker +image. Custom proxy implementations should provide this metadata +variable to take advantage of the Istio version check option.

+ +
+No +
metadatamap<string, string> +

Match on the node metadata supplied by a proxy when connecting +to Istio Pilot. Note that while Envoy’s node metadata is of +type Struct, only string key-value pairs are processed by +Pilot. All keys specified in the metadata must match with exact +values. The match will fail if any of the specified keys are +absent or the values fail to match.

+ +
+No +
+
+

EnvoyFilter.ClusterMatch

+
+

Conditions specified in ClusterMatch must be met for the patch +to be applied to a cluster.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
portNumberuint32 +

The service port for which this cluster was generated. If +omitted, applies to clusters for any port.

+ +
+No +
servicestring +

The fully qualified service name for this cluster. If omitted, +applies to clusters for any service. For services defined +through service entries, the service name is same as the hosts +defined in the service entry.

+ +
+No +
subsetstring +

The subset associated with the service. If omitted, applies to +clusters for any subset of a service.

+ +
+No +
namestring +

The exact name of the cluster to match. To match a specific +cluster by name, such as the internally generated “Passthrough” +cluster, leave all fields in clusterMatch empty, except the +name.

+ +
+No +
+
+

EnvoyFilter.RouteConfigurationMatch

+
+

Conditions specified in RouteConfigurationMatch must be met for +the patch to be applied to a route configuration object or a +specific virtual host within the route configuration.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
portNumberuint32 +

The service port number or gateway server port number for which +this route configuration was generated. If omitted, applies to +route configurations for all ports.

+ +
+No +
portNamestring +

Applicable only for GATEWAY context. The gateway server port +name for which this route configuration was generated.

+ +
+No +
gatewaystring +

The Istio gateway config’s namespace/name for which this route +configuration was generated. Applies only if the context is +GATEWAY. Should be in the namespace/name format. Use this field +in conjunction with the portNumber and portName to accurately +select the Envoy route configuration for a specific HTTPS +server within a gateway config object.

+ +
+No +
vhostVirtualHostMatch +

Match a specific virtual host in a route configuration and +apply the patch to the virtual host.

+ +
+No +
namestring +

Route configuration name to match on. Can be used to match a +specific route configuration by name, such as the internally +generated “http_proxy” route configuration for all sidecars.

+ +
+No +
+
+

EnvoyFilter.ListenerMatch

+
+

Conditions specified in a listener match must be met for the +patch to be applied to a specific listener across all filter +chains, or a specific filter chain inside the listener.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
portNumberuint32 +

The service port/gateway port to which traffic is being +sent/received. If not specified, matches all listeners. Even though +inbound listeners are generated for the instance/pod ports, only +service ports should be used to match listeners.

+ +
+No +
filterChainFilterChainMatch +

Match a specific filter chain in a listener. If specified, the +patch will be applied to the filter chain (and a specific +filter if specified) and not to other filter chains in the +listener.

+ +
+No +
namestring +

Match a specific listener by its name. The listeners generated +by Pilot are typically named as IP:Port.

+ +
+No +
+
+

EnvoyFilter.Patch

+
+

Patch specifies how the selected object should be modified.

+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
operationOperation +

Determines how the patch should be applied.

+ +
+No +
valueStruct +

The JSON config of the object being patched. This will be merged using +json merge semantics with the existing proto in the path.

+ +
+No +
+
+

EnvoyFilter.EnvoyConfigObjectMatch

+
+

One or more match conditions to be met before a patch is applied +to the generated configuration for a given proxy.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
contextPatchContext +

The specific config generation context to match on. Istio Pilot +generates envoy configuration in the context of a gateway, +inbound traffic to sidecar and outbound traffic from sidecar.

+ +
+No +
proxyProxyMatch +

Match on properties associated with a proxy.

+ +
+No +
listenerListenerMatch (oneof) +

Match on envoy listener attributes.

+ +
+No +
routeConfigurationRouteConfigurationMatch (oneof) +

Match on envoy HTTP route configuration attributes.

+ +
+No +
clusterClusterMatch (oneof) +

Match on envoy cluster attributes.

+ +
+No +
+
+

EnvoyFilter.EnvoyConfigObjectPatch

+
+

Changes to be made to various envoy config objects.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
applyToApplyTo +

Specifies where in the Envoy configuration, the patch should be +applied. The match is expected to select the appropriate +object based on applyTo. For example, an applyTo with +HTTPFILTER is expected to have a match condition on the +listeners, with a network filter selection on +envoy.httpconnection_manager and a sub filter selection on the +HTTP filter relative to which the insertion should be +performed. Similarly, an applyTo on CLUSTER should have a match +(if provided) on the cluster and not on a listener.

+ +
+No +
matchEnvoyConfigObjectMatch +

Match on listener/route configuration/cluster.

+ +
+No +
patchPatch +

The patch to apply along with the operation.

+ +
+No +
+
+

EnvoyFilter.RouteConfigurationMatch.RouteMatch

+
+

Match a specific route inside a virtual host in a route configuration.

+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
namestring +

The Route objects generated by default are named as +“default”. Route objects generated using a virtual service +will carry the name used in the virtual service’s HTTP +routes.

+ +
+No +
actionAction +

Match a route with specific action type.

+ +
+No +
+
+

EnvoyFilter.RouteConfigurationMatch.VirtualHostMatch

+
+

Match a specific virtual host inside a route configuration.

+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
namestring +

The VirtualHosts objects generated by Istio are named as +host:port, where the host typically corresponds to the +VirtualService’s host field or the hostname of a service in the +registry.

+ +
+No +
routeRouteMatch +

Match a specific route within the virtual host.

+ +
+No +
+
+

EnvoyFilter.ListenerMatch.FilterChainMatch

+
+

For listeners with multiple filter chains (e.g., inbound +listeners on sidecars with permissive mTLS, gateway listeners +with multiple SNI matches), the filter chain match can be used +to select a specific filter chain to patch.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
namestring +

The name assigned to the filter chain.

+ +
+No +
snistring +

The SNI value used by a filter chain’s match condition. This +condition will evaluate to false if the filter chain has no +sni match.

+ +
+No +
transportProtocolstring +

Applies only to SIDECARINBOUND context. If non-empty, a +transport protocol to consider when determining a filter +chain match. This value will be compared against the +transport protocol of a new connection, when it’s detected by +the tlsinspector listener filter.

+ +

Accepted values include:

+ +
    +
  • raw_buffer - default, used when no transport protocol is detected.
  • +
  • tls - set when TLS protocol is detected by the TLS inspector.
  • +
+ +
+No +
applicationProtocolsstring +

Applies only to sidecars. If non-empty, a comma separated set +of application protocols to consider when determining a +filter chain match. This value will be compared against the +application protocols of a new connection, when it’s detected +by one of the listener filters such as the http_inspector.

+ +

Accepted values include: h2,http/1.1,http/1.0

+ +
+No +
filterFilterMatch +

The name of a specific filter to apply the patch to. Set this +to envoy.httpconnectionmanager to add a filter or apply a +patch to the HTTP connection manager.

+ +
+No +
+
+

EnvoyFilter.ListenerMatch.FilterMatch

+
+

Conditions to match a specific filter within a filter chain.

+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
namestring +

The filter name to match on.

+ +
+No +
subFilterSubFilterMatch +

The next level filter within this filter to match +upon. Typically used for HTTP Connection Manager filters and +Thrift filters.

+ +
+No +
+
+

EnvoyFilter.ListenerMatch.SubFilterMatch

+
+

Conditions to match a specific filter within another +filter. This field is typically useful to match a HTTP filter +inside the envoy.httpconnectionmanager network filter. This +could also be applicable for thrift filters.

+ + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
namestring +

The filter name to match on.

+ +
+No +
+
+

EnvoyFilter.RouteConfigurationMatch.RouteMatch.Action

+
+

Action refers to the route action taken by Envoy when a http route matches.

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
ANY +

All three route actions

+ +
ROUTE +

Route traffic to a cluster / weighted clusters.

+ +
REDIRECT +

Redirect request.

+ +
DIRECT_RESPONSE +

directly respond to a request with specific payload.

+ +
+
+

EnvoyFilter.Patch.Operation

+
+

Operation denotes how the patch should be applied to the selected +configuration.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
INVALID +
MERGE +

Merge the provided config with the generated config using +json merge semantics.

+ +
ADD +

Add the provided config to an existing list (of listeners, +clusters, virtual hosts, network filters, or http +filters). This operation will be ignored when applyTo is set +to ROUTECONFIGURATION, or HTTPROUTE.

+ +
REMOVE +

Remove the selected object from the list (of listeners, +clusters, virtual hosts, network filters, or http +filters). Does not require a value to be specified. This +operation will be ignored when applyTo is set to +ROUTECONFIGURATION, or HTTPROUTE.

+ +
INSERT_BEFORE +

Insert operation on an array of named objects. This operation +is typically useful only in the context of filters, where the +order of filters matter. For clusters and virtual hosts, +order of the element in the array does not matter. Insert +before the selected filter or sub filter. If no filter is +selected, the specified filter will be inserted at the front +of the list.

+ +
INSERT_AFTER +

Insert operation on an array of named objects. This operation +is typically useful only in the context of filters, where the +order of filters matter. For clusters and virtual hosts, +order of the element in the array does not matter. Insert +after the selected filter or sub filter. If no filter is +selected, the specified filter will be inserted at the end +of the list.

+ +
INSERT_FIRST +

Insert operation on an array of named objects. This operation +is typically useful only in the context of filters, where the +order of filters matter. For clusters and virtual hosts, +order of the element in the array does not matter. Insert +first in the list based on the presence of selected filter or not. +This is specifically useful when you want your filter first in the +list based on a match condition specified in Match clause.

+ +
+
+

EnvoyFilter.ApplyTo

+
+

ApplyTo specifies where in the Envoy configuration, the given patch should be applied.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
INVALID +
LISTENER +

Applies the patch to the listener.

+ +
FILTER_CHAIN +

Applies the patch to the filter chain.

+ +
NETWORK_FILTER +

Applies the patch to the network filter chain, to modify an +existing filter or add a new filter.

+ +
HTTP_FILTER +

Applies the patch to the HTTP filter chain in the http +connection manager, to modify an existing filter or add a new +filter.

+ +
ROUTE_CONFIGURATION +

Applies the patch to the Route configuration (rds output) +inside a HTTP connection manager. This does not apply to the +virtual host. Currently, only MERGE operation is allowed on the +route configuration objects.

+ +
VIRTUAL_HOST +

Applies the patch to a virtual host inside a route configuration.

+ +
HTTP_ROUTE +

Applies the patch to a route object inside the matched virtual +host in a route configuration. Currently, only MERGE operation +is allowed on the route objects.

+ +
CLUSTER +

Applies the patch to a cluster in a CDS output. Also used to add new clusters.

+ +
+
+

EnvoyFilter.PatchContext

+
+

PatchContext selects a class of configurations based on the +traffic flow direction and workload type.

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
ANY +

All listeners/routes/clusters in both sidecars and gateways.

+ +
SIDECAR_INBOUND +

Inbound listener/route/cluster in sidecar.

+ +
SIDECAR_OUTBOUND +

Outbound listener/route/cluster in sidecar.

+ +
GATEWAY +

Gateway listener/route/cluster.

+ +
+
diff --git a/vendor/istio.io/api/networking/v1alpha3/envoy_filter.proto b/vendor/istio.io/api/networking/v1alpha3/envoy_filter.proto new file mode 100644 index 0000000000..8559506053 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/envoy_filter.proto @@ -0,0 +1,601 @@ +// Copyright 2018 Istio Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "google/api/field_behavior.proto"; +import "google/protobuf/struct.proto"; +import "networking/v1alpha3/sidecar.proto"; + +// $schema: istio.networking.v1alpha3.EnvoyFilter +// $title: Envoy Filter +// $description: Customizing Envoy configuration generated by Istio. +// $location: https://istio.io/docs/reference/config/networking/envoy-filter.html +// $aliases: [/docs/reference/config/networking/v1alpha3/envoy-filter] + +// `EnvoyFilter` provides a mechanism to customize the Envoy +// configuration generated by Istio Pilot. Use EnvoyFilter to modify +// values for certain fields, add specific filters, or even add +// entirely new listeners, clusters, etc. This feature must be used +// with care, as incorrect configurations could potentially +// destabilize the entire mesh. Unlike other Istio networking objects, +// EnvoyFilters are additively applied. Any number of EnvoyFilters can +// exist for a given workload in a specific namespace. The order of +// application of these EnvoyFilters is as follows: all EnvoyFilters +// in the config [root +// namespace](https://istio.io/docs/reference/config/istio.mesh.v1alpha1/#MeshConfig), +// followed by all matching EnvoyFilters in the workload's namespace. +// +// **NOTE 1**: Some aspects of this API is deeply tied to the internal +// implementation in Istio networking subsystem as well as Envoy's XDS +// API. While the EnvoyFilter API by itself will maintain backward +// compatibility, any envoy configuration provided through this +// mechanism should be carefully monitored across Istio proxy version +// upgrades, to ensure that deprecated fields are removed and replaced +// appropriately. +// +// **NOTE 2**: When multiple EnvoyFilters are bound to the same +// workload in a given namespace, all patches will be processed +// sequentially in order of creation time. The behavior is undefined +// if multiple EnvoyFilter configurations conflict with each other. +// +// **NOTE 3**: To apply an EnvoyFilter resource to all workloads +// (sidecars and gateways) in the system, define the resource in the +// config [root +// namespace](https://istio.io/docs/reference/config/istio.mesh.v1alpha1/#MeshConfig), +// without a workloadSelector. +// +// The example below declares a global default EnvoyFilter resource in +// the root namespace called `istio-config`, that adds a custom +// protocol filter on all sidecars in the system, for outbound port +// 9307. The filter should be added before the terminating tcp_proxy +// filter to take effect. In addition, it sets a 30s idle timeout for +// all HTTP connections in both gateays and sidecars. +// +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: EnvoyFilter +// metadata: +// name: custom-protocol +// namespace: istio-config # as defined in meshConfig resource. +// spec: +// configPatches: +// - applyTo: NETWORK_FILTER +// match: +// context: SIDECAR_OUTBOUND # will match outbound listeners in all sidecars +// listener: +// portNumber: 9307 +// filterChain: +// filter: +// name: "envoy.tcp_proxy" +// patch: +// operation: INSERT_BEFORE +// value: +// # This is the full filter config including the name and config or typed_config section. +// name: "envoy.config.filter.network.custom_protocol" +// config: +// ... +// - applyTo: NETWORK_FILTER # http connection manager is a filter in Envoy +// match: +// # context omitted so that this applies to both sidecars and gateways +// listener: +// filterChain: +// filter: +// name: "envoy.http_connection_manager" +// patch: +// operation: MERGE +// value: +// name: "envoy.http_connection_manager" +// typed_config: +// "@type": "type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager" +// common_http_protocol_options: +// idle_timeout: 30s +//``` +// +// The following example enables Envoy's Lua filter for all inbound +// HTTP calls arriving at service port 8080 of the reviews service pod +// with labels "app: reviews", in the bookinfo namespace. The lua +// filter calls out to an external service internal.org.net:8888 that +// requires a special cluster definition in envoy. The cluster is also +// added to the sidecar as part of this configuration. +// +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: EnvoyFilter +// metadata: +// name: reviews-lua +// namespace: bookinfo +// spec: +// workloadSelector: +// labels: +// app: reviews +// configPatches: +// # The first patch adds the lua filter to the listener/http connection manager +// - applyTo: HTTP_FILTER +// match: +// context: SIDECAR_INBOUND +// listener: +// portNumber: 8080 +// filterChain: +// filter: +// name: "envoy.http_connection_manager" +// subFilter: +// name: "envoy.router" +// patch: +// operation: INSERT_BEFORE +// value: # lua filter specification +// name: envoy.lua +// typed_config: +// "@type": "type.googleapis.com/envoy.config.filter.http.lua.v2.Lua" +// inlineCode: | +// function envoy_on_request(request_handle) +// -- Make an HTTP call to an upstream host with the following headers, body, and timeout. +// local headers, body = request_handle:httpCall( +// "lua_cluster", +// { +// [":method"] = "POST", +// [":path"] = "/acl", +// [":authority"] = "internal.org.net" +// }, +// "authorize call", +// 5000) +// end +// # The second patch adds the cluster that is referenced by the lua code +// # cds match is omitted as a new cluster is being added +// - applyTo: CLUSTER +// match: +// context: SIDECAR_OUTBOUND +// patch: +// operation: ADD +// value: # cluster specification +// name: "lua_cluster" +// type: STRICT_DNS +// connect_timeout: 0.5s +// lb_policy: ROUND_ROBIN +// hosts: +// - socket_address: +// protocol: TCP +// address: "internal.org.net" +// port_value: 8888 +// +// ``` +// +// The following example overwrites certain fields (HTTP idle timeout +// and X-Forward-For trusted hops) in the HTTP connection manager in a +// listener on the ingress gateway in istio-system namespace for the +// SNI host app.example.com: +// +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: EnvoyFilter +// metadata: +// name: hcm-tweaks +// namespace: istio-system +// spec: +// workloadSelector: +// labels: +// istio: ingress-gateway +// configPatches: +// - applyTo: NETWORK_FILTER # http connection manager is a filter in Envoy +// match: +// context: GATEWAY +// listener: +// filterChain: +// sni: app.example.com +// filter: +// name: "envoy.http_connection_manager" +// patch: +// operation: MERGE +// value: +// common_http_protocol_options: +// idle_timeout: 30s +// xff_num_trusted_hops: 5 +//``` +// +package istio.networking.v1alpha3; + +option go_package = "istio.io/api/networking/v1alpha3"; + +// EnvoyFilter provides a mechanism to customize the Envoy configuration +// generated by Istio Pilot. +// +// +// +// +message EnvoyFilter { + // ApplyTo specifies where in the Envoy configuration, the given patch should be applied. + enum ApplyTo { + + INVALID = 0; + + // Applies the patch to the listener. + LISTENER = 1; + + // Applies the patch to the filter chain. + FILTER_CHAIN = 2; + + // Applies the patch to the network filter chain, to modify an + // existing filter or add a new filter. + NETWORK_FILTER = 3; + + // Applies the patch to the HTTP filter chain in the http + // connection manager, to modify an existing filter or add a new + // filter. + HTTP_FILTER = 4; + + // Applies the patch to the Route configuration (rds output) + // inside a HTTP connection manager. This does not apply to the + // virtual host. Currently, only MERGE operation is allowed on the + // route configuration objects. + ROUTE_CONFIGURATION = 5; + + // Applies the patch to a virtual host inside a route configuration. + VIRTUAL_HOST = 6; + + // Applies the patch to a route object inside the matched virtual + // host in a route configuration. Currently, only MERGE operation + // is allowed on the route objects. + HTTP_ROUTE = 7; + + // Applies the patch to a cluster in a CDS output. Also used to add new clusters. + CLUSTER = 8; + }; + + // PatchContext selects a class of configurations based on the + // traffic flow direction and workload type. + enum PatchContext { + // All listeners/routes/clusters in both sidecars and gateways. + ANY = 0; + + // Inbound listener/route/cluster in sidecar. + SIDECAR_INBOUND = 1; + + // Outbound listener/route/cluster in sidecar. + SIDECAR_OUTBOUND = 2; + + // Gateway listener/route/cluster. + GATEWAY = 3; + }; + + // One or more properties of the proxy to match on. + message ProxyMatch { + // A regular expression in golang regex format (RE2) that can be + // used to select proxies using a specific version of istio + // proxy. The Istio version for a given proxy is obtained from the + // node metadata field ISTIO_VERSION supplied by the proxy when + // connecting to Pilot. This value is embedded as an environment + // variable (ISTIO_META_ISTIO_VERSION) in the Istio proxy docker + // image. Custom proxy implementations should provide this metadata + // variable to take advantage of the Istio version check option. + string proxy_version = 1; + + // Match on the node metadata supplied by a proxy when connecting + // to Istio Pilot. Note that while Envoy's node metadata is of + // type Struct, only string key-value pairs are processed by + // Pilot. All keys specified in the metadata must match with exact + // values. The match will fail if any of the specified keys are + // absent or the values fail to match. + map metadata = 2; + }; + + // Conditions specified in ClusterMatch must be met for the patch + // to be applied to a cluster. + message ClusterMatch { + // The service port for which this cluster was generated. If + // omitted, applies to clusters for any port. + uint32 port_number = 1; + + // The fully qualified service name for this cluster. If omitted, + // applies to clusters for any service. For services defined + // through service entries, the service name is same as the hosts + // defined in the service entry. + string service = 2; + + // The subset associated with the service. If omitted, applies to + // clusters for any subset of a service. + string subset = 3; + + // The exact name of the cluster to match. To match a specific + // cluster by name, such as the internally generated "Passthrough" + // cluster, leave all fields in clusterMatch empty, except the + // name. + string name = 4; + }; + + // Conditions specified in RouteConfigurationMatch must be met for + // the patch to be applied to a route configuration object or a + // specific virtual host within the route configuration. + message RouteConfigurationMatch { + // Match a specific route inside a virtual host in a route configuration. + message RouteMatch { + // The Route objects generated by default are named as + // "default". Route objects generated using a virtual service + // will carry the name used in the virtual service's HTTP + // routes. + string name = 1; + + // Action refers to the route action taken by Envoy when a http route matches. + enum Action { + // All three route actions + ANY = 0; + // Route traffic to a cluster / weighted clusters. + ROUTE = 1; + // Redirect request. + REDIRECT = 2; + // directly respond to a request with specific payload. + DIRECT_RESPONSE = 3; + }; + + // Match a route with specific action type. + Action action = 2; + } + + // Match a specific virtual host inside a route configuration. + message VirtualHostMatch { + // The VirtualHosts objects generated by Istio are named as + // host:port, where the host typically corresponds to the + // VirtualService's host field or the hostname of a service in the + // registry. + string name = 1; + + // Match a specific route within the virtual host. + RouteMatch route = 2; + } + + // The service port number or gateway server port number for which + // this route configuration was generated. If omitted, applies to + // route configurations for all ports. + uint32 port_number = 1; + + // Applicable only for GATEWAY context. The gateway server port + // name for which this route configuration was generated. + string port_name = 2; + + // The Istio gateway config's namespace/name for which this route + // configuration was generated. Applies only if the context is + // GATEWAY. Should be in the namespace/name format. Use this field + // in conjunction with the portNumber and portName to accurately + // select the Envoy route configuration for a specific HTTPS + // server within a gateway config object. + string gateway = 3; + + // Match a specific virtual host in a route configuration and + // apply the patch to the virtual host. + VirtualHostMatch vhost = 4; + + // Route configuration name to match on. Can be used to match a + // specific route configuration by name, such as the internally + // generated "http_proxy" route configuration for all sidecars. + string name = 5; + }; + + // Conditions specified in a listener match must be met for the + // patch to be applied to a specific listener across all filter + // chains, or a specific filter chain inside the listener. + message ListenerMatch { + // For listeners with multiple filter chains (e.g., inbound + // listeners on sidecars with permissive mTLS, gateway listeners + // with multiple SNI matches), the filter chain match can be used + // to select a specific filter chain to patch. + message FilterChainMatch { + // The name assigned to the filter chain. + string name = 1; + + // The SNI value used by a filter chain's match condition. This + // condition will evaluate to false if the filter chain has no + // sni match. + string sni = 2; + + // Applies only to SIDECAR_INBOUND context. If non-empty, a + // transport protocol to consider when determining a filter + // chain match. This value will be compared against the + // transport protocol of a new connection, when it's detected by + // the tls_inspector listener filter. + // + // Accepted values include: + // + // * `raw_buffer` - default, used when no transport protocol is detected. + // * `tls` - set when TLS protocol is detected by the TLS inspector. + string transport_protocol = 3; + + // Applies only to sidecars. If non-empty, a comma separated set + // of application protocols to consider when determining a + // filter chain match. This value will be compared against the + // application protocols of a new connection, when it's detected + // by one of the listener filters such as the http_inspector. + // + // Accepted values include: h2,http/1.1,http/1.0 + string application_protocols = 4; + + // The name of a specific filter to apply the patch to. Set this + // to envoy.http_connection_manager to add a filter or apply a + // patch to the HTTP connection manager. + FilterMatch filter = 5; + }; + + // Conditions to match a specific filter within a filter chain. + message FilterMatch { + // The filter name to match on. + string name = 1; + // The next level filter within this filter to match + // upon. Typically used for HTTP Connection Manager filters and + // Thrift filters. + SubFilterMatch sub_filter = 2; + }; + + // Conditions to match a specific filter within another + // filter. This field is typically useful to match a HTTP filter + // inside the envoy.http_connection_manager network filter. This + // could also be applicable for thrift filters. + message SubFilterMatch { + // The filter name to match on. + string name = 1; + }; + + // The service port/gateway port to which traffic is being + // sent/received. If not specified, matches all listeners. Even though + // inbound listeners are generated for the instance/pod ports, only + // service ports should be used to match listeners. + uint32 port_number = 1; + + // Instead of using specific port numbers, a set of ports matching + // a given service's port name can be selected. Matching is case + // insensitive. + // Not implemented. + // $hide_from_docs + string port_name = 2; + + // Match a specific filter chain in a listener. If specified, the + // patch will be applied to the filter chain (and a specific + // filter if specified) and not to other filter chains in the + // listener. + FilterChainMatch filter_chain = 3; + + // Match a specific listener by its name. The listeners generated + // by Pilot are typically named as IP:Port. + string name = 4; + }; + + // Patch specifies how the selected object should be modified. + message Patch { + + // Operation denotes how the patch should be applied to the selected + // configuration. + enum Operation { + INVALID = 0; + + // Merge the provided config with the generated config using + // json merge semantics. + MERGE = 1; + + // Add the provided config to an existing list (of listeners, + // clusters, virtual hosts, network filters, or http + // filters). This operation will be ignored when applyTo is set + // to ROUTE_CONFIGURATION, or HTTP_ROUTE. + ADD = 2; + + // Remove the selected object from the list (of listeners, + // clusters, virtual hosts, network filters, or http + // filters). Does not require a value to be specified. This + // operation will be ignored when applyTo is set to + // ROUTE_CONFIGURATION, or HTTP_ROUTE. + REMOVE = 3; + + // Insert operation on an array of named objects. This operation + // is typically useful only in the context of filters, where the + // order of filters matter. For clusters and virtual hosts, + // order of the element in the array does not matter. Insert + // before the selected filter or sub filter. If no filter is + // selected, the specified filter will be inserted at the front + // of the list. + INSERT_BEFORE = 4; + + // Insert operation on an array of named objects. This operation + // is typically useful only in the context of filters, where the + // order of filters matter. For clusters and virtual hosts, + // order of the element in the array does not matter. Insert + // after the selected filter or sub filter. If no filter is + // selected, the specified filter will be inserted at the end + // of the list. + INSERT_AFTER = 5; + + // Insert operation on an array of named objects. This operation + // is typically useful only in the context of filters, where the + // order of filters matter. For clusters and virtual hosts, + // order of the element in the array does not matter. Insert + // first in the list based on the presence of selected filter or not. + // This is specifically useful when you want your filter first in the + // list based on a match condition specified in Match clause. + INSERT_FIRST = 6; + } + + // Determines how the patch should be applied. + Operation operation = 1; + + // The JSON config of the object being patched. This will be merged using + // json merge semantics with the existing proto in the path. + google.protobuf.Struct value = 2; + }; + + // One or more match conditions to be met before a patch is applied + // to the generated configuration for a given proxy. + message EnvoyConfigObjectMatch { + // The specific config generation context to match on. Istio Pilot + // generates envoy configuration in the context of a gateway, + // inbound traffic to sidecar and outbound traffic from sidecar. + PatchContext context = 1; + + // Match on properties associated with a proxy. + ProxyMatch proxy = 2; + + oneof object_types { + // Match on envoy listener attributes. + ListenerMatch listener = 3; + // Match on envoy HTTP route configuration attributes. + RouteConfigurationMatch route_configuration = 4; + // Match on envoy cluster attributes. + ClusterMatch cluster = 5; + } + }; + + // Changes to be made to various envoy config objects. + message EnvoyConfigObjectPatch { + // Specifies where in the Envoy configuration, the patch should be + // applied. The match is expected to select the appropriate + // object based on applyTo. For example, an applyTo with + // HTTP_FILTER is expected to have a match condition on the + // listeners, with a network filter selection on + // envoy.http_connection_manager and a sub filter selection on the + // HTTP filter relative to which the insertion should be + // performed. Similarly, an applyTo on CLUSTER should have a match + // (if provided) on the cluster and not on a listener. + ApplyTo apply_to = 1; + + // Match on listener/route configuration/cluster. + EnvoyConfigObjectMatch match = 2; + + // The patch to apply along with the operation. + Patch patch = 3; + } + + reserved 1, 2; + reserved "filters", "workload_labels"; + + // Criteria used to select the specific set of pods/VMs on which + // this patch configuration should be applied. If omitted, the set + // of patches in this configuration will be applied to all workload + // instances in the same namespace. If omitted, the EnvoyFilter + // patches will be applied to all workloads in the same + // namespace. If the EnvoyFilter is present in the config root + // namespace, it will be applied to all applicable workloads in any + // namespace. + WorkloadSelector workload_selector = 3; + + // One or more patches with match conditions. + repeated EnvoyConfigObjectPatch config_patches = 4 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/vendor/istio.io/api/networking/v1alpha3/envoy_filter_deepcopy.gen.go b/vendor/istio.io/api/networking/v1alpha3/envoy_filter_deepcopy.gen.go new file mode 100644 index 0000000000..31efcb06f0 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/envoy_filter_deepcopy.gen.go @@ -0,0 +1,405 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/envoy_filter.proto + +// `EnvoyFilter` provides a mechanism to customize the Envoy +// configuration generated by Istio Pilot. Use EnvoyFilter to modify +// values for certain fields, add specific filters, or even add +// entirely new listeners, clusters, etc. This feature must be used +// with care, as incorrect configurations could potentially +// destabilize the entire mesh. Unlike other Istio networking objects, +// EnvoyFilters are additively applied. Any number of EnvoyFilters can +// exist for a given workload in a specific namespace. The order of +// application of these EnvoyFilters is as follows: all EnvoyFilters +// in the config [root +// namespace](https://istio.io/docs/reference/config/istio.mesh.v1alpha1/#MeshConfig), +// followed by all matching EnvoyFilters in the workload's namespace. +// +// **NOTE 1**: Some aspects of this API is deeply tied to the internal +// implementation in Istio networking subsystem as well as Envoy's XDS +// API. While the EnvoyFilter API by itself will maintain backward +// compatibility, any envoy configuration provided through this +// mechanism should be carefully monitored across Istio proxy version +// upgrades, to ensure that deprecated fields are removed and replaced +// appropriately. +// +// **NOTE 2**: When multiple EnvoyFilters are bound to the same +// workload in a given namespace, all patches will be processed +// sequentially in order of creation time. The behavior is undefined +// if multiple EnvoyFilter configurations conflict with each other. +// +// **NOTE 3**: To apply an EnvoyFilter resource to all workloads +// (sidecars and gateways) in the system, define the resource in the +// config [root +// namespace](https://istio.io/docs/reference/config/istio.mesh.v1alpha1/#MeshConfig), +// without a workloadSelector. +// +// The example below declares a global default EnvoyFilter resource in +// the root namespace called `istio-config`, that adds a custom +// protocol filter on all sidecars in the system, for outbound port +// 9307. The filter should be added before the terminating tcp_proxy +// filter to take effect. In addition, it sets a 30s idle timeout for +// all HTTP connections in both gateays and sidecars. +// +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: EnvoyFilter +// metadata: +// name: custom-protocol +// namespace: istio-config # as defined in meshConfig resource. +// spec: +// configPatches: +// - applyTo: NETWORK_FILTER +// match: +// context: SIDECAR_OUTBOUND # will match outbound listeners in all sidecars +// listener: +// portNumber: 9307 +// filterChain: +// filter: +// name: "envoy.tcp_proxy" +// patch: +// operation: INSERT_BEFORE +// value: +// # This is the full filter config including the name and config or typed_config section. +// name: "envoy.config.filter.network.custom_protocol" +// config: +// ... +// - applyTo: NETWORK_FILTER # http connection manager is a filter in Envoy +// match: +// # context omitted so that this applies to both sidecars and gateways +// listener: +// filterChain: +// filter: +// name: "envoy.http_connection_manager" +// patch: +// operation: MERGE +// value: +// name: "envoy.http_connection_manager" +// typed_config: +// "@type": "type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager" +// common_http_protocol_options: +// idle_timeout: 30s +//``` +// +// The following example enables Envoy's Lua filter for all inbound +// HTTP calls arriving at service port 8080 of the reviews service pod +// with labels "app: reviews", in the bookinfo namespace. The lua +// filter calls out to an external service internal.org.net:8888 that +// requires a special cluster definition in envoy. The cluster is also +// added to the sidecar as part of this configuration. +// +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: EnvoyFilter +// metadata: +// name: reviews-lua +// namespace: bookinfo +// spec: +// workloadSelector: +// labels: +// app: reviews +// configPatches: +// # The first patch adds the lua filter to the listener/http connection manager +// - applyTo: HTTP_FILTER +// match: +// context: SIDECAR_INBOUND +// listener: +// portNumber: 8080 +// filterChain: +// filter: +// name: "envoy.http_connection_manager" +// subFilter: +// name: "envoy.router" +// patch: +// operation: INSERT_BEFORE +// value: # lua filter specification +// name: envoy.lua +// typed_config: +// "@type": "type.googleapis.com/envoy.config.filter.http.lua.v2.Lua" +// inlineCode: | +// function envoy_on_request(request_handle) +// -- Make an HTTP call to an upstream host with the following headers, body, and timeout. +// local headers, body = request_handle:httpCall( +// "lua_cluster", +// { +// [":method"] = "POST", +// [":path"] = "/acl", +// [":authority"] = "internal.org.net" +// }, +// "authorize call", +// 5000) +// end +// # The second patch adds the cluster that is referenced by the lua code +// # cds match is omitted as a new cluster is being added +// - applyTo: CLUSTER +// match: +// context: SIDECAR_OUTBOUND +// patch: +// operation: ADD +// value: # cluster specification +// name: "lua_cluster" +// type: STRICT_DNS +// connect_timeout: 0.5s +// lb_policy: ROUND_ROBIN +// hosts: +// - socket_address: +// protocol: TCP +// address: "internal.org.net" +// port_value: 8888 +// +// ``` +// +// The following example overwrites certain fields (HTTP idle timeout +// and X-Forward-For trusted hops) in the HTTP connection manager in a +// listener on the ingress gateway in istio-system namespace for the +// SNI host app.example.com: +// +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: EnvoyFilter +// metadata: +// name: hcm-tweaks +// namespace: istio-system +// spec: +// workloadSelector: +// labels: +// istio: ingress-gateway +// configPatches: +// - applyTo: NETWORK_FILTER # http connection manager is a filter in Envoy +// match: +// context: GATEWAY +// listener: +// filterChain: +// sni: app.example.com +// filter: +// name: "envoy.http_connection_manager" +// patch: +// operation: MERGE +// value: +// common_http_protocol_options: +// idle_timeout: 30s +// xff_num_trusted_hops: 5 +//``` +// + +package v1alpha3 + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// DeepCopyInto supports using EnvoyFilter within kubernetes types, where deepcopy-gen is used. +func (in *EnvoyFilter) DeepCopyInto(out *EnvoyFilter) { + p := proto.Clone(in).(*EnvoyFilter) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyFilter. Required by controller-gen. +func (in *EnvoyFilter) DeepCopy() *EnvoyFilter { + if in == nil { + return nil + } + out := new(EnvoyFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using EnvoyFilter_ProxyMatch within kubernetes types, where deepcopy-gen is used. +func (in *EnvoyFilter_ProxyMatch) DeepCopyInto(out *EnvoyFilter_ProxyMatch) { + p := proto.Clone(in).(*EnvoyFilter_ProxyMatch) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyFilter_ProxyMatch. Required by controller-gen. +func (in *EnvoyFilter_ProxyMatch) DeepCopy() *EnvoyFilter_ProxyMatch { + if in == nil { + return nil + } + out := new(EnvoyFilter_ProxyMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using EnvoyFilter_ClusterMatch within kubernetes types, where deepcopy-gen is used. +func (in *EnvoyFilter_ClusterMatch) DeepCopyInto(out *EnvoyFilter_ClusterMatch) { + p := proto.Clone(in).(*EnvoyFilter_ClusterMatch) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyFilter_ClusterMatch. Required by controller-gen. +func (in *EnvoyFilter_ClusterMatch) DeepCopy() *EnvoyFilter_ClusterMatch { + if in == nil { + return nil + } + out := new(EnvoyFilter_ClusterMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using EnvoyFilter_RouteConfigurationMatch within kubernetes types, where deepcopy-gen is used. +func (in *EnvoyFilter_RouteConfigurationMatch) DeepCopyInto(out *EnvoyFilter_RouteConfigurationMatch) { + p := proto.Clone(in).(*EnvoyFilter_RouteConfigurationMatch) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyFilter_RouteConfigurationMatch. Required by controller-gen. +func (in *EnvoyFilter_RouteConfigurationMatch) DeepCopy() *EnvoyFilter_RouteConfigurationMatch { + if in == nil { + return nil + } + out := new(EnvoyFilter_RouteConfigurationMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using EnvoyFilter_RouteConfigurationMatch_RouteMatch within kubernetes types, where deepcopy-gen is used. +func (in *EnvoyFilter_RouteConfigurationMatch_RouteMatch) DeepCopyInto(out *EnvoyFilter_RouteConfigurationMatch_RouteMatch) { + p := proto.Clone(in).(*EnvoyFilter_RouteConfigurationMatch_RouteMatch) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyFilter_RouteConfigurationMatch_RouteMatch. Required by controller-gen. +func (in *EnvoyFilter_RouteConfigurationMatch_RouteMatch) DeepCopy() *EnvoyFilter_RouteConfigurationMatch_RouteMatch { + if in == nil { + return nil + } + out := new(EnvoyFilter_RouteConfigurationMatch_RouteMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch within kubernetes types, where deepcopy-gen is used. +func (in *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) DeepCopyInto(out *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) { + p := proto.Clone(in).(*EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch. Required by controller-gen. +func (in *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) DeepCopy() *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch { + if in == nil { + return nil + } + out := new(EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using EnvoyFilter_ListenerMatch within kubernetes types, where deepcopy-gen is used. +func (in *EnvoyFilter_ListenerMatch) DeepCopyInto(out *EnvoyFilter_ListenerMatch) { + p := proto.Clone(in).(*EnvoyFilter_ListenerMatch) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyFilter_ListenerMatch. Required by controller-gen. +func (in *EnvoyFilter_ListenerMatch) DeepCopy() *EnvoyFilter_ListenerMatch { + if in == nil { + return nil + } + out := new(EnvoyFilter_ListenerMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using EnvoyFilter_ListenerMatch_FilterChainMatch within kubernetes types, where deepcopy-gen is used. +func (in *EnvoyFilter_ListenerMatch_FilterChainMatch) DeepCopyInto(out *EnvoyFilter_ListenerMatch_FilterChainMatch) { + p := proto.Clone(in).(*EnvoyFilter_ListenerMatch_FilterChainMatch) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyFilter_ListenerMatch_FilterChainMatch. Required by controller-gen. +func (in *EnvoyFilter_ListenerMatch_FilterChainMatch) DeepCopy() *EnvoyFilter_ListenerMatch_FilterChainMatch { + if in == nil { + return nil + } + out := new(EnvoyFilter_ListenerMatch_FilterChainMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using EnvoyFilter_ListenerMatch_FilterMatch within kubernetes types, where deepcopy-gen is used. +func (in *EnvoyFilter_ListenerMatch_FilterMatch) DeepCopyInto(out *EnvoyFilter_ListenerMatch_FilterMatch) { + p := proto.Clone(in).(*EnvoyFilter_ListenerMatch_FilterMatch) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyFilter_ListenerMatch_FilterMatch. Required by controller-gen. +func (in *EnvoyFilter_ListenerMatch_FilterMatch) DeepCopy() *EnvoyFilter_ListenerMatch_FilterMatch { + if in == nil { + return nil + } + out := new(EnvoyFilter_ListenerMatch_FilterMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using EnvoyFilter_ListenerMatch_SubFilterMatch within kubernetes types, where deepcopy-gen is used. +func (in *EnvoyFilter_ListenerMatch_SubFilterMatch) DeepCopyInto(out *EnvoyFilter_ListenerMatch_SubFilterMatch) { + p := proto.Clone(in).(*EnvoyFilter_ListenerMatch_SubFilterMatch) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyFilter_ListenerMatch_SubFilterMatch. Required by controller-gen. +func (in *EnvoyFilter_ListenerMatch_SubFilterMatch) DeepCopy() *EnvoyFilter_ListenerMatch_SubFilterMatch { + if in == nil { + return nil + } + out := new(EnvoyFilter_ListenerMatch_SubFilterMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using EnvoyFilter_Patch within kubernetes types, where deepcopy-gen is used. +func (in *EnvoyFilter_Patch) DeepCopyInto(out *EnvoyFilter_Patch) { + p := proto.Clone(in).(*EnvoyFilter_Patch) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyFilter_Patch. Required by controller-gen. +func (in *EnvoyFilter_Patch) DeepCopy() *EnvoyFilter_Patch { + if in == nil { + return nil + } + out := new(EnvoyFilter_Patch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using EnvoyFilter_EnvoyConfigObjectMatch within kubernetes types, where deepcopy-gen is used. +func (in *EnvoyFilter_EnvoyConfigObjectMatch) DeepCopyInto(out *EnvoyFilter_EnvoyConfigObjectMatch) { + p := proto.Clone(in).(*EnvoyFilter_EnvoyConfigObjectMatch) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyFilter_EnvoyConfigObjectMatch. Required by controller-gen. +func (in *EnvoyFilter_EnvoyConfigObjectMatch) DeepCopy() *EnvoyFilter_EnvoyConfigObjectMatch { + if in == nil { + return nil + } + out := new(EnvoyFilter_EnvoyConfigObjectMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using EnvoyFilter_EnvoyConfigObjectPatch within kubernetes types, where deepcopy-gen is used. +func (in *EnvoyFilter_EnvoyConfigObjectPatch) DeepCopyInto(out *EnvoyFilter_EnvoyConfigObjectPatch) { + p := proto.Clone(in).(*EnvoyFilter_EnvoyConfigObjectPatch) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyFilter_EnvoyConfigObjectPatch. Required by controller-gen. +func (in *EnvoyFilter_EnvoyConfigObjectPatch) DeepCopy() *EnvoyFilter_EnvoyConfigObjectPatch { + if in == nil { + return nil + } + out := new(EnvoyFilter_EnvoyConfigObjectPatch) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/istio.io/api/networking/v1alpha3/envoy_filter_json.gen.go b/vendor/istio.io/api/networking/v1alpha3/envoy_filter_json.gen.go new file mode 100644 index 0000000000..4c382825d0 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/envoy_filter_json.gen.go @@ -0,0 +1,347 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/envoy_filter.proto + +// `EnvoyFilter` provides a mechanism to customize the Envoy +// configuration generated by Istio Pilot. Use EnvoyFilter to modify +// values for certain fields, add specific filters, or even add +// entirely new listeners, clusters, etc. This feature must be used +// with care, as incorrect configurations could potentially +// destabilize the entire mesh. Unlike other Istio networking objects, +// EnvoyFilters are additively applied. Any number of EnvoyFilters can +// exist for a given workload in a specific namespace. The order of +// application of these EnvoyFilters is as follows: all EnvoyFilters +// in the config [root +// namespace](https://istio.io/docs/reference/config/istio.mesh.v1alpha1/#MeshConfig), +// followed by all matching EnvoyFilters in the workload's namespace. +// +// **NOTE 1**: Some aspects of this API is deeply tied to the internal +// implementation in Istio networking subsystem as well as Envoy's XDS +// API. While the EnvoyFilter API by itself will maintain backward +// compatibility, any envoy configuration provided through this +// mechanism should be carefully monitored across Istio proxy version +// upgrades, to ensure that deprecated fields are removed and replaced +// appropriately. +// +// **NOTE 2**: When multiple EnvoyFilters are bound to the same +// workload in a given namespace, all patches will be processed +// sequentially in order of creation time. The behavior is undefined +// if multiple EnvoyFilter configurations conflict with each other. +// +// **NOTE 3**: To apply an EnvoyFilter resource to all workloads +// (sidecars and gateways) in the system, define the resource in the +// config [root +// namespace](https://istio.io/docs/reference/config/istio.mesh.v1alpha1/#MeshConfig), +// without a workloadSelector. +// +// The example below declares a global default EnvoyFilter resource in +// the root namespace called `istio-config`, that adds a custom +// protocol filter on all sidecars in the system, for outbound port +// 9307. The filter should be added before the terminating tcp_proxy +// filter to take effect. In addition, it sets a 30s idle timeout for +// all HTTP connections in both gateays and sidecars. +// +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: EnvoyFilter +// metadata: +// name: custom-protocol +// namespace: istio-config # as defined in meshConfig resource. +// spec: +// configPatches: +// - applyTo: NETWORK_FILTER +// match: +// context: SIDECAR_OUTBOUND # will match outbound listeners in all sidecars +// listener: +// portNumber: 9307 +// filterChain: +// filter: +// name: "envoy.tcp_proxy" +// patch: +// operation: INSERT_BEFORE +// value: +// # This is the full filter config including the name and config or typed_config section. +// name: "envoy.config.filter.network.custom_protocol" +// config: +// ... +// - applyTo: NETWORK_FILTER # http connection manager is a filter in Envoy +// match: +// # context omitted so that this applies to both sidecars and gateways +// listener: +// filterChain: +// filter: +// name: "envoy.http_connection_manager" +// patch: +// operation: MERGE +// value: +// name: "envoy.http_connection_manager" +// typed_config: +// "@type": "type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager" +// common_http_protocol_options: +// idle_timeout: 30s +//``` +// +// The following example enables Envoy's Lua filter for all inbound +// HTTP calls arriving at service port 8080 of the reviews service pod +// with labels "app: reviews", in the bookinfo namespace. The lua +// filter calls out to an external service internal.org.net:8888 that +// requires a special cluster definition in envoy. The cluster is also +// added to the sidecar as part of this configuration. +// +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: EnvoyFilter +// metadata: +// name: reviews-lua +// namespace: bookinfo +// spec: +// workloadSelector: +// labels: +// app: reviews +// configPatches: +// # The first patch adds the lua filter to the listener/http connection manager +// - applyTo: HTTP_FILTER +// match: +// context: SIDECAR_INBOUND +// listener: +// portNumber: 8080 +// filterChain: +// filter: +// name: "envoy.http_connection_manager" +// subFilter: +// name: "envoy.router" +// patch: +// operation: INSERT_BEFORE +// value: # lua filter specification +// name: envoy.lua +// typed_config: +// "@type": "type.googleapis.com/envoy.config.filter.http.lua.v2.Lua" +// inlineCode: | +// function envoy_on_request(request_handle) +// -- Make an HTTP call to an upstream host with the following headers, body, and timeout. +// local headers, body = request_handle:httpCall( +// "lua_cluster", +// { +// [":method"] = "POST", +// [":path"] = "/acl", +// [":authority"] = "internal.org.net" +// }, +// "authorize call", +// 5000) +// end +// # The second patch adds the cluster that is referenced by the lua code +// # cds match is omitted as a new cluster is being added +// - applyTo: CLUSTER +// match: +// context: SIDECAR_OUTBOUND +// patch: +// operation: ADD +// value: # cluster specification +// name: "lua_cluster" +// type: STRICT_DNS +// connect_timeout: 0.5s +// lb_policy: ROUND_ROBIN +// hosts: +// - socket_address: +// protocol: TCP +// address: "internal.org.net" +// port_value: 8888 +// +// ``` +// +// The following example overwrites certain fields (HTTP idle timeout +// and X-Forward-For trusted hops) in the HTTP connection manager in a +// listener on the ingress gateway in istio-system namespace for the +// SNI host app.example.com: +// +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: EnvoyFilter +// metadata: +// name: hcm-tweaks +// namespace: istio-system +// spec: +// workloadSelector: +// labels: +// istio: ingress-gateway +// configPatches: +// - applyTo: NETWORK_FILTER # http connection manager is a filter in Envoy +// match: +// context: GATEWAY +// listener: +// filterChain: +// sni: app.example.com +// filter: +// name: "envoy.http_connection_manager" +// patch: +// operation: MERGE +// value: +// common_http_protocol_options: +// idle_timeout: 30s +// xff_num_trusted_hops: 5 +//``` +// + +package v1alpha3 + +import ( + bytes "bytes" + fmt "fmt" + github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// MarshalJSON is a custom marshaler for EnvoyFilter +func (this *EnvoyFilter) MarshalJSON() ([]byte, error) { + str, err := EnvoyFilterMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for EnvoyFilter +func (this *EnvoyFilter) UnmarshalJSON(b []byte) error { + return EnvoyFilterUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for EnvoyFilter_ProxyMatch +func (this *EnvoyFilter_ProxyMatch) MarshalJSON() ([]byte, error) { + str, err := EnvoyFilterMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for EnvoyFilter_ProxyMatch +func (this *EnvoyFilter_ProxyMatch) UnmarshalJSON(b []byte) error { + return EnvoyFilterUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for EnvoyFilter_ClusterMatch +func (this *EnvoyFilter_ClusterMatch) MarshalJSON() ([]byte, error) { + str, err := EnvoyFilterMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for EnvoyFilter_ClusterMatch +func (this *EnvoyFilter_ClusterMatch) UnmarshalJSON(b []byte) error { + return EnvoyFilterUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for EnvoyFilter_RouteConfigurationMatch +func (this *EnvoyFilter_RouteConfigurationMatch) MarshalJSON() ([]byte, error) { + str, err := EnvoyFilterMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for EnvoyFilter_RouteConfigurationMatch +func (this *EnvoyFilter_RouteConfigurationMatch) UnmarshalJSON(b []byte) error { + return EnvoyFilterUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for EnvoyFilter_RouteConfigurationMatch_RouteMatch +func (this *EnvoyFilter_RouteConfigurationMatch_RouteMatch) MarshalJSON() ([]byte, error) { + str, err := EnvoyFilterMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for EnvoyFilter_RouteConfigurationMatch_RouteMatch +func (this *EnvoyFilter_RouteConfigurationMatch_RouteMatch) UnmarshalJSON(b []byte) error { + return EnvoyFilterUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch +func (this *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) MarshalJSON() ([]byte, error) { + str, err := EnvoyFilterMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch +func (this *EnvoyFilter_RouteConfigurationMatch_VirtualHostMatch) UnmarshalJSON(b []byte) error { + return EnvoyFilterUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for EnvoyFilter_ListenerMatch +func (this *EnvoyFilter_ListenerMatch) MarshalJSON() ([]byte, error) { + str, err := EnvoyFilterMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for EnvoyFilter_ListenerMatch +func (this *EnvoyFilter_ListenerMatch) UnmarshalJSON(b []byte) error { + return EnvoyFilterUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for EnvoyFilter_ListenerMatch_FilterChainMatch +func (this *EnvoyFilter_ListenerMatch_FilterChainMatch) MarshalJSON() ([]byte, error) { + str, err := EnvoyFilterMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for EnvoyFilter_ListenerMatch_FilterChainMatch +func (this *EnvoyFilter_ListenerMatch_FilterChainMatch) UnmarshalJSON(b []byte) error { + return EnvoyFilterUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for EnvoyFilter_ListenerMatch_FilterMatch +func (this *EnvoyFilter_ListenerMatch_FilterMatch) MarshalJSON() ([]byte, error) { + str, err := EnvoyFilterMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for EnvoyFilter_ListenerMatch_FilterMatch +func (this *EnvoyFilter_ListenerMatch_FilterMatch) UnmarshalJSON(b []byte) error { + return EnvoyFilterUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for EnvoyFilter_ListenerMatch_SubFilterMatch +func (this *EnvoyFilter_ListenerMatch_SubFilterMatch) MarshalJSON() ([]byte, error) { + str, err := EnvoyFilterMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for EnvoyFilter_ListenerMatch_SubFilterMatch +func (this *EnvoyFilter_ListenerMatch_SubFilterMatch) UnmarshalJSON(b []byte) error { + return EnvoyFilterUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for EnvoyFilter_Patch +func (this *EnvoyFilter_Patch) MarshalJSON() ([]byte, error) { + str, err := EnvoyFilterMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for EnvoyFilter_Patch +func (this *EnvoyFilter_Patch) UnmarshalJSON(b []byte) error { + return EnvoyFilterUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for EnvoyFilter_EnvoyConfigObjectMatch +func (this *EnvoyFilter_EnvoyConfigObjectMatch) MarshalJSON() ([]byte, error) { + str, err := EnvoyFilterMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for EnvoyFilter_EnvoyConfigObjectMatch +func (this *EnvoyFilter_EnvoyConfigObjectMatch) UnmarshalJSON(b []byte) error { + return EnvoyFilterUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for EnvoyFilter_EnvoyConfigObjectPatch +func (this *EnvoyFilter_EnvoyConfigObjectPatch) MarshalJSON() ([]byte, error) { + str, err := EnvoyFilterMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for EnvoyFilter_EnvoyConfigObjectPatch +func (this *EnvoyFilter_EnvoyConfigObjectPatch) UnmarshalJSON(b []byte) error { + return EnvoyFilterUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +var ( + EnvoyFilterMarshaler = &github_com_gogo_protobuf_jsonpb.Marshaler{} + EnvoyFilterUnmarshaler = &github_com_gogo_protobuf_jsonpb.Unmarshaler{} +) diff --git a/vendor/istio.io/api/networking/v1alpha3/gateway.gen.json b/vendor/istio.io/api/networking/v1alpha3/gateway.gen.json new file mode 100644 index 0000000000..d6be58ef2c --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/gateway.gen.json @@ -0,0 +1,174 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Configuration affecting edge load balancer.", + "version": "v1alpha3" + }, + "components": { + "schemas": { + "istio.networking.v1alpha3.Gateway": { + "description": "Gateway describes a load balancer operating at the edge of the mesh receiving incoming or outgoing HTTP/TCP connections.", + "type": "object", + "properties": { + "servers": { + "description": "A list of server specifications.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.Server" + } + }, + "selector": { + "description": "One or more labels that indicate a specific set of pods/VMs on which this gateway configuration should be applied. The scope of label search is restricted to the configuration namespace in which the the resource is present. In other words, the Gateway resource must reside in the same namespace as the gateway workload instance. If selector is nil, the Gateway will be applied to all workloads.", + "type": "object", + "additionalProperties": { + "type": "string", + "format": "string" + } + } + } + }, + "istio.networking.v1alpha3.Server": { + "description": "`Server` describes the properties of the proxy on a given load balancer port. For example,", + "type": "object", + "properties": { + "tls": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ServerTLSSettings" + }, + "port": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.Port" + }, + "bind": { + "description": "The ip or the Unix domain socket to which the listener should be bound to. Format: `x.x.x.x` or `unix:///path/to/uds` or `unix://@foobar` (Linux abstract namespace). When using Unix domain sockets, the port number should be 0.", + "type": "string", + "format": "string" + }, + "hosts": { + "description": "One or more hosts exposed by this gateway. While typically applicable to HTTP services, it can also be used for TCP services using TLS with SNI. A host is specified as a `dnsName` with an optional `namespace/` prefix. The `dnsName` should be specified using FQDN format, optionally including a wildcard character in the left-most component (e.g., `prod/*.example.com`). Set the `dnsName` to `*` to select all `VirtualService` hosts from the specified namespace (e.g.,`prod/*`).", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "defaultEndpoint": { + "description": "The loopback IP endpoint or Unix domain socket to which traffic should be forwarded to by default. Format should be `127.0.0.1:PORT` or `unix:///path/to/socket` or `unix://@foobar` (Linux abstract namespace). NOT IMPLEMENTED. $hide_from_docs", + "type": "string", + "format": "string" + } + } + }, + "istio.networking.v1alpha3.Port": { + "description": "Port describes the properties of a specific port of a service.", + "type": "object", + "properties": { + "number": { + "description": "A valid non-negative integer port number.", + "type": "integer" + }, + "name": { + "description": "Label assigned to the port.", + "type": "string", + "format": "string" + }, + "protocol": { + "description": "The protocol exposed on the port. MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP|TLS. TLS implies the connection will be routed based on the SNI header to the destination without terminating the TLS connection.", + "type": "string", + "format": "string" + } + } + }, + "istio.networking.v1alpha3.ServerTLSSettings": { + "type": "object", + "properties": { + "mode": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ServerTLSSettings.TLSmode" + }, + "privateKey": { + "description": "REQUIRED if mode is `SIMPLE` or `MUTUAL`. The path to the file holding the server's private key.", + "type": "string", + "format": "string" + }, + "caCertificates": { + "description": "REQUIRED if mode is `MUTUAL`. The path to a file containing certificate authority certificates to use in verifying a presented client side certificate.", + "type": "string", + "format": "string" + }, + "credentialName": { + "description": "For gateways running on Kubernetes, the name of the secret that holds the TLS certs including the CA certificates. Applicable only on Kubernetes. The secret (of type`generic`) should contain the following keys and values: `key: \u003cprivateKey\u003e`, `cert: \u003cserverCert\u003e`, `cacert: \u003cCACertificate\u003e`. Secret of type tls for server certificates along with ca.crt key for CA certificates is also supported. Only one of server certificates and CA certificate or credentialName can be specified.", + "type": "string", + "format": "string" + }, + "subjectAltNames": { + "description": "A list of alternate names to verify the subject identity in the certificate presented by the client.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "httpsRedirect": { + "description": "If set to true, the load balancer will send a 301 redirect for all http connections, asking the clients to use HTTPS.", + "type": "boolean" + }, + "serverCertificate": { + "description": "REQUIRED if mode is `SIMPLE` or `MUTUAL`. The path to the file holding the server-side TLS certificate to use.", + "type": "string", + "format": "string" + }, + "verifyCertificateSpki": { + "description": "An optional list of base64-encoded SHA-256 hashes of the SKPIs of authorized client certificates. Note: When both verify_certificate_hash and verify_certificate_spki are specified, a hash matching either value will result in the certificate being accepted.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "verifyCertificateHash": { + "description": "An optional list of hex-encoded SHA-256 hashes of the authorized client certificates. Both simple and colon separated formats are acceptable. Note: When both verify_certificate_hash and verify_certificate_spki are specified, a hash matching either value will result in the certificate being accepted.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "minProtocolVersion": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ServerTLSSettings.TLSProtocol" + }, + "maxProtocolVersion": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ServerTLSSettings.TLSProtocol" + }, + "cipherSuites": { + "description": "Optional: If specified, only support the specified cipher list. Otherwise default to the default cipher list supported by Envoy.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + } + } + }, + "istio.networking.v1alpha3.ServerTLSSettings.TLSmode": { + "description": "TLS modes enforced by the proxy", + "type": "string", + "enum": [ + "PASSTHROUGH", + "SIMPLE", + "MUTUAL", + "AUTO_PASSTHROUGH", + "ISTIO_MUTUAL" + ] + }, + "istio.networking.v1alpha3.ServerTLSSettings.TLSProtocol": { + "description": "TLS protocol versions.", + "type": "string", + "enum": [ + "TLS_AUTO", + "TLSV1_0", + "TLSV1_1", + "TLSV1_2", + "TLSV1_3" + ] + } + } + } +} \ No newline at end of file diff --git a/vendor/istio.io/api/networking/v1alpha3/gateway.pb.go b/vendor/istio.io/api/networking/v1alpha3/gateway.pb.go new file mode 100644 index 0000000000..0c09e8741d --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/gateway.pb.go @@ -0,0 +1,2630 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/gateway.proto + +// `Gateway` describes a load balancer operating at the edge of the mesh +// receiving incoming or outgoing HTTP/TCP connections. The specification +// describes a set of ports that should be exposed, the type of protocol to +// use, SNI configuration for the load balancer, etc. +// +// For example, the following Gateway configuration sets up a proxy to act +// as a load balancer exposing port 80 and 9080 (http), 443 (https), +// 9443(https) and port 2379 (TCP) for ingress. The gateway will be +// applied to the proxy running on a pod with labels `app: +// my-gateway-controller`. While Istio will configure the proxy to listen +// on these ports, it is the responsibility of the user to ensure that +// external traffic to these ports are allowed into the mesh. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: my-gateway +// namespace: some-config-namespace +// spec: +// selector: +// app: my-gateway-controller +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - uk.bookinfo.com +// - eu.bookinfo.com +// tls: +// httpsRedirect: true # sends 301 redirect for http requests +// - port: +// number: 443 +// name: https-443 +// protocol: HTTPS +// hosts: +// - uk.bookinfo.com +// - eu.bookinfo.com +// tls: +// mode: SIMPLE # enables HTTPS on this port +// serverCertificate: /etc/certs/servercert.pem +// privateKey: /etc/certs/privatekey.pem +// - port: +// number: 9443 +// name: https-9443 +// protocol: HTTPS +// hosts: +// - "bookinfo-namespace/*.bookinfo.com" +// tls: +// mode: SIMPLE # enables HTTPS on this port +// credentialName: bookinfo-secret # fetches certs from Kubernetes secret +// - port: +// number: 9080 +// name: http-wildcard +// protocol: HTTP +// hosts: +// - "*" +// - port: +// number: 2379 # to expose internal service via external port 2379 +// name: mongo +// protocol: MONGO +// hosts: +// - "*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Gateway +// metadata: +// name: my-gateway +// namespace: some-config-namespace +// spec: +// selector: +// app: my-gateway-controller +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - uk.bookinfo.com +// - eu.bookinfo.com +// tls: +// httpsRedirect: true # sends 301 redirect for http requests +// - port: +// number: 443 +// name: https-443 +// protocol: HTTPS +// hosts: +// - uk.bookinfo.com +// - eu.bookinfo.com +// tls: +// mode: SIMPLE # enables HTTPS on this port +// serverCertificate: /etc/certs/servercert.pem +// privateKey: /etc/certs/privatekey.pem +// - port: +// number: 9443 +// name: https-9443 +// protocol: HTTPS +// hosts: +// - "bookinfo-namespace/*.bookinfo.com" +// tls: +// mode: SIMPLE # enables HTTPS on this port +// credentialName: bookinfo-secret # fetches certs from Kubernetes secret +// - port: +// number: 9080 +// name: http-wildcard +// protocol: HTTP +// hosts: +// - "*" +// - port: +// number: 2379 # to expose internal service via external port 2379 +// name: mongo +// protocol: MONGO +// hosts: +// - "*" +// ``` +// {{}} +// {{}} +// +// The Gateway specification above describes the L4-L6 properties of a load +// balancer. A `VirtualService` can then be bound to a gateway to control +// the forwarding of traffic arriving at a particular host or gateway port. +// +// For example, the following VirtualService splits traffic for +// `https://uk.bookinfo.com/reviews`, `https://eu.bookinfo.com/reviews`, +// `http://uk.bookinfo.com:9080/reviews`, +// `http://eu.bookinfo.com:9080/reviews` into two versions (prod and qa) of +// an internal reviews service on port 9080. In addition, requests +// containing the cookie "user: dev-123" will be sent to special port 7777 +// in the qa version. The same rule is also applicable inside the mesh for +// requests to the "reviews.prod.svc.cluster.local" service. This rule is +// applicable across ports 443, 9080. Note that `http://uk.bookinfo.com` +// gets redirected to `https://uk.bookinfo.com` (i.e. 80 redirects to 443). +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo-rule +// namespace: bookinfo-namespace +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// - uk.bookinfo.com +// - eu.bookinfo.com +// gateways: +// - some-config-namespace/my-gateway +// - mesh # applies to all the sidecars in the mesh +// http: +// - match: +// - headers: +// cookie: +// exact: "user=dev-123" +// route: +// - destination: +// port: +// number: 7777 +// host: reviews.qa.svc.cluster.local +// - match: +// - uri: +// prefix: /reviews/ +// route: +// - destination: +// port: +// number: 9080 # can be omitted if it's the only port for reviews +// host: reviews.prod.svc.cluster.local +// weight: 80 +// - destination: +// host: reviews.qa.svc.cluster.local +// weight: 20 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: bookinfo-rule +// namespace: bookinfo-namespace +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// - uk.bookinfo.com +// - eu.bookinfo.com +// gateways: +// - some-config-namespace/my-gateway +// - mesh # applies to all the sidecars in the mesh +// http: +// - match: +// - headers: +// cookie: +// exact: "user=dev-123" +// route: +// - destination: +// port: +// number: 7777 +// host: reviews.qa.svc.cluster.local +// - match: +// - uri: +// prefix: /reviews/ +// route: +// - destination: +// port: +// number: 9080 # can be omitted if it's the only port for reviews +// host: reviews.prod.svc.cluster.local +// weight: 80 +// - destination: +// host: reviews.qa.svc.cluster.local +// weight: 20 +// ``` +// {{}} +// {{}} +// +// The following VirtualService forwards traffic arriving at (external) +// port 27017 to internal Mongo server on port 5555. This rule is not +// applicable internally in the mesh as the gateway list omits the +// reserved name `mesh`. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo-Mongo +// namespace: bookinfo-namespace +// spec: +// hosts: +// - mongosvr.prod.svc.cluster.local # name of internal Mongo service +// gateways: +// - some-config-namespace/my-gateway # can omit the namespace if gateway is in same +// namespace as virtual service. +// tcp: +// - match: +// - port: 27017 +// route: +// - destination: +// host: mongo.prod.svc.cluster.local +// port: +// number: 5555 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: bookinfo-Mongo +// namespace: bookinfo-namespace +// spec: +// hosts: +// - mongosvr.prod.svc.cluster.local # name of internal Mongo service +// gateways: +// - some-config-namespace/my-gateway # can omit the namespace if gateway is in same +// namespace as virtual service. +// tcp: +// - match: +// - port: 27017 +// route: +// - destination: +// host: mongo.prod.svc.cluster.local +// port: +// number: 5555 +// ``` +// {{}} +// {{}} +// +// It is possible to restrict the set of virtual services that can bind to +// a gateway server using the namespace/hostname syntax in the hosts field. +// For example, the following Gateway allows any virtual service in the ns1 +// namespace to bind to it, while restricting only the virtual service with +// foo.bar.com host in the ns2 namespace to bind to it. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: my-gateway +// namespace: some-config-namespace +// spec: +// selector: +// app: my-gateway-controller +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - "ns1/*" +// - "ns2/foo.bar.com" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Gateway +// metadata: +// name: my-gateway +// namespace: some-config-namespace +// spec: +// selector: +// app: my-gateway-controller +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - "ns1/*" +// - "ns2/foo.bar.com" +// ``` +// {{}} +// {{}} +// + +package v1alpha3 + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// TLS modes enforced by the proxy +type ServerTLSSettings_TLSmode int32 + +const ( + // The SNI string presented by the client will be used as the + // match criterion in a VirtualService TLS route to determine + // the destination service from the service registry. + ServerTLSSettings_PASSTHROUGH ServerTLSSettings_TLSmode = 0 + // Secure connections with standard TLS semantics. + ServerTLSSettings_SIMPLE ServerTLSSettings_TLSmode = 1 + // Secure connections to the downstream using mutual TLS by + // presenting server certificates for authentication. + ServerTLSSettings_MUTUAL ServerTLSSettings_TLSmode = 2 + // Similar to the passthrough mode, except servers with this TLS + // mode do not require an associated VirtualService to map from + // the SNI value to service in the registry. The destination + // details such as the service/subset/port are encoded in the + // SNI value. The proxy will forward to the upstream (Envoy) + // cluster (a group of endpoints) specified by the SNI + // value. This server is typically used to provide connectivity + // between services in disparate L3 networks that otherwise do + // not have direct connectivity between their respective + // endpoints. Use of this mode assumes that both the source and + // the destination are using Istio mTLS to secure traffic. + ServerTLSSettings_AUTO_PASSTHROUGH ServerTLSSettings_TLSmode = 3 + // Secure connections from the downstream using mutual TLS by + // presenting server certificates for authentication. Compared + // to Mutual mode, this mode uses certificates, representing + // gateway workload identity, generated automatically by Istio + // for mTLS authentication. When this mode is used, all other + // fields in `TLSOptions` should be empty. + ServerTLSSettings_ISTIO_MUTUAL ServerTLSSettings_TLSmode = 4 +) + +var ServerTLSSettings_TLSmode_name = map[int32]string{ + 0: "PASSTHROUGH", + 1: "SIMPLE", + 2: "MUTUAL", + 3: "AUTO_PASSTHROUGH", + 4: "ISTIO_MUTUAL", +} + +var ServerTLSSettings_TLSmode_value = map[string]int32{ + "PASSTHROUGH": 0, + "SIMPLE": 1, + "MUTUAL": 2, + "AUTO_PASSTHROUGH": 3, + "ISTIO_MUTUAL": 4, +} + +func (x ServerTLSSettings_TLSmode) String() string { + return proto.EnumName(ServerTLSSettings_TLSmode_name, int32(x)) +} + +func (ServerTLSSettings_TLSmode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_067d98d02f84cc0b, []int{3, 0} +} + +// TLS protocol versions. +type ServerTLSSettings_TLSProtocol int32 + +const ( + // Automatically choose the optimal TLS version. + ServerTLSSettings_TLS_AUTO ServerTLSSettings_TLSProtocol = 0 + // TLS version 1.0 + ServerTLSSettings_TLSV1_0 ServerTLSSettings_TLSProtocol = 1 + // TLS version 1.1 + ServerTLSSettings_TLSV1_1 ServerTLSSettings_TLSProtocol = 2 + // TLS version 1.2 + ServerTLSSettings_TLSV1_2 ServerTLSSettings_TLSProtocol = 3 + // TLS version 1.3 + ServerTLSSettings_TLSV1_3 ServerTLSSettings_TLSProtocol = 4 +) + +var ServerTLSSettings_TLSProtocol_name = map[int32]string{ + 0: "TLS_AUTO", + 1: "TLSV1_0", + 2: "TLSV1_1", + 3: "TLSV1_2", + 4: "TLSV1_3", +} + +var ServerTLSSettings_TLSProtocol_value = map[string]int32{ + "TLS_AUTO": 0, + "TLSV1_0": 1, + "TLSV1_1": 2, + "TLSV1_2": 3, + "TLSV1_3": 4, +} + +func (x ServerTLSSettings_TLSProtocol) String() string { + return proto.EnumName(ServerTLSSettings_TLSProtocol_name, int32(x)) +} + +func (ServerTLSSettings_TLSProtocol) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_067d98d02f84cc0b, []int{3, 1} +} + +// Gateway describes a load balancer operating at the edge of the mesh +// receiving incoming or outgoing HTTP/TCP connections. +// +// +// +// +type Gateway struct { + // A list of server specifications. + Servers []*Server `protobuf:"bytes,1,rep,name=servers,proto3" json:"servers,omitempty"` + // One or more labels that indicate a specific set of pods/VMs + // on which this gateway configuration should be applied. The scope of + // label search is restricted to the configuration namespace in which the + // the resource is present. In other words, the Gateway resource must + // reside in the same namespace as the gateway workload instance. + // If selector is nil, the Gateway will be applied to all workloads. + Selector map[string]string `protobuf:"bytes,2,rep,name=selector,proto3" json:"selector,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Gateway) Reset() { *m = Gateway{} } +func (m *Gateway) String() string { return proto.CompactTextString(m) } +func (*Gateway) ProtoMessage() {} +func (*Gateway) Descriptor() ([]byte, []int) { + return fileDescriptor_067d98d02f84cc0b, []int{0} +} +func (m *Gateway) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Gateway) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Gateway.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Gateway) XXX_Merge(src proto.Message) { + xxx_messageInfo_Gateway.Merge(m, src) +} +func (m *Gateway) XXX_Size() int { + return m.Size() +} +func (m *Gateway) XXX_DiscardUnknown() { + xxx_messageInfo_Gateway.DiscardUnknown(m) +} + +var xxx_messageInfo_Gateway proto.InternalMessageInfo + +func (m *Gateway) GetServers() []*Server { + if m != nil { + return m.Servers + } + return nil +} + +func (m *Gateway) GetSelector() map[string]string { + if m != nil { + return m.Selector + } + return nil +} + +// `Server` describes the properties of the proxy on a given load balancer +// port. For example, +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: my-ingress +// spec: +// selector: +// app: my-ingress-gateway +// servers: +// - port: +// number: 80 +// name: http2 +// protocol: HTTP2 +// hosts: +// - "*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Gateway +// metadata: +// name: my-ingress +// spec: +// selector: +// app: my-ingress-gateway +// servers: +// - port: +// number: 80 +// name: http2 +// protocol: HTTP2 +// hosts: +// - "*" +// ``` +// {{}} +// {{}} +// +// Another example +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: my-tcp-ingress +// spec: +// selector: +// app: my-tcp-ingress-gateway +// servers: +// - port: +// number: 27018 +// name: mongo +// protocol: MONGO +// hosts: +// - "*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Gateway +// metadata: +// name: my-tcp-ingress +// spec: +// selector: +// app: my-tcp-ingress-gateway +// servers: +// - port: +// number: 27018 +// name: mongo +// protocol: MONGO +// hosts: +// - "*" +// ``` +// {{}} +// {{}} +// +// The following is an example of TLS configuration for port 443 +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: my-tls-ingress +// spec: +// selector: +// app: my-tls-ingress-gateway +// servers: +// - port: +// number: 443 +// name: https +// protocol: HTTPS +// hosts: +// - "*" +// tls: +// mode: SIMPLE +// serverCertificate: /etc/certs/server.pem +// privateKey: /etc/certs/privatekey.pem +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Gateway +// metadata: +// name: my-tls-ingress +// spec: +// selector: +// app: my-tls-ingress-gateway +// servers: +// - port: +// number: 443 +// name: https +// protocol: HTTPS +// hosts: +// - "*" +// tls: +// mode: SIMPLE +// serverCertificate: /etc/certs/server.pem +// privateKey: /etc/certs/privatekey.pem +// ``` +// {{}} +// {{}} +// +type Server struct { + // The Port on which the proxy should listen for incoming + // connections. + Port *Port `protobuf:"bytes,1,opt,name=port,proto3" json:"port,omitempty"` + // $hide_from_docs + // The ip or the Unix domain socket to which the listener should be bound + // to. Format: `x.x.x.x` or `unix:///path/to/uds` or `unix://@foobar` + // (Linux abstract namespace). When using Unix domain sockets, the port + // number should be 0. + Bind string `protobuf:"bytes,4,opt,name=bind,proto3" json:"bind,omitempty"` + // One or more hosts exposed by this gateway. + // While typically applicable to + // HTTP services, it can also be used for TCP services using TLS with SNI. + // A host is specified as a `dnsName` with an optional `namespace/` prefix. + // The `dnsName` should be specified using FQDN format, optionally including + // a wildcard character in the left-most component (e.g., `prod/*.example.com`). + // Set the `dnsName` to `*` to select all `VirtualService` hosts from the + // specified namespace (e.g.,`prod/*`). + // + // The `namespace` can be set to `*` or `.`, representing any or the current + // namespace, respectively. For example, `*/foo.example.com` selects the + // service from any available namespace while `./foo.example.com` only selects + // the service from the namespace of the sidecar. The default, if no `namespace/` + // is specified, is `*/`, that is, select services from any namespace. + // Any associated `DestinationRule` in the selected namespace will also be used. + // + // A `VirtualService` must be bound to the gateway and must have one or + // more hosts that match the hosts specified in a server. The match + // could be an exact match or a suffix match with the server's hosts. For + // example, if the server's hosts specifies `*.example.com`, a + // `VirtualService` with hosts `dev.example.com` or `prod.example.com` will + // match. However, a `VirtualService` with host `example.com` or + // `newexample.com` will not match. + // + // NOTE: Only virtual services exported to the gateway's namespace + // (e.g., `exportTo` value of `*`) can be referenced. + // Private configurations (e.g., `exportTo` set to `.`) will not be + // available. Refer to the `exportTo` setting in `VirtualService`, + // `DestinationRule`, and `ServiceEntry` configurations for details. + Hosts []string `protobuf:"bytes,2,rep,name=hosts,proto3" json:"hosts,omitempty"` + // Set of TLS related options that govern the server's behavior. Use + // these options to control if all http requests should be redirected to + // https, and the TLS modes to use. + Tls *ServerTLSSettings `protobuf:"bytes,3,opt,name=tls,proto3" json:"tls,omitempty"` + // The loopback IP endpoint or Unix domain socket to which traffic should + // be forwarded to by default. Format should be `127.0.0.1:PORT` or + // `unix:///path/to/socket` or `unix://@foobar` (Linux abstract namespace). + // NOT IMPLEMENTED. + // $hide_from_docs + DefaultEndpoint string `protobuf:"bytes,5,opt,name=default_endpoint,json=defaultEndpoint,proto3" json:"default_endpoint,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Server) Reset() { *m = Server{} } +func (m *Server) String() string { return proto.CompactTextString(m) } +func (*Server) ProtoMessage() {} +func (*Server) Descriptor() ([]byte, []int) { + return fileDescriptor_067d98d02f84cc0b, []int{1} +} +func (m *Server) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Server) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Server.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Server) XXX_Merge(src proto.Message) { + xxx_messageInfo_Server.Merge(m, src) +} +func (m *Server) XXX_Size() int { + return m.Size() +} +func (m *Server) XXX_DiscardUnknown() { + xxx_messageInfo_Server.DiscardUnknown(m) +} + +var xxx_messageInfo_Server proto.InternalMessageInfo + +func (m *Server) GetPort() *Port { + if m != nil { + return m.Port + } + return nil +} + +func (m *Server) GetBind() string { + if m != nil { + return m.Bind + } + return "" +} + +func (m *Server) GetHosts() []string { + if m != nil { + return m.Hosts + } + return nil +} + +func (m *Server) GetTls() *ServerTLSSettings { + if m != nil { + return m.Tls + } + return nil +} + +func (m *Server) GetDefaultEndpoint() string { + if m != nil { + return m.DefaultEndpoint + } + return "" +} + +// Port describes the properties of a specific port of a service. +type Port struct { + // A valid non-negative integer port number. + Number uint32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` + // The protocol exposed on the port. + // MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP|TLS. + // TLS implies the connection will be routed based on the SNI header to + // the destination without terminating the TLS connection. + Protocol string `protobuf:"bytes,2,opt,name=protocol,proto3" json:"protocol,omitempty"` + // Label assigned to the port. + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Port) Reset() { *m = Port{} } +func (m *Port) String() string { return proto.CompactTextString(m) } +func (*Port) ProtoMessage() {} +func (*Port) Descriptor() ([]byte, []int) { + return fileDescriptor_067d98d02f84cc0b, []int{2} +} +func (m *Port) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Port) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Port.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Port) XXX_Merge(src proto.Message) { + xxx_messageInfo_Port.Merge(m, src) +} +func (m *Port) XXX_Size() int { + return m.Size() +} +func (m *Port) XXX_DiscardUnknown() { + xxx_messageInfo_Port.DiscardUnknown(m) +} + +var xxx_messageInfo_Port proto.InternalMessageInfo + +func (m *Port) GetNumber() uint32 { + if m != nil { + return m.Number + } + return 0 +} + +func (m *Port) GetProtocol() string { + if m != nil { + return m.Protocol + } + return "" +} + +func (m *Port) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type ServerTLSSettings struct { + // If set to true, the load balancer will send a 301 redirect for + // all http connections, asking the clients to use HTTPS. + HttpsRedirect bool `protobuf:"varint,1,opt,name=https_redirect,json=httpsRedirect,proto3" json:"https_redirect,omitempty"` + // Optional: Indicates whether connections to this port should be + // secured using TLS. The value of this field determines how TLS is + // enforced. + Mode ServerTLSSettings_TLSmode `protobuf:"varint,2,opt,name=mode,proto3,enum=istio.networking.v1alpha3.ServerTLSSettings_TLSmode" json:"mode,omitempty"` + // REQUIRED if mode is `SIMPLE` or `MUTUAL`. The path to the file + // holding the server-side TLS certificate to use. + ServerCertificate string `protobuf:"bytes,3,opt,name=server_certificate,json=serverCertificate,proto3" json:"server_certificate,omitempty"` + // REQUIRED if mode is `SIMPLE` or `MUTUAL`. The path to the file + // holding the server's private key. + PrivateKey string `protobuf:"bytes,4,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"` + // REQUIRED if mode is `MUTUAL`. The path to a file containing + // certificate authority certificates to use in verifying a presented + // client side certificate. + CaCertificates string `protobuf:"bytes,5,opt,name=ca_certificates,json=caCertificates,proto3" json:"ca_certificates,omitempty"` + // For gateways running on Kubernetes, the name of the secret that + // holds the TLS certs including the CA certificates. Applicable + // only on Kubernetes. The secret (of type`generic`) should + // contain the following keys and values: `key: + // `, `cert: `, `cacert: `. + // Secret of type tls for server certificates along with + // ca.crt key for CA certificates is also supported. + // Only one of server certificates and CA certificate + // or credentialName can be specified. + CredentialName string `protobuf:"bytes,10,opt,name=credential_name,json=credentialName,proto3" json:"credential_name,omitempty"` + // A list of alternate names to verify the subject identity in the + // certificate presented by the client. + SubjectAltNames []string `protobuf:"bytes,6,rep,name=subject_alt_names,json=subjectAltNames,proto3" json:"subject_alt_names,omitempty"` + // An optional list of base64-encoded SHA-256 hashes of the SKPIs of + // authorized client certificates. + // Note: When both verify_certificate_hash and verify_certificate_spki + // are specified, a hash matching either value will result in the + // certificate being accepted. + VerifyCertificateSpki []string `protobuf:"bytes,11,rep,name=verify_certificate_spki,json=verifyCertificateSpki,proto3" json:"verify_certificate_spki,omitempty"` + // An optional list of hex-encoded SHA-256 hashes of the + // authorized client certificates. Both simple and colon separated + // formats are acceptable. + // Note: When both verify_certificate_hash and verify_certificate_spki + // are specified, a hash matching either value will result in the + // certificate being accepted. + VerifyCertificateHash []string `protobuf:"bytes,12,rep,name=verify_certificate_hash,json=verifyCertificateHash,proto3" json:"verify_certificate_hash,omitempty"` + // Optional: Minimum TLS protocol version. + MinProtocolVersion ServerTLSSettings_TLSProtocol `protobuf:"varint,7,opt,name=min_protocol_version,json=minProtocolVersion,proto3,enum=istio.networking.v1alpha3.ServerTLSSettings_TLSProtocol" json:"min_protocol_version,omitempty"` + // Optional: Maximum TLS protocol version. + MaxProtocolVersion ServerTLSSettings_TLSProtocol `protobuf:"varint,8,opt,name=max_protocol_version,json=maxProtocolVersion,proto3,enum=istio.networking.v1alpha3.ServerTLSSettings_TLSProtocol" json:"max_protocol_version,omitempty"` + // Optional: If specified, only support the specified cipher list. + // Otherwise default to the default cipher list supported by Envoy. + CipherSuites []string `protobuf:"bytes,9,rep,name=cipher_suites,json=cipherSuites,proto3" json:"cipher_suites,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ServerTLSSettings) Reset() { *m = ServerTLSSettings{} } +func (m *ServerTLSSettings) String() string { return proto.CompactTextString(m) } +func (*ServerTLSSettings) ProtoMessage() {} +func (*ServerTLSSettings) Descriptor() ([]byte, []int) { + return fileDescriptor_067d98d02f84cc0b, []int{3} +} +func (m *ServerTLSSettings) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ServerTLSSettings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ServerTLSSettings.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ServerTLSSettings) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServerTLSSettings.Merge(m, src) +} +func (m *ServerTLSSettings) XXX_Size() int { + return m.Size() +} +func (m *ServerTLSSettings) XXX_DiscardUnknown() { + xxx_messageInfo_ServerTLSSettings.DiscardUnknown(m) +} + +var xxx_messageInfo_ServerTLSSettings proto.InternalMessageInfo + +func (m *ServerTLSSettings) GetHttpsRedirect() bool { + if m != nil { + return m.HttpsRedirect + } + return false +} + +func (m *ServerTLSSettings) GetMode() ServerTLSSettings_TLSmode { + if m != nil { + return m.Mode + } + return ServerTLSSettings_PASSTHROUGH +} + +func (m *ServerTLSSettings) GetServerCertificate() string { + if m != nil { + return m.ServerCertificate + } + return "" +} + +func (m *ServerTLSSettings) GetPrivateKey() string { + if m != nil { + return m.PrivateKey + } + return "" +} + +func (m *ServerTLSSettings) GetCaCertificates() string { + if m != nil { + return m.CaCertificates + } + return "" +} + +func (m *ServerTLSSettings) GetCredentialName() string { + if m != nil { + return m.CredentialName + } + return "" +} + +func (m *ServerTLSSettings) GetSubjectAltNames() []string { + if m != nil { + return m.SubjectAltNames + } + return nil +} + +func (m *ServerTLSSettings) GetVerifyCertificateSpki() []string { + if m != nil { + return m.VerifyCertificateSpki + } + return nil +} + +func (m *ServerTLSSettings) GetVerifyCertificateHash() []string { + if m != nil { + return m.VerifyCertificateHash + } + return nil +} + +func (m *ServerTLSSettings) GetMinProtocolVersion() ServerTLSSettings_TLSProtocol { + if m != nil { + return m.MinProtocolVersion + } + return ServerTLSSettings_TLS_AUTO +} + +func (m *ServerTLSSettings) GetMaxProtocolVersion() ServerTLSSettings_TLSProtocol { + if m != nil { + return m.MaxProtocolVersion + } + return ServerTLSSettings_TLS_AUTO +} + +func (m *ServerTLSSettings) GetCipherSuites() []string { + if m != nil { + return m.CipherSuites + } + return nil +} + +func init() { + proto.RegisterEnum("istio.networking.v1alpha3.ServerTLSSettings_TLSmode", ServerTLSSettings_TLSmode_name, ServerTLSSettings_TLSmode_value) + proto.RegisterEnum("istio.networking.v1alpha3.ServerTLSSettings_TLSProtocol", ServerTLSSettings_TLSProtocol_name, ServerTLSSettings_TLSProtocol_value) + proto.RegisterType((*Gateway)(nil), "istio.networking.v1alpha3.Gateway") + proto.RegisterMapType((map[string]string)(nil), "istio.networking.v1alpha3.Gateway.SelectorEntry") + proto.RegisterType((*Server)(nil), "istio.networking.v1alpha3.Server") + proto.RegisterType((*Port)(nil), "istio.networking.v1alpha3.Port") + proto.RegisterType((*ServerTLSSettings)(nil), "istio.networking.v1alpha3.ServerTLSSettings") +} + +func init() { proto.RegisterFile("networking/v1alpha3/gateway.proto", fileDescriptor_067d98d02f84cc0b) } + +var fileDescriptor_067d98d02f84cc0b = []byte{ + // 764 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x55, 0xd1, 0x6e, 0x1a, 0x47, + 0x14, 0xcd, 0xc2, 0x1a, 0xf0, 0x05, 0xcc, 0x7a, 0xe4, 0x2a, 0x9b, 0x54, 0x32, 0x0e, 0x55, 0xd5, + 0xb4, 0x6a, 0x97, 0x18, 0x57, 0x95, 0xd5, 0x4a, 0x55, 0x49, 0x65, 0x05, 0xab, 0xa4, 0xd0, 0x5d, + 0xc8, 0x43, 0xa4, 0x6a, 0x35, 0x2c, 0x03, 0x3b, 0x61, 0xd9, 0x59, 0xcd, 0x0c, 0x24, 0xfc, 0x61, + 0x1f, 0xfb, 0xde, 0x3e, 0x44, 0x7e, 0xee, 0x47, 0x54, 0x3b, 0x33, 0x04, 0xda, 0xd4, 0xa9, 0xa2, + 0xbc, 0xcd, 0x9c, 0x7b, 0xcf, 0xb9, 0x67, 0xcf, 0x1d, 0x1b, 0x78, 0x90, 0x12, 0xf9, 0x92, 0xf1, + 0x05, 0x4d, 0xe7, 0xed, 0xf5, 0x39, 0x4e, 0xb2, 0x18, 0x5f, 0xb4, 0xe7, 0x58, 0x92, 0x97, 0x78, + 0xe3, 0x65, 0x9c, 0x49, 0x86, 0xee, 0x51, 0x21, 0x29, 0xf3, 0x76, 0x8d, 0xde, 0xb6, 0xf1, 0x7e, + 0x73, 0xce, 0xd8, 0x3c, 0x21, 0x6d, 0x9c, 0xd1, 0xf6, 0x8c, 0x92, 0x64, 0x1a, 0x4e, 0x48, 0x8c, + 0xd7, 0x94, 0x71, 0xcd, 0x6d, 0xfd, 0x61, 0x41, 0xf9, 0x89, 0x56, 0x43, 0x3f, 0x40, 0x59, 0x10, + 0xbe, 0x26, 0x5c, 0xb8, 0xd6, 0x59, 0xf1, 0x61, 0xb5, 0xf3, 0xc0, 0xbb, 0x55, 0xd9, 0x0b, 0x54, + 0xe7, 0xe3, 0xe2, 0xeb, 0x6e, 0xc1, 0xdf, 0xd2, 0xd0, 0x2f, 0x50, 0x11, 0x24, 0x21, 0x91, 0x64, + 0xdc, 0x2d, 0x28, 0x89, 0x47, 0xef, 0x90, 0x30, 0x73, 0xbd, 0xc0, 0x50, 0xae, 0x52, 0xc9, 0x37, + 0x5a, 0xf1, 0x8d, 0xcc, 0xfd, 0xef, 0xa0, 0xfe, 0x8f, 0x3a, 0x72, 0xa0, 0xb8, 0x20, 0x1b, 0xd7, + 0x3a, 0xb3, 0x1e, 0x1e, 0xfa, 0xf9, 0x11, 0x9d, 0xc0, 0xc1, 0x1a, 0x27, 0x2b, 0xe2, 0x16, 0x14, + 0xa6, 0x2f, 0xdf, 0x16, 0x2e, 0xad, 0xd6, 0x9f, 0x16, 0x94, 0xb4, 0x51, 0x74, 0x09, 0x76, 0xc6, + 0xb8, 0x54, 0xbc, 0x6a, 0xa7, 0xf9, 0x0e, 0x5b, 0x43, 0xc6, 0xa5, 0x76, 0xa1, 0x18, 0x08, 0x81, + 0x3d, 0xa1, 0xe9, 0xd4, 0xb5, 0x95, 0xba, 0x3a, 0xa3, 0x7b, 0x70, 0x10, 0x33, 0x21, 0x85, 0xfa, + 0xca, 0x43, 0xdd, 0xad, 0x11, 0xf4, 0x3d, 0x14, 0x65, 0x22, 0xdc, 0xa2, 0x9a, 0xf3, 0xe5, 0xff, + 0x26, 0x38, 0xea, 0x07, 0x01, 0x91, 0x92, 0xa6, 0x73, 0xe1, 0xe7, 0x44, 0xf4, 0x39, 0x38, 0x53, + 0x32, 0xc3, 0xab, 0x44, 0x86, 0x24, 0x9d, 0x66, 0x8c, 0xa6, 0xd2, 0x3d, 0x50, 0xa3, 0x1b, 0x06, + 0xbf, 0x32, 0x70, 0xeb, 0x57, 0xb0, 0x73, 0xb3, 0xe8, 0x63, 0x28, 0xa5, 0xab, 0xe5, 0x84, 0x70, + 0xf5, 0x75, 0x75, 0x6d, 0xc7, 0x40, 0xa8, 0x09, 0x15, 0xb5, 0xea, 0x88, 0x25, 0x3a, 0x20, 0x93, + 0xf0, 0x16, 0x44, 0x77, 0xc1, 0x4e, 0xf1, 0x92, 0x28, 0xc7, 0xa6, 0xa8, 0x80, 0xd6, 0x5f, 0x25, + 0x38, 0x7e, 0xcb, 0x24, 0xfa, 0x14, 0x8e, 0x62, 0x29, 0x33, 0x11, 0x72, 0x32, 0xa5, 0x9c, 0x44, + 0x3a, 0xd2, 0x8a, 0x5f, 0x57, 0xa8, 0x6f, 0x40, 0xd4, 0x03, 0x7b, 0xc9, 0xa6, 0x7a, 0x27, 0x47, + 0x9d, 0xaf, 0xdf, 0x27, 0x07, 0x6f, 0xd4, 0x0f, 0x72, 0xae, 0xaf, 0x14, 0xd0, 0x57, 0x80, 0xf4, + 0xfb, 0x0a, 0x23, 0xc2, 0x25, 0x9d, 0xd1, 0x08, 0x4b, 0xe3, 0xd6, 0x3f, 0xd6, 0x95, 0x1f, 0x77, + 0x05, 0xd4, 0x84, 0x6a, 0xc6, 0xe9, 0x1a, 0x4b, 0x12, 0xe6, 0xef, 0x44, 0x6f, 0x0d, 0x0c, 0xf4, + 0x13, 0xd9, 0xa0, 0xcf, 0xa0, 0x11, 0xe1, 0x7d, 0x2d, 0x61, 0xf2, 0x3d, 0x8a, 0xf0, 0x9e, 0x90, + 0x50, 0x8d, 0x9c, 0x4c, 0x49, 0x2a, 0x29, 0x4e, 0x42, 0x95, 0x11, 0x98, 0xc6, 0x37, 0xf0, 0xcf, + 0x78, 0x49, 0xd0, 0x17, 0x70, 0x2c, 0x56, 0x93, 0x17, 0x24, 0x92, 0x21, 0x4e, 0xa4, 0xea, 0x14, + 0x6e, 0x29, 0x7f, 0x19, 0x7e, 0xc3, 0x14, 0xba, 0x89, 0xcc, 0x5b, 0x05, 0xfa, 0x06, 0xee, 0xae, + 0x09, 0xa7, 0xb3, 0xcd, 0xbe, 0x83, 0x50, 0x64, 0x0b, 0xea, 0x56, 0x15, 0xe3, 0x23, 0x5d, 0xde, + 0x73, 0x12, 0x64, 0x0b, 0x7a, 0x0b, 0x2f, 0xc6, 0x22, 0x76, 0x6b, 0xb7, 0xf0, 0x7a, 0x58, 0xc4, + 0xe8, 0x05, 0x9c, 0x2c, 0x69, 0x1a, 0x6e, 0xb7, 0x1d, 0xe6, 0x7f, 0xa7, 0x94, 0xa5, 0x6e, 0x59, + 0xed, 0xe5, 0xf2, 0x7d, 0xf7, 0x32, 0x34, 0x3a, 0x3e, 0x5a, 0xd2, 0x74, 0x7b, 0x79, 0xa6, 0x35, + 0xd5, 0x2c, 0xfc, 0xea, 0xed, 0x59, 0x95, 0x0f, 0x9e, 0x85, 0x5f, 0xfd, 0x7b, 0xd6, 0x27, 0x50, + 0x8f, 0x68, 0x16, 0x13, 0x1e, 0x8a, 0x15, 0xcd, 0x77, 0x78, 0xa8, 0x52, 0xa8, 0x69, 0x30, 0x50, + 0x58, 0xeb, 0x39, 0x94, 0xcd, 0x5b, 0x42, 0x0d, 0xa8, 0x0e, 0xbb, 0x41, 0x30, 0xea, 0xf9, 0x83, + 0xf1, 0x93, 0x9e, 0x73, 0x07, 0x01, 0x94, 0x82, 0xeb, 0xa7, 0xc3, 0xfe, 0x95, 0x63, 0xe5, 0xe7, + 0xa7, 0xe3, 0xd1, 0xb8, 0xdb, 0x77, 0x0a, 0xe8, 0x04, 0x9c, 0xee, 0x78, 0x34, 0x08, 0xf7, 0xbb, + 0x8b, 0xc8, 0x81, 0xda, 0x75, 0x30, 0xba, 0x1e, 0x84, 0xa6, 0xcf, 0x6e, 0x0d, 0xa0, 0xba, 0xe7, + 0x11, 0xd5, 0xa0, 0x32, 0xea, 0x07, 0x61, 0x4e, 0x75, 0xee, 0xa0, 0xaa, 0x1a, 0xfc, 0xec, 0x3c, + 0x7c, 0xe4, 0x58, 0xbb, 0xcb, 0xb9, 0x53, 0xd8, 0x5d, 0x3a, 0x4e, 0x71, 0x77, 0xb9, 0x70, 0xec, + 0xc7, 0xde, 0x6f, 0x37, 0xa7, 0xd6, 0xef, 0x37, 0xa7, 0xd6, 0xeb, 0x9b, 0x53, 0xeb, 0xf9, 0x99, + 0x0e, 0x8b, 0x32, 0xf5, 0xbf, 0xfb, 0x3f, 0x7e, 0x04, 0x26, 0x25, 0x95, 0xf3, 0xc5, 0xdf, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x98, 0x2d, 0x3d, 0xc8, 0x22, 0x06, 0x00, 0x00, +} + +func (m *Gateway) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Gateway) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Gateway) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Selector) > 0 { + for k := range m.Selector { + v := m.Selector[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGateway(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintGateway(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintGateway(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Servers) > 0 { + for iNdEx := len(m.Servers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Servers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Server) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Server) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Server) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.DefaultEndpoint) > 0 { + i -= len(m.DefaultEndpoint) + copy(dAtA[i:], m.DefaultEndpoint) + i = encodeVarintGateway(dAtA, i, uint64(len(m.DefaultEndpoint))) + i-- + dAtA[i] = 0x2a + } + if len(m.Bind) > 0 { + i -= len(m.Bind) + copy(dAtA[i:], m.Bind) + i = encodeVarintGateway(dAtA, i, uint64(len(m.Bind))) + i-- + dAtA[i] = 0x22 + } + if m.Tls != nil { + { + size, err := m.Tls.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Hosts) > 0 { + for iNdEx := len(m.Hosts) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Hosts[iNdEx]) + copy(dAtA[i:], m.Hosts[iNdEx]) + i = encodeVarintGateway(dAtA, i, uint64(len(m.Hosts[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if m.Port != nil { + { + size, err := m.Port.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGateway(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Port) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Port) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Port) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGateway(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if len(m.Protocol) > 0 { + i -= len(m.Protocol) + copy(dAtA[i:], m.Protocol) + i = encodeVarintGateway(dAtA, i, uint64(len(m.Protocol))) + i-- + dAtA[i] = 0x12 + } + if m.Number != 0 { + i = encodeVarintGateway(dAtA, i, uint64(m.Number)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ServerTLSSettings) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ServerTLSSettings) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServerTLSSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.VerifyCertificateHash) > 0 { + for iNdEx := len(m.VerifyCertificateHash) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.VerifyCertificateHash[iNdEx]) + copy(dAtA[i:], m.VerifyCertificateHash[iNdEx]) + i = encodeVarintGateway(dAtA, i, uint64(len(m.VerifyCertificateHash[iNdEx]))) + i-- + dAtA[i] = 0x62 + } + } + if len(m.VerifyCertificateSpki) > 0 { + for iNdEx := len(m.VerifyCertificateSpki) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.VerifyCertificateSpki[iNdEx]) + copy(dAtA[i:], m.VerifyCertificateSpki[iNdEx]) + i = encodeVarintGateway(dAtA, i, uint64(len(m.VerifyCertificateSpki[iNdEx]))) + i-- + dAtA[i] = 0x5a + } + } + if len(m.CredentialName) > 0 { + i -= len(m.CredentialName) + copy(dAtA[i:], m.CredentialName) + i = encodeVarintGateway(dAtA, i, uint64(len(m.CredentialName))) + i-- + dAtA[i] = 0x52 + } + if len(m.CipherSuites) > 0 { + for iNdEx := len(m.CipherSuites) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.CipherSuites[iNdEx]) + copy(dAtA[i:], m.CipherSuites[iNdEx]) + i = encodeVarintGateway(dAtA, i, uint64(len(m.CipherSuites[iNdEx]))) + i-- + dAtA[i] = 0x4a + } + } + if m.MaxProtocolVersion != 0 { + i = encodeVarintGateway(dAtA, i, uint64(m.MaxProtocolVersion)) + i-- + dAtA[i] = 0x40 + } + if m.MinProtocolVersion != 0 { + i = encodeVarintGateway(dAtA, i, uint64(m.MinProtocolVersion)) + i-- + dAtA[i] = 0x38 + } + if len(m.SubjectAltNames) > 0 { + for iNdEx := len(m.SubjectAltNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SubjectAltNames[iNdEx]) + copy(dAtA[i:], m.SubjectAltNames[iNdEx]) + i = encodeVarintGateway(dAtA, i, uint64(len(m.SubjectAltNames[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.CaCertificates) > 0 { + i -= len(m.CaCertificates) + copy(dAtA[i:], m.CaCertificates) + i = encodeVarintGateway(dAtA, i, uint64(len(m.CaCertificates))) + i-- + dAtA[i] = 0x2a + } + if len(m.PrivateKey) > 0 { + i -= len(m.PrivateKey) + copy(dAtA[i:], m.PrivateKey) + i = encodeVarintGateway(dAtA, i, uint64(len(m.PrivateKey))) + i-- + dAtA[i] = 0x22 + } + if len(m.ServerCertificate) > 0 { + i -= len(m.ServerCertificate) + copy(dAtA[i:], m.ServerCertificate) + i = encodeVarintGateway(dAtA, i, uint64(len(m.ServerCertificate))) + i-- + dAtA[i] = 0x1a + } + if m.Mode != 0 { + i = encodeVarintGateway(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x10 + } + if m.HttpsRedirect { + i-- + if m.HttpsRedirect { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintGateway(dAtA []byte, offset int, v uint64) int { + offset -= sovGateway(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Gateway) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Servers) > 0 { + for _, e := range m.Servers { + l = e.Size() + n += 1 + l + sovGateway(uint64(l)) + } + } + if len(m.Selector) > 0 { + for k, v := range m.Selector { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGateway(uint64(len(k))) + 1 + len(v) + sovGateway(uint64(len(v))) + n += mapEntrySize + 1 + sovGateway(uint64(mapEntrySize)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Server) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Port != nil { + l = m.Port.Size() + n += 1 + l + sovGateway(uint64(l)) + } + if len(m.Hosts) > 0 { + for _, s := range m.Hosts { + l = len(s) + n += 1 + l + sovGateway(uint64(l)) + } + } + if m.Tls != nil { + l = m.Tls.Size() + n += 1 + l + sovGateway(uint64(l)) + } + l = len(m.Bind) + if l > 0 { + n += 1 + l + sovGateway(uint64(l)) + } + l = len(m.DefaultEndpoint) + if l > 0 { + n += 1 + l + sovGateway(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Port) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Number != 0 { + n += 1 + sovGateway(uint64(m.Number)) + } + l = len(m.Protocol) + if l > 0 { + n += 1 + l + sovGateway(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovGateway(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *ServerTLSSettings) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.HttpsRedirect { + n += 2 + } + if m.Mode != 0 { + n += 1 + sovGateway(uint64(m.Mode)) + } + l = len(m.ServerCertificate) + if l > 0 { + n += 1 + l + sovGateway(uint64(l)) + } + l = len(m.PrivateKey) + if l > 0 { + n += 1 + l + sovGateway(uint64(l)) + } + l = len(m.CaCertificates) + if l > 0 { + n += 1 + l + sovGateway(uint64(l)) + } + if len(m.SubjectAltNames) > 0 { + for _, s := range m.SubjectAltNames { + l = len(s) + n += 1 + l + sovGateway(uint64(l)) + } + } + if m.MinProtocolVersion != 0 { + n += 1 + sovGateway(uint64(m.MinProtocolVersion)) + } + if m.MaxProtocolVersion != 0 { + n += 1 + sovGateway(uint64(m.MaxProtocolVersion)) + } + if len(m.CipherSuites) > 0 { + for _, s := range m.CipherSuites { + l = len(s) + n += 1 + l + sovGateway(uint64(l)) + } + } + l = len(m.CredentialName) + if l > 0 { + n += 1 + l + sovGateway(uint64(l)) + } + if len(m.VerifyCertificateSpki) > 0 { + for _, s := range m.VerifyCertificateSpki { + l = len(s) + n += 1 + l + sovGateway(uint64(l)) + } + } + if len(m.VerifyCertificateHash) > 0 { + for _, s := range m.VerifyCertificateHash { + l = len(s) + n += 1 + l + sovGateway(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovGateway(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGateway(x uint64) (n int) { + return sovGateway(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Gateway) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Gateway: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Gateway: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Servers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Servers = append(m.Servers, &Server{}) + if err := m.Servers[len(m.Servers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Selector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Selector == nil { + m.Selector = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGateway + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGateway + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGateway + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGateway + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGateway(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Selector[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGateway(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Server) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Server: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Server: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Port == nil { + m.Port = &Port{} + } + if err := m.Port.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hosts", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hosts = append(m.Hosts, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tls", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Tls == nil { + m.Tls = &ServerTLSSettings{} + } + if err := m.Tls.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultEndpoint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DefaultEndpoint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGateway(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Port) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Port: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Port: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) + } + m.Number = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Number |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Protocol", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Protocol = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGateway(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ServerTLSSettings) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ServerTLSSettings: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServerTLSSettings: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HttpsRedirect", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.HttpsRedirect = bool(v != 0) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) + } + m.Mode = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Mode |= ServerTLSSettings_TLSmode(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServerCertificate", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServerCertificate = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PrivateKey", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PrivateKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CaCertificates", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CaCertificates = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubjectAltNames", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubjectAltNames = append(m.SubjectAltNames, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MinProtocolVersion", wireType) + } + m.MinProtocolVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MinProtocolVersion |= ServerTLSSettings_TLSProtocol(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxProtocolVersion", wireType) + } + m.MaxProtocolVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxProtocolVersion |= ServerTLSSettings_TLSProtocol(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CipherSuites", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CipherSuites = append(m.CipherSuites, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CredentialName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.CredentialName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VerifyCertificateSpki", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VerifyCertificateSpki = append(m.VerifyCertificateSpki, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VerifyCertificateHash", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGateway + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGateway + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGateway + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.VerifyCertificateHash = append(m.VerifyCertificateHash, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGateway(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthGateway + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGateway(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGateway + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGateway + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGateway + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGateway + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthGateway + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGateway + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipGateway(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthGateway + } + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthGateway = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGateway = fmt.Errorf("proto: integer overflow") +) diff --git a/vendor/istio.io/api/networking/v1alpha3/gateway.pb.html b/vendor/istio.io/api/networking/v1alpha3/gateway.pb.html new file mode 100644 index 0000000000..2c84f3f15c --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/gateway.pb.html @@ -0,0 +1,954 @@ +--- +title: Gateway +description: Configuration affecting edge load balancer. +location: https://istio.io/docs/reference/config/networking/gateway.html +layout: protoc-gen-docs +generator: protoc-gen-docs +schema: istio.networking.v1alpha3.Gateway +aliases: [/docs/reference/config/networking/v1alpha3/gateway] +number_of_entries: 6 +--- +

Gateway describes a load balancer operating at the edge of the mesh +receiving incoming or outgoing HTTP/TCP connections. The specification +describes a set of ports that should be exposed, the type of protocol to +use, SNI configuration for the load balancer, etc.

+ +

For example, the following Gateway configuration sets up a proxy to act +as a load balancer exposing port 80 and 9080 (http), 443 (https), +9443(https) and port 2379 (TCP) for ingress. The gateway will be +applied to the proxy running on a pod with labels app: +my-gateway-controller. While Istio will configure the proxy to listen +on these ports, it is the responsibility of the user to ensure that +external traffic to these ports are allowed into the mesh.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: Gateway
+metadata:
+  name: my-gateway
+  namespace: some-config-namespace
+spec:
+  selector:
+    app: my-gateway-controller
+  servers:
+  - port:
+      number: 80
+      name: http
+      protocol: HTTP
+    hosts:
+    - uk.bookinfo.com
+    - eu.bookinfo.com
+    tls:
+      httpsRedirect: true # sends 301 redirect for http requests
+  - port:
+      number: 443
+      name: https-443
+      protocol: HTTPS
+    hosts:
+    - uk.bookinfo.com
+    - eu.bookinfo.com
+    tls:
+      mode: SIMPLE # enables HTTPS on this port
+      serverCertificate: /etc/certs/servercert.pem
+      privateKey: /etc/certs/privatekey.pem
+  - port:
+      number: 9443
+      name: https-9443
+      protocol: HTTPS
+    hosts:
+    - "bookinfo-namespace/*.bookinfo.com"
+    tls:
+      mode: SIMPLE # enables HTTPS on this port
+      credentialName: bookinfo-secret # fetches certs from Kubernetes secret
+  - port:
+      number: 9080
+      name: http-wildcard
+      protocol: HTTP
+    hosts:
+    - "*"
+  - port:
+      number: 2379 # to expose internal service via external port 2379
+      name: mongo
+      protocol: MONGO
+    hosts:
+    - "*"
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: Gateway
+metadata:
+  name: my-gateway
+  namespace: some-config-namespace
+spec:
+  selector:
+    app: my-gateway-controller
+  servers:
+  - port:
+      number: 80
+      name: http
+      protocol: HTTP
+    hosts:
+    - uk.bookinfo.com
+    - eu.bookinfo.com
+    tls:
+      httpsRedirect: true # sends 301 redirect for http requests
+  - port:
+      number: 443
+      name: https-443
+      protocol: HTTPS
+    hosts:
+    - uk.bookinfo.com
+    - eu.bookinfo.com
+    tls:
+      mode: SIMPLE # enables HTTPS on this port
+      serverCertificate: /etc/certs/servercert.pem
+      privateKey: /etc/certs/privatekey.pem
+  - port:
+      number: 9443
+      name: https-9443
+      protocol: HTTPS
+    hosts:
+    - "bookinfo-namespace/*.bookinfo.com"
+    tls:
+      mode: SIMPLE # enables HTTPS on this port
+      credentialName: bookinfo-secret # fetches certs from Kubernetes secret
+  - port:
+      number: 9080
+      name: http-wildcard
+      protocol: HTTP
+    hosts:
+    - "*"
+  - port:
+      number: 2379 # to expose internal service via external port 2379
+      name: mongo
+      protocol: MONGO
+    hosts:
+    - "*"
+
+ +

{{}} +{{}}

+ +

The Gateway specification above describes the L4-L6 properties of a load +balancer. A VirtualService can then be bound to a gateway to control +the forwarding of traffic arriving at a particular host or gateway port.

+ +

For example, the following VirtualService splits traffic for +https://uk.bookinfo.com/reviews, https://eu.bookinfo.com/reviews, +http://uk.bookinfo.com:9080/reviews, +http://eu.bookinfo.com:9080/reviews into two versions (prod and qa) of +an internal reviews service on port 9080. In addition, requests +containing the cookie “user: dev-123” will be sent to special port 7777 +in the qa version. The same rule is also applicable inside the mesh for +requests to the “reviews.prod.svc.cluster.local” service. This rule is +applicable across ports 443, 9080. Note that http://uk.bookinfo.com +gets redirected to https://uk.bookinfo.com (i.e. 80 redirects to 443).

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: bookinfo-rule
+  namespace: bookinfo-namespace
+spec:
+  hosts:
+  - reviews.prod.svc.cluster.local
+  - uk.bookinfo.com
+  - eu.bookinfo.com
+  gateways:
+  - some-config-namespace/my-gateway
+  - mesh # applies to all the sidecars in the mesh
+  http:
+  - match:
+    - headers:
+        cookie:
+          exact: "user=dev-123"
+    route:
+    - destination:
+        port:
+          number: 7777
+        host: reviews.qa.svc.cluster.local
+  - match:
+    - uri:
+        prefix: /reviews/
+    route:
+    - destination:
+        port:
+          number: 9080 # can be omitted if it's the only port for reviews
+        host: reviews.prod.svc.cluster.local
+      weight: 80
+    - destination:
+        host: reviews.qa.svc.cluster.local
+      weight: 20
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: VirtualService
+metadata:
+  name: bookinfo-rule
+  namespace: bookinfo-namespace
+spec:
+  hosts:
+  - reviews.prod.svc.cluster.local
+  - uk.bookinfo.com
+  - eu.bookinfo.com
+  gateways:
+  - some-config-namespace/my-gateway
+  - mesh # applies to all the sidecars in the mesh
+  http:
+  - match:
+    - headers:
+        cookie:
+          exact: "user=dev-123"
+    route:
+    - destination:
+        port:
+          number: 7777
+        host: reviews.qa.svc.cluster.local
+  - match:
+    - uri:
+        prefix: /reviews/
+    route:
+    - destination:
+        port:
+          number: 9080 # can be omitted if it's the only port for reviews
+        host: reviews.prod.svc.cluster.local
+      weight: 80
+    - destination:
+        host: reviews.qa.svc.cluster.local
+      weight: 20
+
+ +

{{}} +{{}}

+ +

The following VirtualService forwards traffic arriving at (external) +port 27017 to internal Mongo server on port 5555. This rule is not +applicable internally in the mesh as the gateway list omits the +reserved name mesh.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: bookinfo-Mongo
+  namespace: bookinfo-namespace
+spec:
+  hosts:
+  - mongosvr.prod.svc.cluster.local # name of internal Mongo service
+  gateways:
+  - some-config-namespace/my-gateway # can omit the namespace if gateway is in same
+                                       namespace as virtual service.
+  tcp:
+  - match:
+    - port: 27017
+    route:
+    - destination:
+        host: mongo.prod.svc.cluster.local
+        port:
+          number: 5555
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: VirtualService
+metadata:
+  name: bookinfo-Mongo
+  namespace: bookinfo-namespace
+spec:
+  hosts:
+  - mongosvr.prod.svc.cluster.local # name of internal Mongo service
+  gateways:
+  - some-config-namespace/my-gateway # can omit the namespace if gateway is in same
+                                       namespace as virtual service.
+  tcp:
+  - match:
+    - port: 27017
+    route:
+    - destination:
+        host: mongo.prod.svc.cluster.local
+        port:
+          number: 5555
+
+ +

{{}} +{{}}

+ +

It is possible to restrict the set of virtual services that can bind to +a gateway server using the namespace/hostname syntax in the hosts field. +For example, the following Gateway allows any virtual service in the ns1 +namespace to bind to it, while restricting only the virtual service with +foo.bar.com host in the ns2 namespace to bind to it.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: Gateway
+metadata:
+  name: my-gateway
+  namespace: some-config-namespace
+spec:
+  selector:
+    app: my-gateway-controller
+  servers:
+  - port:
+      number: 80
+      name: http
+      protocol: HTTP
+    hosts:
+    - "ns1/*"
+    - "ns2/foo.bar.com"
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: Gateway
+metadata:
+  name: my-gateway
+  namespace: some-config-namespace
+spec:
+  selector:
+    app: my-gateway-controller
+  servers:
+  - port:
+      number: 80
+      name: http
+      protocol: HTTP
+    hosts:
+    - "ns1/*"
+    - "ns2/foo.bar.com"
+
+ +

{{}} +{{}}

+ +

Gateway

+
+

Gateway describes a load balancer operating at the edge of the mesh +receiving incoming or outgoing HTTP/TCP connections.

+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
serversServer[] +

A list of server specifications.

+ +
+Yes +
selectormap<string, string> +

One or more labels that indicate a specific set of pods/VMs +on which this gateway configuration should be applied. The scope of +label search is restricted to the configuration namespace in which the +the resource is present. In other words, the Gateway resource must +reside in the same namespace as the gateway workload instance. +If selector is nil, the Gateway will be applied to all workloads.

+ +
+Yes +
+
+

Server

+
+

Server describes the properties of the proxy on a given load balancer +port. For example,

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: Gateway
+metadata:
+  name: my-ingress
+spec:
+  selector:
+    app: my-ingress-gateway
+  servers:
+  - port:
+      number: 80
+      name: http2
+      protocol: HTTP2
+    hosts:
+    - "*"
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: Gateway
+metadata:
+  name: my-ingress
+spec:
+  selector:
+    app: my-ingress-gateway
+  servers:
+  - port:
+      number: 80
+      name: http2
+      protocol: HTTP2
+    hosts:
+    - "*"
+
+ +

{{}} +{{}}

+ +

Another example

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: Gateway
+metadata:
+  name: my-tcp-ingress
+spec:
+  selector:
+    app: my-tcp-ingress-gateway
+  servers:
+  - port:
+      number: 27018
+      name: mongo
+      protocol: MONGO
+    hosts:
+    - "*"
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: Gateway
+metadata:
+  name: my-tcp-ingress
+spec:
+  selector:
+    app: my-tcp-ingress-gateway
+  servers:
+  - port:
+      number: 27018
+      name: mongo
+      protocol: MONGO
+    hosts:
+    - "*"
+
+ +

{{}} +{{}}

+ +

The following is an example of TLS configuration for port 443

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: Gateway
+metadata:
+  name: my-tls-ingress
+spec:
+  selector:
+    app: my-tls-ingress-gateway
+  servers:
+  - port:
+      number: 443
+      name: https
+      protocol: HTTPS
+    hosts:
+    - "*"
+    tls:
+      mode: SIMPLE
+      serverCertificate: /etc/certs/server.pem
+      privateKey: /etc/certs/privatekey.pem
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: Gateway
+metadata:
+  name: my-tls-ingress
+spec:
+  selector:
+    app: my-tls-ingress-gateway
+  servers:
+  - port:
+      number: 443
+      name: https
+      protocol: HTTPS
+    hosts:
+    - "*"
+    tls:
+      mode: SIMPLE
+      serverCertificate: /etc/certs/server.pem
+      privateKey: /etc/certs/privatekey.pem
+
+ +

{{}} +{{}}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
portPort +

The Port on which the proxy should listen for incoming +connections.

+ +
+Yes +
hostsstring[] +

One or more hosts exposed by this gateway. +While typically applicable to +HTTP services, it can also be used for TCP services using TLS with SNI. +A host is specified as a dnsName with an optional namespace/ prefix. +The dnsName should be specified using FQDN format, optionally including +a wildcard character in the left-most component (e.g., prod/*.example.com). +Set the dnsName to * to select all VirtualService hosts from the +specified namespace (e.g.,prod/*).

+ +

The namespace can be set to * or ., representing any or the current +namespace, respectively. For example, */foo.example.com selects the +service from any available namespace while ./foo.example.com only selects +the service from the namespace of the sidecar. The default, if no namespace/ +is specified, is */, that is, select services from any namespace. +Any associated DestinationRule in the selected namespace will also be used.

+ +

A VirtualService must be bound to the gateway and must have one or +more hosts that match the hosts specified in a server. The match +could be an exact match or a suffix match with the server’s hosts. For +example, if the server’s hosts specifies *.example.com, a +VirtualService with hosts dev.example.com or prod.example.com will +match. However, a VirtualService with host example.com or +newexample.com will not match.

+ +

NOTE: Only virtual services exported to the gateway’s namespace +(e.g., exportTo value of *) can be referenced. +Private configurations (e.g., exportTo set to .) will not be +available. Refer to the exportTo setting in VirtualService, +DestinationRule, and ServiceEntry configurations for details.

+ +
+Yes +
tlsServerTLSSettings +

Set of TLS related options that govern the server’s behavior. Use +these options to control if all http requests should be redirected to +https, and the TLS modes to use.

+ +
+No +
+
+

Port

+
+

Port describes the properties of a specific port of a service.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
numberuint32 +

A valid non-negative integer port number.

+ +
+Yes +
protocolstring +

The protocol exposed on the port. +MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP|TLS. +TLS implies the connection will be routed based on the SNI header to +the destination without terminating the TLS connection.

+ +
+Yes +
namestring +

Label assigned to the port.

+ +
+Yes +
+
+

ServerTLSSettings

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
httpsRedirectbool +

If set to true, the load balancer will send a 301 redirect for +all http connections, asking the clients to use HTTPS.

+ +
+No +
modeTLSmode +

Optional: Indicates whether connections to this port should be +secured using TLS. The value of this field determines how TLS is +enforced.

+ +
+No +
serverCertificatestring +

REQUIRED if mode is SIMPLE or MUTUAL. The path to the file +holding the server-side TLS certificate to use.

+ +
+No +
privateKeystring +

REQUIRED if mode is SIMPLE or MUTUAL. The path to the file +holding the server’s private key.

+ +
+No +
caCertificatesstring +

REQUIRED if mode is MUTUAL. The path to a file containing +certificate authority certificates to use in verifying a presented +client side certificate.

+ +
+No +
credentialNamestring +

For gateways running on Kubernetes, the name of the secret that +holds the TLS certs including the CA certificates. Applicable +only on Kubernetes. The secret (of typegeneric) should +contain the following keys and values: key: +<privateKey>, cert: <serverCert>, cacert: <CACertificate>. +Secret of type tls for server certificates along with +ca.crt key for CA certificates is also supported. +Only one of server certificates and CA certificate +or credentialName can be specified.

+ +
+No +
subjectAltNamesstring[] +

A list of alternate names to verify the subject identity in the +certificate presented by the client.

+ +
+No +
verifyCertificateSpkistring[] +

An optional list of base64-encoded SHA-256 hashes of the SKPIs of +authorized client certificates. +Note: When both verifycertificatehash and verifycertificatespki +are specified, a hash matching either value will result in the +certificate being accepted.

+ +
+No +
verifyCertificateHashstring[] +

An optional list of hex-encoded SHA-256 hashes of the +authorized client certificates. Both simple and colon separated +formats are acceptable. +Note: When both verifycertificatehash and verifycertificatespki +are specified, a hash matching either value will result in the +certificate being accepted.

+ +
+No +
minProtocolVersionTLSProtocol +

Optional: Minimum TLS protocol version.

+ +
+No +
maxProtocolVersionTLSProtocol +

Optional: Maximum TLS protocol version.

+ +
+No +
cipherSuitesstring[] +

Optional: If specified, only support the specified cipher list. +Otherwise default to the default cipher list supported by Envoy.

+ +
+No +
+
+

ServerTLSSettings.TLSmode

+
+

TLS modes enforced by the proxy

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
PASSTHROUGH +

The SNI string presented by the client will be used as the +match criterion in a VirtualService TLS route to determine +the destination service from the service registry.

+ +
SIMPLE +

Secure connections with standard TLS semantics.

+ +
MUTUAL +

Secure connections to the downstream using mutual TLS by +presenting server certificates for authentication.

+ +
AUTO_PASSTHROUGH +

Similar to the passthrough mode, except servers with this TLS +mode do not require an associated VirtualService to map from +the SNI value to service in the registry. The destination +details such as the service/subset/port are encoded in the +SNI value. The proxy will forward to the upstream (Envoy) +cluster (a group of endpoints) specified by the SNI +value. This server is typically used to provide connectivity +between services in disparate L3 networks that otherwise do +not have direct connectivity between their respective +endpoints. Use of this mode assumes that both the source and +the destination are using Istio mTLS to secure traffic.

+ +
ISTIO_MUTUAL +

Secure connections from the downstream using mutual TLS by +presenting server certificates for authentication. Compared +to Mutual mode, this mode uses certificates, representing +gateway workload identity, generated automatically by Istio +for mTLS authentication. When this mode is used, all other +fields in TLSOptions should be empty.

+ +
+
+

ServerTLSSettings.TLSProtocol

+
+

TLS protocol versions.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameDescription
TLS_AUTO +

Automatically choose the optimal TLS version.

+ +
TLSV1_0 +

TLS version 1.0

+ +
TLSV1_1 +

TLS version 1.1

+ +
TLSV1_2 +

TLS version 1.2

+ +
TLSV1_3 +

TLS version 1.3

+ +
+
diff --git a/vendor/istio.io/api/networking/v1alpha3/gateway.proto b/vendor/istio.io/api/networking/v1alpha3/gateway.proto new file mode 100644 index 0000000000..f0f85d5624 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/gateway.proto @@ -0,0 +1,712 @@ +// Copyright 2017 Istio Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "google/api/field_behavior.proto"; + +// $schema: istio.networking.v1alpha3.Gateway +// $title: Gateway +// $description: Configuration affecting edge load balancer. +// $location: https://istio.io/docs/reference/config/networking/gateway.html +// $aliases: [/docs/reference/config/networking/v1alpha3/gateway] + +// `Gateway` describes a load balancer operating at the edge of the mesh +// receiving incoming or outgoing HTTP/TCP connections. The specification +// describes a set of ports that should be exposed, the type of protocol to +// use, SNI configuration for the load balancer, etc. +// +// For example, the following Gateway configuration sets up a proxy to act +// as a load balancer exposing port 80 and 9080 (http), 443 (https), +// 9443(https) and port 2379 (TCP) for ingress. The gateway will be +// applied to the proxy running on a pod with labels `app: +// my-gateway-controller`. While Istio will configure the proxy to listen +// on these ports, it is the responsibility of the user to ensure that +// external traffic to these ports are allowed into the mesh. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: my-gateway +// namespace: some-config-namespace +// spec: +// selector: +// app: my-gateway-controller +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - uk.bookinfo.com +// - eu.bookinfo.com +// tls: +// httpsRedirect: true # sends 301 redirect for http requests +// - port: +// number: 443 +// name: https-443 +// protocol: HTTPS +// hosts: +// - uk.bookinfo.com +// - eu.bookinfo.com +// tls: +// mode: SIMPLE # enables HTTPS on this port +// serverCertificate: /etc/certs/servercert.pem +// privateKey: /etc/certs/privatekey.pem +// - port: +// number: 9443 +// name: https-9443 +// protocol: HTTPS +// hosts: +// - "bookinfo-namespace/*.bookinfo.com" +// tls: +// mode: SIMPLE # enables HTTPS on this port +// credentialName: bookinfo-secret # fetches certs from Kubernetes secret +// - port: +// number: 9080 +// name: http-wildcard +// protocol: HTTP +// hosts: +// - "*" +// - port: +// number: 2379 # to expose internal service via external port 2379 +// name: mongo +// protocol: MONGO +// hosts: +// - "*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Gateway +// metadata: +// name: my-gateway +// namespace: some-config-namespace +// spec: +// selector: +// app: my-gateway-controller +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - uk.bookinfo.com +// - eu.bookinfo.com +// tls: +// httpsRedirect: true # sends 301 redirect for http requests +// - port: +// number: 443 +// name: https-443 +// protocol: HTTPS +// hosts: +// - uk.bookinfo.com +// - eu.bookinfo.com +// tls: +// mode: SIMPLE # enables HTTPS on this port +// serverCertificate: /etc/certs/servercert.pem +// privateKey: /etc/certs/privatekey.pem +// - port: +// number: 9443 +// name: https-9443 +// protocol: HTTPS +// hosts: +// - "bookinfo-namespace/*.bookinfo.com" +// tls: +// mode: SIMPLE # enables HTTPS on this port +// credentialName: bookinfo-secret # fetches certs from Kubernetes secret +// - port: +// number: 9080 +// name: http-wildcard +// protocol: HTTP +// hosts: +// - "*" +// - port: +// number: 2379 # to expose internal service via external port 2379 +// name: mongo +// protocol: MONGO +// hosts: +// - "*" +// ``` +// {{}} +// {{}} +// +// The Gateway specification above describes the L4-L6 properties of a load +// balancer. A `VirtualService` can then be bound to a gateway to control +// the forwarding of traffic arriving at a particular host or gateway port. +// +// For example, the following VirtualService splits traffic for +// `https://uk.bookinfo.com/reviews`, `https://eu.bookinfo.com/reviews`, +// `http://uk.bookinfo.com:9080/reviews`, +// `http://eu.bookinfo.com:9080/reviews` into two versions (prod and qa) of +// an internal reviews service on port 9080. In addition, requests +// containing the cookie "user: dev-123" will be sent to special port 7777 +// in the qa version. The same rule is also applicable inside the mesh for +// requests to the "reviews.prod.svc.cluster.local" service. This rule is +// applicable across ports 443, 9080. Note that `http://uk.bookinfo.com` +// gets redirected to `https://uk.bookinfo.com` (i.e. 80 redirects to 443). +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo-rule +// namespace: bookinfo-namespace +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// - uk.bookinfo.com +// - eu.bookinfo.com +// gateways: +// - some-config-namespace/my-gateway +// - mesh # applies to all the sidecars in the mesh +// http: +// - match: +// - headers: +// cookie: +// exact: "user=dev-123" +// route: +// - destination: +// port: +// number: 7777 +// host: reviews.qa.svc.cluster.local +// - match: +// - uri: +// prefix: /reviews/ +// route: +// - destination: +// port: +// number: 9080 # can be omitted if it's the only port for reviews +// host: reviews.prod.svc.cluster.local +// weight: 80 +// - destination: +// host: reviews.qa.svc.cluster.local +// weight: 20 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: bookinfo-rule +// namespace: bookinfo-namespace +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// - uk.bookinfo.com +// - eu.bookinfo.com +// gateways: +// - some-config-namespace/my-gateway +// - mesh # applies to all the sidecars in the mesh +// http: +// - match: +// - headers: +// cookie: +// exact: "user=dev-123" +// route: +// - destination: +// port: +// number: 7777 +// host: reviews.qa.svc.cluster.local +// - match: +// - uri: +// prefix: /reviews/ +// route: +// - destination: +// port: +// number: 9080 # can be omitted if it's the only port for reviews +// host: reviews.prod.svc.cluster.local +// weight: 80 +// - destination: +// host: reviews.qa.svc.cluster.local +// weight: 20 +// ``` +// {{}} +// {{}} +// +// The following VirtualService forwards traffic arriving at (external) +// port 27017 to internal Mongo server on port 5555. This rule is not +// applicable internally in the mesh as the gateway list omits the +// reserved name `mesh`. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo-Mongo +// namespace: bookinfo-namespace +// spec: +// hosts: +// - mongosvr.prod.svc.cluster.local # name of internal Mongo service +// gateways: +// - some-config-namespace/my-gateway # can omit the namespace if gateway is in same +// namespace as virtual service. +// tcp: +// - match: +// - port: 27017 +// route: +// - destination: +// host: mongo.prod.svc.cluster.local +// port: +// number: 5555 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: bookinfo-Mongo +// namespace: bookinfo-namespace +// spec: +// hosts: +// - mongosvr.prod.svc.cluster.local # name of internal Mongo service +// gateways: +// - some-config-namespace/my-gateway # can omit the namespace if gateway is in same +// namespace as virtual service. +// tcp: +// - match: +// - port: 27017 +// route: +// - destination: +// host: mongo.prod.svc.cluster.local +// port: +// number: 5555 +// ``` +// {{}} +// {{}} +// +// It is possible to restrict the set of virtual services that can bind to +// a gateway server using the namespace/hostname syntax in the hosts field. +// For example, the following Gateway allows any virtual service in the ns1 +// namespace to bind to it, while restricting only the virtual service with +// foo.bar.com host in the ns2 namespace to bind to it. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: my-gateway +// namespace: some-config-namespace +// spec: +// selector: +// app: my-gateway-controller +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - "ns1/*" +// - "ns2/foo.bar.com" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Gateway +// metadata: +// name: my-gateway +// namespace: some-config-namespace +// spec: +// selector: +// app: my-gateway-controller +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - "ns1/*" +// - "ns2/foo.bar.com" +// ``` +// {{}} +// {{}} +// +package istio.networking.v1alpha3; + +option go_package = "istio.io/api/networking/v1alpha3"; + +// Gateway describes a load balancer operating at the edge of the mesh +// receiving incoming or outgoing HTTP/TCP connections. +// +// +// +// +message Gateway { + // A list of server specifications. + repeated Server servers = 1 [(google.api.field_behavior) = REQUIRED]; + + // One or more labels that indicate a specific set of pods/VMs + // on which this gateway configuration should be applied. The scope of + // label search is restricted to the configuration namespace in which the + // the resource is present. In other words, the Gateway resource must + // reside in the same namespace as the gateway workload instance. + // If selector is nil, the Gateway will be applied to all workloads. + map selector = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `Server` describes the properties of the proxy on a given load balancer +// port. For example, +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: my-ingress +// spec: +// selector: +// app: my-ingress-gateway +// servers: +// - port: +// number: 80 +// name: http2 +// protocol: HTTP2 +// hosts: +// - "*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Gateway +// metadata: +// name: my-ingress +// spec: +// selector: +// app: my-ingress-gateway +// servers: +// - port: +// number: 80 +// name: http2 +// protocol: HTTP2 +// hosts: +// - "*" +// ``` +// {{}} +// {{}} +// +// Another example +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: my-tcp-ingress +// spec: +// selector: +// app: my-tcp-ingress-gateway +// servers: +// - port: +// number: 27018 +// name: mongo +// protocol: MONGO +// hosts: +// - "*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Gateway +// metadata: +// name: my-tcp-ingress +// spec: +// selector: +// app: my-tcp-ingress-gateway +// servers: +// - port: +// number: 27018 +// name: mongo +// protocol: MONGO +// hosts: +// - "*" +// ``` +// {{}} +// {{}} +// +// The following is an example of TLS configuration for port 443 +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: my-tls-ingress +// spec: +// selector: +// app: my-tls-ingress-gateway +// servers: +// - port: +// number: 443 +// name: https +// protocol: HTTPS +// hosts: +// - "*" +// tls: +// mode: SIMPLE +// serverCertificate: /etc/certs/server.pem +// privateKey: /etc/certs/privatekey.pem +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Gateway +// metadata: +// name: my-tls-ingress +// spec: +// selector: +// app: my-tls-ingress-gateway +// servers: +// - port: +// number: 443 +// name: https +// protocol: HTTPS +// hosts: +// - "*" +// tls: +// mode: SIMPLE +// serverCertificate: /etc/certs/server.pem +// privateKey: /etc/certs/privatekey.pem +// ``` +// {{}} +// {{}} +// +message Server { + // The Port on which the proxy should listen for incoming + // connections. + Port port = 1 [(google.api.field_behavior) = REQUIRED]; + + // $hide_from_docs + // The ip or the Unix domain socket to which the listener should be bound + // to. Format: `x.x.x.x` or `unix:///path/to/uds` or `unix://@foobar` + // (Linux abstract namespace). When using Unix domain sockets, the port + // number should be 0. + string bind = 4; + + // One or more hosts exposed by this gateway. + // While typically applicable to + // HTTP services, it can also be used for TCP services using TLS with SNI. + // A host is specified as a `dnsName` with an optional `namespace/` prefix. + // The `dnsName` should be specified using FQDN format, optionally including + // a wildcard character in the left-most component (e.g., `prod/*.example.com`). + // Set the `dnsName` to `*` to select all `VirtualService` hosts from the + // specified namespace (e.g.,`prod/*`). + // + // The `namespace` can be set to `*` or `.`, representing any or the current + // namespace, respectively. For example, `*/foo.example.com` selects the + // service from any available namespace while `./foo.example.com` only selects + // the service from the namespace of the sidecar. The default, if no `namespace/` + // is specified, is `*/`, that is, select services from any namespace. + // Any associated `DestinationRule` in the selected namespace will also be used. + // + // A `VirtualService` must be bound to the gateway and must have one or + // more hosts that match the hosts specified in a server. The match + // could be an exact match or a suffix match with the server's hosts. For + // example, if the server's hosts specifies `*.example.com`, a + // `VirtualService` with hosts `dev.example.com` or `prod.example.com` will + // match. However, a `VirtualService` with host `example.com` or + // `newexample.com` will not match. + // + // NOTE: Only virtual services exported to the gateway's namespace + // (e.g., `exportTo` value of `*`) can be referenced. + // Private configurations (e.g., `exportTo` set to `.`) will not be + // available. Refer to the `exportTo` setting in `VirtualService`, + // `DestinationRule`, and `ServiceEntry` configurations for details. + repeated string hosts = 2 [(google.api.field_behavior) = REQUIRED]; + + // Set of TLS related options that govern the server's behavior. Use + // these options to control if all http requests should be redirected to + // https, and the TLS modes to use. + ServerTLSSettings tls = 3; + + // The loopback IP endpoint or Unix domain socket to which traffic should + // be forwarded to by default. Format should be `127.0.0.1:PORT` or + // `unix:///path/to/socket` or `unix://@foobar` (Linux abstract namespace). + // NOT IMPLEMENTED. + // $hide_from_docs + string default_endpoint = 5; +} + +// Port describes the properties of a specific port of a service. +message Port { + // A valid non-negative integer port number. + uint32 number = 1 [(google.api.field_behavior) = REQUIRED]; + + // The protocol exposed on the port. + // MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP|TLS. + // TLS implies the connection will be routed based on the SNI header to + // the destination without terminating the TLS connection. + string protocol = 2 [(google.api.field_behavior) = REQUIRED]; + + // Label assigned to the port. + string name = 3 [(google.api.field_behavior) = REQUIRED]; +} + +message ServerTLSSettings { + // If set to true, the load balancer will send a 301 redirect for + // all http connections, asking the clients to use HTTPS. + bool https_redirect = 1; + + // TLS modes enforced by the proxy + enum TLSmode { + // The SNI string presented by the client will be used as the + // match criterion in a VirtualService TLS route to determine + // the destination service from the service registry. + PASSTHROUGH = 0; + + // Secure connections with standard TLS semantics. + SIMPLE = 1; + + // Secure connections to the downstream using mutual TLS by + // presenting server certificates for authentication. + MUTUAL = 2; + + // Similar to the passthrough mode, except servers with this TLS + // mode do not require an associated VirtualService to map from + // the SNI value to service in the registry. The destination + // details such as the service/subset/port are encoded in the + // SNI value. The proxy will forward to the upstream (Envoy) + // cluster (a group of endpoints) specified by the SNI + // value. This server is typically used to provide connectivity + // between services in disparate L3 networks that otherwise do + // not have direct connectivity between their respective + // endpoints. Use of this mode assumes that both the source and + // the destination are using Istio mTLS to secure traffic. + AUTO_PASSTHROUGH = 3; + + // Secure connections from the downstream using mutual TLS by + // presenting server certificates for authentication. Compared + // to Mutual mode, this mode uses certificates, representing + // gateway workload identity, generated automatically by Istio + // for mTLS authentication. When this mode is used, all other + // fields in `TLSOptions` should be empty. + ISTIO_MUTUAL = 4; + }; + + // Optional: Indicates whether connections to this port should be + // secured using TLS. The value of this field determines how TLS is + // enforced. + TLSmode mode = 2; + + // REQUIRED if mode is `SIMPLE` or `MUTUAL`. The path to the file + // holding the server-side TLS certificate to use. + string server_certificate = 3; + + // REQUIRED if mode is `SIMPLE` or `MUTUAL`. The path to the file + // holding the server's private key. + string private_key = 4; + + // REQUIRED if mode is `MUTUAL`. The path to a file containing + // certificate authority certificates to use in verifying a presented + // client side certificate. + string ca_certificates = 5; + + // For gateways running on Kubernetes, the name of the secret that + // holds the TLS certs including the CA certificates. Applicable + // only on Kubernetes. The secret (of type`generic`) should + // contain the following keys and values: `key: + // `, `cert: `, `cacert: `. + // Secret of type tls for server certificates along with + // ca.crt key for CA certificates is also supported. + // Only one of server certificates and CA certificate + // or credentialName can be specified. + string credential_name = 10; + + // A list of alternate names to verify the subject identity in the + // certificate presented by the client. + repeated string subject_alt_names = 6; + + // An optional list of base64-encoded SHA-256 hashes of the SKPIs of + // authorized client certificates. + // Note: When both verify_certificate_hash and verify_certificate_spki + // are specified, a hash matching either value will result in the + // certificate being accepted. + repeated string verify_certificate_spki = 11; + + // An optional list of hex-encoded SHA-256 hashes of the + // authorized client certificates. Both simple and colon separated + // formats are acceptable. + // Note: When both verify_certificate_hash and verify_certificate_spki + // are specified, a hash matching either value will result in the + // certificate being accepted. + repeated string verify_certificate_hash = 12; + + // TLS protocol versions. + enum TLSProtocol { + // Automatically choose the optimal TLS version. + TLS_AUTO = 0; + + // TLS version 1.0 + TLSV1_0 = 1; + + // TLS version 1.1 + TLSV1_1 = 2; + + // TLS version 1.2 + TLSV1_2 = 3; + + // TLS version 1.3 + TLSV1_3 = 4; + } + + // Optional: Minimum TLS protocol version. + TLSProtocol min_protocol_version = 7; + + // Optional: Maximum TLS protocol version. + TLSProtocol max_protocol_version = 8; + + // Optional: If specified, only support the specified cipher list. + // Otherwise default to the default cipher list supported by Envoy. + repeated string cipher_suites = 9; +} diff --git a/vendor/istio.io/api/networking/v1alpha3/gateway_deepcopy.gen.go b/vendor/istio.io/api/networking/v1alpha3/gateway_deepcopy.gen.go new file mode 100644 index 0000000000..bfba532ab1 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/gateway_deepcopy.gen.go @@ -0,0 +1,408 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/gateway.proto + +// `Gateway` describes a load balancer operating at the edge of the mesh +// receiving incoming or outgoing HTTP/TCP connections. The specification +// describes a set of ports that should be exposed, the type of protocol to +// use, SNI configuration for the load balancer, etc. +// +// For example, the following Gateway configuration sets up a proxy to act +// as a load balancer exposing port 80 and 9080 (http), 443 (https), +// 9443(https) and port 2379 (TCP) for ingress. The gateway will be +// applied to the proxy running on a pod with labels `app: +// my-gateway-controller`. While Istio will configure the proxy to listen +// on these ports, it is the responsibility of the user to ensure that +// external traffic to these ports are allowed into the mesh. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: my-gateway +// namespace: some-config-namespace +// spec: +// selector: +// app: my-gateway-controller +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - uk.bookinfo.com +// - eu.bookinfo.com +// tls: +// httpsRedirect: true # sends 301 redirect for http requests +// - port: +// number: 443 +// name: https-443 +// protocol: HTTPS +// hosts: +// - uk.bookinfo.com +// - eu.bookinfo.com +// tls: +// mode: SIMPLE # enables HTTPS on this port +// serverCertificate: /etc/certs/servercert.pem +// privateKey: /etc/certs/privatekey.pem +// - port: +// number: 9443 +// name: https-9443 +// protocol: HTTPS +// hosts: +// - "bookinfo-namespace/*.bookinfo.com" +// tls: +// mode: SIMPLE # enables HTTPS on this port +// credentialName: bookinfo-secret # fetches certs from Kubernetes secret +// - port: +// number: 9080 +// name: http-wildcard +// protocol: HTTP +// hosts: +// - "*" +// - port: +// number: 2379 # to expose internal service via external port 2379 +// name: mongo +// protocol: MONGO +// hosts: +// - "*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Gateway +// metadata: +// name: my-gateway +// namespace: some-config-namespace +// spec: +// selector: +// app: my-gateway-controller +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - uk.bookinfo.com +// - eu.bookinfo.com +// tls: +// httpsRedirect: true # sends 301 redirect for http requests +// - port: +// number: 443 +// name: https-443 +// protocol: HTTPS +// hosts: +// - uk.bookinfo.com +// - eu.bookinfo.com +// tls: +// mode: SIMPLE # enables HTTPS on this port +// serverCertificate: /etc/certs/servercert.pem +// privateKey: /etc/certs/privatekey.pem +// - port: +// number: 9443 +// name: https-9443 +// protocol: HTTPS +// hosts: +// - "bookinfo-namespace/*.bookinfo.com" +// tls: +// mode: SIMPLE # enables HTTPS on this port +// credentialName: bookinfo-secret # fetches certs from Kubernetes secret +// - port: +// number: 9080 +// name: http-wildcard +// protocol: HTTP +// hosts: +// - "*" +// - port: +// number: 2379 # to expose internal service via external port 2379 +// name: mongo +// protocol: MONGO +// hosts: +// - "*" +// ``` +// {{}} +// {{}} +// +// The Gateway specification above describes the L4-L6 properties of a load +// balancer. A `VirtualService` can then be bound to a gateway to control +// the forwarding of traffic arriving at a particular host or gateway port. +// +// For example, the following VirtualService splits traffic for +// `https://uk.bookinfo.com/reviews`, `https://eu.bookinfo.com/reviews`, +// `http://uk.bookinfo.com:9080/reviews`, +// `http://eu.bookinfo.com:9080/reviews` into two versions (prod and qa) of +// an internal reviews service on port 9080. In addition, requests +// containing the cookie "user: dev-123" will be sent to special port 7777 +// in the qa version. The same rule is also applicable inside the mesh for +// requests to the "reviews.prod.svc.cluster.local" service. This rule is +// applicable across ports 443, 9080. Note that `http://uk.bookinfo.com` +// gets redirected to `https://uk.bookinfo.com` (i.e. 80 redirects to 443). +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo-rule +// namespace: bookinfo-namespace +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// - uk.bookinfo.com +// - eu.bookinfo.com +// gateways: +// - some-config-namespace/my-gateway +// - mesh # applies to all the sidecars in the mesh +// http: +// - match: +// - headers: +// cookie: +// exact: "user=dev-123" +// route: +// - destination: +// port: +// number: 7777 +// host: reviews.qa.svc.cluster.local +// - match: +// - uri: +// prefix: /reviews/ +// route: +// - destination: +// port: +// number: 9080 # can be omitted if it's the only port for reviews +// host: reviews.prod.svc.cluster.local +// weight: 80 +// - destination: +// host: reviews.qa.svc.cluster.local +// weight: 20 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: bookinfo-rule +// namespace: bookinfo-namespace +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// - uk.bookinfo.com +// - eu.bookinfo.com +// gateways: +// - some-config-namespace/my-gateway +// - mesh # applies to all the sidecars in the mesh +// http: +// - match: +// - headers: +// cookie: +// exact: "user=dev-123" +// route: +// - destination: +// port: +// number: 7777 +// host: reviews.qa.svc.cluster.local +// - match: +// - uri: +// prefix: /reviews/ +// route: +// - destination: +// port: +// number: 9080 # can be omitted if it's the only port for reviews +// host: reviews.prod.svc.cluster.local +// weight: 80 +// - destination: +// host: reviews.qa.svc.cluster.local +// weight: 20 +// ``` +// {{}} +// {{}} +// +// The following VirtualService forwards traffic arriving at (external) +// port 27017 to internal Mongo server on port 5555. This rule is not +// applicable internally in the mesh as the gateway list omits the +// reserved name `mesh`. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo-Mongo +// namespace: bookinfo-namespace +// spec: +// hosts: +// - mongosvr.prod.svc.cluster.local # name of internal Mongo service +// gateways: +// - some-config-namespace/my-gateway # can omit the namespace if gateway is in same +// namespace as virtual service. +// tcp: +// - match: +// - port: 27017 +// route: +// - destination: +// host: mongo.prod.svc.cluster.local +// port: +// number: 5555 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: bookinfo-Mongo +// namespace: bookinfo-namespace +// spec: +// hosts: +// - mongosvr.prod.svc.cluster.local # name of internal Mongo service +// gateways: +// - some-config-namespace/my-gateway # can omit the namespace if gateway is in same +// namespace as virtual service. +// tcp: +// - match: +// - port: 27017 +// route: +// - destination: +// host: mongo.prod.svc.cluster.local +// port: +// number: 5555 +// ``` +// {{}} +// {{}} +// +// It is possible to restrict the set of virtual services that can bind to +// a gateway server using the namespace/hostname syntax in the hosts field. +// For example, the following Gateway allows any virtual service in the ns1 +// namespace to bind to it, while restricting only the virtual service with +// foo.bar.com host in the ns2 namespace to bind to it. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: my-gateway +// namespace: some-config-namespace +// spec: +// selector: +// app: my-gateway-controller +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - "ns1/*" +// - "ns2/foo.bar.com" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Gateway +// metadata: +// name: my-gateway +// namespace: some-config-namespace +// spec: +// selector: +// app: my-gateway-controller +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - "ns1/*" +// - "ns2/foo.bar.com" +// ``` +// {{}} +// {{}} +// + +package v1alpha3 + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// DeepCopyInto supports using Gateway within kubernetes types, where deepcopy-gen is used. +func (in *Gateway) DeepCopyInto(out *Gateway) { + p := proto.Clone(in).(*Gateway) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Gateway. Required by controller-gen. +func (in *Gateway) DeepCopy() *Gateway { + if in == nil { + return nil + } + out := new(Gateway) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using Server within kubernetes types, where deepcopy-gen is used. +func (in *Server) DeepCopyInto(out *Server) { + p := proto.Clone(in).(*Server) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Server. Required by controller-gen. +func (in *Server) DeepCopy() *Server { + if in == nil { + return nil + } + out := new(Server) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using Port within kubernetes types, where deepcopy-gen is used. +func (in *Port) DeepCopyInto(out *Port) { + p := proto.Clone(in).(*Port) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Port. Required by controller-gen. +func (in *Port) DeepCopy() *Port { + if in == nil { + return nil + } + out := new(Port) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using ServerTLSSettings within kubernetes types, where deepcopy-gen is used. +func (in *ServerTLSSettings) DeepCopyInto(out *ServerTLSSettings) { + p := proto.Clone(in).(*ServerTLSSettings) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServerTLSSettings. Required by controller-gen. +func (in *ServerTLSSettings) DeepCopy() *ServerTLSSettings { + if in == nil { + return nil + } + out := new(ServerTLSSettings) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/istio.io/api/networking/v1alpha3/gateway_json.gen.go b/vendor/istio.io/api/networking/v1alpha3/gateway_json.gen.go new file mode 100644 index 0000000000..54d52b3b4e --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/gateway_json.gen.go @@ -0,0 +1,395 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/gateway.proto + +// `Gateway` describes a load balancer operating at the edge of the mesh +// receiving incoming or outgoing HTTP/TCP connections. The specification +// describes a set of ports that should be exposed, the type of protocol to +// use, SNI configuration for the load balancer, etc. +// +// For example, the following Gateway configuration sets up a proxy to act +// as a load balancer exposing port 80 and 9080 (http), 443 (https), +// 9443(https) and port 2379 (TCP) for ingress. The gateway will be +// applied to the proxy running on a pod with labels `app: +// my-gateway-controller`. While Istio will configure the proxy to listen +// on these ports, it is the responsibility of the user to ensure that +// external traffic to these ports are allowed into the mesh. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: my-gateway +// namespace: some-config-namespace +// spec: +// selector: +// app: my-gateway-controller +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - uk.bookinfo.com +// - eu.bookinfo.com +// tls: +// httpsRedirect: true # sends 301 redirect for http requests +// - port: +// number: 443 +// name: https-443 +// protocol: HTTPS +// hosts: +// - uk.bookinfo.com +// - eu.bookinfo.com +// tls: +// mode: SIMPLE # enables HTTPS on this port +// serverCertificate: /etc/certs/servercert.pem +// privateKey: /etc/certs/privatekey.pem +// - port: +// number: 9443 +// name: https-9443 +// protocol: HTTPS +// hosts: +// - "bookinfo-namespace/*.bookinfo.com" +// tls: +// mode: SIMPLE # enables HTTPS on this port +// credentialName: bookinfo-secret # fetches certs from Kubernetes secret +// - port: +// number: 9080 +// name: http-wildcard +// protocol: HTTP +// hosts: +// - "*" +// - port: +// number: 2379 # to expose internal service via external port 2379 +// name: mongo +// protocol: MONGO +// hosts: +// - "*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Gateway +// metadata: +// name: my-gateway +// namespace: some-config-namespace +// spec: +// selector: +// app: my-gateway-controller +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - uk.bookinfo.com +// - eu.bookinfo.com +// tls: +// httpsRedirect: true # sends 301 redirect for http requests +// - port: +// number: 443 +// name: https-443 +// protocol: HTTPS +// hosts: +// - uk.bookinfo.com +// - eu.bookinfo.com +// tls: +// mode: SIMPLE # enables HTTPS on this port +// serverCertificate: /etc/certs/servercert.pem +// privateKey: /etc/certs/privatekey.pem +// - port: +// number: 9443 +// name: https-9443 +// protocol: HTTPS +// hosts: +// - "bookinfo-namespace/*.bookinfo.com" +// tls: +// mode: SIMPLE # enables HTTPS on this port +// credentialName: bookinfo-secret # fetches certs from Kubernetes secret +// - port: +// number: 9080 +// name: http-wildcard +// protocol: HTTP +// hosts: +// - "*" +// - port: +// number: 2379 # to expose internal service via external port 2379 +// name: mongo +// protocol: MONGO +// hosts: +// - "*" +// ``` +// {{}} +// {{}} +// +// The Gateway specification above describes the L4-L6 properties of a load +// balancer. A `VirtualService` can then be bound to a gateway to control +// the forwarding of traffic arriving at a particular host or gateway port. +// +// For example, the following VirtualService splits traffic for +// `https://uk.bookinfo.com/reviews`, `https://eu.bookinfo.com/reviews`, +// `http://uk.bookinfo.com:9080/reviews`, +// `http://eu.bookinfo.com:9080/reviews` into two versions (prod and qa) of +// an internal reviews service on port 9080. In addition, requests +// containing the cookie "user: dev-123" will be sent to special port 7777 +// in the qa version. The same rule is also applicable inside the mesh for +// requests to the "reviews.prod.svc.cluster.local" service. This rule is +// applicable across ports 443, 9080. Note that `http://uk.bookinfo.com` +// gets redirected to `https://uk.bookinfo.com` (i.e. 80 redirects to 443). +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo-rule +// namespace: bookinfo-namespace +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// - uk.bookinfo.com +// - eu.bookinfo.com +// gateways: +// - some-config-namespace/my-gateway +// - mesh # applies to all the sidecars in the mesh +// http: +// - match: +// - headers: +// cookie: +// exact: "user=dev-123" +// route: +// - destination: +// port: +// number: 7777 +// host: reviews.qa.svc.cluster.local +// - match: +// - uri: +// prefix: /reviews/ +// route: +// - destination: +// port: +// number: 9080 # can be omitted if it's the only port for reviews +// host: reviews.prod.svc.cluster.local +// weight: 80 +// - destination: +// host: reviews.qa.svc.cluster.local +// weight: 20 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: bookinfo-rule +// namespace: bookinfo-namespace +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// - uk.bookinfo.com +// - eu.bookinfo.com +// gateways: +// - some-config-namespace/my-gateway +// - mesh # applies to all the sidecars in the mesh +// http: +// - match: +// - headers: +// cookie: +// exact: "user=dev-123" +// route: +// - destination: +// port: +// number: 7777 +// host: reviews.qa.svc.cluster.local +// - match: +// - uri: +// prefix: /reviews/ +// route: +// - destination: +// port: +// number: 9080 # can be omitted if it's the only port for reviews +// host: reviews.prod.svc.cluster.local +// weight: 80 +// - destination: +// host: reviews.qa.svc.cluster.local +// weight: 20 +// ``` +// {{}} +// {{}} +// +// The following VirtualService forwards traffic arriving at (external) +// port 27017 to internal Mongo server on port 5555. This rule is not +// applicable internally in the mesh as the gateway list omits the +// reserved name `mesh`. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo-Mongo +// namespace: bookinfo-namespace +// spec: +// hosts: +// - mongosvr.prod.svc.cluster.local # name of internal Mongo service +// gateways: +// - some-config-namespace/my-gateway # can omit the namespace if gateway is in same +// namespace as virtual service. +// tcp: +// - match: +// - port: 27017 +// route: +// - destination: +// host: mongo.prod.svc.cluster.local +// port: +// number: 5555 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: bookinfo-Mongo +// namespace: bookinfo-namespace +// spec: +// hosts: +// - mongosvr.prod.svc.cluster.local # name of internal Mongo service +// gateways: +// - some-config-namespace/my-gateway # can omit the namespace if gateway is in same +// namespace as virtual service. +// tcp: +// - match: +// - port: 27017 +// route: +// - destination: +// host: mongo.prod.svc.cluster.local +// port: +// number: 5555 +// ``` +// {{}} +// {{}} +// +// It is possible to restrict the set of virtual services that can bind to +// a gateway server using the namespace/hostname syntax in the hosts field. +// For example, the following Gateway allows any virtual service in the ns1 +// namespace to bind to it, while restricting only the virtual service with +// foo.bar.com host in the ns2 namespace to bind to it. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: my-gateway +// namespace: some-config-namespace +// spec: +// selector: +// app: my-gateway-controller +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - "ns1/*" +// - "ns2/foo.bar.com" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Gateway +// metadata: +// name: my-gateway +// namespace: some-config-namespace +// spec: +// selector: +// app: my-gateway-controller +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - "ns1/*" +// - "ns2/foo.bar.com" +// ``` +// {{}} +// {{}} +// + +package v1alpha3 + +import ( + bytes "bytes" + fmt "fmt" + github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" + proto "github.com/gogo/protobuf/proto" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// MarshalJSON is a custom marshaler for Gateway +func (this *Gateway) MarshalJSON() ([]byte, error) { + str, err := GatewayMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for Gateway +func (this *Gateway) UnmarshalJSON(b []byte) error { + return GatewayUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for Server +func (this *Server) MarshalJSON() ([]byte, error) { + str, err := GatewayMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for Server +func (this *Server) UnmarshalJSON(b []byte) error { + return GatewayUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for Port +func (this *Port) MarshalJSON() ([]byte, error) { + str, err := GatewayMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for Port +func (this *Port) UnmarshalJSON(b []byte) error { + return GatewayUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for ServerTLSSettings +func (this *ServerTLSSettings) MarshalJSON() ([]byte, error) { + str, err := GatewayMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for ServerTLSSettings +func (this *ServerTLSSettings) UnmarshalJSON(b []byte) error { + return GatewayUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +var ( + GatewayMarshaler = &github_com_gogo_protobuf_jsonpb.Marshaler{} + GatewayUnmarshaler = &github_com_gogo_protobuf_jsonpb.Unmarshaler{} +) diff --git a/vendor/istio.io/api/networking/v1alpha3/service_entry.gen.json b/vendor/istio.io/api/networking/v1alpha3/service_entry.gen.json new file mode 100644 index 0000000000..fbe47cb827 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/service_entry.gen.json @@ -0,0 +1,168 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Configuration affecting service registry.", + "version": "v1alpha3" + }, + "components": { + "schemas": { + "istio.networking.v1alpha3.WorkloadSelector": { + "description": "`WorkloadSelector` specifies the criteria used to determine if the `Gateway`, `Sidecar`, or `EnvoyFilter` or `ServiceEntry` configuration can be applied to a proxy. The matching criteria includes the metadata associated with a proxy, workload instance info such as labels attached to the pod/VM, or any other info that the proxy provides to Istio during the initial handshake. If multiple conditions are specified, all conditions need to match in order for the workload instance to be selected. Currently, only label based selection mechanism is supported.", + "type": "object", + "properties": { + "labels": { + "description": "One or more labels that indicate a specific set of pods/VMs on which the configuration should be applied. The scope of label search is restricted to the configuration namespace in which the the resource is present.", + "type": "object", + "additionalProperties": { + "type": "string", + "format": "string" + } + } + } + }, + "istio.networking.v1alpha3.Port": { + "description": "Port describes the properties of a specific port of a service.", + "type": "object", + "properties": { + "number": { + "description": "A valid non-negative integer port number.", + "type": "integer" + }, + "name": { + "description": "Label assigned to the port.", + "type": "string", + "format": "string" + }, + "protocol": { + "description": "The protocol exposed on the port. MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP|TLS. TLS implies the connection will be routed based on the SNI header to the destination without terminating the TLS connection.", + "type": "string", + "format": "string" + } + } + }, + "istio.networking.v1alpha3.ServiceEntry": { + "description": "ServiceEntry enables adding additional entries into Istio's internal service registry.", + "type": "object", + "properties": { + "exportTo": { + "description": "A list of namespaces to which this service is exported. Exporting a service allows it to be used by sidecars, gateways and virtual services defined in other namespaces. This feature provides a mechanism for service owners and mesh administrators to control the visibility of services across namespace boundaries.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "subjectAltNames": { + "description": "If specified, the proxy will verify that the server certificate's subject alternate name matches one of the specified values.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "workloadSelector": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.WorkloadSelector" + }, + "hosts": { + "description": "The hosts associated with the ServiceEntry. Could be a DNS name with wildcard prefix.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "addresses": { + "description": "The virtual IP addresses associated with the service. Could be CIDR prefix. For HTTP traffic, generated route configurations will include http route domains for both the `addresses` and `hosts` field values and the destination will be identified based on the HTTP Host/Authority header. If one or more IP addresses are specified, the incoming traffic will be identified as belonging to this service if the destination IP matches the IP/CIDRs specified in the addresses field. If the Addresses field is empty, traffic will be identified solely based on the destination port. In such scenarios, the port on which the service is being accessed must not be shared by any other service in the mesh. In other words, the sidecar will behave as a simple TCP proxy, forwarding incoming traffic on a specified port to the specified destination endpoint IP/host. Unix domain socket addresses are not supported in this field.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "ports": { + "description": "The ports associated with the external service. If the Endpoints are Unix domain socket addresses, there must be exactly one port.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.Port" + } + }, + "location": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ServiceEntry.Location" + }, + "resolution": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ServiceEntry.Resolution" + }, + "endpoints": { + "description": "One or more endpoints associated with the service. Only one of `endpoints` or `workloadSelector` can be specified.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.WorkloadEntry" + } + } + } + }, + "istio.networking.v1alpha3.ServiceEntry.Location": { + "description": "Location specifies whether the service is part of Istio mesh or outside the mesh. Location determines the behavior of several features, such as service-to-service mTLS authentication, policy enforcement, etc. When communicating with services outside the mesh, Istio's mTLS authentication is disabled, and policy enforcement is performed on the client-side as opposed to server-side.", + "type": "string", + "enum": [ + "MESH_EXTERNAL", + "MESH_INTERNAL" + ] + }, + "istio.networking.v1alpha3.ServiceEntry.Resolution": { + "description": "Resolution determines how the proxy will resolve the IP addresses of the network endpoints associated with the service, so that it can route to one of them. The resolution mode specified here has no impact on how the application resolves the IP address associated with the service. The application may still have to use DNS to resolve the service to an IP so that the outbound traffic can be captured by the Proxy. Alternatively, for HTTP services, the application could directly communicate with the proxy (e.g., by setting HTTP_PROXY) to talk to these services.", + "type": "string", + "enum": [ + "NONE", + "STATIC", + "DNS" + ] + }, + "istio.networking.v1alpha3.WorkloadEntry": { + "description": "WorkloadEntry enables specifying the properties of a single non-Kubernetes workload such a VM or a bare metal services that can be referred to by service entries.", + "type": "object", + "properties": { + "labels": { + "description": "One or more labels associated with the endpoint.", + "type": "object", + "additionalProperties": { + "type": "string", + "format": "string" + } + }, + "ports": { + "description": "Set of ports associated with the endpoint. The ports must be associated with a port name that was declared as part of the service. Do not use for `unix://` addresses.", + "type": "object", + "additionalProperties": { + "type": "integer" + } + }, + "weight": { + "description": "The load balancing weight associated with the endpoint. Endpoints with higher weights will receive proportionally higher traffic.", + "type": "integer" + }, + "address": { + "description": "Address associated with the network endpoint without the port. Domain names can be used if and only if the resolution is set to DNS, and must be fully-qualified without wildcards. Use the form unix:///absolute/path/to/socket for Unix domain socket endpoints.", + "type": "string", + "format": "string" + }, + "network": { + "description": "Network enables Istio to group endpoints resident in the same L3 domain/network. All endpoints in the same network are assumed to be directly reachable from one another. When endpoints in different networks cannot reach each other directly, an Istio Gateway can be used to establish connectivity (usually using the `AUTO_PASSTHROUGH` mode in a Gateway Server). This is an advanced configuration used typically for spanning an Istio mesh over multiple clusters.", + "type": "string", + "format": "string" + }, + "locality": { + "description": "The locality associated with the endpoint. A locality corresponds to a failure domain (e.g., country/region/zone). Arbitrary failure domain hierarchies can be represented by separating each encapsulating failure domain by /. For example, the locality of an an endpoint in US, in US-East-1 region, within availability zone az-1, in data center rack r11 can be represented as us/us-east-1/az-1/r11. Istio will configure the sidecar to route to endpoints within the same locality as the sidecar. If none of the endpoints in the locality are available, endpoints parent locality (but within the same network ID) will be chosen. For example, if there are two endpoints in same network (networkID \"n1\"), say e1 with locality us/us-east-1/az-1/r11 and e2 with locality us/us-east-1/az-2/r12, a sidecar from us/us-east-1/az-1/r11 locality will prefer e1 from the same locality over e2 from a different locality. Endpoint e2 could be the IP associated with a gateway (that bridges networks n1 and n2), or the IP associated with a standard service endpoint.", + "type": "string", + "format": "string" + }, + "serviceAccount": { + "description": "The service account associated with the workload if a sidecar is present in the workload. The service account must be present in the same namespace as the configuration ( WorkloadEntry or a ServiceEntry)", + "type": "string", + "format": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/vendor/istio.io/api/networking/v1alpha3/service_entry.pb.go b/vendor/istio.io/api/networking/v1alpha3/service_entry.pb.go new file mode 100644 index 0000000000..3181f972b3 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/service_entry.pb.go @@ -0,0 +1,1749 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/service_entry.proto + +// `ServiceEntry` enables adding additional entries into Istio's +// internal service registry, so that auto-discovered services in the +// mesh can access/route to these manually specified services. A +// service entry describes the properties of a service (DNS name, +// VIPs, ports, protocols, endpoints). These services could be +// external to the mesh (e.g., web APIs) or mesh-internal services +// that are not part of the platform's service registry (e.g., a set +// of VMs talking to services in Kubernetes). In addition, the +// endpoints of a service entry can also be dynamically selected by +// using the `workloadSelector` field. These endpoints can be VM +// workloads declared using the `WorkloadEntry` object or Kubernetes +// pods. The ability to select both pods and VMs under a single +// service allows for migration of services from VMs to Kubernetes +// without having to change the existing DNS names associated with the +// services. +// +// The following example declares a few external APIs accessed by internal +// applications over HTTPS. The sidecar inspects the SNI value in the +// ClientHello message to route to the appropriate external service. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-https +// spec: +// hosts: +// - api.dropboxapi.com +// - www.googleapis.com +// - api.facebook.com +// location: MESH_EXTERNAL +// ports: +// - number: 443 +// name: https +// protocol: TLS +// resolution: DNS +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-https +// spec: +// hosts: +// - api.dropboxapi.com +// - www.googleapis.com +// - api.facebook.com +// location: MESH_EXTERNAL +// ports: +// - number: 443 +// name: https +// protocol: TLS +// resolution: DNS +// ``` +// {{}} +// {{}} +// +// The following configuration adds a set of MongoDB instances running on +// unmanaged VMs to Istio's registry, so that these services can be treated +// as any other service in the mesh. The associated DestinationRule is used +// to initiate mTLS connections to the database instances. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-mongocluster +// spec: +// hosts: +// - mymongodb.somedomain # not used +// addresses: +// - 192.192.192.192/24 # VIPs +// ports: +// - number: 27018 +// name: mongodb +// protocol: MONGO +// location: MESH_INTERNAL +// resolution: STATIC +// endpoints: +// - address: 2.2.2.2 +// - address: 3.3.3.3 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-mongocluster +// spec: +// hosts: +// - mymongodb.somedomain # not used +// addresses: +// - 192.192.192.192/24 # VIPs +// ports: +// - number: 27018 +// name: mongodb +// protocol: MONGO +// location: MESH_INTERNAL +// resolution: STATIC +// endpoints: +// - address: 2.2.2.2 +// - address: 3.3.3.3 +// ``` +// {{}} +// {{}} +// +// and the associated DestinationRule +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: mtls-mongocluster +// spec: +// host: mymongodb.somedomain +// trafficPolicy: +// tls: +// mode: MUTUAL +// clientCertificate: /etc/certs/myclientcert.pem +// privateKey: /etc/certs/client_private_key.pem +// caCertificates: /etc/certs/rootcacerts.pem +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: mtls-mongocluster +// spec: +// host: mymongodb.somedomain +// trafficPolicy: +// tls: +// mode: MUTUAL +// clientCertificate: /etc/certs/myclientcert.pem +// privateKey: /etc/certs/client_private_key.pem +// caCertificates: /etc/certs/rootcacerts.pem +// ``` +// {{}} +// {{}} +// +// The following example uses a combination of service entry and TLS +// routing in a virtual service to steer traffic based on the SNI value to +// an internal egress firewall. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-redirect +// spec: +// hosts: +// - wikipedia.org +// - "*.wikipedia.org" +// location: MESH_EXTERNAL +// ports: +// - number: 443 +// name: https +// protocol: TLS +// resolution: NONE +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-redirect +// spec: +// hosts: +// - wikipedia.org +// - "*.wikipedia.org" +// location: MESH_EXTERNAL +// ports: +// - number: 443 +// name: https +// protocol: TLS +// resolution: NONE +// ``` +// {{}} +// {{}} +// +// And the associated VirtualService to route based on the SNI value. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: tls-routing +// spec: +// hosts: +// - wikipedia.org +// - "*.wikipedia.org" +// tls: +// - match: +// - sniHosts: +// - wikipedia.org +// - "*.wikipedia.org" +// route: +// - destination: +// host: internal-egress-firewall.ns1.svc.cluster.local +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: tls-routing +// spec: +// hosts: +// - wikipedia.org +// - "*.wikipedia.org" +// tls: +// - match: +// - sniHosts: +// - wikipedia.org +// - "*.wikipedia.org" +// route: +// - destination: +// host: internal-egress-firewall.ns1.svc.cluster.local +// ``` +// {{}} +// {{}} +// +// The virtual service with TLS match serves to override the default SNI +// match. In the absence of a virtual service, traffic will be forwarded to +// the wikipedia domains. +// +// The following example demonstrates the use of a dedicated egress gateway +// through which all external service traffic is forwarded. +// The 'exportTo' field allows for control over the visibility of a service +// declaration to other namespaces in the mesh. By default, a service is exported +// to all namespaces. The following example restricts the visibility to the +// current namespace, represented by ".", so that it cannot be used by other +// namespaces. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-httpbin +// namespace : egress +// spec: +// hosts: +// - httpbin.com +// exportTo: +// - "." +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-httpbin +// namespace : egress +// spec: +// hosts: +// - httpbin.com +// exportTo: +// - "." +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// ``` +// {{}} +// {{}} +// +// Define a gateway to handle all egress traffic. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: istio-egressgateway +// namespace: istio-system +// spec: +// selector: +// istio: egressgateway +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - "*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Gateway +// metadata: +// name: istio-egressgateway +// namespace: istio-system +// spec: +// selector: +// istio: egressgateway +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - "*" +// ``` +// {{}} +// {{}} +// +// And the associated `VirtualService` to route from the sidecar to the +// gateway service (`istio-egressgateway.istio-system.svc.cluster.local`), as +// well as route from the gateway to the external service. Note that the +// virtual service is exported to all namespaces enabling them to route traffic +// through the gateway to the external service. Forcing traffic to go through +// a managed middle proxy like this is a common practice. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: gateway-routing +// namespace: egress +// spec: +// hosts: +// - httpbin.com +// exportTo: +// - "*" +// gateways: +// - mesh +// - istio-egressgateway +// http: +// - match: +// - port: 80 +// gateways: +// - mesh +// route: +// - destination: +// host: istio-egressgateway.istio-system.svc.cluster.local +// - match: +// - port: 80 +// gateways: +// - istio-egressgateway +// route: +// - destination: +// host: httpbin.com +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: gateway-routing +// namespace: egress +// spec: +// hosts: +// - httpbin.com +// exportTo: +// - "*" +// gateways: +// - mesh +// - istio-egressgateway +// http: +// - match: +// - port: 80 +// gateways: +// - mesh +// route: +// - destination: +// host: istio-egressgateway.istio-system.svc.cluster.local +// - match: +// - port: 80 +// gateways: +// - istio-egressgateway +// route: +// - destination: +// host: httpbin.com +// ``` +// {{}} +// {{}} +// +// The following example demonstrates the use of wildcards in the hosts for +// external services. If the connection has to be routed to the IP address +// requested by the application (i.e. application resolves DNS and attempts +// to connect to a specific IP), the discovery mode must be set to `NONE`. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-wildcard-example +// spec: +// hosts: +// - "*.bar.com" +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: NONE +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-wildcard-example +// spec: +// hosts: +// - "*.bar.com" +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: NONE +// ``` +// {{}} +// {{}} +// +// The following example demonstrates a service that is available via a +// Unix Domain Socket on the host of the client. The resolution must be +// set to STATIC to use Unix address endpoints. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: unix-domain-socket-example +// spec: +// hosts: +// - "example.unix.local" +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// endpoints: +// - address: unix:///var/run/example/socket +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: unix-domain-socket-example +// spec: +// hosts: +// - "example.unix.local" +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// endpoints: +// - address: unix:///var/run/example/socket +// ``` +// {{}} +// {{}} +// +// For HTTP-based services, it is possible to create a `VirtualService` +// backed by multiple DNS addressable endpoints. In such a scenario, the +// application can use the `HTTP_PROXY` environment variable to transparently +// reroute API calls for the `VirtualService` to a chosen backend. For +// example, the following configuration creates a non-existent external +// service called foo.bar.com backed by three domains: us.foo.bar.com:8080, +// uk.foo.bar.com:9080, and in.foo.bar.com:7080 +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-dns +// spec: +// hosts: +// - foo.bar.com +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// endpoints: +// - address: us.foo.bar.com +// ports: +// http: 8080 +// - address: uk.foo.bar.com +// ports: +// http: 9080 +// - address: in.foo.bar.com +// ports: +// http: 7080 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-dns +// spec: +// hosts: +// - foo.bar.com +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// endpoints: +// - address: us.foo.bar.com +// ports: +// https: 8080 +// - address: uk.foo.bar.com +// ports: +// https: 9080 +// - address: in.foo.bar.com +// ports: +// https: 7080 +// ``` +// {{}} +// {{}} +// +// With `HTTP_PROXY=http://localhost/`, calls from the application to +// `http://foo.bar.com` will be load balanced across the three domains +// specified above. In other words, a call to `http://foo.bar.com/baz` would +// be translated to `http://uk.foo.bar.com/baz`. +// +// The following example illustrates the usage of a `ServiceEntry` +// containing a subject alternate name +// whose format conforms to the [SPIFFE standard](https://github.com/spiffe/spiffe/blob/master/standards/SPIFFE-ID.md): +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: httpbin +// namespace : httpbin-ns +// spec: +// hosts: +// - httpbin.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// endpoints: +// - address: 2.2.2.2 +// - address: 3.3.3.3 +// subjectAltNames: +// - "spiffe://cluster.local/ns/httpbin-ns/sa/httpbin-service-account" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: httpbin +// namespace : httpbin-ns +// spec: +// hosts: +// - httpbin.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// endpoints: +// - address: 2.2.2.2 +// - address: 3.3.3.3 +// subjectAltNames: +// - "spiffe://cluster.local/ns/httpbin-ns/sa/httpbin-service-account" +// ``` +// {{}} +// {{}} +// +// The following example demonstrates the use of `ServiceEntry` with a +// `workloadSelector` to handle the migration of a service +// `details.bookinfo.com` from VMs to Kubernetes. The service has two +// VM-based instances with sidecars as well as a set of Kubernetes +// pods managed by a standard deployment object. Consumers of this +// service in the mesh will be automatically load balanced across the +// VMs and Kubernetes. VM for the `details.bookinfo.com` +// service. This VM has sidecar installed and bootstrapped using the +// `details-legacy` service account. The sidecar receives HTTP traffic +// on port 80 (wrapped in istio mutual TLS) and forwards it to the +// application on the localhost on the same port. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: WorkloadEntry +// metadata: +// name: details-vm-1 +// spec: +// serviceAccount: details +// address: 2.2.2.2 +// labels: +// app: details +// instance-id: vm1 +// --- +// apiVersion: networking.istio.io/v1alpha3 +// kind: WorkloadEntry +// metadata: +// name: details-vm-2 +// spec: +// serviceAccount: details +// address: 3.3.3.3 +// labels: +// app: details +// instance-id: vm2 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: WorkloadEntry +// metadata: +// name: details-vm-1 +// spec: +// serviceAccount: details +// address: 2.2.2.2 +// labels: +// app: details +// instance-id: vm1 +// --- +// apiVersion: networking.istio.io/v1beta1 +// kind: WorkloadEntry +// metadata: +// name: details-vm-2 +// spec: +// serviceAccount: details +// address: 3.3.3.3 +// labels: +// app: details +// instance-id: vm2 +// ``` +// {{}} +// {{}} +// +// Assuming there is also a Kubernetes deployment with pod labels +// `app: details` using the same service account `details`, the +// following service entry declares a service spanning both VMs and +// Kubernetes: +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// workloadSelector: +// labels: +// app: details +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// workloadSelector: +// labels: +// app: details +// ``` +// {{}} +// {{}} + +package v1alpha3 + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Location specifies whether the service is part of Istio mesh or +// outside the mesh. Location determines the behavior of several +// features, such as service-to-service mTLS authentication, policy +// enforcement, etc. When communicating with services outside the mesh, +// Istio's mTLS authentication is disabled, and policy enforcement is +// performed on the client-side as opposed to server-side. +type ServiceEntry_Location int32 + +const ( + // Signifies that the service is external to the mesh. Typically used + // to indicate external services consumed through APIs. + ServiceEntry_MESH_EXTERNAL ServiceEntry_Location = 0 + // Signifies that the service is part of the mesh. Typically used to + // indicate services added explicitly as part of expanding the service + // mesh to include unmanaged infrastructure (e.g., VMs added to a + // Kubernetes based service mesh). + ServiceEntry_MESH_INTERNAL ServiceEntry_Location = 1 +) + +var ServiceEntry_Location_name = map[int32]string{ + 0: "MESH_EXTERNAL", + 1: "MESH_INTERNAL", +} + +var ServiceEntry_Location_value = map[string]int32{ + "MESH_EXTERNAL": 0, + "MESH_INTERNAL": 1, +} + +func (x ServiceEntry_Location) String() string { + return proto.EnumName(ServiceEntry_Location_name, int32(x)) +} + +func (ServiceEntry_Location) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_9220e0fa673c4bf8, []int{0, 0} +} + +// Resolution determines how the proxy will resolve the IP addresses of +// the network endpoints associated with the service, so that it can +// route to one of them. The resolution mode specified here has no impact +// on how the application resolves the IP address associated with the +// service. The application may still have to use DNS to resolve the +// service to an IP so that the outbound traffic can be captured by the +// Proxy. Alternatively, for HTTP services, the application could +// directly communicate with the proxy (e.g., by setting HTTP_PROXY) to +// talk to these services. +type ServiceEntry_Resolution int32 + +const ( + // Assume that incoming connections have already been resolved (to a + // specific destination IP address). Such connections are typically + // routed via the proxy using mechanisms such as IP table REDIRECT/ + // eBPF. After performing any routing related transformations, the + // proxy will forward the connection to the IP address to which the + // connection was bound. + ServiceEntry_NONE ServiceEntry_Resolution = 0 + // Use the static IP addresses specified in endpoints (see below) as the + // backing instances associated with the service. + ServiceEntry_STATIC ServiceEntry_Resolution = 1 + // Attempt to resolve the IP address by querying the ambient DNS, + // during request processing. If no endpoints are specified, the proxy + // will resolve the DNS address specified in the hosts field, if + // wildcards are not used. If endpoints are specified, the DNS + // addresses specified in the endpoints will be resolved to determine + // the destination IP address. DNS resolution cannot be used with Unix + // domain socket endpoints. + ServiceEntry_DNS ServiceEntry_Resolution = 2 +) + +var ServiceEntry_Resolution_name = map[int32]string{ + 0: "NONE", + 1: "STATIC", + 2: "DNS", +} + +var ServiceEntry_Resolution_value = map[string]int32{ + "NONE": 0, + "STATIC": 1, + "DNS": 2, +} + +func (x ServiceEntry_Resolution) String() string { + return proto.EnumName(ServiceEntry_Resolution_name, int32(x)) +} + +func (ServiceEntry_Resolution) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_9220e0fa673c4bf8, []int{0, 1} +} + +// ServiceEntry enables adding additional entries into Istio's internal +// service registry. +// +// +// +// +type ServiceEntry struct { + // The hosts associated with the ServiceEntry. Could be a DNS + // name with wildcard prefix. + // + // 1. The hosts field is used to select matching hosts in VirtualServices and DestinationRules. + // 2. For HTTP traffic the HTTP Host/Authority header will be matched against the hosts field. + // 3. For HTTPs or TLS traffic containing Server Name Indication (SNI), the SNI value + // will be matched against the hosts field. + // + // **NOTE 1:** When resolution is set to type DNS and no endpoints + // are specified, the host field will be used as the DNS name of the + // endpoint to route traffic to. + // + // **NOTE 2:** If the hostname matches with the name of a service + // from another service registry such as Kubernetes that also + // supplies its own set of endpoints, the ServiceEntry will be + // treated as a decorator of the existing Kubernetes + // service. Properties in the service entry will be added to the + // Kubernetes service if applicable. Currently, the only the + // following additional properties will be considered by `istiod`: + // + // 1. subjectAltNames: In addition to verifying the SANs of the + // service accounts associated with the pods of the service, the + // SANs specified here will also be verified. + // + Hosts []string `protobuf:"bytes,1,rep,name=hosts,proto3" json:"hosts,omitempty"` + // The virtual IP addresses associated with the service. Could be CIDR + // prefix. For HTTP traffic, generated route configurations will include http route + // domains for both the `addresses` and `hosts` field values and the destination will + // be identified based on the HTTP Host/Authority header. + // If one or more IP addresses are specified, + // the incoming traffic will be identified as belonging to this service + // if the destination IP matches the IP/CIDRs specified in the addresses + // field. If the Addresses field is empty, traffic will be identified + // solely based on the destination port. In such scenarios, the port on + // which the service is being accessed must not be shared by any other + // service in the mesh. In other words, the sidecar will behave as a + // simple TCP proxy, forwarding incoming traffic on a specified port to + // the specified destination endpoint IP/host. Unix domain socket + // addresses are not supported in this field. + Addresses []string `protobuf:"bytes,2,rep,name=addresses,proto3" json:"addresses,omitempty"` + // The ports associated with the external service. If the + // Endpoints are Unix domain socket addresses, there must be exactly one + // port. + Ports []*Port `protobuf:"bytes,3,rep,name=ports,proto3" json:"ports,omitempty"` + // Specify whether the service should be considered external to the mesh + // or part of the mesh. + Location ServiceEntry_Location `protobuf:"varint,4,opt,name=location,proto3,enum=istio.networking.v1alpha3.ServiceEntry_Location" json:"location,omitempty"` + // Service discovery mode for the hosts. Care must be taken + // when setting the resolution mode to NONE for a TCP port without + // accompanying IP addresses. In such cases, traffic to any IP on + // said port will be allowed (i.e. `0.0.0.0:`). + Resolution ServiceEntry_Resolution `protobuf:"varint,5,opt,name=resolution,proto3,enum=istio.networking.v1alpha3.ServiceEntry_Resolution" json:"resolution,omitempty"` + // One or more endpoints associated with the service. Only one of + // `endpoints` or `workloadSelector` can be specified. + Endpoints []*WorkloadEntry `protobuf:"bytes,6,rep,name=endpoints,proto3" json:"endpoints,omitempty"` + // Applicable only for MESH_INTERNAL services. Only one of + // `endpoints` or `workloadSelector` can be specified. Selects one + // or more Kubernetes pods or VM workloads (specified using + // `WorkloadEntry`) based on their labels. The `WorkloadEntry` object + // representing the VMs should be defined in the same namespace as + // the ServiceEntry. + WorkloadSelector *WorkloadSelector `protobuf:"bytes,9,opt,name=workload_selector,json=workloadSelector,proto3" json:"workload_selector,omitempty"` + // A list of namespaces to which this service is exported. Exporting a service + // allows it to be used by sidecars, gateways and virtual services defined in + // other namespaces. This feature provides a mechanism for service owners + // and mesh administrators to control the visibility of services across + // namespace boundaries. + // + // If no namespaces are specified then the service is exported to all + // namespaces by default. + // + // The value "." is reserved and defines an export to the same namespace that + // the service is declared in. Similarly the value "*" is reserved and + // defines an export to all namespaces. + // + // For a Kubernetes Service, the equivalent effect can be achieved by setting + // the annotation "networking.istio.io/exportTo" to a comma-separated list + // of namespace names. + // + // NOTE: in the current release, the `exportTo` value is restricted to + // "." or "*" (i.e., the current namespace or all namespaces). + ExportTo []string `protobuf:"bytes,7,rep,name=export_to,json=exportTo,proto3" json:"export_to,omitempty"` + // If specified, the proxy will verify that the server certificate's + // subject alternate name matches one of the specified values. + // + // NOTE: When using the workloadEntry with workloadSelectors, the + // service account specified in the workloadEntry will also be used + // to derive the additional subject alternate names that should be + // verified. + SubjectAltNames []string `protobuf:"bytes,8,rep,name=subject_alt_names,json=subjectAltNames,proto3" json:"subject_alt_names,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ServiceEntry) Reset() { *m = ServiceEntry{} } +func (m *ServiceEntry) String() string { return proto.CompactTextString(m) } +func (*ServiceEntry) ProtoMessage() {} +func (*ServiceEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_9220e0fa673c4bf8, []int{0} +} +func (m *ServiceEntry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ServiceEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ServiceEntry.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ServiceEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_ServiceEntry.Merge(m, src) +} +func (m *ServiceEntry) XXX_Size() int { + return m.Size() +} +func (m *ServiceEntry) XXX_DiscardUnknown() { + xxx_messageInfo_ServiceEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_ServiceEntry proto.InternalMessageInfo + +func (m *ServiceEntry) GetHosts() []string { + if m != nil { + return m.Hosts + } + return nil +} + +func (m *ServiceEntry) GetAddresses() []string { + if m != nil { + return m.Addresses + } + return nil +} + +func (m *ServiceEntry) GetPorts() []*Port { + if m != nil { + return m.Ports + } + return nil +} + +func (m *ServiceEntry) GetLocation() ServiceEntry_Location { + if m != nil { + return m.Location + } + return ServiceEntry_MESH_EXTERNAL +} + +func (m *ServiceEntry) GetResolution() ServiceEntry_Resolution { + if m != nil { + return m.Resolution + } + return ServiceEntry_NONE +} + +func (m *ServiceEntry) GetEndpoints() []*WorkloadEntry { + if m != nil { + return m.Endpoints + } + return nil +} + +func (m *ServiceEntry) GetWorkloadSelector() *WorkloadSelector { + if m != nil { + return m.WorkloadSelector + } + return nil +} + +func (m *ServiceEntry) GetExportTo() []string { + if m != nil { + return m.ExportTo + } + return nil +} + +func (m *ServiceEntry) GetSubjectAltNames() []string { + if m != nil { + return m.SubjectAltNames + } + return nil +} + +func init() { + proto.RegisterEnum("istio.networking.v1alpha3.ServiceEntry_Location", ServiceEntry_Location_name, ServiceEntry_Location_value) + proto.RegisterEnum("istio.networking.v1alpha3.ServiceEntry_Resolution", ServiceEntry_Resolution_name, ServiceEntry_Resolution_value) + proto.RegisterType((*ServiceEntry)(nil), "istio.networking.v1alpha3.ServiceEntry") +} + +func init() { + proto.RegisterFile("networking/v1alpha3/service_entry.proto", fileDescriptor_9220e0fa673c4bf8) +} + +var fileDescriptor_9220e0fa673c4bf8 = []byte{ + // 469 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x93, 0xcb, 0x6e, 0xd3, 0x40, + 0x14, 0x86, 0xeb, 0xdc, 0x1a, 0x9f, 0x72, 0x71, 0x66, 0xe5, 0x16, 0x94, 0x9a, 0x6c, 0xb0, 0xa8, + 0xe4, 0x94, 0x74, 0xc7, 0x2e, 0x05, 0x23, 0x2a, 0x05, 0x83, 0xec, 0x48, 0xad, 0xd8, 0x58, 0x13, + 0x7b, 0x48, 0x06, 0x8c, 0x8f, 0x35, 0x33, 0x4d, 0xe8, 0x1b, 0xb2, 0xe4, 0x11, 0xaa, 0x3c, 0x03, + 0x0f, 0x80, 0x7c, 0xc9, 0x45, 0x28, 0x44, 0xdd, 0xfe, 0xf3, 0xff, 0x9f, 0xcf, 0xf9, 0x67, 0x0c, + 0x2f, 0x53, 0xa6, 0x16, 0x28, 0xbe, 0xf3, 0x74, 0xda, 0x9f, 0xbf, 0xa6, 0x49, 0x36, 0xa3, 0x17, + 0x7d, 0xc9, 0xc4, 0x9c, 0x47, 0x2c, 0x64, 0xa9, 0x12, 0x77, 0x4e, 0x26, 0x50, 0x21, 0x39, 0xe6, + 0x52, 0x71, 0x74, 0x36, 0x76, 0x67, 0x65, 0x3f, 0x39, 0x9d, 0x22, 0x4e, 0x13, 0xd6, 0xa7, 0x19, + 0xef, 0x7f, 0xe5, 0x2c, 0x89, 0xc3, 0x09, 0x9b, 0xd1, 0x39, 0x47, 0x51, 0x66, 0x4f, 0x5e, 0xec, + 0xfa, 0xc8, 0x94, 0x2a, 0xb6, 0xa0, 0x77, 0xfb, 0x2c, 0x92, 0xc7, 0x2c, 0xa2, 0x2b, 0x8a, 0xbd, + 0xcb, 0x92, 0x0b, 0x09, 0xd2, 0x78, 0x7b, 0xd6, 0xde, 0x9f, 0x06, 0x3c, 0x0a, 0xca, 0x1d, 0xdc, + 0x5c, 0x26, 0xc7, 0xd0, 0x9c, 0xa1, 0x54, 0xd2, 0xd4, 0xac, 0xba, 0xad, 0x5f, 0xd6, 0xef, 0x87, + 0x35, 0xbf, 0x54, 0xc8, 0x73, 0xd0, 0x69, 0x1c, 0x0b, 0x26, 0x25, 0x93, 0x66, 0x2d, 0x3f, 0xf6, + 0x37, 0x02, 0x79, 0x03, 0xcd, 0x0c, 0x85, 0x92, 0x66, 0xdd, 0xaa, 0xdb, 0x47, 0x83, 0x53, 0xe7, + 0xbf, 0x2d, 0x38, 0x9f, 0x51, 0xa8, 0x8a, 0x5c, 0x44, 0xc8, 0x08, 0xda, 0x09, 0x46, 0x54, 0x71, + 0x4c, 0xcd, 0x86, 0xa5, 0xd9, 0x4f, 0x06, 0xe7, 0x7b, 0xe2, 0xdb, 0xf3, 0x3a, 0xa3, 0x2a, 0xe7, + 0xaf, 0x09, 0xe4, 0x1a, 0x40, 0x30, 0x89, 0xc9, 0x6d, 0xc1, 0x6b, 0x16, 0xbc, 0xc1, 0x43, 0x79, + 0xfe, 0x3a, 0x59, 0x4e, 0xb8, 0x85, 0x22, 0xef, 0x41, 0x67, 0x69, 0x9c, 0x21, 0x4f, 0x95, 0x34, + 0x5b, 0xc5, 0x9a, 0xf6, 0x1e, 0xee, 0x75, 0x55, 0x78, 0x01, 0xf6, 0x37, 0x51, 0x72, 0x03, 0x9d, + 0xf5, 0x65, 0x48, 0x96, 0xb0, 0x48, 0xa1, 0x30, 0x75, 0x4b, 0xb3, 0x8f, 0x06, 0x67, 0x0f, 0xe0, + 0x05, 0x55, 0xc4, 0x37, 0x16, 0xff, 0x28, 0xe4, 0x19, 0xe8, 0xec, 0x67, 0xde, 0x69, 0xa8, 0xd0, + 0x3c, 0x2c, 0xae, 0xa8, 0x5d, 0x0a, 0x63, 0x24, 0xaf, 0xa0, 0x23, 0x6f, 0x27, 0xdf, 0x58, 0xa4, + 0x42, 0x9a, 0xa8, 0x30, 0xa5, 0x3f, 0x98, 0x34, 0xdb, 0x85, 0xe9, 0x69, 0x75, 0x30, 0x4c, 0x94, + 0x97, 0xcb, 0xbd, 0x73, 0x68, 0xaf, 0x9a, 0x25, 0x1d, 0x78, 0xfc, 0xd1, 0x0d, 0x3e, 0x84, 0xee, + 0xcd, 0xd8, 0xf5, 0xbd, 0xe1, 0xc8, 0x38, 0x58, 0x4b, 0x57, 0x5e, 0x25, 0x69, 0xbd, 0x33, 0x80, + 0x4d, 0x77, 0xa4, 0x0d, 0x0d, 0xef, 0x93, 0xe7, 0x1a, 0x07, 0x04, 0xa0, 0x15, 0x8c, 0x87, 0xe3, + 0xab, 0xb7, 0x86, 0x46, 0x0e, 0xa1, 0xfe, 0xce, 0x0b, 0x8c, 0xda, 0xa5, 0xf3, 0x6b, 0xd9, 0xd5, + 0x7e, 0x2f, 0xbb, 0xda, 0xfd, 0xb2, 0xab, 0x7d, 0xb1, 0xca, 0x9d, 0x39, 0x16, 0xff, 0xc5, 0x8e, + 0xb7, 0x3b, 0x69, 0x15, 0xaf, 0xf5, 0xe2, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2c, 0xdf, 0x82, + 0x4a, 0x84, 0x03, 0x00, 0x00, +} + +func (m *ServiceEntry) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ServiceEntry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ServiceEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.WorkloadSelector != nil { + { + size, err := m.WorkloadSelector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintServiceEntry(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if len(m.SubjectAltNames) > 0 { + for iNdEx := len(m.SubjectAltNames) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SubjectAltNames[iNdEx]) + copy(dAtA[i:], m.SubjectAltNames[iNdEx]) + i = encodeVarintServiceEntry(dAtA, i, uint64(len(m.SubjectAltNames[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if len(m.ExportTo) > 0 { + for iNdEx := len(m.ExportTo) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ExportTo[iNdEx]) + copy(dAtA[i:], m.ExportTo[iNdEx]) + i = encodeVarintServiceEntry(dAtA, i, uint64(len(m.ExportTo[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if len(m.Endpoints) > 0 { + for iNdEx := len(m.Endpoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Endpoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintServiceEntry(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if m.Resolution != 0 { + i = encodeVarintServiceEntry(dAtA, i, uint64(m.Resolution)) + i-- + dAtA[i] = 0x28 + } + if m.Location != 0 { + i = encodeVarintServiceEntry(dAtA, i, uint64(m.Location)) + i-- + dAtA[i] = 0x20 + } + if len(m.Ports) > 0 { + for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintServiceEntry(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Addresses) > 0 { + for iNdEx := len(m.Addresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Addresses[iNdEx]) + copy(dAtA[i:], m.Addresses[iNdEx]) + i = encodeVarintServiceEntry(dAtA, i, uint64(len(m.Addresses[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Hosts) > 0 { + for iNdEx := len(m.Hosts) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Hosts[iNdEx]) + copy(dAtA[i:], m.Hosts[iNdEx]) + i = encodeVarintServiceEntry(dAtA, i, uint64(len(m.Hosts[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintServiceEntry(dAtA []byte, offset int, v uint64) int { + offset -= sovServiceEntry(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *ServiceEntry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Hosts) > 0 { + for _, s := range m.Hosts { + l = len(s) + n += 1 + l + sovServiceEntry(uint64(l)) + } + } + if len(m.Addresses) > 0 { + for _, s := range m.Addresses { + l = len(s) + n += 1 + l + sovServiceEntry(uint64(l)) + } + } + if len(m.Ports) > 0 { + for _, e := range m.Ports { + l = e.Size() + n += 1 + l + sovServiceEntry(uint64(l)) + } + } + if m.Location != 0 { + n += 1 + sovServiceEntry(uint64(m.Location)) + } + if m.Resolution != 0 { + n += 1 + sovServiceEntry(uint64(m.Resolution)) + } + if len(m.Endpoints) > 0 { + for _, e := range m.Endpoints { + l = e.Size() + n += 1 + l + sovServiceEntry(uint64(l)) + } + } + if len(m.ExportTo) > 0 { + for _, s := range m.ExportTo { + l = len(s) + n += 1 + l + sovServiceEntry(uint64(l)) + } + } + if len(m.SubjectAltNames) > 0 { + for _, s := range m.SubjectAltNames { + l = len(s) + n += 1 + l + sovServiceEntry(uint64(l)) + } + } + if m.WorkloadSelector != nil { + l = m.WorkloadSelector.Size() + n += 1 + l + sovServiceEntry(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovServiceEntry(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozServiceEntry(x uint64) (n int) { + return sovServiceEntry(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *ServiceEntry) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServiceEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ServiceEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ServiceEntry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hosts", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServiceEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthServiceEntry + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthServiceEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hosts = append(m.Hosts, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServiceEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthServiceEntry + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthServiceEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Addresses = append(m.Addresses, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServiceEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthServiceEntry + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthServiceEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ports = append(m.Ports, &Port{}) + if err := m.Ports[len(m.Ports)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Location", wireType) + } + m.Location = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServiceEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Location |= ServiceEntry_Location(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Resolution", wireType) + } + m.Resolution = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServiceEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Resolution |= ServiceEntry_Resolution(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Endpoints", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServiceEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthServiceEntry + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthServiceEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Endpoints = append(m.Endpoints, &WorkloadEntry{}) + if err := m.Endpoints[len(m.Endpoints)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExportTo", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServiceEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthServiceEntry + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthServiceEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExportTo = append(m.ExportTo, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubjectAltNames", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServiceEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthServiceEntry + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthServiceEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubjectAltNames = append(m.SubjectAltNames, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WorkloadSelector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowServiceEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthServiceEntry + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthServiceEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.WorkloadSelector == nil { + m.WorkloadSelector = &WorkloadSelector{} + } + if err := m.WorkloadSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipServiceEntry(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthServiceEntry + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthServiceEntry + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipServiceEntry(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowServiceEntry + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowServiceEntry + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowServiceEntry + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthServiceEntry + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthServiceEntry + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowServiceEntry + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipServiceEntry(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthServiceEntry + } + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthServiceEntry = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowServiceEntry = fmt.Errorf("proto: integer overflow") +) diff --git a/vendor/istio.io/api/networking/v1alpha3/service_entry.pb.html b/vendor/istio.io/api/networking/v1alpha3/service_entry.pb.html new file mode 100644 index 0000000000..3ba1eb60a0 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/service_entry.pb.html @@ -0,0 +1,1071 @@ +--- +title: Service Entry +description: Configuration affecting service registry. +location: https://istio.io/docs/reference/config/networking/service-entry.html +layout: protoc-gen-docs +generator: protoc-gen-docs +schema: istio.networking.v1alpha3.ServiceEntry +aliases: [/docs/reference/config/networking/v1alpha3/service-entry] +number_of_entries: 3 +--- +

ServiceEntry enables adding additional entries into Istio’s +internal service registry, so that auto-discovered services in the +mesh can access/route to these manually specified services. A +service entry describes the properties of a service (DNS name, +VIPs, ports, protocols, endpoints). These services could be +external to the mesh (e.g., web APIs) or mesh-internal services +that are not part of the platform’s service registry (e.g., a set +of VMs talking to services in Kubernetes). In addition, the +endpoints of a service entry can also be dynamically selected by +using the workloadSelector field. These endpoints can be VM +workloads declared using the WorkloadEntry object or Kubernetes +pods. The ability to select both pods and VMs under a single +service allows for migration of services from VMs to Kubernetes +without having to change the existing DNS names associated with the +services.

+ +

The following example declares a few external APIs accessed by internal +applications over HTTPS. The sidecar inspects the SNI value in the +ClientHello message to route to the appropriate external service.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: ServiceEntry
+metadata:
+  name: external-svc-https
+spec:
+  hosts:
+  - api.dropboxapi.com
+  - www.googleapis.com
+  - api.facebook.com
+  location: MESH_EXTERNAL
+  ports:
+  - number: 443
+    name: https
+    protocol: TLS
+  resolution: DNS
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: ServiceEntry
+metadata:
+  name: external-svc-https
+spec:
+  hosts:
+  - api.dropboxapi.com
+  - www.googleapis.com
+  - api.facebook.com
+  location: MESH_EXTERNAL
+  ports:
+  - number: 443
+    name: https
+    protocol: TLS
+  resolution: DNS
+
+ +

{{}} +{{}}

+ +

The following configuration adds a set of MongoDB instances running on +unmanaged VMs to Istio’s registry, so that these services can be treated +as any other service in the mesh. The associated DestinationRule is used +to initiate mTLS connections to the database instances.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: ServiceEntry
+metadata:
+  name: external-svc-mongocluster
+spec:
+  hosts:
+  - mymongodb.somedomain # not used
+  addresses:
+  - 192.192.192.192/24 # VIPs
+  ports:
+  - number: 27018
+    name: mongodb
+    protocol: MONGO
+  location: MESH_INTERNAL
+  resolution: STATIC
+  endpoints:
+  - address: 2.2.2.2
+  - address: 3.3.3.3
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: ServiceEntry
+metadata:
+  name: external-svc-mongocluster
+spec:
+  hosts:
+  - mymongodb.somedomain # not used
+  addresses:
+  - 192.192.192.192/24 # VIPs
+  ports:
+  - number: 27018
+    name: mongodb
+    protocol: MONGO
+  location: MESH_INTERNAL
+  resolution: STATIC
+  endpoints:
+  - address: 2.2.2.2
+  - address: 3.3.3.3
+
+ +

{{}} +{{}}

+ +

and the associated DestinationRule

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: DestinationRule
+metadata:
+  name: mtls-mongocluster
+spec:
+  host: mymongodb.somedomain
+  trafficPolicy:
+    tls:
+      mode: MUTUAL
+      clientCertificate: /etc/certs/myclientcert.pem
+      privateKey: /etc/certs/client_private_key.pem
+      caCertificates: /etc/certs/rootcacerts.pem
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: DestinationRule
+metadata:
+  name: mtls-mongocluster
+spec:
+  host: mymongodb.somedomain
+  trafficPolicy:
+    tls:
+      mode: MUTUAL
+      clientCertificate: /etc/certs/myclientcert.pem
+      privateKey: /etc/certs/client_private_key.pem
+      caCertificates: /etc/certs/rootcacerts.pem
+
+ +

{{}} +{{}}

+ +

The following example uses a combination of service entry and TLS +routing in a virtual service to steer traffic based on the SNI value to +an internal egress firewall.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: ServiceEntry
+metadata:
+  name: external-svc-redirect
+spec:
+  hosts:
+  - wikipedia.org
+  - "*.wikipedia.org"
+  location: MESH_EXTERNAL
+  ports:
+  - number: 443
+    name: https
+    protocol: TLS
+  resolution: NONE
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: ServiceEntry
+metadata:
+  name: external-svc-redirect
+spec:
+  hosts:
+  - wikipedia.org
+  - "*.wikipedia.org"
+  location: MESH_EXTERNAL
+  ports:
+  - number: 443
+    name: https
+    protocol: TLS
+  resolution: NONE
+
+ +

{{}} +{{}}

+ +

And the associated VirtualService to route based on the SNI value.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: tls-routing
+spec:
+  hosts:
+  - wikipedia.org
+  - "*.wikipedia.org"
+  tls:
+  - match:
+    - sniHosts:
+      - wikipedia.org
+      - "*.wikipedia.org"
+    route:
+    - destination:
+        host: internal-egress-firewall.ns1.svc.cluster.local
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: VirtualService
+metadata:
+  name: tls-routing
+spec:
+  hosts:
+  - wikipedia.org
+  - "*.wikipedia.org"
+  tls:
+  - match:
+    - sniHosts:
+      - wikipedia.org
+      - "*.wikipedia.org"
+    route:
+    - destination:
+        host: internal-egress-firewall.ns1.svc.cluster.local
+
+ +

{{}} +{{}}

+ +

The virtual service with TLS match serves to override the default SNI +match. In the absence of a virtual service, traffic will be forwarded to +the wikipedia domains.

+ +

The following example demonstrates the use of a dedicated egress gateway +through which all external service traffic is forwarded. +The ‘exportTo’ field allows for control over the visibility of a service +declaration to other namespaces in the mesh. By default, a service is exported +to all namespaces. The following example restricts the visibility to the +current namespace, represented by “.”, so that it cannot be used by other +namespaces.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: ServiceEntry
+metadata:
+  name: external-svc-httpbin
+  namespace : egress
+spec:
+  hosts:
+  - httpbin.com
+  exportTo:
+  - "."
+  location: MESH_EXTERNAL
+  ports:
+  - number: 80
+    name: http
+    protocol: HTTP
+  resolution: DNS
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: ServiceEntry
+metadata:
+  name: external-svc-httpbin
+  namespace : egress
+spec:
+  hosts:
+  - httpbin.com
+  exportTo:
+  - "."
+  location: MESH_EXTERNAL
+  ports:
+  - number: 80
+    name: http
+    protocol: HTTP
+  resolution: DNS
+
+ +

{{}} +{{}}

+ +

Define a gateway to handle all egress traffic.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: Gateway
+metadata:
+ name: istio-egressgateway
+ namespace: istio-system
+spec:
+ selector:
+   istio: egressgateway
+ servers:
+ - port:
+     number: 80
+     name: http
+     protocol: HTTP
+   hosts:
+   - "*"
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: Gateway
+metadata:
+ name: istio-egressgateway
+ namespace: istio-system
+spec:
+ selector:
+   istio: egressgateway
+ servers:
+ - port:
+     number: 80
+     name: http
+     protocol: HTTP
+   hosts:
+   - "*"
+
+ +

{{}} +{{}}

+ +

And the associated VirtualService to route from the sidecar to the +gateway service (istio-egressgateway.istio-system.svc.cluster.local), as +well as route from the gateway to the external service. Note that the +virtual service is exported to all namespaces enabling them to route traffic +through the gateway to the external service. Forcing traffic to go through +a managed middle proxy like this is a common practice.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: gateway-routing
+  namespace: egress
+spec:
+  hosts:
+  - httpbin.com
+  exportTo:
+  - "*"
+  gateways:
+  - mesh
+  - istio-egressgateway
+  http:
+  - match:
+    - port: 80
+      gateways:
+      - mesh
+    route:
+    - destination:
+        host: istio-egressgateway.istio-system.svc.cluster.local
+  - match:
+    - port: 80
+      gateways:
+      - istio-egressgateway
+    route:
+    - destination:
+        host: httpbin.com
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: VirtualService
+metadata:
+  name: gateway-routing
+  namespace: egress
+spec:
+  hosts:
+  - httpbin.com
+  exportTo:
+  - "*"
+  gateways:
+  - mesh
+  - istio-egressgateway
+  http:
+  - match:
+    - port: 80
+      gateways:
+      - mesh
+    route:
+    - destination:
+        host: istio-egressgateway.istio-system.svc.cluster.local
+  - match:
+    - port: 80
+      gateways:
+      - istio-egressgateway
+    route:
+    - destination:
+        host: httpbin.com
+
+ +

{{}} +{{}}

+ +

The following example demonstrates the use of wildcards in the hosts for +external services. If the connection has to be routed to the IP address +requested by the application (i.e. application resolves DNS and attempts +to connect to a specific IP), the discovery mode must be set to NONE.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: ServiceEntry
+metadata:
+  name: external-svc-wildcard-example
+spec:
+  hosts:
+  - "*.bar.com"
+  location: MESH_EXTERNAL
+  ports:
+  - number: 80
+    name: http
+    protocol: HTTP
+  resolution: NONE
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: ServiceEntry
+metadata:
+  name: external-svc-wildcard-example
+spec:
+  hosts:
+  - "*.bar.com"
+  location: MESH_EXTERNAL
+  ports:
+  - number: 80
+    name: http
+    protocol: HTTP
+  resolution: NONE
+
+ +

{{}} +{{}}

+ +

The following example demonstrates a service that is available via a +Unix Domain Socket on the host of the client. The resolution must be +set to STATIC to use Unix address endpoints.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: ServiceEntry
+metadata:
+  name: unix-domain-socket-example
+spec:
+  hosts:
+  - "example.unix.local"
+  location: MESH_EXTERNAL
+  ports:
+  - number: 80
+    name: http
+    protocol: HTTP
+  resolution: STATIC
+  endpoints:
+  - address: unix:///var/run/example/socket
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: ServiceEntry
+metadata:
+  name: unix-domain-socket-example
+spec:
+  hosts:
+  - "example.unix.local"
+  location: MESH_EXTERNAL
+  ports:
+  - number: 80
+    name: http
+    protocol: HTTP
+  resolution: STATIC
+  endpoints:
+  - address: unix:///var/run/example/socket
+
+ +

{{}} +{{}}

+ +

For HTTP-based services, it is possible to create a VirtualService +backed by multiple DNS addressable endpoints. In such a scenario, the +application can use the HTTP_PROXY environment variable to transparently +reroute API calls for the VirtualService to a chosen backend. For +example, the following configuration creates a non-existent external +service called foo.bar.com backed by three domains: us.foo.bar.com:8080, +uk.foo.bar.com:9080, and in.foo.bar.com:7080

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: ServiceEntry
+metadata:
+  name: external-svc-dns
+spec:
+  hosts:
+  - foo.bar.com
+  location: MESH_EXTERNAL
+  ports:
+  - number: 80
+    name: http
+    protocol: HTTP
+  resolution: DNS
+  endpoints:
+  - address: us.foo.bar.com
+    ports:
+      http: 8080
+  - address: uk.foo.bar.com
+    ports:
+      http: 9080
+  - address: in.foo.bar.com
+    ports:
+      http: 7080
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: ServiceEntry
+metadata:
+  name: external-svc-dns
+spec:
+  hosts:
+  - foo.bar.com
+  location: MESH_EXTERNAL
+  ports:
+  - number: 80
+    name: http
+    protocol: HTTP
+  resolution: DNS
+  endpoints:
+  - address: us.foo.bar.com
+    ports:
+      https: 8080
+  - address: uk.foo.bar.com
+    ports:
+      https: 9080
+  - address: in.foo.bar.com
+    ports:
+      https: 7080
+
+ +

{{}} +{{}}

+ +

With HTTP_PROXY=http://localhost/, calls from the application to +http://foo.bar.com will be load balanced across the three domains +specified above. In other words, a call to http://foo.bar.com/baz would +be translated to http://uk.foo.bar.com/baz.

+ +

The following example illustrates the usage of a ServiceEntry +containing a subject alternate name +whose format conforms to the SPIFFE standard:

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: ServiceEntry
+metadata:
+  name: httpbin
+  namespace : httpbin-ns
+spec:
+  hosts:
+  - httpbin.com
+  location: MESH_INTERNAL
+  ports:
+  - number: 80
+    name: http
+    protocol: HTTP
+  resolution: STATIC
+  endpoints:
+  - address: 2.2.2.2
+  - address: 3.3.3.3
+  subjectAltNames:
+  - "spiffe://cluster.local/ns/httpbin-ns/sa/httpbin-service-account"
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: ServiceEntry
+metadata:
+  name: httpbin
+  namespace : httpbin-ns
+spec:
+  hosts:
+  - httpbin.com
+  location: MESH_INTERNAL
+  ports:
+  - number: 80
+    name: http
+    protocol: HTTP
+  resolution: STATIC
+  endpoints:
+  - address: 2.2.2.2
+  - address: 3.3.3.3
+  subjectAltNames:
+  - "spiffe://cluster.local/ns/httpbin-ns/sa/httpbin-service-account"
+
+ +

{{}} +{{}}

+ +

The following example demonstrates the use of ServiceEntry with a +workloadSelector to handle the migration of a service +details.bookinfo.com from VMs to Kubernetes. The service has two +VM-based instances with sidecars as well as a set of Kubernetes +pods managed by a standard deployment object. Consumers of this +service in the mesh will be automatically load balanced across the +VMs and Kubernetes. VM for the details.bookinfo.com +service. This VM has sidecar installed and bootstrapped using the +details-legacy service account. The sidecar receives HTTP traffic +on port 80 (wrapped in istio mutual TLS) and forwards it to the +application on the localhost on the same port.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: WorkloadEntry
+metadata:
+  name: details-vm-1
+spec:
+  serviceAccount: details
+  address: 2.2.2.2
+  labels:
+    app: details
+    instance-id: vm1
+---
+apiVersion: networking.istio.io/v1alpha3
+kind: WorkloadEntry
+metadata:
+  name: details-vm-2
+spec:
+  serviceAccount: details
+  address: 3.3.3.3
+  labels:
+    app: details
+    instance-id: vm2
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: WorkloadEntry
+metadata:
+  name: details-vm-1
+spec:
+  serviceAccount: details
+  address: 2.2.2.2
+  labels:
+    app: details
+    instance-id: vm1
+---
+apiVersion: networking.istio.io/v1beta1
+kind: WorkloadEntry
+metadata:
+  name: details-vm-2
+spec:
+  serviceAccount: details
+  address: 3.3.3.3
+  labels:
+    app: details
+    instance-id: vm2
+
+ +

{{}} +{{}}

+ +

Assuming there is also a Kubernetes deployment with pod labels +app: details using the same service account details, the +following service entry declares a service spanning both VMs and +Kubernetes:

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: ServiceEntry
+metadata:
+  name: details-svc
+spec:
+  hosts:
+  - details.bookinfo.com
+  location: MESH_INTERNAL
+  ports:
+  - number: 80
+    name: http
+    protocol: HTTP
+  resolution: STATIC
+  workloadSelector:
+    labels:
+      app: details
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: ServiceEntry
+metadata:
+  name: details-svc
+spec:
+  hosts:
+  - details.bookinfo.com
+  location: MESH_INTERNAL
+  ports:
+  - number: 80
+    name: http
+    protocol: HTTP
+  resolution: STATIC
+  workloadSelector:
+    labels:
+      app: details
+
+ +

{{}} +{{}}

+ +

ServiceEntry

+
+

ServiceEntry enables adding additional entries into Istio’s internal +service registry.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
hostsstring[] +

The hosts associated with the ServiceEntry. Could be a DNS +name with wildcard prefix.

+ +
    +
  1. The hosts field is used to select matching hosts in VirtualServices and DestinationRules.
  2. +
  3. For HTTP traffic the HTTP Host/Authority header will be matched against the hosts field.
  4. +
  5. For HTTPs or TLS traffic containing Server Name Indication (SNI), the SNI value +will be matched against the hosts field.
  6. +
+ +

NOTE 1: When resolution is set to type DNS and no endpoints +are specified, the host field will be used as the DNS name of the +endpoint to route traffic to.

+ +

NOTE 2: If the hostname matches with the name of a service +from another service registry such as Kubernetes that also +supplies its own set of endpoints, the ServiceEntry will be +treated as a decorator of the existing Kubernetes +service. Properties in the service entry will be added to the +Kubernetes service if applicable. Currently, the only the +following additional properties will be considered by istiod:

+ +
    +
  1. subjectAltNames: In addition to verifying the SANs of the +service accounts associated with the pods of the service, the +SANs specified here will also be verified.
  2. +
+ +
+Yes +
addressesstring[] +

The virtual IP addresses associated with the service. Could be CIDR +prefix. For HTTP traffic, generated route configurations will include http route +domains for both the addresses and hosts field values and the destination will +be identified based on the HTTP Host/Authority header. +If one or more IP addresses are specified, +the incoming traffic will be identified as belonging to this service +if the destination IP matches the IP/CIDRs specified in the addresses +field. If the Addresses field is empty, traffic will be identified +solely based on the destination port. In such scenarios, the port on +which the service is being accessed must not be shared by any other +service in the mesh. In other words, the sidecar will behave as a +simple TCP proxy, forwarding incoming traffic on a specified port to +the specified destination endpoint IP/host. Unix domain socket +addresses are not supported in this field.

+ +
+No +
portsPort[] +

The ports associated with the external service. If the +Endpoints are Unix domain socket addresses, there must be exactly one +port.

+ +
+Yes +
locationLocation +

Specify whether the service should be considered external to the mesh +or part of the mesh.

+ +
+No +
resolutionResolution +

Service discovery mode for the hosts. Care must be taken +when setting the resolution mode to NONE for a TCP port without +accompanying IP addresses. In such cases, traffic to any IP on +said port will be allowed (i.e. 0.0.0.0:<port>).

+ +
+Yes +
endpointsWorkloadEntry[] +

One or more endpoints associated with the service. Only one of +endpoints or workloadSelector can be specified.

+ +
+No +
workloadSelectorWorkloadSelector +

Applicable only for MESH_INTERNAL services. Only one of +endpoints or workloadSelector can be specified. Selects one +or more Kubernetes pods or VM workloads (specified using +WorkloadEntry) based on their labels. The WorkloadEntry object +representing the VMs should be defined in the same namespace as +the ServiceEntry.

+ +
+No +
exportTostring[] +

A list of namespaces to which this service is exported. Exporting a service +allows it to be used by sidecars, gateways and virtual services defined in +other namespaces. This feature provides a mechanism for service owners +and mesh administrators to control the visibility of services across +namespace boundaries.

+ +

If no namespaces are specified then the service is exported to all +namespaces by default.

+ +

The value “.” is reserved and defines an export to the same namespace that +the service is declared in. Similarly the value “*” is reserved and +defines an export to all namespaces.

+ +

For a Kubernetes Service, the equivalent effect can be achieved by setting +the annotation “networking.istio.io/exportTo” to a comma-separated list +of namespace names.

+ +

NOTE: in the current release, the exportTo value is restricted to +“.” or “*” (i.e., the current namespace or all namespaces).

+ +
+No +
subjectAltNamesstring[] +

If specified, the proxy will verify that the server certificate’s +subject alternate name matches one of the specified values.

+ +

NOTE: When using the workloadEntry with workloadSelectors, the +service account specified in the workloadEntry will also be used +to derive the additional subject alternate names that should be +verified.

+ +
+No +
+
+

ServiceEntry.Location

+
+

Location specifies whether the service is part of Istio mesh or +outside the mesh. Location determines the behavior of several +features, such as service-to-service mTLS authentication, policy +enforcement, etc. When communicating with services outside the mesh, +Istio’s mTLS authentication is disabled, and policy enforcement is +performed on the client-side as opposed to server-side.

+ + + + + + + + + + + + + + + + + + +
NameDescription
MESH_EXTERNAL +

Signifies that the service is external to the mesh. Typically used +to indicate external services consumed through APIs.

+ +
MESH_INTERNAL +

Signifies that the service is part of the mesh. Typically used to +indicate services added explicitly as part of expanding the service +mesh to include unmanaged infrastructure (e.g., VMs added to a +Kubernetes based service mesh).

+ +
+
+

ServiceEntry.Resolution

+
+

Resolution determines how the proxy will resolve the IP addresses of +the network endpoints associated with the service, so that it can +route to one of them. The resolution mode specified here has no impact +on how the application resolves the IP address associated with the +service. The application may still have to use DNS to resolve the +service to an IP so that the outbound traffic can be captured by the +Proxy. Alternatively, for HTTP services, the application could +directly communicate with the proxy (e.g., by setting HTTP_PROXY) to +talk to these services.

+ + + + + + + + + + + + + + + + + + + + + + +
NameDescription
NONE +

Assume that incoming connections have already been resolved (to a +specific destination IP address). Such connections are typically +routed via the proxy using mechanisms such as IP table REDIRECT/ +eBPF. After performing any routing related transformations, the +proxy will forward the connection to the IP address to which the +connection was bound.

+ +
STATIC +

Use the static IP addresses specified in endpoints (see below) as the +backing instances associated with the service.

+ +
DNS +

Attempt to resolve the IP address by querying the ambient DNS, +during request processing. If no endpoints are specified, the proxy +will resolve the DNS address specified in the hosts field, if +wildcards are not used. If endpoints are specified, the DNS +addresses specified in the endpoints will be resolved to determine +the destination IP address. DNS resolution cannot be used with Unix +domain socket endpoints.

+ +
+
diff --git a/vendor/istio.io/api/networking/v1alpha3/service_entry.proto b/vendor/istio.io/api/networking/v1alpha3/service_entry.proto new file mode 100644 index 0000000000..15efe66c1c --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/service_entry.proto @@ -0,0 +1,957 @@ +// Copyright 2018 Istio Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "google/api/field_behavior.proto"; +import "networking/v1alpha3/gateway.proto"; +import "networking/v1alpha3/sidecar.proto"; +import "networking/v1alpha3/workload_entry.proto"; + +// $schema: istio.networking.v1alpha3.ServiceEntry +// $title: Service Entry +// $description: Configuration affecting service registry. +// $location: https://istio.io/docs/reference/config/networking/service-entry.html +// $aliases: [/docs/reference/config/networking/v1alpha3/service-entry] + +// `ServiceEntry` enables adding additional entries into Istio's +// internal service registry, so that auto-discovered services in the +// mesh can access/route to these manually specified services. A +// service entry describes the properties of a service (DNS name, +// VIPs, ports, protocols, endpoints). These services could be +// external to the mesh (e.g., web APIs) or mesh-internal services +// that are not part of the platform's service registry (e.g., a set +// of VMs talking to services in Kubernetes). In addition, the +// endpoints of a service entry can also be dynamically selected by +// using the `workloadSelector` field. These endpoints can be VM +// workloads declared using the `WorkloadEntry` object or Kubernetes +// pods. The ability to select both pods and VMs under a single +// service allows for migration of services from VMs to Kubernetes +// without having to change the existing DNS names associated with the +// services. +// +// The following example declares a few external APIs accessed by internal +// applications over HTTPS. The sidecar inspects the SNI value in the +// ClientHello message to route to the appropriate external service. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-https +// spec: +// hosts: +// - api.dropboxapi.com +// - www.googleapis.com +// - api.facebook.com +// location: MESH_EXTERNAL +// ports: +// - number: 443 +// name: https +// protocol: TLS +// resolution: DNS +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-https +// spec: +// hosts: +// - api.dropboxapi.com +// - www.googleapis.com +// - api.facebook.com +// location: MESH_EXTERNAL +// ports: +// - number: 443 +// name: https +// protocol: TLS +// resolution: DNS +// ``` +// {{}} +// {{}} +// +// The following configuration adds a set of MongoDB instances running on +// unmanaged VMs to Istio's registry, so that these services can be treated +// as any other service in the mesh. The associated DestinationRule is used +// to initiate mTLS connections to the database instances. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-mongocluster +// spec: +// hosts: +// - mymongodb.somedomain # not used +// addresses: +// - 192.192.192.192/24 # VIPs +// ports: +// - number: 27018 +// name: mongodb +// protocol: MONGO +// location: MESH_INTERNAL +// resolution: STATIC +// endpoints: +// - address: 2.2.2.2 +// - address: 3.3.3.3 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-mongocluster +// spec: +// hosts: +// - mymongodb.somedomain # not used +// addresses: +// - 192.192.192.192/24 # VIPs +// ports: +// - number: 27018 +// name: mongodb +// protocol: MONGO +// location: MESH_INTERNAL +// resolution: STATIC +// endpoints: +// - address: 2.2.2.2 +// - address: 3.3.3.3 +// ``` +// {{}} +// {{}} +// +// and the associated DestinationRule +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: mtls-mongocluster +// spec: +// host: mymongodb.somedomain +// trafficPolicy: +// tls: +// mode: MUTUAL +// clientCertificate: /etc/certs/myclientcert.pem +// privateKey: /etc/certs/client_private_key.pem +// caCertificates: /etc/certs/rootcacerts.pem +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: mtls-mongocluster +// spec: +// host: mymongodb.somedomain +// trafficPolicy: +// tls: +// mode: MUTUAL +// clientCertificate: /etc/certs/myclientcert.pem +// privateKey: /etc/certs/client_private_key.pem +// caCertificates: /etc/certs/rootcacerts.pem +// ``` +// {{}} +// {{}} +// +// The following example uses a combination of service entry and TLS +// routing in a virtual service to steer traffic based on the SNI value to +// an internal egress firewall. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-redirect +// spec: +// hosts: +// - wikipedia.org +// - "*.wikipedia.org" +// location: MESH_EXTERNAL +// ports: +// - number: 443 +// name: https +// protocol: TLS +// resolution: NONE +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-redirect +// spec: +// hosts: +// - wikipedia.org +// - "*.wikipedia.org" +// location: MESH_EXTERNAL +// ports: +// - number: 443 +// name: https +// protocol: TLS +// resolution: NONE +// ``` +// {{}} +// {{}} +// +// And the associated VirtualService to route based on the SNI value. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: tls-routing +// spec: +// hosts: +// - wikipedia.org +// - "*.wikipedia.org" +// tls: +// - match: +// - sniHosts: +// - wikipedia.org +// - "*.wikipedia.org" +// route: +// - destination: +// host: internal-egress-firewall.ns1.svc.cluster.local +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: tls-routing +// spec: +// hosts: +// - wikipedia.org +// - "*.wikipedia.org" +// tls: +// - match: +// - sniHosts: +// - wikipedia.org +// - "*.wikipedia.org" +// route: +// - destination: +// host: internal-egress-firewall.ns1.svc.cluster.local +// ``` +// {{}} +// {{}} +// +// The virtual service with TLS match serves to override the default SNI +// match. In the absence of a virtual service, traffic will be forwarded to +// the wikipedia domains. +// +// The following example demonstrates the use of a dedicated egress gateway +// through which all external service traffic is forwarded. +// The 'exportTo' field allows for control over the visibility of a service +// declaration to other namespaces in the mesh. By default, a service is exported +// to all namespaces. The following example restricts the visibility to the +// current namespace, represented by ".", so that it cannot be used by other +// namespaces. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-httpbin +// namespace : egress +// spec: +// hosts: +// - httpbin.com +// exportTo: +// - "." +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-httpbin +// namespace : egress +// spec: +// hosts: +// - httpbin.com +// exportTo: +// - "." +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// ``` +// {{}} +// {{}} +// +// Define a gateway to handle all egress traffic. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: istio-egressgateway +// namespace: istio-system +// spec: +// selector: +// istio: egressgateway +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - "*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Gateway +// metadata: +// name: istio-egressgateway +// namespace: istio-system +// spec: +// selector: +// istio: egressgateway +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - "*" +// ``` +// {{}} +// {{}} +// +// And the associated `VirtualService` to route from the sidecar to the +// gateway service (`istio-egressgateway.istio-system.svc.cluster.local`), as +// well as route from the gateway to the external service. Note that the +// virtual service is exported to all namespaces enabling them to route traffic +// through the gateway to the external service. Forcing traffic to go through +// a managed middle proxy like this is a common practice. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: gateway-routing +// namespace: egress +// spec: +// hosts: +// - httpbin.com +// exportTo: +// - "*" +// gateways: +// - mesh +// - istio-egressgateway +// http: +// - match: +// - port: 80 +// gateways: +// - mesh +// route: +// - destination: +// host: istio-egressgateway.istio-system.svc.cluster.local +// - match: +// - port: 80 +// gateways: +// - istio-egressgateway +// route: +// - destination: +// host: httpbin.com +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: gateway-routing +// namespace: egress +// spec: +// hosts: +// - httpbin.com +// exportTo: +// - "*" +// gateways: +// - mesh +// - istio-egressgateway +// http: +// - match: +// - port: 80 +// gateways: +// - mesh +// route: +// - destination: +// host: istio-egressgateway.istio-system.svc.cluster.local +// - match: +// - port: 80 +// gateways: +// - istio-egressgateway +// route: +// - destination: +// host: httpbin.com +// ``` +// {{}} +// {{}} +// +// The following example demonstrates the use of wildcards in the hosts for +// external services. If the connection has to be routed to the IP address +// requested by the application (i.e. application resolves DNS and attempts +// to connect to a specific IP), the discovery mode must be set to `NONE`. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-wildcard-example +// spec: +// hosts: +// - "*.bar.com" +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: NONE +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-wildcard-example +// spec: +// hosts: +// - "*.bar.com" +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: NONE +// ``` +// {{}} +// {{}} +// +// The following example demonstrates a service that is available via a +// Unix Domain Socket on the host of the client. The resolution must be +// set to STATIC to use Unix address endpoints. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: unix-domain-socket-example +// spec: +// hosts: +// - "example.unix.local" +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// endpoints: +// - address: unix:///var/run/example/socket +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: unix-domain-socket-example +// spec: +// hosts: +// - "example.unix.local" +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// endpoints: +// - address: unix:///var/run/example/socket +// ``` +// {{}} +// {{}} +// +// For HTTP-based services, it is possible to create a `VirtualService` +// backed by multiple DNS addressable endpoints. In such a scenario, the +// application can use the `HTTP_PROXY` environment variable to transparently +// reroute API calls for the `VirtualService` to a chosen backend. For +// example, the following configuration creates a non-existent external +// service called foo.bar.com backed by three domains: us.foo.bar.com:8080, +// uk.foo.bar.com:9080, and in.foo.bar.com:7080 +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-dns +// spec: +// hosts: +// - foo.bar.com +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// endpoints: +// - address: us.foo.bar.com +// ports: +// http: 8080 +// - address: uk.foo.bar.com +// ports: +// http: 9080 +// - address: in.foo.bar.com +// ports: +// http: 7080 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-dns +// spec: +// hosts: +// - foo.bar.com +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// endpoints: +// - address: us.foo.bar.com +// ports: +// https: 8080 +// - address: uk.foo.bar.com +// ports: +// https: 9080 +// - address: in.foo.bar.com +// ports: +// https: 7080 +// ``` +// {{}} +// {{}} +// +// With `HTTP_PROXY=http://localhost/`, calls from the application to +// `http://foo.bar.com` will be load balanced across the three domains +// specified above. In other words, a call to `http://foo.bar.com/baz` would +// be translated to `http://uk.foo.bar.com/baz`. +// +// The following example illustrates the usage of a `ServiceEntry` +// containing a subject alternate name +// whose format conforms to the [SPIFFE standard](https://github.com/spiffe/spiffe/blob/master/standards/SPIFFE-ID.md): +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: httpbin +// namespace : httpbin-ns +// spec: +// hosts: +// - httpbin.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// endpoints: +// - address: 2.2.2.2 +// - address: 3.3.3.3 +// subjectAltNames: +// - "spiffe://cluster.local/ns/httpbin-ns/sa/httpbin-service-account" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: httpbin +// namespace : httpbin-ns +// spec: +// hosts: +// - httpbin.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// endpoints: +// - address: 2.2.2.2 +// - address: 3.3.3.3 +// subjectAltNames: +// - "spiffe://cluster.local/ns/httpbin-ns/sa/httpbin-service-account" +// ``` +// {{}} +// {{}} +// +// The following example demonstrates the use of `ServiceEntry` with a +// `workloadSelector` to handle the migration of a service +// `details.bookinfo.com` from VMs to Kubernetes. The service has two +// VM-based instances with sidecars as well as a set of Kubernetes +// pods managed by a standard deployment object. Consumers of this +// service in the mesh will be automatically load balanced across the +// VMs and Kubernetes. VM for the `details.bookinfo.com` +// service. This VM has sidecar installed and bootstrapped using the +// `details-legacy` service account. The sidecar receives HTTP traffic +// on port 80 (wrapped in istio mutual TLS) and forwards it to the +// application on the localhost on the same port. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: WorkloadEntry +// metadata: +// name: details-vm-1 +// spec: +// serviceAccount: details +// address: 2.2.2.2 +// labels: +// app: details +// instance-id: vm1 +// --- +// apiVersion: networking.istio.io/v1alpha3 +// kind: WorkloadEntry +// metadata: +// name: details-vm-2 +// spec: +// serviceAccount: details +// address: 3.3.3.3 +// labels: +// app: details +// instance-id: vm2 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: WorkloadEntry +// metadata: +// name: details-vm-1 +// spec: +// serviceAccount: details +// address: 2.2.2.2 +// labels: +// app: details +// instance-id: vm1 +// --- +// apiVersion: networking.istio.io/v1beta1 +// kind: WorkloadEntry +// metadata: +// name: details-vm-2 +// spec: +// serviceAccount: details +// address: 3.3.3.3 +// labels: +// app: details +// instance-id: vm2 +// ``` +// {{}} +// {{}} +// +// Assuming there is also a Kubernetes deployment with pod labels +// `app: details` using the same service account `details`, the +// following service entry declares a service spanning both VMs and +// Kubernetes: +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// workloadSelector: +// labels: +// app: details +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// workloadSelector: +// labels: +// app: details +// ``` +// {{}} +// {{}} +package istio.networking.v1alpha3; + +option go_package = "istio.io/api/networking/v1alpha3"; + +// ServiceEntry enables adding additional entries into Istio's internal +// service registry. +// +// +// +// +message ServiceEntry { + // The hosts associated with the ServiceEntry. Could be a DNS + // name with wildcard prefix. + // + // 1. The hosts field is used to select matching hosts in VirtualServices and DestinationRules. + // 2. For HTTP traffic the HTTP Host/Authority header will be matched against the hosts field. + // 3. For HTTPs or TLS traffic containing Server Name Indication (SNI), the SNI value + // will be matched against the hosts field. + // + // **NOTE 1:** When resolution is set to type DNS and no endpoints + // are specified, the host field will be used as the DNS name of the + // endpoint to route traffic to. + // + // **NOTE 2:** If the hostname matches with the name of a service + // from another service registry such as Kubernetes that also + // supplies its own set of endpoints, the ServiceEntry will be + // treated as a decorator of the existing Kubernetes + // service. Properties in the service entry will be added to the + // Kubernetes service if applicable. Currently, the only the + // following additional properties will be considered by `istiod`: + // + // 1. subjectAltNames: In addition to verifying the SANs of the + // service accounts associated with the pods of the service, the + // SANs specified here will also be verified. + // + repeated string hosts = 1 [(google.api.field_behavior) = REQUIRED]; + + // The virtual IP addresses associated with the service. Could be CIDR + // prefix. For HTTP traffic, generated route configurations will include http route + // domains for both the `addresses` and `hosts` field values and the destination will + // be identified based on the HTTP Host/Authority header. + // If one or more IP addresses are specified, + // the incoming traffic will be identified as belonging to this service + // if the destination IP matches the IP/CIDRs specified in the addresses + // field. If the Addresses field is empty, traffic will be identified + // solely based on the destination port. In such scenarios, the port on + // which the service is being accessed must not be shared by any other + // service in the mesh. In other words, the sidecar will behave as a + // simple TCP proxy, forwarding incoming traffic on a specified port to + // the specified destination endpoint IP/host. Unix domain socket + // addresses are not supported in this field. + repeated string addresses = 2; + + // The ports associated with the external service. If the + // Endpoints are Unix domain socket addresses, there must be exactly one + // port. + repeated Port ports = 3 [(google.api.field_behavior) = REQUIRED]; + + // Location specifies whether the service is part of Istio mesh or + // outside the mesh. Location determines the behavior of several + // features, such as service-to-service mTLS authentication, policy + // enforcement, etc. When communicating with services outside the mesh, + // Istio's mTLS authentication is disabled, and policy enforcement is + // performed on the client-side as opposed to server-side. + enum Location { + // Signifies that the service is external to the mesh. Typically used + // to indicate external services consumed through APIs. + MESH_EXTERNAL = 0; + + // Signifies that the service is part of the mesh. Typically used to + // indicate services added explicitly as part of expanding the service + // mesh to include unmanaged infrastructure (e.g., VMs added to a + // Kubernetes based service mesh). + MESH_INTERNAL = 1; + }; + + // Specify whether the service should be considered external to the mesh + // or part of the mesh. + Location location = 4; + + // Resolution determines how the proxy will resolve the IP addresses of + // the network endpoints associated with the service, so that it can + // route to one of them. The resolution mode specified here has no impact + // on how the application resolves the IP address associated with the + // service. The application may still have to use DNS to resolve the + // service to an IP so that the outbound traffic can be captured by the + // Proxy. Alternatively, for HTTP services, the application could + // directly communicate with the proxy (e.g., by setting HTTP_PROXY) to + // talk to these services. + enum Resolution { + // Assume that incoming connections have already been resolved (to a + // specific destination IP address). Such connections are typically + // routed via the proxy using mechanisms such as IP table REDIRECT/ + // eBPF. After performing any routing related transformations, the + // proxy will forward the connection to the IP address to which the + // connection was bound. + NONE = 0; + + // Use the static IP addresses specified in endpoints (see below) as the + // backing instances associated with the service. + STATIC = 1; + + // Attempt to resolve the IP address by querying the ambient DNS, + // during request processing. If no endpoints are specified, the proxy + // will resolve the DNS address specified in the hosts field, if + // wildcards are not used. If endpoints are specified, the DNS + // addresses specified in the endpoints will be resolved to determine + // the destination IP address. DNS resolution cannot be used with Unix + // domain socket endpoints. + DNS = 2; + }; + + // Service discovery mode for the hosts. Care must be taken + // when setting the resolution mode to NONE for a TCP port without + // accompanying IP addresses. In such cases, traffic to any IP on + // said port will be allowed (i.e. `0.0.0.0:`). + Resolution resolution = 5 [(google.api.field_behavior) = REQUIRED]; + + // One or more endpoints associated with the service. Only one of + // `endpoints` or `workloadSelector` can be specified. + repeated WorkloadEntry endpoints = 6; + + // Applicable only for MESH_INTERNAL services. Only one of + // `endpoints` or `workloadSelector` can be specified. Selects one + // or more Kubernetes pods or VM workloads (specified using + // `WorkloadEntry`) based on their labels. The `WorkloadEntry` object + // representing the VMs should be defined in the same namespace as + // the ServiceEntry. + WorkloadSelector workload_selector = 9; + + // A list of namespaces to which this service is exported. Exporting a service + // allows it to be used by sidecars, gateways and virtual services defined in + // other namespaces. This feature provides a mechanism for service owners + // and mesh administrators to control the visibility of services across + // namespace boundaries. + // + // If no namespaces are specified then the service is exported to all + // namespaces by default. + // + // The value "." is reserved and defines an export to the same namespace that + // the service is declared in. Similarly the value "*" is reserved and + // defines an export to all namespaces. + // + // For a Kubernetes Service, the equivalent effect can be achieved by setting + // the annotation "networking.istio.io/exportTo" to a comma-separated list + // of namespace names. + // + // NOTE: in the current release, the `exportTo` value is restricted to + // "." or "*" (i.e., the current namespace or all namespaces). + repeated string export_to = 7; + + // If specified, the proxy will verify that the server certificate's + // subject alternate name matches one of the specified values. + // + // NOTE: When using the workloadEntry with workloadSelectors, the + // service account specified in the workloadEntry will also be used + // to derive the additional subject alternate names that should be + // verified. + repeated string subject_alt_names = 8; +} diff --git a/vendor/istio.io/api/networking/v1alpha3/service_entry_deepcopy.gen.go b/vendor/istio.io/api/networking/v1alpha3/service_entry_deepcopy.gen.go new file mode 100644 index 0000000000..7f7357f2f0 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/service_entry_deepcopy.gen.go @@ -0,0 +1,779 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/service_entry.proto + +// `ServiceEntry` enables adding additional entries into Istio's +// internal service registry, so that auto-discovered services in the +// mesh can access/route to these manually specified services. A +// service entry describes the properties of a service (DNS name, +// VIPs, ports, protocols, endpoints). These services could be +// external to the mesh (e.g., web APIs) or mesh-internal services +// that are not part of the platform's service registry (e.g., a set +// of VMs talking to services in Kubernetes). In addition, the +// endpoints of a service entry can also be dynamically selected by +// using the `workloadSelector` field. These endpoints can be VM +// workloads declared using the `WorkloadEntry` object or Kubernetes +// pods. The ability to select both pods and VMs under a single +// service allows for migration of services from VMs to Kubernetes +// without having to change the existing DNS names associated with the +// services. +// +// The following example declares a few external APIs accessed by internal +// applications over HTTPS. The sidecar inspects the SNI value in the +// ClientHello message to route to the appropriate external service. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-https +// spec: +// hosts: +// - api.dropboxapi.com +// - www.googleapis.com +// - api.facebook.com +// location: MESH_EXTERNAL +// ports: +// - number: 443 +// name: https +// protocol: TLS +// resolution: DNS +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-https +// spec: +// hosts: +// - api.dropboxapi.com +// - www.googleapis.com +// - api.facebook.com +// location: MESH_EXTERNAL +// ports: +// - number: 443 +// name: https +// protocol: TLS +// resolution: DNS +// ``` +// {{}} +// {{}} +// +// The following configuration adds a set of MongoDB instances running on +// unmanaged VMs to Istio's registry, so that these services can be treated +// as any other service in the mesh. The associated DestinationRule is used +// to initiate mTLS connections to the database instances. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-mongocluster +// spec: +// hosts: +// - mymongodb.somedomain # not used +// addresses: +// - 192.192.192.192/24 # VIPs +// ports: +// - number: 27018 +// name: mongodb +// protocol: MONGO +// location: MESH_INTERNAL +// resolution: STATIC +// endpoints: +// - address: 2.2.2.2 +// - address: 3.3.3.3 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-mongocluster +// spec: +// hosts: +// - mymongodb.somedomain # not used +// addresses: +// - 192.192.192.192/24 # VIPs +// ports: +// - number: 27018 +// name: mongodb +// protocol: MONGO +// location: MESH_INTERNAL +// resolution: STATIC +// endpoints: +// - address: 2.2.2.2 +// - address: 3.3.3.3 +// ``` +// {{}} +// {{}} +// +// and the associated DestinationRule +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: mtls-mongocluster +// spec: +// host: mymongodb.somedomain +// trafficPolicy: +// tls: +// mode: MUTUAL +// clientCertificate: /etc/certs/myclientcert.pem +// privateKey: /etc/certs/client_private_key.pem +// caCertificates: /etc/certs/rootcacerts.pem +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: mtls-mongocluster +// spec: +// host: mymongodb.somedomain +// trafficPolicy: +// tls: +// mode: MUTUAL +// clientCertificate: /etc/certs/myclientcert.pem +// privateKey: /etc/certs/client_private_key.pem +// caCertificates: /etc/certs/rootcacerts.pem +// ``` +// {{}} +// {{}} +// +// The following example uses a combination of service entry and TLS +// routing in a virtual service to steer traffic based on the SNI value to +// an internal egress firewall. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-redirect +// spec: +// hosts: +// - wikipedia.org +// - "*.wikipedia.org" +// location: MESH_EXTERNAL +// ports: +// - number: 443 +// name: https +// protocol: TLS +// resolution: NONE +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-redirect +// spec: +// hosts: +// - wikipedia.org +// - "*.wikipedia.org" +// location: MESH_EXTERNAL +// ports: +// - number: 443 +// name: https +// protocol: TLS +// resolution: NONE +// ``` +// {{}} +// {{}} +// +// And the associated VirtualService to route based on the SNI value. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: tls-routing +// spec: +// hosts: +// - wikipedia.org +// - "*.wikipedia.org" +// tls: +// - match: +// - sniHosts: +// - wikipedia.org +// - "*.wikipedia.org" +// route: +// - destination: +// host: internal-egress-firewall.ns1.svc.cluster.local +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: tls-routing +// spec: +// hosts: +// - wikipedia.org +// - "*.wikipedia.org" +// tls: +// - match: +// - sniHosts: +// - wikipedia.org +// - "*.wikipedia.org" +// route: +// - destination: +// host: internal-egress-firewall.ns1.svc.cluster.local +// ``` +// {{}} +// {{}} +// +// The virtual service with TLS match serves to override the default SNI +// match. In the absence of a virtual service, traffic will be forwarded to +// the wikipedia domains. +// +// The following example demonstrates the use of a dedicated egress gateway +// through which all external service traffic is forwarded. +// The 'exportTo' field allows for control over the visibility of a service +// declaration to other namespaces in the mesh. By default, a service is exported +// to all namespaces. The following example restricts the visibility to the +// current namespace, represented by ".", so that it cannot be used by other +// namespaces. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-httpbin +// namespace : egress +// spec: +// hosts: +// - httpbin.com +// exportTo: +// - "." +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-httpbin +// namespace : egress +// spec: +// hosts: +// - httpbin.com +// exportTo: +// - "." +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// ``` +// {{}} +// {{}} +// +// Define a gateway to handle all egress traffic. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: istio-egressgateway +// namespace: istio-system +// spec: +// selector: +// istio: egressgateway +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - "*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Gateway +// metadata: +// name: istio-egressgateway +// namespace: istio-system +// spec: +// selector: +// istio: egressgateway +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - "*" +// ``` +// {{}} +// {{}} +// +// And the associated `VirtualService` to route from the sidecar to the +// gateway service (`istio-egressgateway.istio-system.svc.cluster.local`), as +// well as route from the gateway to the external service. Note that the +// virtual service is exported to all namespaces enabling them to route traffic +// through the gateway to the external service. Forcing traffic to go through +// a managed middle proxy like this is a common practice. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: gateway-routing +// namespace: egress +// spec: +// hosts: +// - httpbin.com +// exportTo: +// - "*" +// gateways: +// - mesh +// - istio-egressgateway +// http: +// - match: +// - port: 80 +// gateways: +// - mesh +// route: +// - destination: +// host: istio-egressgateway.istio-system.svc.cluster.local +// - match: +// - port: 80 +// gateways: +// - istio-egressgateway +// route: +// - destination: +// host: httpbin.com +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: gateway-routing +// namespace: egress +// spec: +// hosts: +// - httpbin.com +// exportTo: +// - "*" +// gateways: +// - mesh +// - istio-egressgateway +// http: +// - match: +// - port: 80 +// gateways: +// - mesh +// route: +// - destination: +// host: istio-egressgateway.istio-system.svc.cluster.local +// - match: +// - port: 80 +// gateways: +// - istio-egressgateway +// route: +// - destination: +// host: httpbin.com +// ``` +// {{}} +// {{}} +// +// The following example demonstrates the use of wildcards in the hosts for +// external services. If the connection has to be routed to the IP address +// requested by the application (i.e. application resolves DNS and attempts +// to connect to a specific IP), the discovery mode must be set to `NONE`. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-wildcard-example +// spec: +// hosts: +// - "*.bar.com" +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: NONE +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-wildcard-example +// spec: +// hosts: +// - "*.bar.com" +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: NONE +// ``` +// {{}} +// {{}} +// +// The following example demonstrates a service that is available via a +// Unix Domain Socket on the host of the client. The resolution must be +// set to STATIC to use Unix address endpoints. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: unix-domain-socket-example +// spec: +// hosts: +// - "example.unix.local" +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// endpoints: +// - address: unix:///var/run/example/socket +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: unix-domain-socket-example +// spec: +// hosts: +// - "example.unix.local" +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// endpoints: +// - address: unix:///var/run/example/socket +// ``` +// {{}} +// {{}} +// +// For HTTP-based services, it is possible to create a `VirtualService` +// backed by multiple DNS addressable endpoints. In such a scenario, the +// application can use the `HTTP_PROXY` environment variable to transparently +// reroute API calls for the `VirtualService` to a chosen backend. For +// example, the following configuration creates a non-existent external +// service called foo.bar.com backed by three domains: us.foo.bar.com:8080, +// uk.foo.bar.com:9080, and in.foo.bar.com:7080 +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-dns +// spec: +// hosts: +// - foo.bar.com +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// endpoints: +// - address: us.foo.bar.com +// ports: +// http: 8080 +// - address: uk.foo.bar.com +// ports: +// http: 9080 +// - address: in.foo.bar.com +// ports: +// http: 7080 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-dns +// spec: +// hosts: +// - foo.bar.com +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// endpoints: +// - address: us.foo.bar.com +// ports: +// https: 8080 +// - address: uk.foo.bar.com +// ports: +// https: 9080 +// - address: in.foo.bar.com +// ports: +// https: 7080 +// ``` +// {{}} +// {{}} +// +// With `HTTP_PROXY=http://localhost/`, calls from the application to +// `http://foo.bar.com` will be load balanced across the three domains +// specified above. In other words, a call to `http://foo.bar.com/baz` would +// be translated to `http://uk.foo.bar.com/baz`. +// +// The following example illustrates the usage of a `ServiceEntry` +// containing a subject alternate name +// whose format conforms to the [SPIFFE standard](https://github.com/spiffe/spiffe/blob/master/standards/SPIFFE-ID.md): +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: httpbin +// namespace : httpbin-ns +// spec: +// hosts: +// - httpbin.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// endpoints: +// - address: 2.2.2.2 +// - address: 3.3.3.3 +// subjectAltNames: +// - "spiffe://cluster.local/ns/httpbin-ns/sa/httpbin-service-account" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: httpbin +// namespace : httpbin-ns +// spec: +// hosts: +// - httpbin.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// endpoints: +// - address: 2.2.2.2 +// - address: 3.3.3.3 +// subjectAltNames: +// - "spiffe://cluster.local/ns/httpbin-ns/sa/httpbin-service-account" +// ``` +// {{}} +// {{}} +// +// The following example demonstrates the use of `ServiceEntry` with a +// `workloadSelector` to handle the migration of a service +// `details.bookinfo.com` from VMs to Kubernetes. The service has two +// VM-based instances with sidecars as well as a set of Kubernetes +// pods managed by a standard deployment object. Consumers of this +// service in the mesh will be automatically load balanced across the +// VMs and Kubernetes. VM for the `details.bookinfo.com` +// service. This VM has sidecar installed and bootstrapped using the +// `details-legacy` service account. The sidecar receives HTTP traffic +// on port 80 (wrapped in istio mutual TLS) and forwards it to the +// application on the localhost on the same port. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: WorkloadEntry +// metadata: +// name: details-vm-1 +// spec: +// serviceAccount: details +// address: 2.2.2.2 +// labels: +// app: details +// instance-id: vm1 +// --- +// apiVersion: networking.istio.io/v1alpha3 +// kind: WorkloadEntry +// metadata: +// name: details-vm-2 +// spec: +// serviceAccount: details +// address: 3.3.3.3 +// labels: +// app: details +// instance-id: vm2 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: WorkloadEntry +// metadata: +// name: details-vm-1 +// spec: +// serviceAccount: details +// address: 2.2.2.2 +// labels: +// app: details +// instance-id: vm1 +// --- +// apiVersion: networking.istio.io/v1beta1 +// kind: WorkloadEntry +// metadata: +// name: details-vm-2 +// spec: +// serviceAccount: details +// address: 3.3.3.3 +// labels: +// app: details +// instance-id: vm2 +// ``` +// {{}} +// {{}} +// +// Assuming there is also a Kubernetes deployment with pod labels +// `app: details` using the same service account `details`, the +// following service entry declares a service spanning both VMs and +// Kubernetes: +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// workloadSelector: +// labels: +// app: details +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// workloadSelector: +// labels: +// app: details +// ``` +// {{}} +// {{}} + +package v1alpha3 + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// DeepCopyInto supports using ServiceEntry within kubernetes types, where deepcopy-gen is used. +func (in *ServiceEntry) DeepCopyInto(out *ServiceEntry) { + p := proto.Clone(in).(*ServiceEntry) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceEntry. Required by controller-gen. +func (in *ServiceEntry) DeepCopy() *ServiceEntry { + if in == nil { + return nil + } + out := new(ServiceEntry) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/istio.io/api/networking/v1alpha3/service_entry_json.gen.go b/vendor/istio.io/api/networking/v1alpha3/service_entry_json.gen.go new file mode 100644 index 0000000000..c9da598dd3 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/service_entry_json.gen.go @@ -0,0 +1,781 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/service_entry.proto + +// `ServiceEntry` enables adding additional entries into Istio's +// internal service registry, so that auto-discovered services in the +// mesh can access/route to these manually specified services. A +// service entry describes the properties of a service (DNS name, +// VIPs, ports, protocols, endpoints). These services could be +// external to the mesh (e.g., web APIs) or mesh-internal services +// that are not part of the platform's service registry (e.g., a set +// of VMs talking to services in Kubernetes). In addition, the +// endpoints of a service entry can also be dynamically selected by +// using the `workloadSelector` field. These endpoints can be VM +// workloads declared using the `WorkloadEntry` object or Kubernetes +// pods. The ability to select both pods and VMs under a single +// service allows for migration of services from VMs to Kubernetes +// without having to change the existing DNS names associated with the +// services. +// +// The following example declares a few external APIs accessed by internal +// applications over HTTPS. The sidecar inspects the SNI value in the +// ClientHello message to route to the appropriate external service. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-https +// spec: +// hosts: +// - api.dropboxapi.com +// - www.googleapis.com +// - api.facebook.com +// location: MESH_EXTERNAL +// ports: +// - number: 443 +// name: https +// protocol: TLS +// resolution: DNS +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-https +// spec: +// hosts: +// - api.dropboxapi.com +// - www.googleapis.com +// - api.facebook.com +// location: MESH_EXTERNAL +// ports: +// - number: 443 +// name: https +// protocol: TLS +// resolution: DNS +// ``` +// {{}} +// {{}} +// +// The following configuration adds a set of MongoDB instances running on +// unmanaged VMs to Istio's registry, so that these services can be treated +// as any other service in the mesh. The associated DestinationRule is used +// to initiate mTLS connections to the database instances. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-mongocluster +// spec: +// hosts: +// - mymongodb.somedomain # not used +// addresses: +// - 192.192.192.192/24 # VIPs +// ports: +// - number: 27018 +// name: mongodb +// protocol: MONGO +// location: MESH_INTERNAL +// resolution: STATIC +// endpoints: +// - address: 2.2.2.2 +// - address: 3.3.3.3 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-mongocluster +// spec: +// hosts: +// - mymongodb.somedomain # not used +// addresses: +// - 192.192.192.192/24 # VIPs +// ports: +// - number: 27018 +// name: mongodb +// protocol: MONGO +// location: MESH_INTERNAL +// resolution: STATIC +// endpoints: +// - address: 2.2.2.2 +// - address: 3.3.3.3 +// ``` +// {{}} +// {{}} +// +// and the associated DestinationRule +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: mtls-mongocluster +// spec: +// host: mymongodb.somedomain +// trafficPolicy: +// tls: +// mode: MUTUAL +// clientCertificate: /etc/certs/myclientcert.pem +// privateKey: /etc/certs/client_private_key.pem +// caCertificates: /etc/certs/rootcacerts.pem +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: mtls-mongocluster +// spec: +// host: mymongodb.somedomain +// trafficPolicy: +// tls: +// mode: MUTUAL +// clientCertificate: /etc/certs/myclientcert.pem +// privateKey: /etc/certs/client_private_key.pem +// caCertificates: /etc/certs/rootcacerts.pem +// ``` +// {{}} +// {{}} +// +// The following example uses a combination of service entry and TLS +// routing in a virtual service to steer traffic based on the SNI value to +// an internal egress firewall. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-redirect +// spec: +// hosts: +// - wikipedia.org +// - "*.wikipedia.org" +// location: MESH_EXTERNAL +// ports: +// - number: 443 +// name: https +// protocol: TLS +// resolution: NONE +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-redirect +// spec: +// hosts: +// - wikipedia.org +// - "*.wikipedia.org" +// location: MESH_EXTERNAL +// ports: +// - number: 443 +// name: https +// protocol: TLS +// resolution: NONE +// ``` +// {{}} +// {{}} +// +// And the associated VirtualService to route based on the SNI value. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: tls-routing +// spec: +// hosts: +// - wikipedia.org +// - "*.wikipedia.org" +// tls: +// - match: +// - sniHosts: +// - wikipedia.org +// - "*.wikipedia.org" +// route: +// - destination: +// host: internal-egress-firewall.ns1.svc.cluster.local +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: tls-routing +// spec: +// hosts: +// - wikipedia.org +// - "*.wikipedia.org" +// tls: +// - match: +// - sniHosts: +// - wikipedia.org +// - "*.wikipedia.org" +// route: +// - destination: +// host: internal-egress-firewall.ns1.svc.cluster.local +// ``` +// {{}} +// {{}} +// +// The virtual service with TLS match serves to override the default SNI +// match. In the absence of a virtual service, traffic will be forwarded to +// the wikipedia domains. +// +// The following example demonstrates the use of a dedicated egress gateway +// through which all external service traffic is forwarded. +// The 'exportTo' field allows for control over the visibility of a service +// declaration to other namespaces in the mesh. By default, a service is exported +// to all namespaces. The following example restricts the visibility to the +// current namespace, represented by ".", so that it cannot be used by other +// namespaces. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-httpbin +// namespace : egress +// spec: +// hosts: +// - httpbin.com +// exportTo: +// - "." +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-httpbin +// namespace : egress +// spec: +// hosts: +// - httpbin.com +// exportTo: +// - "." +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// ``` +// {{}} +// {{}} +// +// Define a gateway to handle all egress traffic. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Gateway +// metadata: +// name: istio-egressgateway +// namespace: istio-system +// spec: +// selector: +// istio: egressgateway +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - "*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Gateway +// metadata: +// name: istio-egressgateway +// namespace: istio-system +// spec: +// selector: +// istio: egressgateway +// servers: +// - port: +// number: 80 +// name: http +// protocol: HTTP +// hosts: +// - "*" +// ``` +// {{}} +// {{}} +// +// And the associated `VirtualService` to route from the sidecar to the +// gateway service (`istio-egressgateway.istio-system.svc.cluster.local`), as +// well as route from the gateway to the external service. Note that the +// virtual service is exported to all namespaces enabling them to route traffic +// through the gateway to the external service. Forcing traffic to go through +// a managed middle proxy like this is a common practice. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: gateway-routing +// namespace: egress +// spec: +// hosts: +// - httpbin.com +// exportTo: +// - "*" +// gateways: +// - mesh +// - istio-egressgateway +// http: +// - match: +// - port: 80 +// gateways: +// - mesh +// route: +// - destination: +// host: istio-egressgateway.istio-system.svc.cluster.local +// - match: +// - port: 80 +// gateways: +// - istio-egressgateway +// route: +// - destination: +// host: httpbin.com +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: gateway-routing +// namespace: egress +// spec: +// hosts: +// - httpbin.com +// exportTo: +// - "*" +// gateways: +// - mesh +// - istio-egressgateway +// http: +// - match: +// - port: 80 +// gateways: +// - mesh +// route: +// - destination: +// host: istio-egressgateway.istio-system.svc.cluster.local +// - match: +// - port: 80 +// gateways: +// - istio-egressgateway +// route: +// - destination: +// host: httpbin.com +// ``` +// {{}} +// {{}} +// +// The following example demonstrates the use of wildcards in the hosts for +// external services. If the connection has to be routed to the IP address +// requested by the application (i.e. application resolves DNS and attempts +// to connect to a specific IP), the discovery mode must be set to `NONE`. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-wildcard-example +// spec: +// hosts: +// - "*.bar.com" +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: NONE +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-wildcard-example +// spec: +// hosts: +// - "*.bar.com" +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: NONE +// ``` +// {{}} +// {{}} +// +// The following example demonstrates a service that is available via a +// Unix Domain Socket on the host of the client. The resolution must be +// set to STATIC to use Unix address endpoints. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: unix-domain-socket-example +// spec: +// hosts: +// - "example.unix.local" +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// endpoints: +// - address: unix:///var/run/example/socket +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: unix-domain-socket-example +// spec: +// hosts: +// - "example.unix.local" +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// endpoints: +// - address: unix:///var/run/example/socket +// ``` +// {{}} +// {{}} +// +// For HTTP-based services, it is possible to create a `VirtualService` +// backed by multiple DNS addressable endpoints. In such a scenario, the +// application can use the `HTTP_PROXY` environment variable to transparently +// reroute API calls for the `VirtualService` to a chosen backend. For +// example, the following configuration creates a non-existent external +// service called foo.bar.com backed by three domains: us.foo.bar.com:8080, +// uk.foo.bar.com:9080, and in.foo.bar.com:7080 +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-dns +// spec: +// hosts: +// - foo.bar.com +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// endpoints: +// - address: us.foo.bar.com +// ports: +// http: 8080 +// - address: uk.foo.bar.com +// ports: +// http: 9080 +// - address: in.foo.bar.com +// ports: +// http: 7080 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-dns +// spec: +// hosts: +// - foo.bar.com +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// endpoints: +// - address: us.foo.bar.com +// ports: +// https: 8080 +// - address: uk.foo.bar.com +// ports: +// https: 9080 +// - address: in.foo.bar.com +// ports: +// https: 7080 +// ``` +// {{}} +// {{}} +// +// With `HTTP_PROXY=http://localhost/`, calls from the application to +// `http://foo.bar.com` will be load balanced across the three domains +// specified above. In other words, a call to `http://foo.bar.com/baz` would +// be translated to `http://uk.foo.bar.com/baz`. +// +// The following example illustrates the usage of a `ServiceEntry` +// containing a subject alternate name +// whose format conforms to the [SPIFFE standard](https://github.com/spiffe/spiffe/blob/master/standards/SPIFFE-ID.md): +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: httpbin +// namespace : httpbin-ns +// spec: +// hosts: +// - httpbin.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// endpoints: +// - address: 2.2.2.2 +// - address: 3.3.3.3 +// subjectAltNames: +// - "spiffe://cluster.local/ns/httpbin-ns/sa/httpbin-service-account" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: httpbin +// namespace : httpbin-ns +// spec: +// hosts: +// - httpbin.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// endpoints: +// - address: 2.2.2.2 +// - address: 3.3.3.3 +// subjectAltNames: +// - "spiffe://cluster.local/ns/httpbin-ns/sa/httpbin-service-account" +// ``` +// {{}} +// {{}} +// +// The following example demonstrates the use of `ServiceEntry` with a +// `workloadSelector` to handle the migration of a service +// `details.bookinfo.com` from VMs to Kubernetes. The service has two +// VM-based instances with sidecars as well as a set of Kubernetes +// pods managed by a standard deployment object. Consumers of this +// service in the mesh will be automatically load balanced across the +// VMs and Kubernetes. VM for the `details.bookinfo.com` +// service. This VM has sidecar installed and bootstrapped using the +// `details-legacy` service account. The sidecar receives HTTP traffic +// on port 80 (wrapped in istio mutual TLS) and forwards it to the +// application on the localhost on the same port. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: WorkloadEntry +// metadata: +// name: details-vm-1 +// spec: +// serviceAccount: details +// address: 2.2.2.2 +// labels: +// app: details +// instance-id: vm1 +// --- +// apiVersion: networking.istio.io/v1alpha3 +// kind: WorkloadEntry +// metadata: +// name: details-vm-2 +// spec: +// serviceAccount: details +// address: 3.3.3.3 +// labels: +// app: details +// instance-id: vm2 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: WorkloadEntry +// metadata: +// name: details-vm-1 +// spec: +// serviceAccount: details +// address: 2.2.2.2 +// labels: +// app: details +// instance-id: vm1 +// --- +// apiVersion: networking.istio.io/v1beta1 +// kind: WorkloadEntry +// metadata: +// name: details-vm-2 +// spec: +// serviceAccount: details +// address: 3.3.3.3 +// labels: +// app: details +// instance-id: vm2 +// ``` +// {{}} +// {{}} +// +// Assuming there is also a Kubernetes deployment with pod labels +// `app: details` using the same service account `details`, the +// following service entry declares a service spanning both VMs and +// Kubernetes: +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// workloadSelector: +// labels: +// app: details +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// workloadSelector: +// labels: +// app: details +// ``` +// {{}} +// {{}} + +package v1alpha3 + +import ( + bytes "bytes" + fmt "fmt" + github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" + proto "github.com/gogo/protobuf/proto" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// MarshalJSON is a custom marshaler for ServiceEntry +func (this *ServiceEntry) MarshalJSON() ([]byte, error) { + str, err := ServiceEntryMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for ServiceEntry +func (this *ServiceEntry) UnmarshalJSON(b []byte) error { + return ServiceEntryUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +var ( + ServiceEntryMarshaler = &github_com_gogo_protobuf_jsonpb.Marshaler{} + ServiceEntryUnmarshaler = &github_com_gogo_protobuf_jsonpb.Unmarshaler{} +) diff --git a/vendor/istio.io/api/networking/v1alpha3/sidecar.gen.json b/vendor/istio.io/api/networking/v1alpha3/sidecar.gen.json new file mode 100644 index 0000000000..2a575bd6f4 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/sidecar.gen.json @@ -0,0 +1,340 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Configuration affecting network reachability of a sidecar.", + "version": "v1alpha3" + }, + "components": { + "schemas": { + "istio.networking.v1alpha3.ClientTLSSettings": { + "description": "SSL/TLS related settings for upstream connections. See Envoy's [TLS context](https://www.envoyproxy.io/docs/envoy/latest/api-v2/api/v2/auth/cert.proto.html) for more details. These settings are common to both HTTP and TCP upstreams.", + "type": "object", + "properties": { + "mode": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ClientTLSSettings.TLSmode" + }, + "clientCertificate": { + "description": "REQUIRED if mode is `MUTUAL`. The path to the file holding the client-side TLS certificate to use. Should be empty if mode is `ISTIO_MUTUAL`.", + "type": "string", + "format": "string" + }, + "privateKey": { + "description": "REQUIRED if mode is `MUTUAL`. The path to the file holding the client's private key. Should be empty if mode is `ISTIO_MUTUAL`.", + "type": "string", + "format": "string" + }, + "caCertificates": { + "description": "OPTIONAL: The path to the file containing certificate authority certificates to use in verifying a presented server certificate. If omitted, the proxy will not verify the server's certificate. Should be empty if mode is `ISTIO_MUTUAL`.", + "type": "string", + "format": "string" + }, + "credentialName": { + "description": "The name of the secret that holds the TLS certs for the client including the CA certificates. Applicable only on Kubernetes. Secret must exist in the same namespace with the proxy using the certificates. The secret (of type `generic`)should contain the following keys and values: `key: \u003cprivateKey\u003e`, `cert: \u003cserverCert\u003e`, `cacert: \u003cCACertificate\u003e`. Secret of type tls for client certificates along with ca.crt key for CA certificates is also supported. Only one of client certificates and CA certificate or credentialName can be specified.", + "type": "string", + "format": "string" + }, + "subjectAltNames": { + "description": "A list of alternate names to verify the subject identity in the certificate. If specified, the proxy will verify that the server certificate's subject alt name matches one of the specified values. If specified, this list overrides the value of subject_alt_names from the ServiceEntry.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "sni": { + "description": "SNI string to present to the server during TLS handshake.", + "type": "string", + "format": "string" + } + } + }, + "istio.networking.v1alpha3.PortSelector": { + "description": "PortSelector specifies the number of a port to be used for matching or selection for final routing.", + "type": "object", + "properties": { + "number": { + "description": "Valid port number", + "type": "integer" + } + } + }, + "istio.networking.v1alpha3.ClientTLSSettings.TLSmode": { + "description": "TLS connection mode", + "type": "string", + "enum": [ + "DISABLE", + "SIMPLE", + "MUTUAL", + "ISTIO_MUTUAL" + ] + }, + "istio.networking.v1alpha3.WorkloadSelector": { + "description": "`WorkloadSelector` specifies the criteria used to determine if the `Gateway`, `Sidecar`, or `EnvoyFilter` or `ServiceEntry` configuration can be applied to a proxy. The matching criteria includes the metadata associated with a proxy, workload instance info such as labels attached to the pod/VM, or any other info that the proxy provides to Istio during the initial handshake. If multiple conditions are specified, all conditions need to match in order for the workload instance to be selected. Currently, only label based selection mechanism is supported.", + "type": "object", + "properties": { + "labels": { + "description": "One or more labels that indicate a specific set of pods/VMs on which the configuration should be applied. The scope of label search is restricted to the configuration namespace in which the the resource is present.", + "type": "object", + "additionalProperties": { + "type": "string", + "format": "string" + } + } + } + }, + "istio.networking.v1alpha3.Port": { + "description": "Port describes the properties of a specific port of a service.", + "type": "object", + "properties": { + "number": { + "description": "A valid non-negative integer port number.", + "type": "integer" + }, + "name": { + "description": "Label assigned to the port.", + "type": "string", + "format": "string" + }, + "protocol": { + "description": "The protocol exposed on the port. MUST BE one of HTTP|HTTPS|GRPC|HTTP2|MONGO|TCP|TLS. TLS implies the connection will be routed based on the SNI header to the destination without terminating the TLS connection.", + "type": "string", + "format": "string" + } + } + }, + "istio.networking.v1alpha3.ServerTLSSettings": { + "type": "object", + "properties": { + "mode": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ServerTLSSettings.TLSmode" + }, + "privateKey": { + "description": "REQUIRED if mode is `SIMPLE` or `MUTUAL`. The path to the file holding the server's private key.", + "type": "string", + "format": "string" + }, + "caCertificates": { + "description": "REQUIRED if mode is `MUTUAL`. The path to a file containing certificate authority certificates to use in verifying a presented client side certificate.", + "type": "string", + "format": "string" + }, + "credentialName": { + "description": "For gateways running on Kubernetes, the name of the secret that holds the TLS certs including the CA certificates. Applicable only on Kubernetes. The secret (of type`generic`) should contain the following keys and values: `key: \u003cprivateKey\u003e`, `cert: \u003cserverCert\u003e`, `cacert: \u003cCACertificate\u003e`. Secret of type tls for server certificates along with ca.crt key for CA certificates is also supported. Only one of server certificates and CA certificate or credentialName can be specified.", + "type": "string", + "format": "string" + }, + "subjectAltNames": { + "description": "A list of alternate names to verify the subject identity in the certificate presented by the client.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "httpsRedirect": { + "description": "If set to true, the load balancer will send a 301 redirect for all http connections, asking the clients to use HTTPS.", + "type": "boolean" + }, + "serverCertificate": { + "description": "REQUIRED if mode is `SIMPLE` or `MUTUAL`. The path to the file holding the server-side TLS certificate to use.", + "type": "string", + "format": "string" + }, + "verifyCertificateSpki": { + "description": "An optional list of base64-encoded SHA-256 hashes of the SKPIs of authorized client certificates. Note: When both verify_certificate_hash and verify_certificate_spki are specified, a hash matching either value will result in the certificate being accepted.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "verifyCertificateHash": { + "description": "An optional list of hex-encoded SHA-256 hashes of the authorized client certificates. Both simple and colon separated formats are acceptable. Note: When both verify_certificate_hash and verify_certificate_spki are specified, a hash matching either value will result in the certificate being accepted.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "minProtocolVersion": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ServerTLSSettings.TLSProtocol" + }, + "maxProtocolVersion": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ServerTLSSettings.TLSProtocol" + }, + "cipherSuites": { + "description": "Optional: If specified, only support the specified cipher list. Otherwise default to the default cipher list supported by Envoy.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + } + } + }, + "istio.networking.v1alpha3.ServerTLSSettings.TLSmode": { + "description": "TLS modes enforced by the proxy", + "type": "string", + "enum": [ + "PASSTHROUGH", + "SIMPLE", + "MUTUAL", + "AUTO_PASSTHROUGH", + "ISTIO_MUTUAL" + ] + }, + "istio.networking.v1alpha3.ServerTLSSettings.TLSProtocol": { + "description": "TLS protocol versions.", + "type": "string", + "enum": [ + "TLS_AUTO", + "TLSV1_0", + "TLSV1_1", + "TLSV1_2", + "TLSV1_3" + ] + }, + "istio.networking.v1alpha3.Sidecar": { + "description": "`Sidecar` describes the configuration of the sidecar proxy that mediates inbound and outbound communication of the workload instance to which it is attached.", + "type": "object", + "properties": { + "workloadSelector": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.WorkloadSelector" + }, + "ingress": { + "description": "Ingress specifies the configuration of the sidecar for processing inbound traffic to the attached workload instance. If omitted, Istio will automatically configure the sidecar based on the information about the workload obtained from the orchestration platform (e.g., exposed ports, services, etc.). If specified, inbound ports are configured if and only if the workload instance is associated with a service.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.IstioIngressListener" + } + }, + "egress": { + "description": "Egress specifies the configuration of the sidecar for processing outbound traffic from the attached workload instance to other services in the mesh. If not specified, inherits the system detected defaults from the namespace-wide or the global default Sidecar.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.IstioEgressListener" + } + }, + "outboundTrafficPolicy": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.OutboundTrafficPolicy" + }, + "localhost": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.Localhost" + } + } + }, + "istio.networking.v1alpha3.IstioIngressListener": { + "description": "`IstioIngressListener` specifies the properties of an inbound traffic listener on the sidecar proxy attached to a workload instance.", + "type": "object", + "properties": { + "port": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.Port" + }, + "bind": { + "description": "The IP to which the listener should be bound. Must be in the format `x.x.x.x`. Unix domain socket addresses are not allowed in the bind field for ingress listeners. If omitted, Istio will automatically configure the defaults based on imported services and the workload instances to which this configuration is applied to.", + "type": "string", + "format": "string" + }, + "defaultEndpoint": { + "description": "The loopback IP endpoint or Unix domain socket to which traffic should be forwarded to. This configuration can be used to redirect traffic arriving at the bind `IP:Port` on the sidecar to a `localhost:port` or Unix domain socket where the application workload instance is listening for connections. Format should be `127.0.0.1:PORT` or `unix:///path/to/socket`", + "type": "string", + "format": "string" + }, + "captureMode": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.CaptureMode" + }, + "localhostClientTls": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ClientTLSSettings" + } + } + }, + "istio.networking.v1alpha3.IstioEgressListener": { + "description": "`IstioEgressListener` specifies the properties of an outbound traffic listener on the sidecar proxy attached to a workload instance.", + "type": "object", + "properties": { + "port": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.Port" + }, + "bind": { + "description": "The IP or the Unix domain socket to which the listener should be bound to. Port MUST be specified if bind is not empty. Format: `x.x.x.x` or `unix:///path/to/uds` or `unix://@foobar` (Linux abstract namespace). If omitted, Istio will automatically configure the defaults based on imported services, the workload instances to which this configuration is applied to and the captureMode. If captureMode is `NONE`, bind will default to 127.0.0.1.", + "type": "string", + "format": "string" + }, + "hosts": { + "description": "One or more service hosts exposed by the listener in `namespace/dnsName` format. Services in the specified namespace matching `dnsName` will be exposed. The corresponding service can be a service in the service registry (e.g., a Kubernetes or cloud foundry service) or a service specified using a `ServiceEntry` or `VirtualService` configuration. Any associated `DestinationRule` in the same namespace will also be used.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "captureMode": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.CaptureMode" + }, + "localhostServerTls": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ServerTLSSettings" + } + } + }, + "istio.networking.v1alpha3.OutboundTrafficPolicy": { + "description": "`OutboundTrafficPolicy` sets the default behavior of the sidecar for handling outbound traffic from the application. If your application uses one or more external services that are not known apriori, setting the policy to `ALLOW_ANY` will cause the sidecars to route any unknown traffic originating from the application to its requested destination. Users are strongly encouraged to use `ServiceEntry` configurations to explicitly declare any external dependencies, instead of using `ALLOW_ANY`, so that traffic to these services can be monitored.", + "type": "object", + "properties": { + "mode": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.OutboundTrafficPolicy.Mode" + }, + "egressProxy": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.Destination" + } + } + }, + "istio.networking.v1alpha3.Localhost": { + "description": "`Localhost` describes the sidecar settings related to the communication between the sidecar and the workload it is attached to in a Kubernetes Pod or a VM. These settings apply by default to all ingress and egress listeners in a sidecar unless overridden.", + "type": "object", + "properties": { + "clientTls": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ClientTLSSettings" + }, + "serverTls": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.ServerTLSSettings" + } + } + }, + "istio.networking.v1alpha3.CaptureMode": { + "description": "`CaptureMode` describes how traffic to a listener is expected to be captured. Applicable only when the listener is bound to an IP.", + "type": "string", + "enum": [ + "DEFAULT", + "IPTABLES", + "NONE" + ] + }, + "istio.networking.v1alpha3.OutboundTrafficPolicy.Mode": { + "type": "string", + "enum": [ + "REGISTRY_ONLY", + "ALLOW_ANY" + ] + }, + "istio.networking.v1alpha3.Destination": { + "description": "Destination indicates the network addressable service to which the request/connection will be sent after processing a routing rule. The destination.host should unambiguously refer to a service in the service registry. Istio's service registry is composed of all the services found in the platform's service registry (e.g., Kubernetes services, Consul services), as well as services declared through the [ServiceEntry](https://istio.io/docs/reference/config/networking/service-entry/#ServiceEntry) resource.", + "type": "object", + "properties": { + "host": { + "description": "The name of a service from the service registry. Service names are looked up from the platform's service registry (e.g., Kubernetes services, Consul services, etc.) and from the hosts declared by [ServiceEntry](https://istio.io/docs/reference/config/networking/service-entry/#ServiceEntry). Traffic forwarded to destinations that are not found in either of the two, will be dropped.", + "type": "string", + "format": "string" + }, + "port": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.PortSelector" + }, + "subset": { + "description": "The name of a subset within the service. Applicable only to services within the mesh. The subset must be defined in a corresponding DestinationRule.", + "type": "string", + "format": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/vendor/istio.io/api/networking/v1alpha3/sidecar.pb.go b/vendor/istio.io/api/networking/v1alpha3/sidecar.pb.go new file mode 100644 index 0000000000..735e6ed33e --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/sidecar.pb.go @@ -0,0 +1,2903 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/sidecar.proto + +// `Sidecar` describes the configuration of the sidecar proxy that mediates +// inbound and outbound communication to the workload instance it is attached to. By +// default, Istio will program all sidecar proxies in the mesh with the +// necessary configuration required to reach every workload instance in the mesh, as +// well as accept traffic on all the ports associated with the +// workload. The `Sidecar` configuration provides a way to fine tune the set of +// ports, protocols that the proxy will accept when forwarding traffic to +// and from the workload. In addition, it is possible to restrict the set +// of services that the proxy can reach when forwarding outbound traffic +// from workload instances. +// +// Services and configuration in a mesh are organized into one or more +// namespaces (e.g., a Kubernetes namespace or a CF org/space). A `Sidecar` +// configuration in a namespace will apply to one or more workload instances in the same +// namespace, selected using the `workloadSelector` field. In the absence of a +// `workloadSelector`, it will apply to all workload instances in the same +// namespace. When determining the `Sidecar` configuration to be applied to a +// workload instance, preference will be given to the resource with a +// `workloadSelector` that selects this workload instance, over a `Sidecar` configuration +// without any `workloadSelector`. +// +// **NOTE 1**: *_Each namespace can have only one `Sidecar` +// configuration without any `workloadSelector`_ that specifies the +// default for all pods in that namespace*. It is recommended to use +// the name `default` for the namespace-wide sidecar. The behavior of +// the system is undefined if more than one selector-less `Sidecar` +// configurations exist in a given namespace. The behavior of the +// system is undefined if two or more `Sidecar` configurations with a +// `workloadSelector` select the same workload instance. +// +// **NOTE 2**: *_A `Sidecar` configuration in the `MeshConfig` +// [root namespace](https://istio.io/docs/reference/config/istio.mesh.v1alpha1/#MeshConfig) +// will be applied by default to all namespaces without a `Sidecar` +// configuration_*. This global default `Sidecar` configuration should not have +// any `workloadSelector`. +// +// The example below declares a global default `Sidecar` configuration +// in the root namespace called `istio-config`, that configures +// sidecars in all namespaces to allow egress traffic only to other +// workloads in the same namespace as well as to services in the +// `istio-system` namespace. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: default +// namespace: istio-config +// spec: +// egress: +// - hosts: +// - "./*" +// - "istio-system/*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: default +// namespace: istio-config +// spec: +// egress: +// - hosts: +// - "./*" +// - "istio-system/*" +// ``` +// {{}} +// {{}} +// +// The example below declares a `Sidecar` configuration in the +// `prod-us1` namespace that overrides the global default defined +// above, and configures the sidecars in the namespace to allow egress +// traffic to public services in the `prod-us1`, `prod-apis`, and the +// `istio-system` namespaces. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: default +// namespace: prod-us1 +// spec: +// egress: +// - hosts: +// - "prod-us1/*" +// - "prod-apis/*" +// - "istio-system/*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: default +// namespace: prod-us1 +// spec: +// egress: +// - hosts: +// - "prod-us1/*" +// - "prod-apis/*" +// - "istio-system/*" +// ``` +// {{}} +// {{}} +// +// The following example declares a `Sidecar` configuration in the +// `prod-us1` namespace for all pods with labels `app: ratings` +// belonging to the `ratings.prod-us1` service. The workload accepts +// inbound HTTP traffic on port 9080. The traffic is then forwarded to +// the attached workload instance listening on a Unix domain +// socket. In the egress direction, in addition to the `istio-system` +// namespace, the sidecar proxies only HTTP traffic bound for port +// 9080 for services in the `prod-us1` namespace. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: ratings +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: ratings +// ingress: +// - port: +// number: 9080 +// protocol: HTTP +// name: somename +// defaultEndpoint: unix:///var/run/someuds.sock +// egress: +// - port: +// number: 9080 +// protocol: HTTP +// name: egresshttp +// hosts: +// - "prod-us1/*" +// - hosts: +// - "istio-system/*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: ratings +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: ratings +// ingress: +// - port: +// number: 9080 +// protocol: HTTP +// name: somename +// defaultEndpoint: unix:///var/run/someuds.sock +// egress: +// - port: +// number: 9080 +// protocol: HTTP +// name: egresshttp +// hosts: +// - "prod-us1/*" +// - hosts: +// - "istio-system/*" +// ``` +// {{}} +// {{}} +// +// If the workload is deployed without IPTables-based traffic capture, +// the `Sidecar` configuration is the only way to configure the ports +// on the proxy attached to the workload instance. The following +// example declares a `Sidecar` configuration in the `prod-us1` +// namespace for all pods with labels `app: productpage` belonging to +// the `productpage.prod-us1` service. Assuming that these pods are +// deployed without IPtable rules (i.e. the `istio-init` container) +// and the proxy metadata `ISTIO_META_INTERCEPTION_MODE` is set to +// `NONE`, the specification, below, allows such pods to receive HTTP +// traffic on port 9080 (wrapped inside Istio mutual TLS) and forward +// it to the application listening on `127.0.0.1:8080`. It also allows +// the application to communicate with a backing MySQL database on +// `127.0.0.1:3306`, that then gets proxied to the externally hosted +// MySQL service at `mysql.foo.com:3306`. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: no-ip-tables +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: productpage +// ingress: +// - port: +// number: 9080 # binds to proxy_instance_ip:9080 (0.0.0.0:9080, if no unicast IP is available for the instance) +// protocol: HTTP +// name: somename +// defaultEndpoint: 127.0.0.1:8080 +// captureMode: NONE # not needed if metadata is set for entire proxy +// egress: +// - port: +// number: 3306 +// protocol: MYSQL +// name: egressmysql +// captureMode: NONE # not needed if metadata is set for entire proxy +// bind: 127.0.0.1 +// hosts: +// - "*/mysql.foo.com" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: no-ip-tables +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: productpage +// ingress: +// - port: +// number: 9080 # binds to proxy_instance_ip:9080 (0.0.0.0:9080, if no unicast IP is available for the instance) +// protocol: HTTP +// name: somename +// defaultEndpoint: 127.0.0.1:8080 +// captureMode: NONE # not needed if metadata is set for entire proxy +// egress: +// - port: +// number: 3306 +// protocol: MYSQL +// name: egressmysql +// captureMode: NONE # not needed if metadata is set for entire proxy +// bind: 127.0.0.1 +// hosts: +// - "*/mysql.foo.com" +// ``` +// {{}} +// {{}} +// +// And the associated service entry for routing to `mysql.foo.com:3306` +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-mysql +// namespace: ns1 +// spec: +// hosts: +// - mysql.foo.com +// ports: +// - number: 3306 +// name: mysql +// protocol: MYSQL +// location: MESH_EXTERNAL +// resolution: DNS +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-mysql +// namespace: ns1 +// spec: +// hosts: +// - mysql.foo.com +// ports: +// - number: 3306 +// name: mysql +// protocol: MYSQL +// location: MESH_EXTERNAL +// resolution: DNS +// ``` +// {{}} +// {{}} +// +// It is also possible to mix and match traffic capture modes in a single +// proxy. For example, consider a setup where internal services are on the +// `192.168.0.0/16` subnet. So, IP tables are setup on the VM to capture all +// outbound traffic on `192.168.0.0/16` subnet. Assume that the VM has an +// additional network interface on `172.16.0.0/16` subnet for inbound +// traffic. The following `Sidecar` configuration allows the VM to expose a +// listener on `172.16.1.32:80` (the VM's IP) for traffic arriving from the +// `172.16.0.0/16` subnet. +// +// **NOTE**: The `ISTIO_META_INTERCEPTION_MODE` metadata on the +// proxy in the VM should contain `REDIRECT` or `TPROXY` as its value, +// implying that IP tables based traffic capture is active. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: partial-ip-tables +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: productpage +// ingress: +// - bind: 172.16.1.32 +// port: +// number: 80 # binds to 172.16.1.32:80 +// protocol: HTTP +// name: somename +// defaultEndpoint: 127.0.0.1:8080 +// captureMode: NONE +// egress: +// # use the system detected defaults +// # sets up configuration to handle outbound traffic to services +// # in 192.168.0.0/16 subnet, based on information provided by the +// # service registry +// - captureMode: IPTABLES +// hosts: +// - "*/*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: partial-ip-tables +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: productpage +// ingress: +// - bind: 172.16.1.32 +// port: +// number: 80 # binds to 172.16.1.32:80 +// protocol: HTTP +// name: somename +// defaultEndpoint: 127.0.0.1:8080 +// captureMode: NONE +// egress: +// # use the system detected defaults +// # sets up configuration to handle outbound traffic to services +// # in 192.168.0.0/16 subnet, based on information provided by the +// # service registry +// - captureMode: IPTABLES +// hosts: +// - "*/*" +// ``` +// {{}} +// {{}} +// + +package v1alpha3 + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// `CaptureMode` describes how traffic to a listener is expected to be +// captured. Applicable only when the listener is bound to an IP. +type CaptureMode int32 + +const ( + // The default capture mode defined by the environment. + CaptureMode_DEFAULT CaptureMode = 0 + // Capture traffic using IPtables redirection. + CaptureMode_IPTABLES CaptureMode = 1 + // No traffic capture. When used in an egress listener, the application is + // expected to explicitly communicate with the listener port or Unix + // domain socket. When used in an ingress listener, care needs to be taken + // to ensure that the listener port is not in use by other processes on + // the host. + CaptureMode_NONE CaptureMode = 2 +) + +var CaptureMode_name = map[int32]string{ + 0: "DEFAULT", + 1: "IPTABLES", + 2: "NONE", +} + +var CaptureMode_value = map[string]int32{ + "DEFAULT": 0, + "IPTABLES": 1, + "NONE": 2, +} + +func (x CaptureMode) String() string { + return proto.EnumName(CaptureMode_name, int32(x)) +} + +func (CaptureMode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_b5c11342f04ad3d1, []int{0} +} + +type OutboundTrafficPolicy_Mode int32 + +const ( + // Outbound traffic will be restricted to services defined in the + // service registry as well as those defined through `ServiceEntry` configurations. + OutboundTrafficPolicy_REGISTRY_ONLY OutboundTrafficPolicy_Mode = 0 + // Outbound traffic to unknown destinations will be allowed, in case + // there are no services or `ServiceEntry` configurations for the destination port. + OutboundTrafficPolicy_ALLOW_ANY OutboundTrafficPolicy_Mode = 1 +) + +var OutboundTrafficPolicy_Mode_name = map[int32]string{ + 0: "REGISTRY_ONLY", + 1: "ALLOW_ANY", +} + +var OutboundTrafficPolicy_Mode_value = map[string]int32{ + "REGISTRY_ONLY": 0, + "ALLOW_ANY": 1, +} + +func (x OutboundTrafficPolicy_Mode) String() string { + return proto.EnumName(OutboundTrafficPolicy_Mode_name, int32(x)) +} + +func (OutboundTrafficPolicy_Mode) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_b5c11342f04ad3d1, []int{4, 0} +} + +// `Sidecar` describes the configuration of the sidecar proxy that mediates +// inbound and outbound communication of the workload instance to which it is +// attached. +// +// +// +// +type Sidecar struct { + // Criteria used to select the specific set of pods/VMs on which this + // `Sidecar` configuration should be applied. If omitted, the `Sidecar` + // configuration will be applied to all workload instances in the same namespace. + WorkloadSelector *WorkloadSelector `protobuf:"bytes,1,opt,name=workload_selector,json=workloadSelector,proto3" json:"workload_selector,omitempty"` + // Ingress specifies the configuration of the sidecar for processing + // inbound traffic to the attached workload instance. If omitted, Istio will + // automatically configure the sidecar based on the information about the workload + // obtained from the orchestration platform (e.g., exposed ports, services, + // etc.). If specified, inbound ports are configured if and only if the + // workload instance is associated with a service. + Ingress []*IstioIngressListener `protobuf:"bytes,2,rep,name=ingress,proto3" json:"ingress,omitempty"` + // Egress specifies the configuration of the sidecar for processing + // outbound traffic from the attached workload instance to other + // services in the mesh. If not specified, inherits the system + // detected defaults from the namespace-wide or the global default Sidecar. + Egress []*IstioEgressListener `protobuf:"bytes,3,rep,name=egress,proto3" json:"egress,omitempty"` + // Configuration for the outbound traffic policy. If your + // application uses one or more external services that are not known + // apriori, setting the policy to `ALLOW_ANY` will cause the + // sidecars to route any unknown traffic originating from the + // application to its requested destination. If not specified, + // inherits the system detected defaults from the namespace-wide or + // the global default Sidecar. + OutboundTrafficPolicy *OutboundTrafficPolicy `protobuf:"bytes,4,opt,name=outbound_traffic_policy,json=outboundTrafficPolicy,proto3" json:"outbound_traffic_policy,omitempty"` + // $hide_from_docs + // `Localhost` describes the sidecar settings related to the + // communication between the sidecar and the workload it is attached to + // in a Kubernetes Pod or a VM. These settings apply to all ingress + // and egress listeners in a sidecar unless overridden. There are no + // built in defaults for this setting. If not specified, the + // features will be disabled. + Localhost *Localhost `protobuf:"bytes,6,opt,name=localhost,proto3" json:"localhost,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Sidecar) Reset() { *m = Sidecar{} } +func (m *Sidecar) String() string { return proto.CompactTextString(m) } +func (*Sidecar) ProtoMessage() {} +func (*Sidecar) Descriptor() ([]byte, []int) { + return fileDescriptor_b5c11342f04ad3d1, []int{0} +} +func (m *Sidecar) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Sidecar) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Sidecar.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Sidecar) XXX_Merge(src proto.Message) { + xxx_messageInfo_Sidecar.Merge(m, src) +} +func (m *Sidecar) XXX_Size() int { + return m.Size() +} +func (m *Sidecar) XXX_DiscardUnknown() { + xxx_messageInfo_Sidecar.DiscardUnknown(m) +} + +var xxx_messageInfo_Sidecar proto.InternalMessageInfo + +func (m *Sidecar) GetWorkloadSelector() *WorkloadSelector { + if m != nil { + return m.WorkloadSelector + } + return nil +} + +func (m *Sidecar) GetIngress() []*IstioIngressListener { + if m != nil { + return m.Ingress + } + return nil +} + +func (m *Sidecar) GetEgress() []*IstioEgressListener { + if m != nil { + return m.Egress + } + return nil +} + +func (m *Sidecar) GetOutboundTrafficPolicy() *OutboundTrafficPolicy { + if m != nil { + return m.OutboundTrafficPolicy + } + return nil +} + +func (m *Sidecar) GetLocalhost() *Localhost { + if m != nil { + return m.Localhost + } + return nil +} + +// `IstioIngressListener` specifies the properties of an inbound +// traffic listener on the sidecar proxy attached to a workload instance. +type IstioIngressListener struct { + // The port associated with the listener. + Port *Port `protobuf:"bytes,1,opt,name=port,proto3" json:"port,omitempty"` + // The IP to which the listener should be bound. Must be in the + // format `x.x.x.x`. Unix domain socket addresses are not allowed in + // the bind field for ingress listeners. If omitted, Istio will + // automatically configure the defaults based on imported services + // and the workload instances to which this configuration is applied + // to. + Bind string `protobuf:"bytes,2,opt,name=bind,proto3" json:"bind,omitempty"` + // The captureMode option dictates how traffic to the listener is + // expected to be captured (or not). + CaptureMode CaptureMode `protobuf:"varint,3,opt,name=capture_mode,json=captureMode,proto3,enum=istio.networking.v1alpha3.CaptureMode" json:"capture_mode,omitempty"` + // The loopback IP endpoint or Unix domain socket to which + // traffic should be forwarded to. This configuration can be used to + // redirect traffic arriving at the bind `IP:Port` on the sidecar to a `localhost:port` + // or Unix domain socket where the application workload instance is listening for + // connections. Format should be `127.0.0.1:PORT` or `unix:///path/to/socket` + DefaultEndpoint string `protobuf:"bytes,4,opt,name=default_endpoint,json=defaultEndpoint,proto3" json:"default_endpoint,omitempty"` + // $hide_from_docs + // TLS settings to be used by the sidecar (client) when forwarding + // traffic from the sidecar to the workload (server) on the + // localhost. Overrides the `localhost` level `clientTls` settings. + // + // **NOTE**: DISABLE, SIMPLE and MUTUAL are the only valid TLS modes. + LocalhostClientTls *ClientTLSSettings `protobuf:"bytes,6,opt,name=localhost_client_tls,json=localhostClientTls,proto3" json:"localhost_client_tls,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *IstioIngressListener) Reset() { *m = IstioIngressListener{} } +func (m *IstioIngressListener) String() string { return proto.CompactTextString(m) } +func (*IstioIngressListener) ProtoMessage() {} +func (*IstioIngressListener) Descriptor() ([]byte, []int) { + return fileDescriptor_b5c11342f04ad3d1, []int{1} +} +func (m *IstioIngressListener) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IstioIngressListener) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IstioIngressListener.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *IstioIngressListener) XXX_Merge(src proto.Message) { + xxx_messageInfo_IstioIngressListener.Merge(m, src) +} +func (m *IstioIngressListener) XXX_Size() int { + return m.Size() +} +func (m *IstioIngressListener) XXX_DiscardUnknown() { + xxx_messageInfo_IstioIngressListener.DiscardUnknown(m) +} + +var xxx_messageInfo_IstioIngressListener proto.InternalMessageInfo + +func (m *IstioIngressListener) GetPort() *Port { + if m != nil { + return m.Port + } + return nil +} + +func (m *IstioIngressListener) GetBind() string { + if m != nil { + return m.Bind + } + return "" +} + +func (m *IstioIngressListener) GetCaptureMode() CaptureMode { + if m != nil { + return m.CaptureMode + } + return CaptureMode_DEFAULT +} + +func (m *IstioIngressListener) GetDefaultEndpoint() string { + if m != nil { + return m.DefaultEndpoint + } + return "" +} + +func (m *IstioIngressListener) GetLocalhostClientTls() *ClientTLSSettings { + if m != nil { + return m.LocalhostClientTls + } + return nil +} + +// `IstioEgressListener` specifies the properties of an outbound traffic +// listener on the sidecar proxy attached to a workload instance. +type IstioEgressListener struct { + // The port associated with the listener. If using Unix domain socket, + // use 0 as the port number, with a valid protocol. The port if + // specified, will be used as the default destination port associated + // with the imported hosts. If the port is omitted, Istio will infer the + // listener ports based on the imported hosts. Note that when multiple + // egress listeners are specified, where one or more listeners have + // specific ports while others have no port, the hosts exposed on a + // listener port will be based on the listener with the most specific + // port. + Port *Port `protobuf:"bytes,1,opt,name=port,proto3" json:"port,omitempty"` + // The IP or the Unix domain socket to which the listener should be bound + // to. Port MUST be specified if bind is not empty. Format: `x.x.x.x` or + // `unix:///path/to/uds` or `unix://@foobar` (Linux abstract namespace). If + // omitted, Istio will automatically configure the defaults based on imported + // services, the workload instances to which this configuration is applied to and + // the captureMode. If captureMode is `NONE`, bind will default to + // 127.0.0.1. + Bind string `protobuf:"bytes,2,opt,name=bind,proto3" json:"bind,omitempty"` + // When the bind address is an IP, the captureMode option dictates + // how traffic to the listener is expected to be captured (or not). + // captureMode must be DEFAULT or `NONE` for Unix domain socket binds. + CaptureMode CaptureMode `protobuf:"varint,3,opt,name=capture_mode,json=captureMode,proto3,enum=istio.networking.v1alpha3.CaptureMode" json:"capture_mode,omitempty"` + // One or more service hosts exposed by the listener + // in `namespace/dnsName` format. Services in the specified namespace + // matching `dnsName` will be exposed. + // The corresponding service can be a service in the service registry + // (e.g., a Kubernetes or cloud foundry service) or a service specified + // using a `ServiceEntry` or `VirtualService` configuration. Any + // associated `DestinationRule` in the same namespace will also be used. + // + // The `dnsName` should be specified using FQDN format, optionally including + // a wildcard character in the left-most component (e.g., `prod/*.example.com`). + // Set the `dnsName` to `*` to select all services from the specified namespace + // (e.g., `prod/*`). + // + // The `namespace` can be set to `*`, `.`, or `~`, representing any, the current, + // or no namespace, respectively. For example, `*/foo.example.com` selects the + // service from any available namespace while `./foo.example.com` only selects + // the service from the namespace of the sidecar. If a host is set to `*/*`, + // Istio will configure the sidecar to be able to reach every service in the + // mesh that is exported to the sidecar's namespace. The value `~/*` can be used + // to completely trim the configuration for sidecars that simply receive traffic + // and respond, but make no outbound connections of their own. + // + // NOTE: Only services and configuration artifacts exported to the sidecar's + // namespace (e.g., `exportTo` value of `*`) can be referenced. + // Private configurations (e.g., `exportTo` set to `.`) will + // not be available. Refer to the `exportTo` setting in `VirtualService`, + // `DestinationRule`, and `ServiceEntry` configurations for details. + // + // **WARNING:** The list of egress hosts in a `Sidecar` must also include + // the Mixer control plane services if they are enabled. Envoy will not + // be able to reach them otherwise. For example, add host + // `istio-system/istio-telemetry.istio-system.svc.cluster.local` if telemetry + // is enabled, `istio-system/istio-policy.istio-system.svc.cluster.local` if + // policy is enabled, or add `istio-system/*` to allow all services in the + // `istio-system` namespace. This requirement is temporary and will be removed + // in a future Istio release. + Hosts []string `protobuf:"bytes,4,rep,name=hosts,proto3" json:"hosts,omitempty"` + // $hide_from_docs + // TLS settings to be used by the sidecar (server) when receiving + // traffic from the workload (client) on the + // localhost. Overrides the `localhost` level `serverTls` settings. + // + // **NOTE**: SIMPLE and MUTUAL are the only valid TLS + // modes. `httpsRedirect` and `credentialName` (for fetching + // certificates from Kubernetes secrets) are not valid. All + // certificates must be mounted as files inside the sidecar + // container. + LocalhostServerTls *ServerTLSSettings `protobuf:"bytes,5,opt,name=localhost_server_tls,json=localhostServerTls,proto3" json:"localhost_server_tls,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *IstioEgressListener) Reset() { *m = IstioEgressListener{} } +func (m *IstioEgressListener) String() string { return proto.CompactTextString(m) } +func (*IstioEgressListener) ProtoMessage() {} +func (*IstioEgressListener) Descriptor() ([]byte, []int) { + return fileDescriptor_b5c11342f04ad3d1, []int{2} +} +func (m *IstioEgressListener) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *IstioEgressListener) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_IstioEgressListener.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *IstioEgressListener) XXX_Merge(src proto.Message) { + xxx_messageInfo_IstioEgressListener.Merge(m, src) +} +func (m *IstioEgressListener) XXX_Size() int { + return m.Size() +} +func (m *IstioEgressListener) XXX_DiscardUnknown() { + xxx_messageInfo_IstioEgressListener.DiscardUnknown(m) +} + +var xxx_messageInfo_IstioEgressListener proto.InternalMessageInfo + +func (m *IstioEgressListener) GetPort() *Port { + if m != nil { + return m.Port + } + return nil +} + +func (m *IstioEgressListener) GetBind() string { + if m != nil { + return m.Bind + } + return "" +} + +func (m *IstioEgressListener) GetCaptureMode() CaptureMode { + if m != nil { + return m.CaptureMode + } + return CaptureMode_DEFAULT +} + +func (m *IstioEgressListener) GetHosts() []string { + if m != nil { + return m.Hosts + } + return nil +} + +func (m *IstioEgressListener) GetLocalhostServerTls() *ServerTLSSettings { + if m != nil { + return m.LocalhostServerTls + } + return nil +} + +// `WorkloadSelector` specifies the criteria used to determine if the +// `Gateway`, `Sidecar`, or `EnvoyFilter` or `ServiceEntry` +// configuration can be applied to a proxy. The matching criteria +// includes the metadata associated with a proxy, workload instance +// info such as labels attached to the pod/VM, or any other info that +// the proxy provides to Istio during the initial handshake. If +// multiple conditions are specified, all conditions need to match in +// order for the workload instance to be selected. Currently, only +// label based selection mechanism is supported. +type WorkloadSelector struct { + // One or more labels that indicate a specific set of pods/VMs + // on which the configuration should be applied. The scope of + // label search is restricted to the configuration namespace in which the + // the resource is present. + Labels map[string]string `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WorkloadSelector) Reset() { *m = WorkloadSelector{} } +func (m *WorkloadSelector) String() string { return proto.CompactTextString(m) } +func (*WorkloadSelector) ProtoMessage() {} +func (*WorkloadSelector) Descriptor() ([]byte, []int) { + return fileDescriptor_b5c11342f04ad3d1, []int{3} +} +func (m *WorkloadSelector) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WorkloadSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WorkloadSelector.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WorkloadSelector) XXX_Merge(src proto.Message) { + xxx_messageInfo_WorkloadSelector.Merge(m, src) +} +func (m *WorkloadSelector) XXX_Size() int { + return m.Size() +} +func (m *WorkloadSelector) XXX_DiscardUnknown() { + xxx_messageInfo_WorkloadSelector.DiscardUnknown(m) +} + +var xxx_messageInfo_WorkloadSelector proto.InternalMessageInfo + +func (m *WorkloadSelector) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +// `OutboundTrafficPolicy` sets the default behavior of the sidecar for +// handling outbound traffic from the application. +// If your application uses one or more external +// services that are not known apriori, setting the policy to `ALLOW_ANY` +// will cause the sidecars to route any unknown traffic originating from +// the application to its requested destination. Users are strongly +// encouraged to use `ServiceEntry` configurations to explicitly declare any external +// dependencies, instead of using `ALLOW_ANY`, so that traffic to these +// services can be monitored. +type OutboundTrafficPolicy struct { + Mode OutboundTrafficPolicy_Mode `protobuf:"varint,1,opt,name=mode,proto3,enum=istio.networking.v1alpha3.OutboundTrafficPolicy_Mode" json:"mode,omitempty"` + // Specifies the details of the egress proxy to which unknown + // traffic should be forwarded to from the sidecar. Valid only if + // the mode is set to ALLOW_ANY. If not specified when the mode is + // ALLOW_ANY, the sidecar will send the unknown traffic directly to + // the IP requested by the application. + // + // ** NOTE 1**: The specified egress host must be imported in the + // egress section for the traffic forwarding to work. + // + // ** NOTE 2**: An Envoy based egress gateway is unlikely to be able + // to handle plain text TCP connections forwarded from the sidecar. + // Envoy's dynamic forward proxy can handle only HTTP and TLS + // connections. + // $hide_from_docs + EgressProxy *Destination `protobuf:"bytes,2,opt,name=egress_proxy,json=egressProxy,proto3" json:"egress_proxy,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *OutboundTrafficPolicy) Reset() { *m = OutboundTrafficPolicy{} } +func (m *OutboundTrafficPolicy) String() string { return proto.CompactTextString(m) } +func (*OutboundTrafficPolicy) ProtoMessage() {} +func (*OutboundTrafficPolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_b5c11342f04ad3d1, []int{4} +} +func (m *OutboundTrafficPolicy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OutboundTrafficPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_OutboundTrafficPolicy.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *OutboundTrafficPolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_OutboundTrafficPolicy.Merge(m, src) +} +func (m *OutboundTrafficPolicy) XXX_Size() int { + return m.Size() +} +func (m *OutboundTrafficPolicy) XXX_DiscardUnknown() { + xxx_messageInfo_OutboundTrafficPolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_OutboundTrafficPolicy proto.InternalMessageInfo + +func (m *OutboundTrafficPolicy) GetMode() OutboundTrafficPolicy_Mode { + if m != nil { + return m.Mode + } + return OutboundTrafficPolicy_REGISTRY_ONLY +} + +func (m *OutboundTrafficPolicy) GetEgressProxy() *Destination { + if m != nil { + return m.EgressProxy + } + return nil +} + +// $hide_from_docs +// `Localhost` describes the sidecar settings related to the +// communication between the sidecar and the workload it is attached +// to in a Kubernetes Pod or a VM. These settings apply by default to all +// ingress and egress listeners in a sidecar unless overridden. +// +// The following example configures the sidecars on pods of the +// reviews service to use TLS for traffic to/from the sidecar to the +// workload in the same pod, assuming the appropriate +// certificates are mounted in the sidecar. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: reviews-localhost-tls +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: reviews +// localhost: +// clientTls: +// mode: SIMPLE +// caCertificates: /etc/legacy/ca.pem +// serverTls: +// mode: SIMPLE +// serverCertificate: /etc/legacy/server.pem +// privateKey: /etc/legacy/private.pem +// egress: +// - hosts: +// - "./" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: reviews-localhost-tls +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: reviews +// localhost: +// clientTls: +// mode: SIMPLE +// caCertificates: /etc/legacy/ca.pem +// serverTls: +// mode: SIMPLE +// serverCertificate: /etc/legacy/server.pem +// privateKey: /etc/legacy/private.pem +// egress: +// - hosts: +// - "./" +// ``` +// {{}} +// {{}} +// +type Localhost struct { + // TLS settings to be used by the sidecar (client) when forwarding + // traffic from the sidecar to the workload it is attached to + // (server) on the localhost. + // + // **NOTE**: DISABLE, SIMPLE and MUTUAL are the only valid TLS modes. + ClientTls *ClientTLSSettings `protobuf:"bytes,1,opt,name=client_tls,json=clientTls,proto3" json:"client_tls,omitempty"` + // TLS settings to be used by the sidecar (server) when receiving + // traffic from the workload (client) on the localhost. + // + // **NOTE**: SIMPLE and MUTUAL are the only valid TLS + // modes. `httpsRedirect` and `credentialName` (for fetching + // certificates from Kubernetes secrets) are not valid. All + // certificates must be mounted as files inside the sidecar + // container. + ServerTls *ServerTLSSettings `protobuf:"bytes,2,opt,name=server_tls,json=serverTls,proto3" json:"server_tls,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Localhost) Reset() { *m = Localhost{} } +func (m *Localhost) String() string { return proto.CompactTextString(m) } +func (*Localhost) ProtoMessage() {} +func (*Localhost) Descriptor() ([]byte, []int) { + return fileDescriptor_b5c11342f04ad3d1, []int{5} +} +func (m *Localhost) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Localhost) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Localhost.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Localhost) XXX_Merge(src proto.Message) { + xxx_messageInfo_Localhost.Merge(m, src) +} +func (m *Localhost) XXX_Size() int { + return m.Size() +} +func (m *Localhost) XXX_DiscardUnknown() { + xxx_messageInfo_Localhost.DiscardUnknown(m) +} + +var xxx_messageInfo_Localhost proto.InternalMessageInfo + +func (m *Localhost) GetClientTls() *ClientTLSSettings { + if m != nil { + return m.ClientTls + } + return nil +} + +func (m *Localhost) GetServerTls() *ServerTLSSettings { + if m != nil { + return m.ServerTls + } + return nil +} + +func init() { + proto.RegisterEnum("istio.networking.v1alpha3.CaptureMode", CaptureMode_name, CaptureMode_value) + proto.RegisterEnum("istio.networking.v1alpha3.OutboundTrafficPolicy_Mode", OutboundTrafficPolicy_Mode_name, OutboundTrafficPolicy_Mode_value) + proto.RegisterType((*Sidecar)(nil), "istio.networking.v1alpha3.Sidecar") + proto.RegisterType((*IstioIngressListener)(nil), "istio.networking.v1alpha3.IstioIngressListener") + proto.RegisterType((*IstioEgressListener)(nil), "istio.networking.v1alpha3.IstioEgressListener") + proto.RegisterType((*WorkloadSelector)(nil), "istio.networking.v1alpha3.WorkloadSelector") + proto.RegisterMapType((map[string]string)(nil), "istio.networking.v1alpha3.WorkloadSelector.LabelsEntry") + proto.RegisterType((*OutboundTrafficPolicy)(nil), "istio.networking.v1alpha3.OutboundTrafficPolicy") + proto.RegisterType((*Localhost)(nil), "istio.networking.v1alpha3.Localhost") +} + +func init() { proto.RegisterFile("networking/v1alpha3/sidecar.proto", fileDescriptor_b5c11342f04ad3d1) } + +var fileDescriptor_b5c11342f04ad3d1 = []byte{ + // 766 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x41, 0x8f, 0xdb, 0x44, + 0x14, 0xee, 0x38, 0xd9, 0xdd, 0xfa, 0xb9, 0x05, 0x77, 0xd8, 0x0a, 0x77, 0x0f, 0xdb, 0x10, 0x21, + 0x14, 0x0a, 0x72, 0x60, 0x57, 0x88, 0xc2, 0x2d, 0x4b, 0x53, 0x14, 0x61, 0x76, 0x57, 0x4e, 0x50, + 0x59, 0x0e, 0x58, 0x13, 0x7b, 0x92, 0x8c, 0x3a, 0x78, 0xac, 0x99, 0x49, 0x96, 0xfc, 0x1e, 0xca, + 0xef, 0xe0, 0xca, 0x91, 0x1b, 0xd7, 0x6a, 0x7f, 0x09, 0xf2, 0x78, 0xb2, 0x49, 0x2b, 0x93, 0x6a, + 0x7b, 0xe8, 0xcd, 0x33, 0xef, 0xfb, 0x3e, 0xcf, 0xfb, 0xde, 0x7b, 0x33, 0xf0, 0x51, 0x4e, 0xf5, + 0xa5, 0x90, 0xcf, 0x59, 0x3e, 0xed, 0x2e, 0xbe, 0x24, 0xbc, 0x98, 0x91, 0xe3, 0xae, 0x62, 0x19, + 0x4d, 0x89, 0x0c, 0x0b, 0x29, 0xb4, 0xc0, 0x0f, 0x98, 0xd2, 0x4c, 0x84, 0x6b, 0x60, 0xb8, 0x02, + 0x1e, 0x3c, 0x9c, 0x0a, 0x31, 0xe5, 0xb4, 0x4b, 0x0a, 0xd6, 0x9d, 0x30, 0xca, 0xb3, 0x64, 0x4c, + 0x67, 0x64, 0xc1, 0x84, 0xe5, 0x1e, 0xd4, 0xca, 0x4f, 0x89, 0xa6, 0x97, 0x64, 0x69, 0x21, 0x9f, + 0xd6, 0x41, 0x16, 0x4c, 0xea, 0x39, 0xe1, 0x89, 0xa2, 0x72, 0xc1, 0x52, 0x6a, 0xa1, 0x8f, 0xea, + 0xa0, 0x19, 0x55, 0x9a, 0xe5, 0x44, 0x33, 0x91, 0x27, 0x72, 0xce, 0x2d, 0xb6, 0xfd, 0xa2, 0x01, + 0x7b, 0xc3, 0x2a, 0x0f, 0xfc, 0x33, 0xdc, 0x2b, 0x69, 0x5c, 0x90, 0x2c, 0x51, 0x94, 0xd3, 0x54, + 0x0b, 0x19, 0xa0, 0x16, 0xea, 0x78, 0x47, 0x9f, 0x85, 0xff, 0x9b, 0x5d, 0xf8, 0xcc, 0x72, 0x86, + 0x96, 0x12, 0xfb, 0x97, 0xaf, 0xed, 0xe0, 0x01, 0xec, 0xb1, 0x7c, 0x2a, 0xa9, 0x52, 0x81, 0xd3, + 0x6a, 0x74, 0xbc, 0xa3, 0xee, 0x16, 0xbd, 0x41, 0x19, 0x19, 0x54, 0xf0, 0x88, 0x29, 0x4d, 0x73, + 0x2a, 0xe3, 0x15, 0x1f, 0x3f, 0x85, 0x5d, 0x5a, 0x29, 0x35, 0x8c, 0x52, 0xf8, 0x26, 0xa5, 0xfe, + 0xab, 0x42, 0x96, 0x8d, 0x67, 0xf0, 0xa1, 0x98, 0xeb, 0xb1, 0x98, 0xe7, 0x59, 0xa2, 0x25, 0x99, + 0x4c, 0x58, 0x9a, 0x14, 0x82, 0xb3, 0x74, 0x19, 0x34, 0x4d, 0xca, 0x5f, 0x6c, 0x11, 0x3e, 0xb3, + 0xcc, 0x51, 0x45, 0x3c, 0x37, 0xbc, 0xf8, 0xbe, 0xa8, 0xdb, 0xc6, 0x27, 0xe0, 0x72, 0x91, 0x12, + 0x3e, 0x13, 0x4a, 0x07, 0xbb, 0x46, 0xfb, 0xe3, 0x2d, 0xda, 0xd1, 0x0a, 0x1b, 0xaf, 0x69, 0xed, + 0xbf, 0x1c, 0xd8, 0xaf, 0xf3, 0x05, 0x3f, 0x86, 0x66, 0x21, 0xa4, 0xb6, 0x65, 0x7a, 0xb8, 0x45, + 0xf7, 0x5c, 0x48, 0x7d, 0xd2, 0x78, 0xd9, 0x73, 0x62, 0xc3, 0xc0, 0x18, 0x9a, 0x63, 0x96, 0x67, + 0x81, 0xd3, 0x42, 0x1d, 0x37, 0x36, 0xdf, 0x78, 0x00, 0x77, 0x52, 0x52, 0xe8, 0xb9, 0xa4, 0xc9, + 0x6f, 0x22, 0xa3, 0x41, 0xa3, 0x85, 0x3a, 0xef, 0x1d, 0x7d, 0xb2, 0x45, 0xf5, 0xbb, 0x0a, 0xfe, + 0xa3, 0xc8, 0x68, 0xec, 0xa5, 0xeb, 0x05, 0x0e, 0xc1, 0xcf, 0xe8, 0x84, 0xcc, 0xb9, 0x4e, 0x68, + 0x9e, 0x15, 0x82, 0xe5, 0xda, 0x18, 0xeb, 0x56, 0x67, 0x78, 0xdf, 0x06, 0xfb, 0x36, 0x86, 0x7f, + 0x85, 0xfd, 0xeb, 0x74, 0x93, 0x94, 0x33, 0x9a, 0xeb, 0x44, 0x73, 0x65, 0x0d, 0xfb, 0x7c, 0xdb, + 0x11, 0x0c, 0x78, 0x14, 0x0d, 0x87, 0x54, 0x6b, 0x96, 0x4f, 0x55, 0x8c, 0xaf, 0x95, 0x6c, 0x8c, + 0xab, 0xf6, 0x0b, 0x07, 0x3e, 0xa8, 0xe9, 0x07, 0x7c, 0x7c, 0x23, 0x03, 0xdf, 0x8d, 0x77, 0x0f, + 0x60, 0xa7, 0x3c, 0xbc, 0x0a, 0x9a, 0xad, 0xc6, 0xca, 0xb0, 0x6a, 0xe7, 0x55, 0x9b, 0xca, 0xb1, + 0xa7, 0xd2, 0xd8, 0xb4, 0xf3, 0x46, 0x9b, 0x86, 0x06, 0x5c, 0x6f, 0x93, 0x8d, 0x71, 0xd5, 0xfe, + 0x03, 0x81, 0xff, 0xfa, 0x40, 0xe3, 0x11, 0xec, 0x72, 0x32, 0xa6, 0x5c, 0x05, 0xc8, 0xcc, 0xdc, + 0xd7, 0x37, 0xb8, 0x0d, 0xc2, 0xc8, 0x30, 0xfb, 0xb9, 0x96, 0xcb, 0x2a, 0x13, 0xab, 0x75, 0xf0, + 0x0d, 0x78, 0x1b, 0x31, 0xec, 0x43, 0xe3, 0x39, 0x5d, 0x9a, 0x3a, 0xb8, 0x71, 0xf9, 0x89, 0xf7, + 0x61, 0x67, 0x41, 0xf8, 0x9c, 0x5a, 0x9b, 0xab, 0xc5, 0xb7, 0xce, 0x63, 0xd4, 0xfe, 0x17, 0xc1, + 0xfd, 0xda, 0x19, 0xc4, 0x03, 0x68, 0x1a, 0xf7, 0x91, 0x71, 0xff, 0xab, 0x9b, 0xce, 0x70, 0x68, + 0x8a, 0x61, 0x24, 0xca, 0x82, 0x56, 0x77, 0x45, 0x52, 0x48, 0xf1, 0xfb, 0xd2, 0x9c, 0xc2, 0xdb, + 0x5a, 0xd0, 0x27, 0xeb, 0x3b, 0x36, 0xf6, 0x2a, 0xee, 0x79, 0x49, 0x6d, 0x77, 0xa0, 0x69, 0x0a, + 0x7b, 0x0f, 0xee, 0xc6, 0xfd, 0xef, 0x07, 0xc3, 0x51, 0x7c, 0x91, 0x9c, 0x9d, 0x46, 0x17, 0xfe, + 0x2d, 0x7c, 0x17, 0xdc, 0x5e, 0x14, 0x9d, 0x3d, 0x4b, 0x7a, 0xa7, 0x17, 0x3e, 0x6a, 0xff, 0x89, + 0xc0, 0xbd, 0xbe, 0x01, 0xf0, 0x0f, 0x00, 0x1b, 0xa3, 0x80, 0xde, 0x62, 0x14, 0xdc, 0x74, 0x35, + 0x01, 0xa5, 0xd8, 0x46, 0xc3, 0x38, 0x6f, 0xd1, 0x30, 0xae, 0x5a, 0xf5, 0xc9, 0xa3, 0x23, 0xf0, + 0x36, 0xda, 0x17, 0x7b, 0xb0, 0xf7, 0xa4, 0xff, 0xb4, 0xf7, 0x53, 0x34, 0xf2, 0x6f, 0xe1, 0x3b, + 0x70, 0x7b, 0x70, 0x3e, 0xea, 0x9d, 0x44, 0xfd, 0xa1, 0x8f, 0xf0, 0x6d, 0x68, 0x9e, 0x9e, 0x9d, + 0xf6, 0x7d, 0xe7, 0x24, 0xfc, 0xfb, 0xea, 0x10, 0xfd, 0x73, 0x75, 0x88, 0x5e, 0x5e, 0x1d, 0xa2, + 0x5f, 0x5a, 0xd5, 0x9f, 0x99, 0x30, 0xcf, 0x62, 0xcd, 0x93, 0x35, 0xde, 0x35, 0x4f, 0xd4, 0xf1, + 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x14, 0xd9, 0x1b, 0x47, 0x7d, 0x07, 0x00, 0x00, +} + +func (m *Sidecar) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Sidecar) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Sidecar) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Localhost != nil { + { + size, err := m.Localhost.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSidecar(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.OutboundTrafficPolicy != nil { + { + size, err := m.OutboundTrafficPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSidecar(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.Egress) > 0 { + for iNdEx := len(m.Egress) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Egress[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSidecar(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Ingress) > 0 { + for iNdEx := len(m.Ingress) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ingress[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSidecar(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.WorkloadSelector != nil { + { + size, err := m.WorkloadSelector.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSidecar(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *IstioIngressListener) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IstioIngressListener) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IstioIngressListener) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.LocalhostClientTls != nil { + { + size, err := m.LocalhostClientTls.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSidecar(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.DefaultEndpoint) > 0 { + i -= len(m.DefaultEndpoint) + copy(dAtA[i:], m.DefaultEndpoint) + i = encodeVarintSidecar(dAtA, i, uint64(len(m.DefaultEndpoint))) + i-- + dAtA[i] = 0x22 + } + if m.CaptureMode != 0 { + i = encodeVarintSidecar(dAtA, i, uint64(m.CaptureMode)) + i-- + dAtA[i] = 0x18 + } + if len(m.Bind) > 0 { + i -= len(m.Bind) + copy(dAtA[i:], m.Bind) + i = encodeVarintSidecar(dAtA, i, uint64(len(m.Bind))) + i-- + dAtA[i] = 0x12 + } + if m.Port != nil { + { + size, err := m.Port.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSidecar(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *IstioEgressListener) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *IstioEgressListener) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IstioEgressListener) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.LocalhostServerTls != nil { + { + size, err := m.LocalhostServerTls.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSidecar(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.Hosts) > 0 { + for iNdEx := len(m.Hosts) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Hosts[iNdEx]) + copy(dAtA[i:], m.Hosts[iNdEx]) + i = encodeVarintSidecar(dAtA, i, uint64(len(m.Hosts[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if m.CaptureMode != 0 { + i = encodeVarintSidecar(dAtA, i, uint64(m.CaptureMode)) + i-- + dAtA[i] = 0x18 + } + if len(m.Bind) > 0 { + i -= len(m.Bind) + copy(dAtA[i:], m.Bind) + i = encodeVarintSidecar(dAtA, i, uint64(len(m.Bind))) + i-- + dAtA[i] = 0x12 + } + if m.Port != nil { + { + size, err := m.Port.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSidecar(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *WorkloadSelector) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadSelector) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Labels) > 0 { + for k := range m.Labels { + v := m.Labels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintSidecar(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintSidecar(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintSidecar(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *OutboundTrafficPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OutboundTrafficPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OutboundTrafficPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.EgressProxy != nil { + { + size, err := m.EgressProxy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSidecar(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Mode != 0 { + i = encodeVarintSidecar(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Localhost) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Localhost) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Localhost) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.ServerTls != nil { + { + size, err := m.ServerTls.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSidecar(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.ClientTls != nil { + { + size, err := m.ClientTls.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSidecar(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintSidecar(dAtA []byte, offset int, v uint64) int { + offset -= sovSidecar(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Sidecar) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.WorkloadSelector != nil { + l = m.WorkloadSelector.Size() + n += 1 + l + sovSidecar(uint64(l)) + } + if len(m.Ingress) > 0 { + for _, e := range m.Ingress { + l = e.Size() + n += 1 + l + sovSidecar(uint64(l)) + } + } + if len(m.Egress) > 0 { + for _, e := range m.Egress { + l = e.Size() + n += 1 + l + sovSidecar(uint64(l)) + } + } + if m.OutboundTrafficPolicy != nil { + l = m.OutboundTrafficPolicy.Size() + n += 1 + l + sovSidecar(uint64(l)) + } + if m.Localhost != nil { + l = m.Localhost.Size() + n += 1 + l + sovSidecar(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *IstioIngressListener) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Port != nil { + l = m.Port.Size() + n += 1 + l + sovSidecar(uint64(l)) + } + l = len(m.Bind) + if l > 0 { + n += 1 + l + sovSidecar(uint64(l)) + } + if m.CaptureMode != 0 { + n += 1 + sovSidecar(uint64(m.CaptureMode)) + } + l = len(m.DefaultEndpoint) + if l > 0 { + n += 1 + l + sovSidecar(uint64(l)) + } + if m.LocalhostClientTls != nil { + l = m.LocalhostClientTls.Size() + n += 1 + l + sovSidecar(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *IstioEgressListener) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Port != nil { + l = m.Port.Size() + n += 1 + l + sovSidecar(uint64(l)) + } + l = len(m.Bind) + if l > 0 { + n += 1 + l + sovSidecar(uint64(l)) + } + if m.CaptureMode != 0 { + n += 1 + sovSidecar(uint64(m.CaptureMode)) + } + if len(m.Hosts) > 0 { + for _, s := range m.Hosts { + l = len(s) + n += 1 + l + sovSidecar(uint64(l)) + } + } + if m.LocalhostServerTls != nil { + l = m.LocalhostServerTls.Size() + n += 1 + l + sovSidecar(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *WorkloadSelector) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Labels) > 0 { + for k, v := range m.Labels { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovSidecar(uint64(len(k))) + 1 + len(v) + sovSidecar(uint64(len(v))) + n += mapEntrySize + 1 + sovSidecar(uint64(mapEntrySize)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *OutboundTrafficPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Mode != 0 { + n += 1 + sovSidecar(uint64(m.Mode)) + } + if m.EgressProxy != nil { + l = m.EgressProxy.Size() + n += 1 + l + sovSidecar(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Localhost) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ClientTls != nil { + l = m.ClientTls.Size() + n += 1 + l + sovSidecar(uint64(l)) + } + if m.ServerTls != nil { + l = m.ServerTls.Size() + n += 1 + l + sovSidecar(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovSidecar(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozSidecar(x uint64) (n int) { + return sovSidecar(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Sidecar) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Sidecar: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Sidecar: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WorkloadSelector", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSidecar + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSidecar + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.WorkloadSelector == nil { + m.WorkloadSelector = &WorkloadSelector{} + } + if err := m.WorkloadSelector.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ingress", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSidecar + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSidecar + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ingress = append(m.Ingress, &IstioIngressListener{}) + if err := m.Ingress[len(m.Ingress)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Egress", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSidecar + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSidecar + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Egress = append(m.Egress, &IstioEgressListener{}) + if err := m.Egress[len(m.Egress)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OutboundTrafficPolicy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSidecar + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSidecar + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.OutboundTrafficPolicy == nil { + m.OutboundTrafficPolicy = &OutboundTrafficPolicy{} + } + if err := m.OutboundTrafficPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Localhost", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSidecar + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSidecar + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Localhost == nil { + m.Localhost = &Localhost{} + } + if err := m.Localhost.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSidecar(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthSidecar + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthSidecar + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IstioIngressListener) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IstioIngressListener: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IstioIngressListener: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSidecar + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSidecar + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Port == nil { + m.Port = &Port{} + } + if err := m.Port.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSidecar + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSidecar + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CaptureMode", wireType) + } + m.CaptureMode = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CaptureMode |= CaptureMode(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DefaultEndpoint", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSidecar + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSidecar + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DefaultEndpoint = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LocalhostClientTls", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSidecar + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSidecar + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LocalhostClientTls == nil { + m.LocalhostClientTls = &ClientTLSSettings{} + } + if err := m.LocalhostClientTls.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSidecar(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthSidecar + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthSidecar + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *IstioEgressListener) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: IstioEgressListener: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: IstioEgressListener: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSidecar + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSidecar + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Port == nil { + m.Port = &Port{} + } + if err := m.Port.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSidecar + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSidecar + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CaptureMode", wireType) + } + m.CaptureMode = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CaptureMode |= CaptureMode(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hosts", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSidecar + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSidecar + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hosts = append(m.Hosts, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LocalhostServerTls", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSidecar + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSidecar + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LocalhostServerTls == nil { + m.LocalhostServerTls = &ServerTLSSettings{} + } + if err := m.LocalhostServerTls.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSidecar(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthSidecar + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthSidecar + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *WorkloadSelector) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadSelector: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadSelector: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSidecar + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSidecar + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Labels == nil { + m.Labels = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthSidecar + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthSidecar + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthSidecar + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthSidecar + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipSidecar(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthSidecar + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Labels[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSidecar(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthSidecar + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthSidecar + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OutboundTrafficPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OutboundTrafficPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OutboundTrafficPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Mode", wireType) + } + m.Mode = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Mode |= OutboundTrafficPolicy_Mode(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EgressProxy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSidecar + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSidecar + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.EgressProxy == nil { + m.EgressProxy = &Destination{} + } + if err := m.EgressProxy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSidecar(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthSidecar + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthSidecar + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Localhost) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Localhost: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Localhost: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientTls", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSidecar + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSidecar + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClientTls == nil { + m.ClientTls = &ClientTLSSettings{} + } + if err := m.ClientTls.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServerTls", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSidecar + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSidecar + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSidecar + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ServerTls == nil { + m.ServerTls = &ServerTLSSettings{} + } + if err := m.ServerTls.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSidecar(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthSidecar + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthSidecar + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipSidecar(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSidecar + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSidecar + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSidecar + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthSidecar + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthSidecar + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSidecar + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipSidecar(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthSidecar + } + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthSidecar = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSidecar = fmt.Errorf("proto: integer overflow") +) diff --git a/vendor/istio.io/api/networking/v1alpha3/sidecar.pb.html b/vendor/istio.io/api/networking/v1alpha3/sidecar.pb.html new file mode 100644 index 0000000000..e0f79a92a1 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/sidecar.pb.html @@ -0,0 +1,806 @@ +--- +title: Sidecar +description: Configuration affecting network reachability of a sidecar. +location: https://istio.io/docs/reference/config/networking/sidecar.html +layout: protoc-gen-docs +generator: protoc-gen-docs +schema: istio.networking.v1alpha3.Sidecar +aliases: [/docs/reference/config/networking/v1alpha3/sidecar] +number_of_entries: 7 +--- +

Sidecar describes the configuration of the sidecar proxy that mediates +inbound and outbound communication to the workload instance it is attached to. By +default, Istio will program all sidecar proxies in the mesh with the +necessary configuration required to reach every workload instance in the mesh, as +well as accept traffic on all the ports associated with the +workload. The Sidecar configuration provides a way to fine tune the set of +ports, protocols that the proxy will accept when forwarding traffic to +and from the workload. In addition, it is possible to restrict the set +of services that the proxy can reach when forwarding outbound traffic +from workload instances.

+ +

Services and configuration in a mesh are organized into one or more +namespaces (e.g., a Kubernetes namespace or a CF org/space). A Sidecar +configuration in a namespace will apply to one or more workload instances in the same +namespace, selected using the workloadSelector field. In the absence of a +workloadSelector, it will apply to all workload instances in the same +namespace. When determining the Sidecar configuration to be applied to a +workload instance, preference will be given to the resource with a +workloadSelector that selects this workload instance, over a Sidecar configuration +without any workloadSelector.

+ +

NOTE 1: Each namespace can have only one Sidecar +configuration without any workloadSelector that specifies the +default for all pods in that namespace. It is recommended to use +the name default for the namespace-wide sidecar. The behavior of +the system is undefined if more than one selector-less Sidecar +configurations exist in a given namespace. The behavior of the +system is undefined if two or more Sidecar configurations with a +workloadSelector select the same workload instance.

+ +

NOTE 2: A Sidecar configuration in the MeshConfig +root namespace +will be applied by default to all namespaces without a Sidecar +configuration. This global default Sidecar configuration should not have +any workloadSelector.

+ +

The example below declares a global default Sidecar configuration +in the root namespace called istio-config, that configures +sidecars in all namespaces to allow egress traffic only to other +workloads in the same namespace as well as to services in the +istio-system namespace.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: Sidecar
+metadata:
+  name: default
+  namespace: istio-config
+spec:
+  egress:
+  - hosts:
+    - "./*"
+    - "istio-system/*"
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: Sidecar
+metadata:
+  name: default
+  namespace: istio-config
+spec:
+  egress:
+  - hosts:
+    - "./*"
+    - "istio-system/*"
+
+ +

{{}} +{{}}

+ +

The example below declares a Sidecar configuration in the +prod-us1 namespace that overrides the global default defined +above, and configures the sidecars in the namespace to allow egress +traffic to public services in the prod-us1, prod-apis, and the +istio-system namespaces.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: Sidecar
+metadata:
+  name: default
+  namespace: prod-us1
+spec:
+  egress:
+  - hosts:
+    - "prod-us1/*"
+    - "prod-apis/*"
+    - "istio-system/*"
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: Sidecar
+metadata:
+  name: default
+  namespace: prod-us1
+spec:
+  egress:
+  - hosts:
+    - "prod-us1/*"
+    - "prod-apis/*"
+    - "istio-system/*"
+
+ +

{{}} +{{}}

+ +

The following example declares a Sidecar configuration in the +prod-us1 namespace for all pods with labels app: ratings +belonging to the ratings.prod-us1 service. The workload accepts +inbound HTTP traffic on port 9080. The traffic is then forwarded to +the attached workload instance listening on a Unix domain +socket. In the egress direction, in addition to the istio-system +namespace, the sidecar proxies only HTTP traffic bound for port +9080 for services in the prod-us1 namespace.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: Sidecar
+metadata:
+  name: ratings
+  namespace: prod-us1
+spec:
+  workloadSelector:
+    labels:
+      app: ratings
+  ingress:
+  - port:
+      number: 9080
+      protocol: HTTP
+      name: somename
+    defaultEndpoint: unix:///var/run/someuds.sock
+  egress:
+  - port:
+      number: 9080
+      protocol: HTTP
+      name: egresshttp
+    hosts:
+    - "prod-us1/*"
+  - hosts:
+    - "istio-system/*"
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: Sidecar
+metadata:
+  name: ratings
+  namespace: prod-us1
+spec:
+  workloadSelector:
+    labels:
+      app: ratings
+  ingress:
+  - port:
+      number: 9080
+      protocol: HTTP
+      name: somename
+    defaultEndpoint: unix:///var/run/someuds.sock
+  egress:
+  - port:
+      number: 9080
+      protocol: HTTP
+      name: egresshttp
+    hosts:
+    - "prod-us1/*"
+  - hosts:
+    - "istio-system/*"
+
+ +

{{}} +{{}}

+ +

If the workload is deployed without IPTables-based traffic capture, +the Sidecar configuration is the only way to configure the ports +on the proxy attached to the workload instance. The following +example declares a Sidecar configuration in the prod-us1 +namespace for all pods with labels app: productpage belonging to +the productpage.prod-us1 service. Assuming that these pods are +deployed without IPtable rules (i.e. the istio-init container) +and the proxy metadata ISTIO_META_INTERCEPTION_MODE is set to +NONE, the specification, below, allows such pods to receive HTTP +traffic on port 9080 (wrapped inside Istio mutual TLS) and forward +it to the application listening on 127.0.0.1:8080. It also allows +the application to communicate with a backing MySQL database on +127.0.0.1:3306, that then gets proxied to the externally hosted +MySQL service at mysql.foo.com:3306.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: Sidecar
+metadata:
+  name: no-ip-tables
+  namespace: prod-us1
+spec:
+  workloadSelector:
+    labels:
+      app: productpage
+  ingress:
+  - port:
+      number: 9080 # binds to proxy_instance_ip:9080 (0.0.0.0:9080, if no unicast IP is available for the instance)
+      protocol: HTTP
+      name: somename
+    defaultEndpoint: 127.0.0.1:8080
+    captureMode: NONE # not needed if metadata is set for entire proxy
+  egress:
+  - port:
+      number: 3306
+      protocol: MYSQL
+      name: egressmysql
+    captureMode: NONE # not needed if metadata is set for entire proxy
+    bind: 127.0.0.1
+    hosts:
+    - "*/mysql.foo.com"
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: Sidecar
+metadata:
+  name: no-ip-tables
+  namespace: prod-us1
+spec:
+  workloadSelector:
+    labels:
+      app: productpage
+  ingress:
+  - port:
+      number: 9080 # binds to proxy_instance_ip:9080 (0.0.0.0:9080, if no unicast IP is available for the instance)
+      protocol: HTTP
+      name: somename
+    defaultEndpoint: 127.0.0.1:8080
+    captureMode: NONE # not needed if metadata is set for entire proxy
+  egress:
+  - port:
+      number: 3306
+      protocol: MYSQL
+      name: egressmysql
+    captureMode: NONE # not needed if metadata is set for entire proxy
+    bind: 127.0.0.1
+    hosts:
+    - "*/mysql.foo.com"
+
+ +

{{}} +{{}}

+ +

And the associated service entry for routing to mysql.foo.com:3306

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: ServiceEntry
+metadata:
+  name: external-svc-mysql
+  namespace: ns1
+spec:
+  hosts:
+  - mysql.foo.com
+  ports:
+  - number: 3306
+    name: mysql
+    protocol: MYSQL
+  location: MESH_EXTERNAL
+  resolution: DNS
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: ServiceEntry
+metadata:
+  name: external-svc-mysql
+  namespace: ns1
+spec:
+  hosts:
+  - mysql.foo.com
+  ports:
+  - number: 3306
+    name: mysql
+    protocol: MYSQL
+  location: MESH_EXTERNAL
+  resolution: DNS
+
+ +

{{}} +{{}}

+ +

It is also possible to mix and match traffic capture modes in a single +proxy. For example, consider a setup where internal services are on the +192.168.0.0/16 subnet. So, IP tables are setup on the VM to capture all +outbound traffic on 192.168.0.0/16 subnet. Assume that the VM has an +additional network interface on 172.16.0.0/16 subnet for inbound +traffic. The following Sidecar configuration allows the VM to expose a +listener on 172.16.1.32:80 (the VM’s IP) for traffic arriving from the +172.16.0.0/16 subnet.

+ +

NOTE: The ISTIO_META_INTERCEPTION_MODE metadata on the +proxy in the VM should contain REDIRECT or TPROXY as its value, +implying that IP tables based traffic capture is active.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: Sidecar
+metadata:
+  name: partial-ip-tables
+  namespace: prod-us1
+spec:
+  workloadSelector:
+    labels:
+      app: productpage
+  ingress:
+  - bind: 172.16.1.32
+    port:
+      number: 80 # binds to 172.16.1.32:80
+      protocol: HTTP
+      name: somename
+    defaultEndpoint: 127.0.0.1:8080
+    captureMode: NONE
+  egress:
+    # use the system detected defaults
+    # sets up configuration to handle outbound traffic to services
+    # in 192.168.0.0/16 subnet, based on information provided by the
+    # service registry
+  - captureMode: IPTABLES
+    hosts:
+    - "*/*"
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: Sidecar
+metadata:
+  name: partial-ip-tables
+  namespace: prod-us1
+spec:
+  workloadSelector:
+    labels:
+      app: productpage
+  ingress:
+  - bind: 172.16.1.32
+    port:
+      number: 80 # binds to 172.16.1.32:80
+      protocol: HTTP
+      name: somename
+    defaultEndpoint: 127.0.0.1:8080
+    captureMode: NONE
+  egress:
+    # use the system detected defaults
+    # sets up configuration to handle outbound traffic to services
+    # in 192.168.0.0/16 subnet, based on information provided by the
+    # service registry
+  - captureMode: IPTABLES
+    hosts:
+    - "*/*"
+
+ +

{{}} +{{}}

+ +

Sidecar

+
+

Sidecar describes the configuration of the sidecar proxy that mediates +inbound and outbound communication of the workload instance to which it is +attached.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
workloadSelectorWorkloadSelector +

Criteria used to select the specific set of pods/VMs on which this +Sidecar configuration should be applied. If omitted, the Sidecar +configuration will be applied to all workload instances in the same namespace.

+ +
+No +
ingressIstioIngressListener[] +

Ingress specifies the configuration of the sidecar for processing +inbound traffic to the attached workload instance. If omitted, Istio will +automatically configure the sidecar based on the information about the workload +obtained from the orchestration platform (e.g., exposed ports, services, +etc.). If specified, inbound ports are configured if and only if the +workload instance is associated with a service.

+ +
+No +
egressIstioEgressListener[] +

Egress specifies the configuration of the sidecar for processing +outbound traffic from the attached workload instance to other +services in the mesh. If not specified, inherits the system +detected defaults from the namespace-wide or the global default Sidecar.

+ +
+No +
outboundTrafficPolicyOutboundTrafficPolicy +

Configuration for the outbound traffic policy. If your +application uses one or more external services that are not known +apriori, setting the policy to ALLOW_ANY will cause the +sidecars to route any unknown traffic originating from the +application to its requested destination. If not specified, +inherits the system detected defaults from the namespace-wide or +the global default Sidecar.

+ +
+No +
+
+

IstioIngressListener

+
+

IstioIngressListener specifies the properties of an inbound +traffic listener on the sidecar proxy attached to a workload instance.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
portPort +

The port associated with the listener.

+ +
+Yes +
bindstring +

The IP to which the listener should be bound. Must be in the +format x.x.x.x. Unix domain socket addresses are not allowed in +the bind field for ingress listeners. If omitted, Istio will +automatically configure the defaults based on imported services +and the workload instances to which this configuration is applied +to.

+ +
+No +
captureModeCaptureMode +

The captureMode option dictates how traffic to the listener is +expected to be captured (or not).

+ +
+No +
defaultEndpointstring +

The loopback IP endpoint or Unix domain socket to which +traffic should be forwarded to. This configuration can be used to +redirect traffic arriving at the bind IP:Port on the sidecar to a localhost:port +or Unix domain socket where the application workload instance is listening for +connections. Format should be 127.0.0.1:PORT or unix:///path/to/socket

+ +
+Yes +
+
+

IstioEgressListener

+
+

IstioEgressListener specifies the properties of an outbound traffic +listener on the sidecar proxy attached to a workload instance.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
portPort +

The port associated with the listener. If using Unix domain socket, +use 0 as the port number, with a valid protocol. The port if +specified, will be used as the default destination port associated +with the imported hosts. If the port is omitted, Istio will infer the +listener ports based on the imported hosts. Note that when multiple +egress listeners are specified, where one or more listeners have +specific ports while others have no port, the hosts exposed on a +listener port will be based on the listener with the most specific +port.

+ +
+No +
bindstring +

The IP or the Unix domain socket to which the listener should be bound +to. Port MUST be specified if bind is not empty. Format: x.x.x.x or +unix:///path/to/uds or unix://@foobar (Linux abstract namespace). If +omitted, Istio will automatically configure the defaults based on imported +services, the workload instances to which this configuration is applied to and +the captureMode. If captureMode is NONE, bind will default to +127.0.0.1.

+ +
+No +
captureModeCaptureMode +

When the bind address is an IP, the captureMode option dictates +how traffic to the listener is expected to be captured (or not). +captureMode must be DEFAULT or NONE for Unix domain socket binds.

+ +
+No +
hostsstring[] +

One or more service hosts exposed by the listener +in namespace/dnsName format. Services in the specified namespace +matching dnsName will be exposed. +The corresponding service can be a service in the service registry +(e.g., a Kubernetes or cloud foundry service) or a service specified +using a ServiceEntry or VirtualService configuration. Any +associated DestinationRule in the same namespace will also be used.

+ +

The dnsName should be specified using FQDN format, optionally including +a wildcard character in the left-most component (e.g., prod/*.example.com). +Set the dnsName to * to select all services from the specified namespace +(e.g., prod/*).

+ +

The namespace can be set to *, ., or ~, representing any, the current, +or no namespace, respectively. For example, */foo.example.com selects the +service from any available namespace while ./foo.example.com only selects +the service from the namespace of the sidecar. If a host is set to */*, +Istio will configure the sidecar to be able to reach every service in the +mesh that is exported to the sidecar’s namespace. The value ~/* can be used +to completely trim the configuration for sidecars that simply receive traffic +and respond, but make no outbound connections of their own.

+ +

NOTE: Only services and configuration artifacts exported to the sidecar’s +namespace (e.g., exportTo value of *) can be referenced. +Private configurations (e.g., exportTo set to .) will +not be available. Refer to the exportTo setting in VirtualService, +DestinationRule, and ServiceEntry configurations for details.

+ +

WARNING: The list of egress hosts in a Sidecar must also include +the Mixer control plane services if they are enabled. Envoy will not +be able to reach them otherwise. For example, add host +istio-system/istio-telemetry.istio-system.svc.cluster.local if telemetry +is enabled, istio-system/istio-policy.istio-system.svc.cluster.local if +policy is enabled, or add istio-system/* to allow all services in the +istio-system namespace. This requirement is temporary and will be removed +in a future Istio release.

+ +
+Yes +
+
+

WorkloadSelector

+
+

WorkloadSelector specifies the criteria used to determine if the +Gateway, Sidecar, or EnvoyFilter or ServiceEntry +configuration can be applied to a proxy. The matching criteria +includes the metadata associated with a proxy, workload instance +info such as labels attached to the pod/VM, or any other info that +the proxy provides to Istio during the initial handshake. If +multiple conditions are specified, all conditions need to match in +order for the workload instance to be selected. Currently, only +label based selection mechanism is supported.

+ + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
labelsmap<string, string> +

One or more labels that indicate a specific set of pods/VMs +on which the configuration should be applied. The scope of +label search is restricted to the configuration namespace in which the +the resource is present.

+ +
+Yes +
+
+

OutboundTrafficPolicy

+
+

OutboundTrafficPolicy sets the default behavior of the sidecar for +handling outbound traffic from the application. +If your application uses one or more external +services that are not known apriori, setting the policy to ALLOW_ANY +will cause the sidecars to route any unknown traffic originating from +the application to its requested destination. Users are strongly +encouraged to use ServiceEntry configurations to explicitly declare any external +dependencies, instead of using ALLOW_ANY, so that traffic to these +services can be monitored.

+ + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
modeMode + +No +
+
+

OutboundTrafficPolicy.Mode

+
+ + + + + + + + + + + + + + + + + +
NameDescription
REGISTRY_ONLY +

Outbound traffic will be restricted to services defined in the +service registry as well as those defined through ServiceEntry configurations.

+ +
ALLOW_ANY +

Outbound traffic to unknown destinations will be allowed, in case +there are no services or ServiceEntry configurations for the destination port.

+ +
+
+

CaptureMode

+
+

CaptureMode describes how traffic to a listener is expected to be +captured. Applicable only when the listener is bound to an IP.

+ + + + + + + + + + + + + + + + + + + + + + +
NameDescription
DEFAULT +

The default capture mode defined by the environment.

+ +
IPTABLES +

Capture traffic using IPtables redirection.

+ +
NONE +

No traffic capture. When used in an egress listener, the application is +expected to explicitly communicate with the listener port or Unix +domain socket. When used in an ingress listener, care needs to be taken +to ensure that the listener port is not in use by other processes on +the host.

+ +
+
diff --git a/vendor/istio.io/api/networking/v1alpha3/sidecar.proto b/vendor/istio.io/api/networking/v1alpha3/sidecar.proto new file mode 100644 index 0000000000..9344a3ecb5 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/sidecar.proto @@ -0,0 +1,740 @@ +// Copyright 2018 Istio Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "google/api/field_behavior.proto"; +import "networking/v1alpha3/gateway.proto"; +import "networking/v1alpha3/virtual_service.proto"; +import "networking/v1alpha3/destination_rule.proto"; + +// $schema: istio.networking.v1alpha3.Sidecar +// $title: Sidecar +// $description: Configuration affecting network reachability of a sidecar. +// $location: https://istio.io/docs/reference/config/networking/sidecar.html +// $aliases: [/docs/reference/config/networking/v1alpha3/sidecar] + +// `Sidecar` describes the configuration of the sidecar proxy that mediates +// inbound and outbound communication to the workload instance it is attached to. By +// default, Istio will program all sidecar proxies in the mesh with the +// necessary configuration required to reach every workload instance in the mesh, as +// well as accept traffic on all the ports associated with the +// workload. The `Sidecar` configuration provides a way to fine tune the set of +// ports, protocols that the proxy will accept when forwarding traffic to +// and from the workload. In addition, it is possible to restrict the set +// of services that the proxy can reach when forwarding outbound traffic +// from workload instances. +// +// Services and configuration in a mesh are organized into one or more +// namespaces (e.g., a Kubernetes namespace or a CF org/space). A `Sidecar` +// configuration in a namespace will apply to one or more workload instances in the same +// namespace, selected using the `workloadSelector` field. In the absence of a +// `workloadSelector`, it will apply to all workload instances in the same +// namespace. When determining the `Sidecar` configuration to be applied to a +// workload instance, preference will be given to the resource with a +// `workloadSelector` that selects this workload instance, over a `Sidecar` configuration +// without any `workloadSelector`. +// +// **NOTE 1**: *_Each namespace can have only one `Sidecar` +// configuration without any `workloadSelector`_ that specifies the +// default for all pods in that namespace*. It is recommended to use +// the name `default` for the namespace-wide sidecar. The behavior of +// the system is undefined if more than one selector-less `Sidecar` +// configurations exist in a given namespace. The behavior of the +// system is undefined if two or more `Sidecar` configurations with a +// `workloadSelector` select the same workload instance. +// +// **NOTE 2**: *_A `Sidecar` configuration in the `MeshConfig` +// [root namespace](https://istio.io/docs/reference/config/istio.mesh.v1alpha1/#MeshConfig) +// will be applied by default to all namespaces without a `Sidecar` +// configuration_*. This global default `Sidecar` configuration should not have +// any `workloadSelector`. +// +// The example below declares a global default `Sidecar` configuration +// in the root namespace called `istio-config`, that configures +// sidecars in all namespaces to allow egress traffic only to other +// workloads in the same namespace as well as to services in the +// `istio-system` namespace. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: default +// namespace: istio-config +// spec: +// egress: +// - hosts: +// - "./*" +// - "istio-system/*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: default +// namespace: istio-config +// spec: +// egress: +// - hosts: +// - "./*" +// - "istio-system/*" +// ``` +// {{}} +// {{}} +// +// The example below declares a `Sidecar` configuration in the +// `prod-us1` namespace that overrides the global default defined +// above, and configures the sidecars in the namespace to allow egress +// traffic to public services in the `prod-us1`, `prod-apis`, and the +// `istio-system` namespaces. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: default +// namespace: prod-us1 +// spec: +// egress: +// - hosts: +// - "prod-us1/*" +// - "prod-apis/*" +// - "istio-system/*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: default +// namespace: prod-us1 +// spec: +// egress: +// - hosts: +// - "prod-us1/*" +// - "prod-apis/*" +// - "istio-system/*" +// ``` +// {{}} +// {{}} +// +// The following example declares a `Sidecar` configuration in the +// `prod-us1` namespace for all pods with labels `app: ratings` +// belonging to the `ratings.prod-us1` service. The workload accepts +// inbound HTTP traffic on port 9080. The traffic is then forwarded to +// the attached workload instance listening on a Unix domain +// socket. In the egress direction, in addition to the `istio-system` +// namespace, the sidecar proxies only HTTP traffic bound for port +// 9080 for services in the `prod-us1` namespace. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: ratings +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: ratings +// ingress: +// - port: +// number: 9080 +// protocol: HTTP +// name: somename +// defaultEndpoint: unix:///var/run/someuds.sock +// egress: +// - port: +// number: 9080 +// protocol: HTTP +// name: egresshttp +// hosts: +// - "prod-us1/*" +// - hosts: +// - "istio-system/*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: ratings +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: ratings +// ingress: +// - port: +// number: 9080 +// protocol: HTTP +// name: somename +// defaultEndpoint: unix:///var/run/someuds.sock +// egress: +// - port: +// number: 9080 +// protocol: HTTP +// name: egresshttp +// hosts: +// - "prod-us1/*" +// - hosts: +// - "istio-system/*" +// ``` +// {{}} +// {{}} +// +// If the workload is deployed without IPTables-based traffic capture, +// the `Sidecar` configuration is the only way to configure the ports +// on the proxy attached to the workload instance. The following +// example declares a `Sidecar` configuration in the `prod-us1` +// namespace for all pods with labels `app: productpage` belonging to +// the `productpage.prod-us1` service. Assuming that these pods are +// deployed without IPtable rules (i.e. the `istio-init` container) +// and the proxy metadata `ISTIO_META_INTERCEPTION_MODE` is set to +// `NONE`, the specification, below, allows such pods to receive HTTP +// traffic on port 9080 (wrapped inside Istio mutual TLS) and forward +// it to the application listening on `127.0.0.1:8080`. It also allows +// the application to communicate with a backing MySQL database on +// `127.0.0.1:3306`, that then gets proxied to the externally hosted +// MySQL service at `mysql.foo.com:3306`. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: no-ip-tables +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: productpage +// ingress: +// - port: +// number: 9080 # binds to proxy_instance_ip:9080 (0.0.0.0:9080, if no unicast IP is available for the instance) +// protocol: HTTP +// name: somename +// defaultEndpoint: 127.0.0.1:8080 +// captureMode: NONE # not needed if metadata is set for entire proxy +// egress: +// - port: +// number: 3306 +// protocol: MYSQL +// name: egressmysql +// captureMode: NONE # not needed if metadata is set for entire proxy +// bind: 127.0.0.1 +// hosts: +// - "*/mysql.foo.com" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: no-ip-tables +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: productpage +// ingress: +// - port: +// number: 9080 # binds to proxy_instance_ip:9080 (0.0.0.0:9080, if no unicast IP is available for the instance) +// protocol: HTTP +// name: somename +// defaultEndpoint: 127.0.0.1:8080 +// captureMode: NONE # not needed if metadata is set for entire proxy +// egress: +// - port: +// number: 3306 +// protocol: MYSQL +// name: egressmysql +// captureMode: NONE # not needed if metadata is set for entire proxy +// bind: 127.0.0.1 +// hosts: +// - "*/mysql.foo.com" +// ``` +// {{}} +// {{}} +// +// And the associated service entry for routing to `mysql.foo.com:3306` +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-mysql +// namespace: ns1 +// spec: +// hosts: +// - mysql.foo.com +// ports: +// - number: 3306 +// name: mysql +// protocol: MYSQL +// location: MESH_EXTERNAL +// resolution: DNS +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-mysql +// namespace: ns1 +// spec: +// hosts: +// - mysql.foo.com +// ports: +// - number: 3306 +// name: mysql +// protocol: MYSQL +// location: MESH_EXTERNAL +// resolution: DNS +// ``` +// {{}} +// {{}} +// +// It is also possible to mix and match traffic capture modes in a single +// proxy. For example, consider a setup where internal services are on the +// `192.168.0.0/16` subnet. So, IP tables are setup on the VM to capture all +// outbound traffic on `192.168.0.0/16` subnet. Assume that the VM has an +// additional network interface on `172.16.0.0/16` subnet for inbound +// traffic. The following `Sidecar` configuration allows the VM to expose a +// listener on `172.16.1.32:80` (the VM's IP) for traffic arriving from the +// `172.16.0.0/16` subnet. +// +// **NOTE**: The `ISTIO_META_INTERCEPTION_MODE` metadata on the +// proxy in the VM should contain `REDIRECT` or `TPROXY` as its value, +// implying that IP tables based traffic capture is active. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: partial-ip-tables +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: productpage +// ingress: +// - bind: 172.16.1.32 +// port: +// number: 80 # binds to 172.16.1.32:80 +// protocol: HTTP +// name: somename +// defaultEndpoint: 127.0.0.1:8080 +// captureMode: NONE +// egress: +// # use the system detected defaults +// # sets up configuration to handle outbound traffic to services +// # in 192.168.0.0/16 subnet, based on information provided by the +// # service registry +// - captureMode: IPTABLES +// hosts: +// - "*/*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: partial-ip-tables +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: productpage +// ingress: +// - bind: 172.16.1.32 +// port: +// number: 80 # binds to 172.16.1.32:80 +// protocol: HTTP +// name: somename +// defaultEndpoint: 127.0.0.1:8080 +// captureMode: NONE +// egress: +// # use the system detected defaults +// # sets up configuration to handle outbound traffic to services +// # in 192.168.0.0/16 subnet, based on information provided by the +// # service registry +// - captureMode: IPTABLES +// hosts: +// - "*/*" +// ``` +// {{}} +// {{}} +// +package istio.networking.v1alpha3; + +option go_package = "istio.io/api/networking/v1alpha3"; + +// `Sidecar` describes the configuration of the sidecar proxy that mediates +// inbound and outbound communication of the workload instance to which it is +// attached. +// +// +// +// +message Sidecar { + // Criteria used to select the specific set of pods/VMs on which this + // `Sidecar` configuration should be applied. If omitted, the `Sidecar` + // configuration will be applied to all workload instances in the same namespace. + WorkloadSelector workload_selector = 1; + + // Ingress specifies the configuration of the sidecar for processing + // inbound traffic to the attached workload instance. If omitted, Istio will + // automatically configure the sidecar based on the information about the workload + // obtained from the orchestration platform (e.g., exposed ports, services, + // etc.). If specified, inbound ports are configured if and only if the + // workload instance is associated with a service. + repeated IstioIngressListener ingress = 2; + + // Egress specifies the configuration of the sidecar for processing + // outbound traffic from the attached workload instance to other + // services in the mesh. If not specified, inherits the system + // detected defaults from the namespace-wide or the global default Sidecar. + repeated IstioEgressListener egress = 3; + + // Configuration for the outbound traffic policy. If your + // application uses one or more external services that are not known + // apriori, setting the policy to `ALLOW_ANY` will cause the + // sidecars to route any unknown traffic originating from the + // application to its requested destination. If not specified, + // inherits the system detected defaults from the namespace-wide or + // the global default Sidecar. + OutboundTrafficPolicy outbound_traffic_policy = 4; + + // $hide_from_docs + // `Localhost` describes the sidecar settings related to the + // communication between the sidecar and the workload it is attached to + // in a Kubernetes Pod or a VM. These settings apply to all ingress + // and egress listeners in a sidecar unless overridden. There are no + // built in defaults for this setting. If not specified, the + // features will be disabled. + Localhost localhost = 6; +} + +// `IstioIngressListener` specifies the properties of an inbound +// traffic listener on the sidecar proxy attached to a workload instance. +message IstioIngressListener { + // The port associated with the listener. + Port port = 1 [(google.api.field_behavior) = REQUIRED]; + + // The IP to which the listener should be bound. Must be in the + // format `x.x.x.x`. Unix domain socket addresses are not allowed in + // the bind field for ingress listeners. If omitted, Istio will + // automatically configure the defaults based on imported services + // and the workload instances to which this configuration is applied + // to. + string bind = 2; + + // The captureMode option dictates how traffic to the listener is + // expected to be captured (or not). + CaptureMode capture_mode = 3; + + // The loopback IP endpoint or Unix domain socket to which + // traffic should be forwarded to. This configuration can be used to + // redirect traffic arriving at the bind `IP:Port` on the sidecar to a `localhost:port` + // or Unix domain socket where the application workload instance is listening for + // connections. Format should be `127.0.0.1:PORT` or `unix:///path/to/socket` + string default_endpoint = 4 [(google.api.field_behavior) = REQUIRED]; + + // $hide_from_docs + // TLS settings to be used by the sidecar (client) when forwarding + // traffic from the sidecar to the workload (server) on the + // localhost. Overrides the `localhost` level `clientTls` settings. + // + // **NOTE**: DISABLE, SIMPLE and MUTUAL are the only valid TLS modes. + ClientTLSSettings localhost_client_tls = 6; +} + +// `IstioEgressListener` specifies the properties of an outbound traffic +// listener on the sidecar proxy attached to a workload instance. +message IstioEgressListener { + // The port associated with the listener. If using Unix domain socket, + // use 0 as the port number, with a valid protocol. The port if + // specified, will be used as the default destination port associated + // with the imported hosts. If the port is omitted, Istio will infer the + // listener ports based on the imported hosts. Note that when multiple + // egress listeners are specified, where one or more listeners have + // specific ports while others have no port, the hosts exposed on a + // listener port will be based on the listener with the most specific + // port. + Port port = 1; + + // The IP or the Unix domain socket to which the listener should be bound + // to. Port MUST be specified if bind is not empty. Format: `x.x.x.x` or + // `unix:///path/to/uds` or `unix://@foobar` (Linux abstract namespace). If + // omitted, Istio will automatically configure the defaults based on imported + // services, the workload instances to which this configuration is applied to and + // the captureMode. If captureMode is `NONE`, bind will default to + // 127.0.0.1. + string bind = 2; + + // When the bind address is an IP, the captureMode option dictates + // how traffic to the listener is expected to be captured (or not). + // captureMode must be DEFAULT or `NONE` for Unix domain socket binds. + CaptureMode capture_mode = 3; + + // One or more service hosts exposed by the listener + // in `namespace/dnsName` format. Services in the specified namespace + // matching `dnsName` will be exposed. + // The corresponding service can be a service in the service registry + // (e.g., a Kubernetes or cloud foundry service) or a service specified + // using a `ServiceEntry` or `VirtualService` configuration. Any + // associated `DestinationRule` in the same namespace will also be used. + // + // The `dnsName` should be specified using FQDN format, optionally including + // a wildcard character in the left-most component (e.g., `prod/*.example.com`). + // Set the `dnsName` to `*` to select all services from the specified namespace + // (e.g., `prod/*`). + // + // The `namespace` can be set to `*`, `.`, or `~`, representing any, the current, + // or no namespace, respectively. For example, `*/foo.example.com` selects the + // service from any available namespace while `./foo.example.com` only selects + // the service from the namespace of the sidecar. If a host is set to `*/*`, + // Istio will configure the sidecar to be able to reach every service in the + // mesh that is exported to the sidecar's namespace. The value `~/*` can be used + // to completely trim the configuration for sidecars that simply receive traffic + // and respond, but make no outbound connections of their own. + // + // NOTE: Only services and configuration artifacts exported to the sidecar's + // namespace (e.g., `exportTo` value of `*`) can be referenced. + // Private configurations (e.g., `exportTo` set to `.`) will + // not be available. Refer to the `exportTo` setting in `VirtualService`, + // `DestinationRule`, and `ServiceEntry` configurations for details. + // + // **WARNING:** The list of egress hosts in a `Sidecar` must also include + // the Mixer control plane services if they are enabled. Envoy will not + // be able to reach them otherwise. For example, add host + // `istio-system/istio-telemetry.istio-system.svc.cluster.local` if telemetry + // is enabled, `istio-system/istio-policy.istio-system.svc.cluster.local` if + // policy is enabled, or add `istio-system/*` to allow all services in the + // `istio-system` namespace. This requirement is temporary and will be removed + // in a future Istio release. + repeated string hosts = 4 [(google.api.field_behavior) = REQUIRED]; + + // $hide_from_docs + // TLS settings to be used by the sidecar (server) when receiving + // traffic from the workload (client) on the + // localhost. Overrides the `localhost` level `serverTls` settings. + // + // **NOTE**: SIMPLE and MUTUAL are the only valid TLS + // modes. `httpsRedirect` and `credentialName` (for fetching + // certificates from Kubernetes secrets) are not valid. All + // certificates must be mounted as files inside the sidecar + // container. + ServerTLSSettings localhost_server_tls = 5; +} + +// `WorkloadSelector` specifies the criteria used to determine if the +// `Gateway`, `Sidecar`, or `EnvoyFilter` or `ServiceEntry` +// configuration can be applied to a proxy. The matching criteria +// includes the metadata associated with a proxy, workload instance +// info such as labels attached to the pod/VM, or any other info that +// the proxy provides to Istio during the initial handshake. If +// multiple conditions are specified, all conditions need to match in +// order for the workload instance to be selected. Currently, only +// label based selection mechanism is supported. +message WorkloadSelector { + // One or more labels that indicate a specific set of pods/VMs + // on which the configuration should be applied. The scope of + // label search is restricted to the configuration namespace in which the + // the resource is present. + map labels = 1 [(google.api.field_behavior) = REQUIRED]; + + // $hide_from_docs + // other forms of identification supplied by the proxy + // when connecting to Pilot, such as X509 fields, tenant IDs, JWT, + // etc. This has nothing to do with the request level authN etc. +} + +// `OutboundTrafficPolicy` sets the default behavior of the sidecar for +// handling outbound traffic from the application. +// If your application uses one or more external +// services that are not known apriori, setting the policy to `ALLOW_ANY` +// will cause the sidecars to route any unknown traffic originating from +// the application to its requested destination. Users are strongly +// encouraged to use `ServiceEntry` configurations to explicitly declare any external +// dependencies, instead of using `ALLOW_ANY`, so that traffic to these +// services can be monitored. +message OutboundTrafficPolicy { + enum Mode { + // Outbound traffic will be restricted to services defined in the + // service registry as well as those defined through `ServiceEntry` configurations. + REGISTRY_ONLY = 0; + // Outbound traffic to unknown destinations will be allowed, in case + // there are no services or `ServiceEntry` configurations for the destination port. + ALLOW_ANY = 1; + } + Mode mode = 1; + + // Specifies the details of the egress proxy to which unknown + // traffic should be forwarded to from the sidecar. Valid only if + // the mode is set to ALLOW_ANY. If not specified when the mode is + // ALLOW_ANY, the sidecar will send the unknown traffic directly to + // the IP requested by the application. + // + // ** NOTE 1**: The specified egress host must be imported in the + // egress section for the traffic forwarding to work. + // + // ** NOTE 2**: An Envoy based egress gateway is unlikely to be able + // to handle plain text TCP connections forwarded from the sidecar. + // Envoy's dynamic forward proxy can handle only HTTP and TLS + // connections. + // $hide_from_docs + istio.networking.v1alpha3.Destination egress_proxy = 2; +} + + +// `CaptureMode` describes how traffic to a listener is expected to be +// captured. Applicable only when the listener is bound to an IP. +enum CaptureMode { + // The default capture mode defined by the environment. + DEFAULT = 0; + + // Capture traffic using IPtables redirection. + IPTABLES = 1; + + // No traffic capture. When used in an egress listener, the application is + // expected to explicitly communicate with the listener port or Unix + // domain socket. When used in an ingress listener, care needs to be taken + // to ensure that the listener port is not in use by other processes on + // the host. + NONE = 2; +} + +// $hide_from_docs +// `Localhost` describes the sidecar settings related to the +// communication between the sidecar and the workload it is attached +// to in a Kubernetes Pod or a VM. These settings apply by default to all +// ingress and egress listeners in a sidecar unless overridden. +// +// The following example configures the sidecars on pods of the +// reviews service to use TLS for traffic to/from the sidecar to the +// workload in the same pod, assuming the appropriate +// certificates are mounted in the sidecar. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: reviews-localhost-tls +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: reviews +// localhost: +// clientTls: +// mode: SIMPLE +// caCertificates: /etc/legacy/ca.pem +// serverTls: +// mode: SIMPLE +// serverCertificate: /etc/legacy/server.pem +// privateKey: /etc/legacy/private.pem +// egress: +// - hosts: +// - "./" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: reviews-localhost-tls +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: reviews +// localhost: +// clientTls: +// mode: SIMPLE +// caCertificates: /etc/legacy/ca.pem +// serverTls: +// mode: SIMPLE +// serverCertificate: /etc/legacy/server.pem +// privateKey: /etc/legacy/private.pem +// egress: +// - hosts: +// - "./" +// ``` +// {{}} +// {{}} +// +message Localhost { + // TLS settings to be used by the sidecar (client) when forwarding + // traffic from the sidecar to the workload it is attached to + // (server) on the localhost. + // + // **NOTE**: DISABLE, SIMPLE and MUTUAL are the only valid TLS modes. + ClientTLSSettings client_tls = 1; + + // TLS settings to be used by the sidecar (server) when receiving + // traffic from the workload (client) on the localhost. + // + // **NOTE**: SIMPLE and MUTUAL are the only valid TLS + // modes. `httpsRedirect` and `credentialName` (for fetching + // certificates from Kubernetes secrets) are not valid. All + // certificates must be mounted as files inside the sidecar + // container. + ServerTLSSettings server_tls = 2; +} diff --git a/vendor/istio.io/api/networking/v1alpha3/sidecar_deepcopy.gen.go b/vendor/istio.io/api/networking/v1alpha3/sidecar_deepcopy.gen.go new file mode 100644 index 0000000000..45f128c7f5 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/sidecar_deepcopy.gen.go @@ -0,0 +1,490 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/sidecar.proto + +// `Sidecar` describes the configuration of the sidecar proxy that mediates +// inbound and outbound communication to the workload instance it is attached to. By +// default, Istio will program all sidecar proxies in the mesh with the +// necessary configuration required to reach every workload instance in the mesh, as +// well as accept traffic on all the ports associated with the +// workload. The `Sidecar` configuration provides a way to fine tune the set of +// ports, protocols that the proxy will accept when forwarding traffic to +// and from the workload. In addition, it is possible to restrict the set +// of services that the proxy can reach when forwarding outbound traffic +// from workload instances. +// +// Services and configuration in a mesh are organized into one or more +// namespaces (e.g., a Kubernetes namespace or a CF org/space). A `Sidecar` +// configuration in a namespace will apply to one or more workload instances in the same +// namespace, selected using the `workloadSelector` field. In the absence of a +// `workloadSelector`, it will apply to all workload instances in the same +// namespace. When determining the `Sidecar` configuration to be applied to a +// workload instance, preference will be given to the resource with a +// `workloadSelector` that selects this workload instance, over a `Sidecar` configuration +// without any `workloadSelector`. +// +// **NOTE 1**: *_Each namespace can have only one `Sidecar` +// configuration without any `workloadSelector`_ that specifies the +// default for all pods in that namespace*. It is recommended to use +// the name `default` for the namespace-wide sidecar. The behavior of +// the system is undefined if more than one selector-less `Sidecar` +// configurations exist in a given namespace. The behavior of the +// system is undefined if two or more `Sidecar` configurations with a +// `workloadSelector` select the same workload instance. +// +// **NOTE 2**: *_A `Sidecar` configuration in the `MeshConfig` +// [root namespace](https://istio.io/docs/reference/config/istio.mesh.v1alpha1/#MeshConfig) +// will be applied by default to all namespaces without a `Sidecar` +// configuration_*. This global default `Sidecar` configuration should not have +// any `workloadSelector`. +// +// The example below declares a global default `Sidecar` configuration +// in the root namespace called `istio-config`, that configures +// sidecars in all namespaces to allow egress traffic only to other +// workloads in the same namespace as well as to services in the +// `istio-system` namespace. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: default +// namespace: istio-config +// spec: +// egress: +// - hosts: +// - "./*" +// - "istio-system/*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: default +// namespace: istio-config +// spec: +// egress: +// - hosts: +// - "./*" +// - "istio-system/*" +// ``` +// {{}} +// {{}} +// +// The example below declares a `Sidecar` configuration in the +// `prod-us1` namespace that overrides the global default defined +// above, and configures the sidecars in the namespace to allow egress +// traffic to public services in the `prod-us1`, `prod-apis`, and the +// `istio-system` namespaces. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: default +// namespace: prod-us1 +// spec: +// egress: +// - hosts: +// - "prod-us1/*" +// - "prod-apis/*" +// - "istio-system/*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: default +// namespace: prod-us1 +// spec: +// egress: +// - hosts: +// - "prod-us1/*" +// - "prod-apis/*" +// - "istio-system/*" +// ``` +// {{}} +// {{}} +// +// The following example declares a `Sidecar` configuration in the +// `prod-us1` namespace for all pods with labels `app: ratings` +// belonging to the `ratings.prod-us1` service. The workload accepts +// inbound HTTP traffic on port 9080. The traffic is then forwarded to +// the attached workload instance listening on a Unix domain +// socket. In the egress direction, in addition to the `istio-system` +// namespace, the sidecar proxies only HTTP traffic bound for port +// 9080 for services in the `prod-us1` namespace. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: ratings +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: ratings +// ingress: +// - port: +// number: 9080 +// protocol: HTTP +// name: somename +// defaultEndpoint: unix:///var/run/someuds.sock +// egress: +// - port: +// number: 9080 +// protocol: HTTP +// name: egresshttp +// hosts: +// - "prod-us1/*" +// - hosts: +// - "istio-system/*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: ratings +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: ratings +// ingress: +// - port: +// number: 9080 +// protocol: HTTP +// name: somename +// defaultEndpoint: unix:///var/run/someuds.sock +// egress: +// - port: +// number: 9080 +// protocol: HTTP +// name: egresshttp +// hosts: +// - "prod-us1/*" +// - hosts: +// - "istio-system/*" +// ``` +// {{}} +// {{}} +// +// If the workload is deployed without IPTables-based traffic capture, +// the `Sidecar` configuration is the only way to configure the ports +// on the proxy attached to the workload instance. The following +// example declares a `Sidecar` configuration in the `prod-us1` +// namespace for all pods with labels `app: productpage` belonging to +// the `productpage.prod-us1` service. Assuming that these pods are +// deployed without IPtable rules (i.e. the `istio-init` container) +// and the proxy metadata `ISTIO_META_INTERCEPTION_MODE` is set to +// `NONE`, the specification, below, allows such pods to receive HTTP +// traffic on port 9080 (wrapped inside Istio mutual TLS) and forward +// it to the application listening on `127.0.0.1:8080`. It also allows +// the application to communicate with a backing MySQL database on +// `127.0.0.1:3306`, that then gets proxied to the externally hosted +// MySQL service at `mysql.foo.com:3306`. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: no-ip-tables +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: productpage +// ingress: +// - port: +// number: 9080 # binds to proxy_instance_ip:9080 (0.0.0.0:9080, if no unicast IP is available for the instance) +// protocol: HTTP +// name: somename +// defaultEndpoint: 127.0.0.1:8080 +// captureMode: NONE # not needed if metadata is set for entire proxy +// egress: +// - port: +// number: 3306 +// protocol: MYSQL +// name: egressmysql +// captureMode: NONE # not needed if metadata is set for entire proxy +// bind: 127.0.0.1 +// hosts: +// - "*/mysql.foo.com" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: no-ip-tables +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: productpage +// ingress: +// - port: +// number: 9080 # binds to proxy_instance_ip:9080 (0.0.0.0:9080, if no unicast IP is available for the instance) +// protocol: HTTP +// name: somename +// defaultEndpoint: 127.0.0.1:8080 +// captureMode: NONE # not needed if metadata is set for entire proxy +// egress: +// - port: +// number: 3306 +// protocol: MYSQL +// name: egressmysql +// captureMode: NONE # not needed if metadata is set for entire proxy +// bind: 127.0.0.1 +// hosts: +// - "*/mysql.foo.com" +// ``` +// {{}} +// {{}} +// +// And the associated service entry for routing to `mysql.foo.com:3306` +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-mysql +// namespace: ns1 +// spec: +// hosts: +// - mysql.foo.com +// ports: +// - number: 3306 +// name: mysql +// protocol: MYSQL +// location: MESH_EXTERNAL +// resolution: DNS +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-mysql +// namespace: ns1 +// spec: +// hosts: +// - mysql.foo.com +// ports: +// - number: 3306 +// name: mysql +// protocol: MYSQL +// location: MESH_EXTERNAL +// resolution: DNS +// ``` +// {{}} +// {{}} +// +// It is also possible to mix and match traffic capture modes in a single +// proxy. For example, consider a setup where internal services are on the +// `192.168.0.0/16` subnet. So, IP tables are setup on the VM to capture all +// outbound traffic on `192.168.0.0/16` subnet. Assume that the VM has an +// additional network interface on `172.16.0.0/16` subnet for inbound +// traffic. The following `Sidecar` configuration allows the VM to expose a +// listener on `172.16.1.32:80` (the VM's IP) for traffic arriving from the +// `172.16.0.0/16` subnet. +// +// **NOTE**: The `ISTIO_META_INTERCEPTION_MODE` metadata on the +// proxy in the VM should contain `REDIRECT` or `TPROXY` as its value, +// implying that IP tables based traffic capture is active. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: partial-ip-tables +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: productpage +// ingress: +// - bind: 172.16.1.32 +// port: +// number: 80 # binds to 172.16.1.32:80 +// protocol: HTTP +// name: somename +// defaultEndpoint: 127.0.0.1:8080 +// captureMode: NONE +// egress: +// # use the system detected defaults +// # sets up configuration to handle outbound traffic to services +// # in 192.168.0.0/16 subnet, based on information provided by the +// # service registry +// - captureMode: IPTABLES +// hosts: +// - "*/*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: partial-ip-tables +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: productpage +// ingress: +// - bind: 172.16.1.32 +// port: +// number: 80 # binds to 172.16.1.32:80 +// protocol: HTTP +// name: somename +// defaultEndpoint: 127.0.0.1:8080 +// captureMode: NONE +// egress: +// # use the system detected defaults +// # sets up configuration to handle outbound traffic to services +// # in 192.168.0.0/16 subnet, based on information provided by the +// # service registry +// - captureMode: IPTABLES +// hosts: +// - "*/*" +// ``` +// {{}} +// {{}} +// + +package v1alpha3 + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// DeepCopyInto supports using Sidecar within kubernetes types, where deepcopy-gen is used. +func (in *Sidecar) DeepCopyInto(out *Sidecar) { + p := proto.Clone(in).(*Sidecar) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sidecar. Required by controller-gen. +func (in *Sidecar) DeepCopy() *Sidecar { + if in == nil { + return nil + } + out := new(Sidecar) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using IstioIngressListener within kubernetes types, where deepcopy-gen is used. +func (in *IstioIngressListener) DeepCopyInto(out *IstioIngressListener) { + p := proto.Clone(in).(*IstioIngressListener) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IstioIngressListener. Required by controller-gen. +func (in *IstioIngressListener) DeepCopy() *IstioIngressListener { + if in == nil { + return nil + } + out := new(IstioIngressListener) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using IstioEgressListener within kubernetes types, where deepcopy-gen is used. +func (in *IstioEgressListener) DeepCopyInto(out *IstioEgressListener) { + p := proto.Clone(in).(*IstioEgressListener) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IstioEgressListener. Required by controller-gen. +func (in *IstioEgressListener) DeepCopy() *IstioEgressListener { + if in == nil { + return nil + } + out := new(IstioEgressListener) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using WorkloadSelector within kubernetes types, where deepcopy-gen is used. +func (in *WorkloadSelector) DeepCopyInto(out *WorkloadSelector) { + p := proto.Clone(in).(*WorkloadSelector) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadSelector. Required by controller-gen. +func (in *WorkloadSelector) DeepCopy() *WorkloadSelector { + if in == nil { + return nil + } + out := new(WorkloadSelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using OutboundTrafficPolicy within kubernetes types, where deepcopy-gen is used. +func (in *OutboundTrafficPolicy) DeepCopyInto(out *OutboundTrafficPolicy) { + p := proto.Clone(in).(*OutboundTrafficPolicy) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OutboundTrafficPolicy. Required by controller-gen. +func (in *OutboundTrafficPolicy) DeepCopy() *OutboundTrafficPolicy { + if in == nil { + return nil + } + out := new(OutboundTrafficPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using Localhost within kubernetes types, where deepcopy-gen is used. +func (in *Localhost) DeepCopyInto(out *Localhost) { + p := proto.Clone(in).(*Localhost) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Localhost. Required by controller-gen. +func (in *Localhost) DeepCopy() *Localhost { + if in == nil { + return nil + } + out := new(Localhost) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/istio.io/api/networking/v1alpha3/sidecar_json.gen.go b/vendor/istio.io/api/networking/v1alpha3/sidecar_json.gen.go new file mode 100644 index 0000000000..e7cdfcaf21 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/sidecar_json.gen.go @@ -0,0 +1,467 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/sidecar.proto + +// `Sidecar` describes the configuration of the sidecar proxy that mediates +// inbound and outbound communication to the workload instance it is attached to. By +// default, Istio will program all sidecar proxies in the mesh with the +// necessary configuration required to reach every workload instance in the mesh, as +// well as accept traffic on all the ports associated with the +// workload. The `Sidecar` configuration provides a way to fine tune the set of +// ports, protocols that the proxy will accept when forwarding traffic to +// and from the workload. In addition, it is possible to restrict the set +// of services that the proxy can reach when forwarding outbound traffic +// from workload instances. +// +// Services and configuration in a mesh are organized into one or more +// namespaces (e.g., a Kubernetes namespace or a CF org/space). A `Sidecar` +// configuration in a namespace will apply to one or more workload instances in the same +// namespace, selected using the `workloadSelector` field. In the absence of a +// `workloadSelector`, it will apply to all workload instances in the same +// namespace. When determining the `Sidecar` configuration to be applied to a +// workload instance, preference will be given to the resource with a +// `workloadSelector` that selects this workload instance, over a `Sidecar` configuration +// without any `workloadSelector`. +// +// **NOTE 1**: *_Each namespace can have only one `Sidecar` +// configuration without any `workloadSelector`_ that specifies the +// default for all pods in that namespace*. It is recommended to use +// the name `default` for the namespace-wide sidecar. The behavior of +// the system is undefined if more than one selector-less `Sidecar` +// configurations exist in a given namespace. The behavior of the +// system is undefined if two or more `Sidecar` configurations with a +// `workloadSelector` select the same workload instance. +// +// **NOTE 2**: *_A `Sidecar` configuration in the `MeshConfig` +// [root namespace](https://istio.io/docs/reference/config/istio.mesh.v1alpha1/#MeshConfig) +// will be applied by default to all namespaces without a `Sidecar` +// configuration_*. This global default `Sidecar` configuration should not have +// any `workloadSelector`. +// +// The example below declares a global default `Sidecar` configuration +// in the root namespace called `istio-config`, that configures +// sidecars in all namespaces to allow egress traffic only to other +// workloads in the same namespace as well as to services in the +// `istio-system` namespace. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: default +// namespace: istio-config +// spec: +// egress: +// - hosts: +// - "./*" +// - "istio-system/*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: default +// namespace: istio-config +// spec: +// egress: +// - hosts: +// - "./*" +// - "istio-system/*" +// ``` +// {{}} +// {{}} +// +// The example below declares a `Sidecar` configuration in the +// `prod-us1` namespace that overrides the global default defined +// above, and configures the sidecars in the namespace to allow egress +// traffic to public services in the `prod-us1`, `prod-apis`, and the +// `istio-system` namespaces. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: default +// namespace: prod-us1 +// spec: +// egress: +// - hosts: +// - "prod-us1/*" +// - "prod-apis/*" +// - "istio-system/*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: default +// namespace: prod-us1 +// spec: +// egress: +// - hosts: +// - "prod-us1/*" +// - "prod-apis/*" +// - "istio-system/*" +// ``` +// {{}} +// {{}} +// +// The following example declares a `Sidecar` configuration in the +// `prod-us1` namespace for all pods with labels `app: ratings` +// belonging to the `ratings.prod-us1` service. The workload accepts +// inbound HTTP traffic on port 9080. The traffic is then forwarded to +// the attached workload instance listening on a Unix domain +// socket. In the egress direction, in addition to the `istio-system` +// namespace, the sidecar proxies only HTTP traffic bound for port +// 9080 for services in the `prod-us1` namespace. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: ratings +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: ratings +// ingress: +// - port: +// number: 9080 +// protocol: HTTP +// name: somename +// defaultEndpoint: unix:///var/run/someuds.sock +// egress: +// - port: +// number: 9080 +// protocol: HTTP +// name: egresshttp +// hosts: +// - "prod-us1/*" +// - hosts: +// - "istio-system/*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: ratings +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: ratings +// ingress: +// - port: +// number: 9080 +// protocol: HTTP +// name: somename +// defaultEndpoint: unix:///var/run/someuds.sock +// egress: +// - port: +// number: 9080 +// protocol: HTTP +// name: egresshttp +// hosts: +// - "prod-us1/*" +// - hosts: +// - "istio-system/*" +// ``` +// {{}} +// {{}} +// +// If the workload is deployed without IPTables-based traffic capture, +// the `Sidecar` configuration is the only way to configure the ports +// on the proxy attached to the workload instance. The following +// example declares a `Sidecar` configuration in the `prod-us1` +// namespace for all pods with labels `app: productpage` belonging to +// the `productpage.prod-us1` service. Assuming that these pods are +// deployed without IPtable rules (i.e. the `istio-init` container) +// and the proxy metadata `ISTIO_META_INTERCEPTION_MODE` is set to +// `NONE`, the specification, below, allows such pods to receive HTTP +// traffic on port 9080 (wrapped inside Istio mutual TLS) and forward +// it to the application listening on `127.0.0.1:8080`. It also allows +// the application to communicate with a backing MySQL database on +// `127.0.0.1:3306`, that then gets proxied to the externally hosted +// MySQL service at `mysql.foo.com:3306`. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: no-ip-tables +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: productpage +// ingress: +// - port: +// number: 9080 # binds to proxy_instance_ip:9080 (0.0.0.0:9080, if no unicast IP is available for the instance) +// protocol: HTTP +// name: somename +// defaultEndpoint: 127.0.0.1:8080 +// captureMode: NONE # not needed if metadata is set for entire proxy +// egress: +// - port: +// number: 3306 +// protocol: MYSQL +// name: egressmysql +// captureMode: NONE # not needed if metadata is set for entire proxy +// bind: 127.0.0.1 +// hosts: +// - "*/mysql.foo.com" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: no-ip-tables +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: productpage +// ingress: +// - port: +// number: 9080 # binds to proxy_instance_ip:9080 (0.0.0.0:9080, if no unicast IP is available for the instance) +// protocol: HTTP +// name: somename +// defaultEndpoint: 127.0.0.1:8080 +// captureMode: NONE # not needed if metadata is set for entire proxy +// egress: +// - port: +// number: 3306 +// protocol: MYSQL +// name: egressmysql +// captureMode: NONE # not needed if metadata is set for entire proxy +// bind: 127.0.0.1 +// hosts: +// - "*/mysql.foo.com" +// ``` +// {{}} +// {{}} +// +// And the associated service entry for routing to `mysql.foo.com:3306` +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-mysql +// namespace: ns1 +// spec: +// hosts: +// - mysql.foo.com +// ports: +// - number: 3306 +// name: mysql +// protocol: MYSQL +// location: MESH_EXTERNAL +// resolution: DNS +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-mysql +// namespace: ns1 +// spec: +// hosts: +// - mysql.foo.com +// ports: +// - number: 3306 +// name: mysql +// protocol: MYSQL +// location: MESH_EXTERNAL +// resolution: DNS +// ``` +// {{}} +// {{}} +// +// It is also possible to mix and match traffic capture modes in a single +// proxy. For example, consider a setup where internal services are on the +// `192.168.0.0/16` subnet. So, IP tables are setup on the VM to capture all +// outbound traffic on `192.168.0.0/16` subnet. Assume that the VM has an +// additional network interface on `172.16.0.0/16` subnet for inbound +// traffic. The following `Sidecar` configuration allows the VM to expose a +// listener on `172.16.1.32:80` (the VM's IP) for traffic arriving from the +// `172.16.0.0/16` subnet. +// +// **NOTE**: The `ISTIO_META_INTERCEPTION_MODE` metadata on the +// proxy in the VM should contain `REDIRECT` or `TPROXY` as its value, +// implying that IP tables based traffic capture is active. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: Sidecar +// metadata: +// name: partial-ip-tables +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: productpage +// ingress: +// - bind: 172.16.1.32 +// port: +// number: 80 # binds to 172.16.1.32:80 +// protocol: HTTP +// name: somename +// defaultEndpoint: 127.0.0.1:8080 +// captureMode: NONE +// egress: +// # use the system detected defaults +// # sets up configuration to handle outbound traffic to services +// # in 192.168.0.0/16 subnet, based on information provided by the +// # service registry +// - captureMode: IPTABLES +// hosts: +// - "*/*" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: Sidecar +// metadata: +// name: partial-ip-tables +// namespace: prod-us1 +// spec: +// workloadSelector: +// labels: +// app: productpage +// ingress: +// - bind: 172.16.1.32 +// port: +// number: 80 # binds to 172.16.1.32:80 +// protocol: HTTP +// name: somename +// defaultEndpoint: 127.0.0.1:8080 +// captureMode: NONE +// egress: +// # use the system detected defaults +// # sets up configuration to handle outbound traffic to services +// # in 192.168.0.0/16 subnet, based on information provided by the +// # service registry +// - captureMode: IPTABLES +// hosts: +// - "*/*" +// ``` +// {{}} +// {{}} +// + +package v1alpha3 + +import ( + bytes "bytes" + fmt "fmt" + github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" + proto "github.com/gogo/protobuf/proto" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// MarshalJSON is a custom marshaler for Sidecar +func (this *Sidecar) MarshalJSON() ([]byte, error) { + str, err := SidecarMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for Sidecar +func (this *Sidecar) UnmarshalJSON(b []byte) error { + return SidecarUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for IstioIngressListener +func (this *IstioIngressListener) MarshalJSON() ([]byte, error) { + str, err := SidecarMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for IstioIngressListener +func (this *IstioIngressListener) UnmarshalJSON(b []byte) error { + return SidecarUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for IstioEgressListener +func (this *IstioEgressListener) MarshalJSON() ([]byte, error) { + str, err := SidecarMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for IstioEgressListener +func (this *IstioEgressListener) UnmarshalJSON(b []byte) error { + return SidecarUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for WorkloadSelector +func (this *WorkloadSelector) MarshalJSON() ([]byte, error) { + str, err := SidecarMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for WorkloadSelector +func (this *WorkloadSelector) UnmarshalJSON(b []byte) error { + return SidecarUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for OutboundTrafficPolicy +func (this *OutboundTrafficPolicy) MarshalJSON() ([]byte, error) { + str, err := SidecarMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for OutboundTrafficPolicy +func (this *OutboundTrafficPolicy) UnmarshalJSON(b []byte) error { + return SidecarUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for Localhost +func (this *Localhost) MarshalJSON() ([]byte, error) { + str, err := SidecarMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for Localhost +func (this *Localhost) UnmarshalJSON(b []byte) error { + return SidecarUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +var ( + SidecarMarshaler = &github_com_gogo_protobuf_jsonpb.Marshaler{} + SidecarUnmarshaler = &github_com_gogo_protobuf_jsonpb.Unmarshaler{} +) diff --git a/vendor/istio.io/api/networking/v1alpha3/virtual_service.gen.json b/vendor/istio.io/api/networking/v1alpha3/virtual_service.gen.json new file mode 100644 index 0000000000..99b2dc169b --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/virtual_service.gen.json @@ -0,0 +1,817 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Configuration affecting label/content routing, sni routing, etc.", + "version": "v1alpha3" + }, + "components": { + "schemas": { + "istio.networking.v1alpha3.PortSelector": { + "description": "PortSelector specifies the number of a port to be used for matching or selection for final routing.", + "type": "object", + "properties": { + "number": { + "description": "Valid port number", + "type": "integer" + } + } + }, + "istio.networking.v1alpha3.Destination": { + "description": "Destination indicates the network addressable service to which the request/connection will be sent after processing a routing rule. The destination.host should unambiguously refer to a service in the service registry. Istio's service registry is composed of all the services found in the platform's service registry (e.g., Kubernetes services, Consul services), as well as services declared through the [ServiceEntry](https://istio.io/docs/reference/config/networking/service-entry/#ServiceEntry) resource.", + "type": "object", + "properties": { + "host": { + "description": "The name of a service from the service registry. Service names are looked up from the platform's service registry (e.g., Kubernetes services, Consul services, etc.) and from the hosts declared by [ServiceEntry](https://istio.io/docs/reference/config/networking/service-entry/#ServiceEntry). Traffic forwarded to destinations that are not found in either of the two, will be dropped.", + "type": "string", + "format": "string" + }, + "port": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.PortSelector" + }, + "subset": { + "description": "The name of a subset within the service. Applicable only to services within the mesh. The subset must be defined in a corresponding DestinationRule.", + "type": "string", + "format": "string" + } + } + }, + "istio.networking.v1alpha3.VirtualService": { + "description": "Configuration affecting traffic routing.", + "type": "object", + "properties": { + "exportTo": { + "description": "A list of namespaces to which this virtual service is exported. Exporting a virtual service allows it to be used by sidecars and gateways defined in other namespaces. This feature provides a mechanism for service owners and mesh administrators to control the visibility of virtual services across namespace boundaries.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "tls": { + "description": "An ordered list of route rule for non-terminated TLS \u0026 HTTPS traffic. Routing is typically performed using the SNI value presented by the ClientHello message. TLS routes will be applied to platform service ports named 'https-*', 'tls-*', unterminated gateway ports using HTTPS/TLS protocols (i.e. with \"passthrough\" TLS mode) and service entry ports using HTTPS/TLS protocols. The first rule matching an incoming request is used. NOTE: Traffic 'https-*' or 'tls-*' ports without associated virtual service will be treated as opaque TCP traffic.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.TLSRoute" + } + }, + "tcp": { + "description": "An ordered list of route rules for opaque TCP traffic. TCP routes will be applied to any port that is not a HTTP or TLS port. The first rule matching an incoming request is used.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.TCPRoute" + } + }, + "http": { + "description": "An ordered list of route rules for HTTP traffic. HTTP routes will be applied to platform service ports named 'http-*'/'http2-*'/'grpc-*', gateway ports with protocol HTTP/HTTP2/GRPC/ TLS-terminated-HTTPS and service entry ports using HTTP/HTTP2/GRPC protocols. The first rule matching an incoming request is used.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.HTTPRoute" + } + }, + "hosts": { + "description": "The destination hosts to which traffic is being sent. Could be a DNS name with wildcard prefix or an IP address. Depending on the platform, short-names can also be used instead of a FQDN (i.e. has no dots in the name). In such a scenario, the FQDN of the host would be derived based on the underlying platform.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "gateways": { + "description": "The names of gateways and sidecars that should apply these routes. Gateways in other namespaces may be referred to by `\u003cgateway namespace\u003e/\u003cgateway name\u003e`; specifying a gateway with no namespace qualifier is the same as specifying the VirtualService's namespace. A single VirtualService is used for sidecars inside the mesh as well as for one or more gateways. The selection condition imposed by this field can be overridden using the source field in the match conditions of protocol-specific routes. The reserved word `mesh` is used to imply all the sidecars in the mesh. When this field is omitted, the default gateway (`mesh`) will be used, which would apply the rule to all sidecars in the mesh. If a list of gateway names is provided, the rules will apply only to the gateways. To apply the rules to both gateways and sidecars, specify `mesh` as one of the gateway names.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + } + } + }, + "istio.networking.v1alpha3.HTTPRoute": { + "description": "Describes match conditions and actions for routing HTTP/1.1, HTTP2, and gRPC traffic. See VirtualService for usage examples.", + "type": "object", + "properties": { + "name": { + "description": "The name assigned to the route for debugging purposes. The route's name will be concatenated with the match's name and will be logged in the access logs for requests matching this route/match.", + "type": "string", + "format": "string" + }, + "route": { + "description": "A HTTP rule can either redirect or forward (default) traffic. The forwarding target can be one of several versions of a service (see glossary in beginning of document). Weights associated with the service version determine the proportion of traffic it receives.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.HTTPRouteDestination" + } + }, + "match": { + "description": "Match conditions to be satisfied for the rule to be activated. All conditions inside a single match block have AND semantics, while the list of match blocks have OR semantics. The rule is matched if any one of the match blocks succeed.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.HTTPMatchRequest" + } + }, + "redirect": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.HTTPRedirect" + }, + "delegate": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.Delegate" + }, + "rewrite": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.HTTPRewrite" + }, + "timeout": { + "description": "Timeout for HTTP requests.", + "type": "string" + }, + "retries": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.HTTPRetry" + }, + "fault": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.HTTPFaultInjection" + }, + "mirror": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.Destination" + }, + "mirrorPercent": { + "description": "Percentage of the traffic to be mirrored by the `mirror` field. Use of integer `mirror_percent` value is deprecated. Use the double `mirror_percentage` field instead", + "type": "integer", + "deprecated": true, + "nullable": true + }, + "mirrorPercentage": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.Percent" + }, + "corsPolicy": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.CorsPolicy" + }, + "headers": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.Headers" + } + } + }, + "istio.networking.v1alpha3.TLSRoute": { + "description": "Describes match conditions and actions for routing unterminated TLS traffic (TLS/HTTPS) The following routing rule forwards unterminated TLS traffic arriving at port 443 of gateway called \"mygateway\" to internal services in the mesh based on the SNI value.", + "type": "object", + "properties": { + "route": { + "description": "The destination to which the connection should be forwarded to.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.RouteDestination" + } + }, + "match": { + "description": "Match conditions to be satisfied for the rule to be activated. All conditions inside a single match block have AND semantics, while the list of match blocks have OR semantics. The rule is matched if any one of the match blocks succeed.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.TLSMatchAttributes" + } + } + } + }, + "istio.networking.v1alpha3.TCPRoute": { + "description": "Describes match conditions and actions for routing TCP traffic. The following routing rule forwards traffic arriving at port 27017 for mongo.prod.svc.cluster.local to another Mongo server on port 5555.", + "type": "object", + "properties": { + "route": { + "description": "The destination to which the connection should be forwarded to.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.RouteDestination" + } + }, + "match": { + "description": "Match conditions to be satisfied for the rule to be activated. All conditions inside a single match block have AND semantics, while the list of match blocks have OR semantics. The rule is matched if any one of the match blocks succeed.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.L4MatchAttributes" + } + } + } + }, + "istio.networking.v1alpha3.HTTPMatchRequest": { + "description": "HttpMatchRequest specifies a set of criterion to be met in order for the rule to be applied to the HTTP request. For example, the following restricts the rule to match only requests where the URL path starts with /ratings/v2/ and the request contains a custom `end-user` header with value `jason`.", + "type": "object", + "properties": { + "name": { + "description": "The name assigned to a match. The match's name will be concatenated with the parent route's name and will be logged in the access logs for requests matching this route.", + "type": "string", + "format": "string" + }, + "method": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.StringMatch" + }, + "port": { + "description": "Specifies the ports on the host that is being addressed. Many services only expose a single port or label ports with the protocols they support, in these cases it is not required to explicitly select the port.", + "type": "integer" + }, + "gateways": { + "description": "Names of gateways where the rule should be applied. Gateway names in the top-level `gateways` field of the VirtualService (if any) are overridden. The gateway match is independent of sourceLabels.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "headers": { + "description": "The header keys must be lowercase and use hyphen as the separator, e.g. _x-request-id_.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.StringMatch" + } + }, + "uri": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.StringMatch" + }, + "scheme": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.StringMatch" + }, + "authority": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.StringMatch" + }, + "sourceLabels": { + "description": "One or more labels that constrain the applicability of a rule to workloads with the given labels. If the VirtualService has a list of gateways specified in the top-level `gateways` field, it must include the reserved gateway `mesh` for this field to be applicable.", + "type": "object", + "additionalProperties": { + "type": "string", + "format": "string" + } + }, + "queryParams": { + "description": "Query parameters for matching.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.StringMatch" + } + }, + "ignoreUriCase": { + "description": "Flag to specify whether the URI matching should be case-insensitive.", + "type": "boolean" + }, + "withoutHeaders": { + "description": "withoutHeader has the same syntax with the header, but has opposite meaning. If a header is matched with a matching rule among withoutHeader, the traffic becomes not matched one.", + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.StringMatch" + } + }, + "sourceNamespace": { + "description": "Source namespace constraining the applicability of a rule to workloads in that namespace. If the VirtualService has a list of gateways specified in the top-level `gateways` field, it must include the reserved gateway `mesh` for this field to be applicable.", + "type": "string", + "format": "string" + } + } + }, + "istio.networking.v1alpha3.HTTPRouteDestination": { + "description": "Each routing rule is associated with one or more service versions (see glossary in beginning of document). Weights associated with the version determine the proportion of traffic it receives. For example, the following rule will route 25% of traffic for the \"reviews\" service to instances with the \"v2\" tag and the remaining traffic (i.e., 75%) to \"v1\".", + "type": "object", + "properties": { + "headers": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.Headers" + }, + "destination": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.Destination" + }, + "weight": { + "description": "The proportion of traffic to be forwarded to the service version. (0-100). Sum of weights across destinations SHOULD BE == 100. If there is only one destination in a rule, the weight value is assumed to be 100.", + "type": "integer", + "format": "int32" + } + } + }, + "istio.networking.v1alpha3.HTTPRedirect": { + "description": "HTTPRedirect can be used to send a 301 redirect response to the caller, where the Authority/Host and the URI in the response can be swapped with the specified values. For example, the following rule redirects requests for /v1/getProductRatings API on the ratings service to /v1/bookRatings provided by the bookratings service.", + "type": "object", + "properties": { + "uri": { + "description": "On a redirect, overwrite the Path portion of the URL with this value. Note that the entire path will be replaced, irrespective of the request URI being matched as an exact path or prefix.", + "type": "string", + "format": "string" + }, + "authority": { + "description": "On a redirect, overwrite the Authority/Host portion of the URL with this value.", + "type": "string", + "format": "string" + }, + "redirectCode": { + "description": "On a redirect, Specifies the HTTP status code to use in the redirect response. The default response code is MOVED_PERMANENTLY (301).", + "type": "integer" + } + } + }, + "istio.networking.v1alpha3.Delegate": { + "description": "Describes the delegate VirtualService. The following routing rules forward the traffic to `/productpage` by a delegate VirtualService named `productpage`, forward the traffic to `/reviews` by a delegate VirtualService named `reviews`.", + "type": "object", + "properties": { + "name": { + "description": "Name specifies the name of the delegate VirtualService.", + "type": "string", + "format": "string" + }, + "namespace": { + "description": "Namespace specifies the namespace where the delegate VirtualService resides. By default, it is same to the root's.", + "type": "string", + "format": "string" + } + } + }, + "istio.networking.v1alpha3.HTTPRewrite": { + "description": "HTTPRewrite can be used to rewrite specific parts of a HTTP request before forwarding the request to the destination. Rewrite primitive can be used only with HTTPRouteDestination. The following example demonstrates how to rewrite the URL prefix for api call (/ratings) to ratings service before making the actual API call.", + "type": "object", + "properties": { + "uri": { + "description": "rewrite the path (or the prefix) portion of the URI with this value. If the original URI was matched based on prefix, the value provided in this field will replace the corresponding matched prefix.", + "type": "string", + "format": "string" + }, + "authority": { + "description": "rewrite the Authority/Host header with this value.", + "type": "string", + "format": "string" + } + } + }, + "istio.networking.v1alpha3.HTTPRetry": { + "description": "Describes the retry policy to use when a HTTP request fails. For example, the following rule sets the maximum number of retries to 3 when calling ratings:v1 service, with a 2s timeout per retry attempt.", + "type": "object", + "properties": { + "attempts": { + "description": "Number of retries for a given request. The interval between retries will be determined automatically (25ms+). Actual number of retries attempted depends on the request `timeout` of the [HTTP route](https://istio.io/docs/reference/config/networking/virtual-service/#HTTPRoute).", + "type": "integer", + "format": "int32" + }, + "perTryTimeout": { + "description": "Timeout per retry attempt for a given request. format: 1h/1m/1s/1ms. MUST BE \u003e=1ms.", + "type": "string" + }, + "retryOn": { + "description": "Specifies the conditions under which retry takes place. One or more policies can be specified using a ‘,’ delimited list. See the [retry policies](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/router_filter#x-envoy-retry-on) and [gRPC retry policies](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/router_filter#x-envoy-retry-grpc-on) for more details.", + "type": "string", + "format": "string" + }, + "retryRemoteLocalities": { + "description": "Flag to specify whether the retries should retry to other localities. See the [retry plugin configuration](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/http/http_connection_management#retry-plugin-configuration) for more details.", + "type": "boolean", + "nullable": true + } + } + }, + "istio.networking.v1alpha3.HTTPFaultInjection": { + "description": "HTTPFaultInjection can be used to specify one or more faults to inject while forwarding HTTP requests to the destination specified in a route. Fault specification is part of a VirtualService rule. Faults include aborting the Http request from downstream service, and/or delaying proxying of requests. A fault rule MUST HAVE delay or abort or both.", + "type": "object", + "properties": { + "delay": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.HTTPFaultInjection.Delay" + }, + "abort": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.HTTPFaultInjection.Abort" + } + } + }, + "istio.networking.v1alpha3.Percent": { + "description": "Percent specifies a percentage in the range of [0.0, 100.0].", + "type": "object", + "properties": { + "value": { + "type": "number", + "format": "double" + } + } + }, + "istio.networking.v1alpha3.CorsPolicy": { + "description": "Describes the Cross-Origin Resource Sharing (CORS) policy, for a given service. Refer to [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) for further details about cross origin resource sharing. For example, the following rule restricts cross origin requests to those originating from example.com domain using HTTP POST/GET, and sets the `Access-Control-Allow-Credentials` header to false. In addition, it only exposes `X-Foo-bar` header and sets an expiry period of 1 day.", + "type": "object", + "properties": { + "allowOrigin": { + "description": "The list of origins that are allowed to perform CORS requests. The content will be serialized into the Access-Control-Allow-Origin header. Wildcard * will allow all origins. $hide_from_docs", + "type": "array", + "items": { + "type": "string", + "format": "string" + }, + "deprecated": true + }, + "allowOrigins": { + "description": "String patterns that match allowed origins. An origin is allowed if any of the string matchers match. If a match is found, then the outgoing Access-Control-Allow-Origin would be set to the origin as provided by the client.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.StringMatch" + } + }, + "allowMethods": { + "description": "List of HTTP methods allowed to access the resource. The content will be serialized into the Access-Control-Allow-Methods header.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "allowHeaders": { + "description": "List of HTTP headers that can be used when requesting the resource. Serialized to Access-Control-Allow-Headers header.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "exposeHeaders": { + "description": "A white list of HTTP headers that the browsers are allowed to access. Serialized into Access-Control-Expose-Headers header.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "maxAge": { + "description": "Specifies how long the results of a preflight request can be cached. Translates to the `Access-Control-Max-Age` header.", + "type": "string" + }, + "allowCredentials": { + "description": "Indicates whether the caller is allowed to send the actual request (not the preflight) using credentials. Translates to `Access-Control-Allow-Credentials` header.", + "type": "boolean", + "nullable": true + } + } + }, + "istio.networking.v1alpha3.Headers": { + "type": "object", + "properties": { + "response": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.Headers.HeaderOperations" + }, + "request": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.Headers.HeaderOperations" + } + } + }, + "istio.networking.v1alpha3.Headers.HeaderOperations": { + "description": "HeaderOperations Describes the header manipulations to apply", + "type": "object", + "properties": { + "set": { + "description": "Overwrite the headers specified by key with the given values", + "type": "object", + "additionalProperties": { + "type": "string", + "format": "string" + } + }, + "add": { + "description": "Append the given values to the headers specified by keys (will create a comma-separated list of values)", + "type": "object", + "additionalProperties": { + "type": "string", + "format": "string" + } + }, + "remove": { + "description": "Remove a the specified headers", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + } + } + }, + "istio.networking.v1alpha3.TLSMatchAttributes": { + "description": "TLS connection match attributes.", + "type": "object", + "properties": { + "port": { + "description": "Specifies the port on the host that is being addressed. Many services only expose a single port or label ports with the protocols they support, in these cases it is not required to explicitly select the port.", + "type": "integer" + }, + "gateways": { + "description": "Names of gateways where the rule should be applied. Gateway names in the top-level `gateways` field of the VirtualService (if any) are overridden. The gateway match is independent of sourceLabels.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "sourceLabels": { + "description": "One or more labels that constrain the applicability of a rule to workloads with the given labels. If the VirtualService has a list of gateways specified in the top-level `gateways` field, it should include the reserved gateway `mesh` in order for this field to be applicable.", + "type": "object", + "additionalProperties": { + "type": "string", + "format": "string" + } + }, + "sourceNamespace": { + "description": "Source namespace constraining the applicability of a rule to workloads in that namespace. If the VirtualService has a list of gateways specified in the top-level `gateways` field, it must include the reserved gateway `mesh` for this field to be applicable.", + "type": "string", + "format": "string" + }, + "destinationSubnets": { + "description": "IPv4 or IPv6 ip addresses of destination with optional subnet. E.g., a.b.c.d/xx form or just a.b.c.d.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "sniHosts": { + "description": "SNI (server name indicator) to match on. Wildcard prefixes can be used in the SNI value, e.g., *.com will match foo.example.com as well as example.com. An SNI value must be a subset (i.e., fall within the domain) of the corresponding virtual serivce's hosts.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + } + } + }, + "istio.networking.v1alpha3.RouteDestination": { + "description": "L4 routing rule weighted destination.", + "type": "object", + "properties": { + "destination": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.Destination" + }, + "weight": { + "description": "The proportion of traffic to be forwarded to the service version. If there is only one destination in a rule, all traffic will be routed to it irrespective of the weight.", + "type": "integer", + "format": "int32" + } + } + }, + "istio.networking.v1alpha3.L4MatchAttributes": { + "description": "L4 connection match attributes. Note that L4 connection matching support is incomplete.", + "type": "object", + "properties": { + "port": { + "description": "Specifies the port on the host that is being addressed. Many services only expose a single port or label ports with the protocols they support, in these cases it is not required to explicitly select the port.", + "type": "integer" + }, + "gateways": { + "description": "Names of gateways where the rule should be applied. Gateway names in the top-level `gateways` field of the VirtualService (if any) are overridden. The gateway match is independent of sourceLabels.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "sourceLabels": { + "description": "One or more labels that constrain the applicability of a rule to workloads with the given labels. If the VirtualService has a list of gateways specified in the top-level `gateways` field, it should include the reserved gateway `mesh` in order for this field to be applicable.", + "type": "object", + "additionalProperties": { + "type": "string", + "format": "string" + } + }, + "sourceNamespace": { + "description": "Source namespace constraining the applicability of a rule to workloads in that namespace. If the VirtualService has a list of gateways specified in the top-level `gateways` field, it must include the reserved gateway `mesh` for this field to be applicable.", + "type": "string", + "format": "string" + }, + "destinationSubnets": { + "description": "IPv4 or IPv6 ip addresses of destination with optional subnet. E.g., a.b.c.d/xx form or just a.b.c.d.", + "type": "array", + "items": { + "type": "string", + "format": "string" + } + }, + "sourceSubnet": { + "description": "IPv4 or IPv6 ip address of source with optional subnet. E.g., a.b.c.d/xx form or just a.b.c.d $hide_from_docs", + "type": "string", + "format": "string" + } + } + }, + "istio.networking.v1alpha3.StringMatch": { + "description": "Describes how to match a given string in HTTP headers. Match is case-sensitive.", + "type": "object", + "oneOf": [ + { + "not": { + "anyOf": [ + { + "required": [ + "exact" + ], + "properties": { + "exact": { + "description": "exact string match", + "type": "string", + "format": "string" + } + } + }, + { + "required": [ + "prefix" + ], + "properties": { + "prefix": { + "description": "prefix-based match", + "type": "string", + "format": "string" + } + } + }, + { + "required": [ + "regex" + ], + "properties": { + "regex": { + "description": "RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).", + "type": "string", + "format": "string" + } + } + } + ] + } + }, + { + "required": [ + "exact" + ], + "properties": { + "exact": { + "description": "exact string match", + "type": "string", + "format": "string" + } + } + }, + { + "required": [ + "prefix" + ], + "properties": { + "prefix": { + "description": "prefix-based match", + "type": "string", + "format": "string" + } + } + }, + { + "required": [ + "regex" + ], + "properties": { + "regex": { + "description": "RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).", + "type": "string", + "format": "string" + } + } + } + ] + }, + "istio.networking.v1alpha3.HTTPFaultInjection.Delay": { + "description": "Delay specification is used to inject latency into the request forwarding path. The following example will introduce a 5 second delay in 1 out of every 1000 requests to the \"v1\" version of the \"reviews\" service from all pods with label env: prod", + "type": "object", + "properties": { + "percent": { + "description": "Percentage of requests on which the delay will be injected (0-100). Use of integer `percent` value is deprecated. Use the double `percentage` field instead.", + "type": "integer", + "format": "int32", + "deprecated": true + }, + "percentage": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.Percent" + } + }, + "oneOf": [ + { + "not": { + "anyOf": [ + { + "required": [ + "fixedDelay" + ], + "properties": { + "fixedDelay": { + "description": "Add a fixed delay before forwarding the request. Format: 1h/1m/1s/1ms. MUST be \u003e=1ms.", + "type": "string" + } + } + }, + { + "required": [ + "exponentialDelay" + ], + "properties": { + "exponentialDelay": { + "type": "string" + } + } + } + ] + } + }, + { + "required": [ + "fixedDelay" + ], + "properties": { + "fixedDelay": { + "description": "Add a fixed delay before forwarding the request. Format: 1h/1m/1s/1ms. MUST be \u003e=1ms.", + "type": "string" + } + } + }, + { + "required": [ + "exponentialDelay" + ], + "properties": { + "exponentialDelay": { + "type": "string" + } + } + } + ] + }, + "istio.networking.v1alpha3.HTTPFaultInjection.Abort": { + "description": "Abort specification is used to prematurely abort a request with a pre-specified error code. The following example will return an HTTP 400 error code for 1 out of every 1000 requests to the \"ratings\" service \"v1\".", + "type": "object", + "properties": { + "percentage": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.Percent" + } + }, + "oneOf": [ + { + "not": { + "anyOf": [ + { + "required": [ + "httpStatus" + ], + "properties": { + "httpStatus": { + "description": "HTTP status code to use to abort the Http request.", + "type": "integer", + "format": "int32" + } + } + }, + { + "required": [ + "grpcStatus" + ], + "properties": { + "grpcStatus": { + "type": "string", + "format": "string" + } + } + }, + { + "required": [ + "http2Error" + ], + "properties": { + "http2Error": { + "type": "string", + "format": "string" + } + } + } + ] + } + }, + { + "required": [ + "httpStatus" + ], + "properties": { + "httpStatus": { + "description": "HTTP status code to use to abort the Http request.", + "type": "integer", + "format": "int32" + } + } + }, + { + "required": [ + "grpcStatus" + ], + "properties": { + "grpcStatus": { + "type": "string", + "format": "string" + } + } + }, + { + "required": [ + "http2Error" + ], + "properties": { + "http2Error": { + "type": "string", + "format": "string" + } + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/vendor/istio.io/api/networking/v1alpha3/virtual_service.pb.go b/vendor/istio.io/api/networking/v1alpha3/virtual_service.pb.go new file mode 100644 index 0000000000..6b342a1e68 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/virtual_service.pb.go @@ -0,0 +1,11118 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/virtual_service.proto + +// Configuration affecting traffic routing. Here are a few terms useful to define +// in the context of traffic routing. +// +// `Service` a unit of application behavior bound to a unique name in a +// service registry. Services consist of multiple network *endpoints* +// implemented by workload instances running on pods, containers, VMs etc. +// +// `Service versions (a.k.a. subsets)` - In a continuous deployment +// scenario, for a given service, there can be distinct subsets of +// instances running different variants of the application binary. These +// variants are not necessarily different API versions. They could be +// iterative changes to the same service, deployed in different +// environments (prod, staging, dev, etc.). Common scenarios where this +// occurs include A/B testing, canary rollouts, etc. The choice of a +// particular version can be decided based on various criterion (headers, +// url, etc.) and/or by weights assigned to each version. Each service has +// a default version consisting of all its instances. +// +// `Source` - A downstream client calling a service. +// +// `Host` - The address used by a client when attempting to connect to a +// service. +// +// `Access model` - Applications address only the destination service +// (Host) without knowledge of individual service versions (subsets). The +// actual choice of the version is determined by the proxy/sidecar, enabling the +// application code to decouple itself from the evolution of dependent +// services. +// +// A `VirtualService` defines a set of traffic routing rules to apply when a host is +// addressed. Each routing rule defines matching criteria for traffic of a specific +// protocol. If the traffic is matched, then it is sent to a named destination service +// (or subset/version of it) defined in the registry. +// +// The source of traffic can also be matched in a routing rule. This allows routing +// to be customized for specific client contexts. +// +// The following example on Kubernetes, routes all HTTP traffic by default to +// pods of the reviews service with label "version: v1". In addition, +// HTTP requests with path starting with /wpcatalog/ or /consumercatalog/ will +// be rewritten to /newcatalog and sent to pods with label "version: v2". +// +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: reviews-route +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// http: +// - name: "reviews-v2-routes" +// match: +// - uri: +// prefix: "/wpcatalog" +// - uri: +// prefix: "/consumercatalog" +// rewrite: +// uri: "/newcatalog" +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v2 +// - name: "reviews-v1-route" +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v1 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: reviews-route +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// http: +// - name: "reviews-v2-routes" +// match: +// - uri: +// prefix: "/wpcatalog" +// - uri: +// prefix: "/consumercatalog" +// rewrite: +// uri: "/newcatalog" +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v2 +// - name: "reviews-v1-route" +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v1 +// ``` +// {{}} +// {{}} +// +// A subset/version of a route destination is identified with a reference +// to a named service subset which must be declared in a corresponding +// `DestinationRule`. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: reviews-destination +// spec: +// host: reviews.prod.svc.cluster.local +// subsets: +// - name: v1 +// labels: +// version: v1 +// - name: v2 +// labels: +// version: v2 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: reviews-destination +// spec: +// host: reviews.prod.svc.cluster.local +// subsets: +// - name: v1 +// labels: +// version: v1 +// - name: v2 +// labels: +// version: v2 +// ``` +// {{}} +// {{}} +// + +package v1alpha3 + +import ( + encoding_binary "encoding/binary" + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + types "github.com/gogo/protobuf/types" + io "io" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Configuration affecting traffic routing. +// +// +// +// +type VirtualService struct { + // The destination hosts to which traffic is being sent. Could + // be a DNS name with wildcard prefix or an IP address. Depending on the + // platform, short-names can also be used instead of a FQDN (i.e. has no + // dots in the name). In such a scenario, the FQDN of the host would be + // derived based on the underlying platform. + // + // A single VirtualService can be used to describe all the traffic + // properties of the corresponding hosts, including those for multiple + // HTTP and TCP ports. Alternatively, the traffic properties of a host + // can be defined using more than one VirtualService, with certain + // caveats. Refer to the + // [Operations Guide](https://istio.io/docs/ops/best-practices/traffic-management/#split-virtual-services) + // for details. + // + // *Note for Kubernetes users*: When short names are used (e.g. "reviews" + // instead of "reviews.default.svc.cluster.local"), Istio will interpret + // the short name based on the namespace of the rule, not the service. A + // rule in the "default" namespace containing a host "reviews" will be + // interpreted as "reviews.default.svc.cluster.local", irrespective of + // the actual namespace associated with the reviews service. _To avoid + // potential misconfigurations, it is recommended to always use fully + // qualified domain names over short names._ + // + // The hosts field applies to both HTTP and TCP services. Service inside + // the mesh, i.e., those found in the service registry, must always be + // referred to using their alphanumeric names. IP addresses are allowed + // only for services defined via the Gateway. + // + // *Note*: It must be empty for a delegate VirtualService. + Hosts []string `protobuf:"bytes,1,rep,name=hosts,proto3" json:"hosts,omitempty"` + // The names of gateways and sidecars that should apply these routes. + // Gateways in other namespaces may be referred to by + // `/`; specifying a gateway with no + // namespace qualifier is the same as specifying the VirtualService's + // namespace. A single VirtualService is used for sidecars inside the mesh as + // well as for one or more gateways. The selection condition imposed by this + // field can be overridden using the source field in the match conditions + // of protocol-specific routes. The reserved word `mesh` is used to imply + // all the sidecars in the mesh. When this field is omitted, the default + // gateway (`mesh`) will be used, which would apply the rule to all + // sidecars in the mesh. If a list of gateway names is provided, the + // rules will apply only to the gateways. To apply the rules to both + // gateways and sidecars, specify `mesh` as one of the gateway names. + Gateways []string `protobuf:"bytes,2,rep,name=gateways,proto3" json:"gateways,omitempty"` + // An ordered list of route rules for HTTP traffic. HTTP routes will be + // applied to platform service ports named 'http-*'/'http2-*'/'grpc-*', gateway + // ports with protocol HTTP/HTTP2/GRPC/ TLS-terminated-HTTPS and service + // entry ports using HTTP/HTTP2/GRPC protocols. The first rule matching + // an incoming request is used. + Http []*HTTPRoute `protobuf:"bytes,3,rep,name=http,proto3" json:"http,omitempty"` + // An ordered list of route rule for non-terminated TLS & HTTPS + // traffic. Routing is typically performed using the SNI value presented + // by the ClientHello message. TLS routes will be applied to platform + // service ports named 'https-*', 'tls-*', unterminated gateway ports using + // HTTPS/TLS protocols (i.e. with "passthrough" TLS mode) and service + // entry ports using HTTPS/TLS protocols. The first rule matching an + // incoming request is used. NOTE: Traffic 'https-*' or 'tls-*' ports + // without associated virtual service will be treated as opaque TCP + // traffic. + Tls []*TLSRoute `protobuf:"bytes,5,rep,name=tls,proto3" json:"tls,omitempty"` + // An ordered list of route rules for opaque TCP traffic. TCP routes will + // be applied to any port that is not a HTTP or TLS port. The first rule + // matching an incoming request is used. + Tcp []*TCPRoute `protobuf:"bytes,4,rep,name=tcp,proto3" json:"tcp,omitempty"` + // A list of namespaces to which this virtual service is exported. Exporting a + // virtual service allows it to be used by sidecars and gateways defined in + // other namespaces. This feature provides a mechanism for service owners + // and mesh administrators to control the visibility of virtual services + // across namespace boundaries. + // + // If no namespaces are specified then the virtual service is exported to all + // namespaces by default. + // + // The value "." is reserved and defines an export to the same namespace that + // the virtual service is declared in. Similarly the value "*" is reserved and + // defines an export to all namespaces. + // + // NOTE: in the current release, the `exportTo` value is restricted to + // "." or "*" (i.e., the current namespace or all namespaces). + ExportTo []string `protobuf:"bytes,6,rep,name=export_to,json=exportTo,proto3" json:"export_to,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *VirtualService) Reset() { *m = VirtualService{} } +func (m *VirtualService) String() string { return proto.CompactTextString(m) } +func (*VirtualService) ProtoMessage() {} +func (*VirtualService) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{0} +} +func (m *VirtualService) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *VirtualService) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_VirtualService.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *VirtualService) XXX_Merge(src proto.Message) { + xxx_messageInfo_VirtualService.Merge(m, src) +} +func (m *VirtualService) XXX_Size() int { + return m.Size() +} +func (m *VirtualService) XXX_DiscardUnknown() { + xxx_messageInfo_VirtualService.DiscardUnknown(m) +} + +var xxx_messageInfo_VirtualService proto.InternalMessageInfo + +func (m *VirtualService) GetHosts() []string { + if m != nil { + return m.Hosts + } + return nil +} + +func (m *VirtualService) GetGateways() []string { + if m != nil { + return m.Gateways + } + return nil +} + +func (m *VirtualService) GetHttp() []*HTTPRoute { + if m != nil { + return m.Http + } + return nil +} + +func (m *VirtualService) GetTls() []*TLSRoute { + if m != nil { + return m.Tls + } + return nil +} + +func (m *VirtualService) GetTcp() []*TCPRoute { + if m != nil { + return m.Tcp + } + return nil +} + +func (m *VirtualService) GetExportTo() []string { + if m != nil { + return m.ExportTo + } + return nil +} + +// Destination indicates the network addressable service to which the +// request/connection will be sent after processing a routing rule. The +// destination.host should unambiguously refer to a service in the service +// registry. Istio's service registry is composed of all the services found +// in the platform's service registry (e.g., Kubernetes services, Consul +// services), as well as services declared through the +// [ServiceEntry](https://istio.io/docs/reference/config/networking/service-entry/#ServiceEntry) resource. +// +// *Note for Kubernetes users*: When short names are used (e.g. "reviews" +// instead of "reviews.default.svc.cluster.local"), Istio will interpret +// the short name based on the namespace of the rule, not the service. A +// rule in the "default" namespace containing a host "reviews will be +// interpreted as "reviews.default.svc.cluster.local", irrespective of the +// actual namespace associated with the reviews service. _To avoid potential +// misconfigurations, it is recommended to always use fully qualified +// domain names over short names._ +// +// The following Kubernetes example routes all traffic by default to pods +// of the reviews service with label "version: v1" (i.e., subset v1), and +// some to subset v2, in a Kubernetes environment. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: reviews-route +// namespace: foo +// spec: +// hosts: +// - reviews # interpreted as reviews.foo.svc.cluster.local +// http: +// - match: +// - uri: +// prefix: "/wpcatalog" +// - uri: +// prefix: "/consumercatalog" +// rewrite: +// uri: "/newcatalog" +// route: +// - destination: +// host: reviews # interpreted as reviews.foo.svc.cluster.local +// subset: v2 +// - route: +// - destination: +// host: reviews # interpreted as reviews.foo.svc.cluster.local +// subset: v1 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: reviews-route +// namespace: foo +// spec: +// hosts: +// - reviews # interpreted as reviews.foo.svc.cluster.local +// http: +// - match: +// - uri: +// prefix: "/wpcatalog" +// - uri: +// prefix: "/consumercatalog" +// rewrite: +// uri: "/newcatalog" +// route: +// - destination: +// host: reviews # interpreted as reviews.foo.svc.cluster.local +// subset: v2 +// - route: +// - destination: +// host: reviews # interpreted as reviews.foo.svc.cluster.local +// subset: v1 +// ``` +// {{}} +// {{}} +// +// And the associated DestinationRule +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: reviews-destination +// namespace: foo +// spec: +// host: reviews # interpreted as reviews.foo.svc.cluster.local +// subsets: +// - name: v1 +// labels: +// version: v1 +// - name: v2 +// labels: +// version: v2 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: reviews-destination +// namespace: foo +// spec: +// host: reviews # interpreted as reviews.foo.svc.cluster.local +// subsets: +// - name: v1 +// labels: +// version: v1 +// - name: v2 +// labels: +// version: v2 +// ``` +// {{}} +// {{}} +// +// The following VirtualService sets a timeout of 5s for all calls to +// productpage.prod.svc.cluster.local service in Kubernetes. Notice that +// there are no subsets defined in this rule. Istio will fetch all +// instances of productpage.prod.svc.cluster.local service from the service +// registry and populate the sidecar's load balancing pool. Also, notice +// that this rule is set in the istio-system namespace but uses the fully +// qualified domain name of the productpage service, +// productpage.prod.svc.cluster.local. Therefore the rule's namespace does +// not have an impact in resolving the name of the productpage service. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: my-productpage-rule +// namespace: istio-system +// spec: +// hosts: +// - productpage.prod.svc.cluster.local # ignores rule namespace +// http: +// - timeout: 5s +// route: +// - destination: +// host: productpage.prod.svc.cluster.local +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: my-productpage-rule +// namespace: istio-system +// spec: +// hosts: +// - productpage.prod.svc.cluster.local # ignores rule namespace +// http: +// - timeout: 5s +// route: +// - destination: +// host: productpage.prod.svc.cluster.local +// ``` +// {{}} +// {{}} +// +// To control routing for traffic bound to services outside the mesh, external +// services must first be added to Istio's internal service registry using the +// ServiceEntry resource. VirtualServices can then be defined to control traffic +// bound to these external services. For example, the following rules define a +// Service for wikipedia.org and set a timeout of 5s for HTTP requests. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-wikipedia +// spec: +// hosts: +// - wikipedia.org +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: example-http +// protocol: HTTP +// resolution: DNS +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: my-wiki-rule +// spec: +// hosts: +// - wikipedia.org +// http: +// - timeout: 5s +// route: +// - destination: +// host: wikipedia.org +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-wikipedia +// spec: +// hosts: +// - wikipedia.org +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: example-http +// protocol: HTTP +// resolution: DNS +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: my-wiki-rule +// spec: +// hosts: +// - wikipedia.org +// http: +// - timeout: 5s +// route: +// - destination: +// host: wikipedia.org +// ``` +// {{}} +// {{}} +// +type Destination struct { + // The name of a service from the service registry. Service + // names are looked up from the platform's service registry (e.g., + // Kubernetes services, Consul services, etc.) and from the hosts + // declared by [ServiceEntry](https://istio.io/docs/reference/config/networking/service-entry/#ServiceEntry). Traffic forwarded to + // destinations that are not found in either of the two, will be dropped. + // + // *Note for Kubernetes users*: When short names are used (e.g. "reviews" + // instead of "reviews.default.svc.cluster.local"), Istio will interpret + // the short name based on the namespace of the rule, not the service. A + // rule in the "default" namespace containing a host "reviews will be + // interpreted as "reviews.default.svc.cluster.local", irrespective of + // the actual namespace associated with the reviews service. To avoid + // potential misconfiguration, it is recommended to always use fully + // qualified domain names over short names. + Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` + // The name of a subset within the service. Applicable only to services + // within the mesh. The subset must be defined in a corresponding + // DestinationRule. + Subset string `protobuf:"bytes,2,opt,name=subset,proto3" json:"subset,omitempty"` + // Specifies the port on the host that is being addressed. If a service + // exposes only a single port it is not required to explicitly select the + // port. + Port *PortSelector `protobuf:"bytes,3,opt,name=port,proto3" json:"port,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Destination) Reset() { *m = Destination{} } +func (m *Destination) String() string { return proto.CompactTextString(m) } +func (*Destination) ProtoMessage() {} +func (*Destination) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{1} +} +func (m *Destination) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Destination) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Destination.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Destination) XXX_Merge(src proto.Message) { + xxx_messageInfo_Destination.Merge(m, src) +} +func (m *Destination) XXX_Size() int { + return m.Size() +} +func (m *Destination) XXX_DiscardUnknown() { + xxx_messageInfo_Destination.DiscardUnknown(m) +} + +var xxx_messageInfo_Destination proto.InternalMessageInfo + +func (m *Destination) GetHost() string { + if m != nil { + return m.Host + } + return "" +} + +func (m *Destination) GetSubset() string { + if m != nil { + return m.Subset + } + return "" +} + +func (m *Destination) GetPort() *PortSelector { + if m != nil { + return m.Port + } + return nil +} + +// Describes match conditions and actions for routing HTTP/1.1, HTTP2, and +// gRPC traffic. See VirtualService for usage examples. +type HTTPRoute struct { + // The name assigned to the route for debugging purposes. The + // route's name will be concatenated with the match's name and will + // be logged in the access logs for requests matching this + // route/match. + Name string `protobuf:"bytes,17,opt,name=name,proto3" json:"name,omitempty"` + // Match conditions to be satisfied for the rule to be + // activated. All conditions inside a single match block have AND + // semantics, while the list of match blocks have OR semantics. The rule + // is matched if any one of the match blocks succeed. + Match []*HTTPMatchRequest `protobuf:"bytes,1,rep,name=match,proto3" json:"match,omitempty"` + // A HTTP rule can either redirect or forward (default) traffic. The + // forwarding target can be one of several versions of a service (see + // glossary in beginning of document). Weights associated with the + // service version determine the proportion of traffic it receives. + Route []*HTTPRouteDestination `protobuf:"bytes,2,rep,name=route,proto3" json:"route,omitempty"` + // A HTTP rule can either redirect or forward (default) traffic. If + // traffic passthrough option is specified in the rule, + // route/redirect will be ignored. The redirect primitive can be used to + // send a HTTP 301 redirect to a different URI or Authority. + Redirect *HTTPRedirect `protobuf:"bytes,3,opt,name=redirect,proto3" json:"redirect,omitempty"` + // Delegate is used to specify the particular VirtualService which + // can be used to define delegate HTTPRoute. + // It can be set only when `Route` and `Redirect` are empty, and the route rules of the + // delegate VirtualService will be merged with that in the current one. + // **NOTE**: + // 1. Only one level delegation is supported. + // 2. The delegate's HTTPMatchRequest must be a strict subset of the root's, + // otherwise there is a conflict and the HTTPRoute will not take effect. + Delegate *Delegate `protobuf:"bytes,20,opt,name=delegate,proto3" json:"delegate,omitempty"` + // Rewrite HTTP URIs and Authority headers. Rewrite cannot be used with + // Redirect primitive. Rewrite will be performed before forwarding. + Rewrite *HTTPRewrite `protobuf:"bytes,4,opt,name=rewrite,proto3" json:"rewrite,omitempty"` + // Timeout for HTTP requests. + Timeout *types.Duration `protobuf:"bytes,6,opt,name=timeout,proto3" json:"timeout,omitempty"` + // Retry policy for HTTP requests. + Retries *HTTPRetry `protobuf:"bytes,7,opt,name=retries,proto3" json:"retries,omitempty"` + // Fault injection policy to apply on HTTP traffic at the client side. + // Note that timeouts or retries will not be enabled when faults are + // enabled on the client side. + Fault *HTTPFaultInjection `protobuf:"bytes,8,opt,name=fault,proto3" json:"fault,omitempty"` + // Mirror HTTP traffic to a another destination in addition to forwarding + // the requests to the intended destination. Mirrored traffic is on a + // best effort basis where the sidecar/gateway will not wait for the + // mirrored cluster to respond before returning the response from the + // original destination. Statistics will be generated for the mirrored + // destination. + Mirror *Destination `protobuf:"bytes,9,opt,name=mirror,proto3" json:"mirror,omitempty"` + // Percentage of the traffic to be mirrored by the `mirror` field. + // Use of integer `mirror_percent` value is deprecated. Use the + // double `mirror_percentage` field instead + MirrorPercent *types.UInt32Value `protobuf:"bytes,18,opt,name=mirror_percent,json=mirrorPercent,proto3" json:"mirror_percent,omitempty"` // Deprecated: Do not use. + // Percentage of the traffic to be mirrored by the `mirror` field. + // If this field is absent, all the traffic (100%) will be mirrored. + // Max value is 100. + MirrorPercentage *Percent `protobuf:"bytes,19,opt,name=mirror_percentage,json=mirrorPercentage,proto3" json:"mirror_percentage,omitempty"` + // Cross-Origin Resource Sharing policy (CORS). Refer to + // [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) + // for further details about cross origin resource sharing. + CorsPolicy *CorsPolicy `protobuf:"bytes,10,opt,name=cors_policy,json=corsPolicy,proto3" json:"cors_policy,omitempty"` + // Header manipulation rules + Headers *Headers `protobuf:"bytes,16,opt,name=headers,proto3" json:"headers,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HTTPRoute) Reset() { *m = HTTPRoute{} } +func (m *HTTPRoute) String() string { return proto.CompactTextString(m) } +func (*HTTPRoute) ProtoMessage() {} +func (*HTTPRoute) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{2} +} +func (m *HTTPRoute) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HTTPRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HTTPRoute.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HTTPRoute) XXX_Merge(src proto.Message) { + xxx_messageInfo_HTTPRoute.Merge(m, src) +} +func (m *HTTPRoute) XXX_Size() int { + return m.Size() +} +func (m *HTTPRoute) XXX_DiscardUnknown() { + xxx_messageInfo_HTTPRoute.DiscardUnknown(m) +} + +var xxx_messageInfo_HTTPRoute proto.InternalMessageInfo + +func (m *HTTPRoute) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *HTTPRoute) GetMatch() []*HTTPMatchRequest { + if m != nil { + return m.Match + } + return nil +} + +func (m *HTTPRoute) GetRoute() []*HTTPRouteDestination { + if m != nil { + return m.Route + } + return nil +} + +func (m *HTTPRoute) GetRedirect() *HTTPRedirect { + if m != nil { + return m.Redirect + } + return nil +} + +func (m *HTTPRoute) GetDelegate() *Delegate { + if m != nil { + return m.Delegate + } + return nil +} + +func (m *HTTPRoute) GetRewrite() *HTTPRewrite { + if m != nil { + return m.Rewrite + } + return nil +} + +func (m *HTTPRoute) GetTimeout() *types.Duration { + if m != nil { + return m.Timeout + } + return nil +} + +func (m *HTTPRoute) GetRetries() *HTTPRetry { + if m != nil { + return m.Retries + } + return nil +} + +func (m *HTTPRoute) GetFault() *HTTPFaultInjection { + if m != nil { + return m.Fault + } + return nil +} + +func (m *HTTPRoute) GetMirror() *Destination { + if m != nil { + return m.Mirror + } + return nil +} + +// Deprecated: Do not use. +func (m *HTTPRoute) GetMirrorPercent() *types.UInt32Value { + if m != nil { + return m.MirrorPercent + } + return nil +} + +func (m *HTTPRoute) GetMirrorPercentage() *Percent { + if m != nil { + return m.MirrorPercentage + } + return nil +} + +func (m *HTTPRoute) GetCorsPolicy() *CorsPolicy { + if m != nil { + return m.CorsPolicy + } + return nil +} + +func (m *HTTPRoute) GetHeaders() *Headers { + if m != nil { + return m.Headers + } + return nil +} + +// Describes the delegate VirtualService. +// The following routing rules forward the traffic to `/productpage` by a delegate VirtualService named `productpage`, +// forward the traffic to `/reviews` by a delegate VirtualService named `reviews`. +// +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo +// spec: +// hosts: +// - "bookinfo.com" +// gateways: +// - mygateway +// http: +// - match: +// - uri: +// prefix: "/productpage" +// delegate: +// name: productpage +// namespace: nsA +// - match: +// - uri: +// prefix: "/reviews" +// delegate: +// name: reviews +// namespace: nsB +// ``` +// +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: productpage +// namespace: nsA +// spec: +// http: +// - match: +// - uri: +// prefix: "/productpage/v1/" +// route: +// - destination: +// host: productpage-v1.nsA.svc.cluster.local +// - route: +// - destination: +// host: productpage.nsA.svc.cluster.local +// ``` +// +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: reviews +// namespace: nsB +// spec: +// http: +// - route: +// - destination: +// host: reviews.nsB.svc.cluster.local +// ``` +type Delegate struct { + // Name specifies the name of the delegate VirtualService. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Namespace specifies the namespace where the delegate VirtualService resides. + // By default, it is same to the root's. + Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Delegate) Reset() { *m = Delegate{} } +func (m *Delegate) String() string { return proto.CompactTextString(m) } +func (*Delegate) ProtoMessage() {} +func (*Delegate) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{3} +} +func (m *Delegate) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Delegate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Delegate.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Delegate) XXX_Merge(src proto.Message) { + xxx_messageInfo_Delegate.Merge(m, src) +} +func (m *Delegate) XXX_Size() int { + return m.Size() +} +func (m *Delegate) XXX_DiscardUnknown() { + xxx_messageInfo_Delegate.DiscardUnknown(m) +} + +var xxx_messageInfo_Delegate proto.InternalMessageInfo + +func (m *Delegate) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *Delegate) GetNamespace() string { + if m != nil { + return m.Namespace + } + return "" +} + +type Headers struct { + // Header manipulation rules to apply before forwarding a request + // to the destination service + Request *Headers_HeaderOperations `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"` + // Header manipulation rules to apply before returning a response + // to the caller + Response *Headers_HeaderOperations `protobuf:"bytes,2,opt,name=response,proto3" json:"response,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Headers) Reset() { *m = Headers{} } +func (m *Headers) String() string { return proto.CompactTextString(m) } +func (*Headers) ProtoMessage() {} +func (*Headers) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{4} +} +func (m *Headers) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Headers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Headers.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Headers) XXX_Merge(src proto.Message) { + xxx_messageInfo_Headers.Merge(m, src) +} +func (m *Headers) XXX_Size() int { + return m.Size() +} +func (m *Headers) XXX_DiscardUnknown() { + xxx_messageInfo_Headers.DiscardUnknown(m) +} + +var xxx_messageInfo_Headers proto.InternalMessageInfo + +func (m *Headers) GetRequest() *Headers_HeaderOperations { + if m != nil { + return m.Request + } + return nil +} + +func (m *Headers) GetResponse() *Headers_HeaderOperations { + if m != nil { + return m.Response + } + return nil +} + +// HeaderOperations Describes the header manipulations to apply +type Headers_HeaderOperations struct { + // Overwrite the headers specified by key with the given values + Set map[string]string `protobuf:"bytes,1,rep,name=set,proto3" json:"set,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Append the given values to the headers specified by keys + // (will create a comma-separated list of values) + Add map[string]string `protobuf:"bytes,2,rep,name=add,proto3" json:"add,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Remove a the specified headers + Remove []string `protobuf:"bytes,3,rep,name=remove,proto3" json:"remove,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Headers_HeaderOperations) Reset() { *m = Headers_HeaderOperations{} } +func (m *Headers_HeaderOperations) String() string { return proto.CompactTextString(m) } +func (*Headers_HeaderOperations) ProtoMessage() {} +func (*Headers_HeaderOperations) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{4, 0} +} +func (m *Headers_HeaderOperations) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Headers_HeaderOperations) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Headers_HeaderOperations.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Headers_HeaderOperations) XXX_Merge(src proto.Message) { + xxx_messageInfo_Headers_HeaderOperations.Merge(m, src) +} +func (m *Headers_HeaderOperations) XXX_Size() int { + return m.Size() +} +func (m *Headers_HeaderOperations) XXX_DiscardUnknown() { + xxx_messageInfo_Headers_HeaderOperations.DiscardUnknown(m) +} + +var xxx_messageInfo_Headers_HeaderOperations proto.InternalMessageInfo + +func (m *Headers_HeaderOperations) GetSet() map[string]string { + if m != nil { + return m.Set + } + return nil +} + +func (m *Headers_HeaderOperations) GetAdd() map[string]string { + if m != nil { + return m.Add + } + return nil +} + +func (m *Headers_HeaderOperations) GetRemove() []string { + if m != nil { + return m.Remove + } + return nil +} + +// Describes match conditions and actions for routing unterminated TLS +// traffic (TLS/HTTPS) The following routing rule forwards unterminated TLS +// traffic arriving at port 443 of gateway called "mygateway" to internal +// services in the mesh based on the SNI value. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo-sni +// spec: +// hosts: +// - "*.bookinfo.com" +// gateways: +// - mygateway +// tls: +// - match: +// - port: 443 +// sniHosts: +// - login.bookinfo.com +// route: +// - destination: +// host: login.prod.svc.cluster.local +// - match: +// - port: 443 +// sniHosts: +// - reviews.bookinfo.com +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: bookinfo-sni +// spec: +// hosts: +// - "*.bookinfo.com" +// gateways: +// - mygateway +// tls: +// - match: +// - port: 443 +// sniHosts: +// - login.bookinfo.com +// route: +// - destination: +// host: login.prod.svc.cluster.local +// - match: +// - port: 443 +// sniHosts: +// - reviews.bookinfo.com +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// ``` +// {{}} +// {{}} +type TLSRoute struct { + // Match conditions to be satisfied for the rule to be + // activated. All conditions inside a single match block have AND + // semantics, while the list of match blocks have OR semantics. The rule + // is matched if any one of the match blocks succeed. + Match []*TLSMatchAttributes `protobuf:"bytes,1,rep,name=match,proto3" json:"match,omitempty"` + // The destination to which the connection should be forwarded to. + Route []*RouteDestination `protobuf:"bytes,2,rep,name=route,proto3" json:"route,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TLSRoute) Reset() { *m = TLSRoute{} } +func (m *TLSRoute) String() string { return proto.CompactTextString(m) } +func (*TLSRoute) ProtoMessage() {} +func (*TLSRoute) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{5} +} +func (m *TLSRoute) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TLSRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TLSRoute.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TLSRoute) XXX_Merge(src proto.Message) { + xxx_messageInfo_TLSRoute.Merge(m, src) +} +func (m *TLSRoute) XXX_Size() int { + return m.Size() +} +func (m *TLSRoute) XXX_DiscardUnknown() { + xxx_messageInfo_TLSRoute.DiscardUnknown(m) +} + +var xxx_messageInfo_TLSRoute proto.InternalMessageInfo + +func (m *TLSRoute) GetMatch() []*TLSMatchAttributes { + if m != nil { + return m.Match + } + return nil +} + +func (m *TLSRoute) GetRoute() []*RouteDestination { + if m != nil { + return m.Route + } + return nil +} + +// Describes match conditions and actions for routing TCP traffic. The +// following routing rule forwards traffic arriving at port 27017 for +// mongo.prod.svc.cluster.local to another Mongo server on port 5555. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo-Mongo +// spec: +// hosts: +// - mongo.prod.svc.cluster.local +// tcp: +// - match: +// - port: 27017 +// route: +// - destination: +// host: mongo.backup.svc.cluster.local +// port: +// number: 5555 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: bookinfo-Mongo +// spec: +// hosts: +// - mongo.prod.svc.cluster.local +// tcp: +// - match: +// - port: 27017 +// route: +// - destination: +// host: mongo.backup.svc.cluster.local +// port: +// number: 5555 +// ``` +// {{}} +// {{}} +type TCPRoute struct { + // Match conditions to be satisfied for the rule to be + // activated. All conditions inside a single match block have AND + // semantics, while the list of match blocks have OR semantics. The rule + // is matched if any one of the match blocks succeed. + Match []*L4MatchAttributes `protobuf:"bytes,1,rep,name=match,proto3" json:"match,omitempty"` + // The destination to which the connection should be forwarded to. + Route []*RouteDestination `protobuf:"bytes,2,rep,name=route,proto3" json:"route,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TCPRoute) Reset() { *m = TCPRoute{} } +func (m *TCPRoute) String() string { return proto.CompactTextString(m) } +func (*TCPRoute) ProtoMessage() {} +func (*TCPRoute) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{6} +} +func (m *TCPRoute) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TCPRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TCPRoute.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TCPRoute) XXX_Merge(src proto.Message) { + xxx_messageInfo_TCPRoute.Merge(m, src) +} +func (m *TCPRoute) XXX_Size() int { + return m.Size() +} +func (m *TCPRoute) XXX_DiscardUnknown() { + xxx_messageInfo_TCPRoute.DiscardUnknown(m) +} + +var xxx_messageInfo_TCPRoute proto.InternalMessageInfo + +func (m *TCPRoute) GetMatch() []*L4MatchAttributes { + if m != nil { + return m.Match + } + return nil +} + +func (m *TCPRoute) GetRoute() []*RouteDestination { + if m != nil { + return m.Route + } + return nil +} + +// HttpMatchRequest specifies a set of criterion to be met in order for the +// rule to be applied to the HTTP request. For example, the following +// restricts the rule to match only requests where the URL path +// starts with /ratings/v2/ and the request contains a custom `end-user` header +// with value `jason`. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - match: +// - headers: +// end-user: +// exact: jason +// uri: +// prefix: "/ratings/v2/" +// ignoreUriCase: true +// route: +// - destination: +// host: ratings.prod.svc.cluster.local +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - match: +// - headers: +// end-user: +// exact: jason +// uri: +// prefix: "/ratings/v2/" +// ignoreUriCase: true +// route: +// - destination: +// host: ratings.prod.svc.cluster.local +// ``` +// {{}} +// {{}} +// +// HTTPMatchRequest CANNOT be empty. +// **Note:** No regex string match can be set when delegate VirtualService is specified. +type HTTPMatchRequest struct { + // The name assigned to a match. The match's name will be + // concatenated with the parent route's name and will be logged in + // the access logs for requests matching this route. + Name string `protobuf:"bytes,11,opt,name=name,proto3" json:"name,omitempty"` + // URI to match + // values are case-sensitive and formatted as follows: + // + // - `exact: "value"` for exact string match + // + // - `prefix: "value"` for prefix-based match + // + // - `regex: "value"` for ECMAscript style regex-based match + // + // **Note:** Case-insensitive matching could be enabled via the + // `ignore_uri_case` flag. + Uri *StringMatch `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` + // URI Scheme + // values are case-sensitive and formatted as follows: + // + // - `exact: "value"` for exact string match + // + // - `prefix: "value"` for prefix-based match + // + // - `regex: "value"` for ECMAscript style regex-based match + // + Scheme *StringMatch `protobuf:"bytes,2,opt,name=scheme,proto3" json:"scheme,omitempty"` + // HTTP Method + // values are case-sensitive and formatted as follows: + // + // - `exact: "value"` for exact string match + // + // - `prefix: "value"` for prefix-based match + // + // - `regex: "value"` for ECMAscript style regex-based match + // + Method *StringMatch `protobuf:"bytes,3,opt,name=method,proto3" json:"method,omitempty"` + // HTTP Authority + // values are case-sensitive and formatted as follows: + // + // - `exact: "value"` for exact string match + // + // - `prefix: "value"` for prefix-based match + // + // - `regex: "value"` for ECMAscript style regex-based match + // + Authority *StringMatch `protobuf:"bytes,4,opt,name=authority,proto3" json:"authority,omitempty"` + // The header keys must be lowercase and use hyphen as the separator, + // e.g. _x-request-id_. + // + // Header values are case-sensitive and formatted as follows: + // + // - `exact: "value"` for exact string match + // + // - `prefix: "value"` for prefix-based match + // + // - `regex: "value"` for ECMAscript style regex-based match + // + // If the value is empty and only the name of header is specfied, presence of the header is checked. + // **Note:** The keys `uri`, `scheme`, `method`, and `authority` will be ignored. + Headers map[string]*StringMatch `protobuf:"bytes,5,rep,name=headers,proto3" json:"headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Specifies the ports on the host that is being addressed. Many services + // only expose a single port or label ports with the protocols they support, + // in these cases it is not required to explicitly select the port. + Port uint32 `protobuf:"varint,6,opt,name=port,proto3" json:"port,omitempty"` + // One or more labels that constrain the applicability of a rule to + // workloads with the given labels. If the VirtualService has a list of + // gateways specified in the top-level `gateways` field, it must include the reserved gateway + // `mesh` for this field to be applicable. + SourceLabels map[string]string `protobuf:"bytes,7,rep,name=source_labels,json=sourceLabels,proto3" json:"source_labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Names of gateways where the rule should be applied. Gateway names + // in the top-level `gateways` field of the VirtualService (if any) are overridden. The gateway + // match is independent of sourceLabels. + Gateways []string `protobuf:"bytes,8,rep,name=gateways,proto3" json:"gateways,omitempty"` + // Query parameters for matching. + // + // Ex: + // - For a query parameter like "?key=true", the map key would be "key" and + // the string match could be defined as `exact: "true"`. + // - For a query parameter like "?key", the map key would be "key" and the + // string match could be defined as `exact: ""`. + // - For a query parameter like "?key=123", the map key would be "key" and the + // string match could be defined as `regex: "\d+$"`. Note that this + // configuration will only match values like "123" but not "a123" or "123a". + // + // **Note:** `prefix` matching is currently not supported. + QueryParams map[string]*StringMatch `protobuf:"bytes,9,rep,name=query_params,json=queryParams,proto3" json:"query_params,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Flag to specify whether the URI matching should be case-insensitive. + // + // **Note:** The case will be ignored only in the case of `exact` and `prefix` + // URI matches. + IgnoreUriCase bool `protobuf:"varint,10,opt,name=ignore_uri_case,json=ignoreUriCase,proto3" json:"ignore_uri_case,omitempty"` + // withoutHeader has the same syntax with the header, but has opposite meaning. + // If a header is matched with a matching rule among withoutHeader, the traffic becomes not matched one. + WithoutHeaders map[string]*StringMatch `protobuf:"bytes,12,rep,name=without_headers,json=withoutHeaders,proto3" json:"without_headers,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Source namespace constraining the applicability of a rule to workloads in that namespace. + // If the VirtualService has a list of gateways specified in the top-level `gateways` field, + // it must include the reserved gateway `mesh` for this field to be applicable. + SourceNamespace string `protobuf:"bytes,13,opt,name=source_namespace,json=sourceNamespace,proto3" json:"source_namespace,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HTTPMatchRequest) Reset() { *m = HTTPMatchRequest{} } +func (m *HTTPMatchRequest) String() string { return proto.CompactTextString(m) } +func (*HTTPMatchRequest) ProtoMessage() {} +func (*HTTPMatchRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{7} +} +func (m *HTTPMatchRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HTTPMatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HTTPMatchRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HTTPMatchRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_HTTPMatchRequest.Merge(m, src) +} +func (m *HTTPMatchRequest) XXX_Size() int { + return m.Size() +} +func (m *HTTPMatchRequest) XXX_DiscardUnknown() { + xxx_messageInfo_HTTPMatchRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_HTTPMatchRequest proto.InternalMessageInfo + +func (m *HTTPMatchRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *HTTPMatchRequest) GetUri() *StringMatch { + if m != nil { + return m.Uri + } + return nil +} + +func (m *HTTPMatchRequest) GetScheme() *StringMatch { + if m != nil { + return m.Scheme + } + return nil +} + +func (m *HTTPMatchRequest) GetMethod() *StringMatch { + if m != nil { + return m.Method + } + return nil +} + +func (m *HTTPMatchRequest) GetAuthority() *StringMatch { + if m != nil { + return m.Authority + } + return nil +} + +func (m *HTTPMatchRequest) GetHeaders() map[string]*StringMatch { + if m != nil { + return m.Headers + } + return nil +} + +func (m *HTTPMatchRequest) GetPort() uint32 { + if m != nil { + return m.Port + } + return 0 +} + +func (m *HTTPMatchRequest) GetSourceLabels() map[string]string { + if m != nil { + return m.SourceLabels + } + return nil +} + +func (m *HTTPMatchRequest) GetGateways() []string { + if m != nil { + return m.Gateways + } + return nil +} + +func (m *HTTPMatchRequest) GetQueryParams() map[string]*StringMatch { + if m != nil { + return m.QueryParams + } + return nil +} + +func (m *HTTPMatchRequest) GetIgnoreUriCase() bool { + if m != nil { + return m.IgnoreUriCase + } + return false +} + +func (m *HTTPMatchRequest) GetWithoutHeaders() map[string]*StringMatch { + if m != nil { + return m.WithoutHeaders + } + return nil +} + +func (m *HTTPMatchRequest) GetSourceNamespace() string { + if m != nil { + return m.SourceNamespace + } + return "" +} + +// Each routing rule is associated with one or more service versions (see +// glossary in beginning of document). Weights associated with the version +// determine the proportion of traffic it receives. For example, the +// following rule will route 25% of traffic for the "reviews" service to +// instances with the "v2" tag and the remaining traffic (i.e., 75%) to +// "v1". +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: reviews-route +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// http: +// - route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v2 +// weight: 25 +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v1 +// weight: 75 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: reviews-route +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// http: +// - route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v2 +// weight: 25 +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v1 +// weight: 75 +// ``` +// {{}} +// {{}} +// +// And the associated DestinationRule +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: reviews-destination +// spec: +// host: reviews.prod.svc.cluster.local +// subsets: +// - name: v1 +// labels: +// version: v1 +// - name: v2 +// labels: +// version: v2 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: reviews-destination +// spec: +// host: reviews.prod.svc.cluster.local +// subsets: +// - name: v1 +// labels: +// version: v1 +// - name: v2 +// labels: +// version: v2 +// ``` +// {{}} +// {{}} +// +// Traffic can also be split across two entirely different services without +// having to define new subsets. For example, the following rule forwards 25% of +// traffic to reviews.com to dev.reviews.com +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: reviews-route-two-domains +// spec: +// hosts: +// - reviews.com +// http: +// - route: +// - destination: +// host: dev.reviews.com +// weight: 25 +// - destination: +// host: reviews.com +// weight: 75 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: reviews-route-two-domains +// spec: +// hosts: +// - reviews.com +// http: +// - route: +// - destination: +// host: dev.reviews.com +// weight: 25 +// - destination: +// host: reviews.com +// weight: 75 +// ``` +// {{}} +// {{}} +// +type HTTPRouteDestination struct { + // Destination uniquely identifies the instances of a service + // to which the request/connection should be forwarded to. + Destination *Destination `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"` + // The proportion of traffic to be forwarded to the service + // version. (0-100). Sum of weights across destinations SHOULD BE == 100. + // If there is only one destination in a rule, the weight value is assumed to + // be 100. + Weight int32 `protobuf:"varint,2,opt,name=weight,proto3" json:"weight,omitempty"` + // Header manipulation rules + Headers *Headers `protobuf:"bytes,7,opt,name=headers,proto3" json:"headers,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HTTPRouteDestination) Reset() { *m = HTTPRouteDestination{} } +func (m *HTTPRouteDestination) String() string { return proto.CompactTextString(m) } +func (*HTTPRouteDestination) ProtoMessage() {} +func (*HTTPRouteDestination) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{8} +} +func (m *HTTPRouteDestination) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HTTPRouteDestination) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HTTPRouteDestination.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HTTPRouteDestination) XXX_Merge(src proto.Message) { + xxx_messageInfo_HTTPRouteDestination.Merge(m, src) +} +func (m *HTTPRouteDestination) XXX_Size() int { + return m.Size() +} +func (m *HTTPRouteDestination) XXX_DiscardUnknown() { + xxx_messageInfo_HTTPRouteDestination.DiscardUnknown(m) +} + +var xxx_messageInfo_HTTPRouteDestination proto.InternalMessageInfo + +func (m *HTTPRouteDestination) GetDestination() *Destination { + if m != nil { + return m.Destination + } + return nil +} + +func (m *HTTPRouteDestination) GetWeight() int32 { + if m != nil { + return m.Weight + } + return 0 +} + +func (m *HTTPRouteDestination) GetHeaders() *Headers { + if m != nil { + return m.Headers + } + return nil +} + +// L4 routing rule weighted destination. +type RouteDestination struct { + // Destination uniquely identifies the instances of a service + // to which the request/connection should be forwarded to. + Destination *Destination `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"` + // The proportion of traffic to be forwarded to the service + // version. If there is only one destination in a rule, all traffic will be + // routed to it irrespective of the weight. + Weight int32 `protobuf:"varint,2,opt,name=weight,proto3" json:"weight,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RouteDestination) Reset() { *m = RouteDestination{} } +func (m *RouteDestination) String() string { return proto.CompactTextString(m) } +func (*RouteDestination) ProtoMessage() {} +func (*RouteDestination) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{9} +} +func (m *RouteDestination) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RouteDestination) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RouteDestination.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RouteDestination) XXX_Merge(src proto.Message) { + xxx_messageInfo_RouteDestination.Merge(m, src) +} +func (m *RouteDestination) XXX_Size() int { + return m.Size() +} +func (m *RouteDestination) XXX_DiscardUnknown() { + xxx_messageInfo_RouteDestination.DiscardUnknown(m) +} + +var xxx_messageInfo_RouteDestination proto.InternalMessageInfo + +func (m *RouteDestination) GetDestination() *Destination { + if m != nil { + return m.Destination + } + return nil +} + +func (m *RouteDestination) GetWeight() int32 { + if m != nil { + return m.Weight + } + return 0 +} + +// L4 connection match attributes. Note that L4 connection matching support +// is incomplete. +type L4MatchAttributes struct { + // IPv4 or IPv6 ip addresses of destination with optional subnet. E.g., + // a.b.c.d/xx form or just a.b.c.d. + DestinationSubnets []string `protobuf:"bytes,1,rep,name=destination_subnets,json=destinationSubnets,proto3" json:"destination_subnets,omitempty"` + // Specifies the port on the host that is being addressed. Many services + // only expose a single port or label ports with the protocols they support, + // in these cases it is not required to explicitly select the port. + Port uint32 `protobuf:"varint,2,opt,name=port,proto3" json:"port,omitempty"` + // IPv4 or IPv6 ip address of source with optional subnet. E.g., a.b.c.d/xx + // form or just a.b.c.d + // $hide_from_docs + SourceSubnet string `protobuf:"bytes,3,opt,name=source_subnet,json=sourceSubnet,proto3" json:"source_subnet,omitempty"` + // One or more labels that constrain the applicability of a rule to + // workloads with the given labels. If the VirtualService has a list of + // gateways specified in the top-level `gateways` field, it should include the reserved gateway + // `mesh` in order for this field to be applicable. + SourceLabels map[string]string `protobuf:"bytes,4,rep,name=source_labels,json=sourceLabels,proto3" json:"source_labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Names of gateways where the rule should be applied. Gateway names + // in the top-level `gateways` field of the VirtualService (if any) are overridden. The gateway + // match is independent of sourceLabels. + Gateways []string `protobuf:"bytes,5,rep,name=gateways,proto3" json:"gateways,omitempty"` + // Source namespace constraining the applicability of a rule to workloads in that namespace. + // If the VirtualService has a list of gateways specified in the top-level `gateways` field, + // it must include the reserved gateway `mesh` for this field to be applicable. + SourceNamespace string `protobuf:"bytes,6,opt,name=source_namespace,json=sourceNamespace,proto3" json:"source_namespace,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *L4MatchAttributes) Reset() { *m = L4MatchAttributes{} } +func (m *L4MatchAttributes) String() string { return proto.CompactTextString(m) } +func (*L4MatchAttributes) ProtoMessage() {} +func (*L4MatchAttributes) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{10} +} +func (m *L4MatchAttributes) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *L4MatchAttributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_L4MatchAttributes.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *L4MatchAttributes) XXX_Merge(src proto.Message) { + xxx_messageInfo_L4MatchAttributes.Merge(m, src) +} +func (m *L4MatchAttributes) XXX_Size() int { + return m.Size() +} +func (m *L4MatchAttributes) XXX_DiscardUnknown() { + xxx_messageInfo_L4MatchAttributes.DiscardUnknown(m) +} + +var xxx_messageInfo_L4MatchAttributes proto.InternalMessageInfo + +func (m *L4MatchAttributes) GetDestinationSubnets() []string { + if m != nil { + return m.DestinationSubnets + } + return nil +} + +func (m *L4MatchAttributes) GetPort() uint32 { + if m != nil { + return m.Port + } + return 0 +} + +func (m *L4MatchAttributes) GetSourceSubnet() string { + if m != nil { + return m.SourceSubnet + } + return "" +} + +func (m *L4MatchAttributes) GetSourceLabels() map[string]string { + if m != nil { + return m.SourceLabels + } + return nil +} + +func (m *L4MatchAttributes) GetGateways() []string { + if m != nil { + return m.Gateways + } + return nil +} + +func (m *L4MatchAttributes) GetSourceNamespace() string { + if m != nil { + return m.SourceNamespace + } + return "" +} + +// TLS connection match attributes. +type TLSMatchAttributes struct { + // SNI (server name indicator) to match on. Wildcard prefixes + // can be used in the SNI value, e.g., *.com will match foo.example.com + // as well as example.com. An SNI value must be a subset (i.e., fall + // within the domain) of the corresponding virtual serivce's hosts. + SniHosts []string `protobuf:"bytes,1,rep,name=sni_hosts,json=sniHosts,proto3" json:"sni_hosts,omitempty"` + // IPv4 or IPv6 ip addresses of destination with optional subnet. E.g., + // a.b.c.d/xx form or just a.b.c.d. + DestinationSubnets []string `protobuf:"bytes,2,rep,name=destination_subnets,json=destinationSubnets,proto3" json:"destination_subnets,omitempty"` + // Specifies the port on the host that is being addressed. Many services + // only expose a single port or label ports with the protocols they + // support, in these cases it is not required to explicitly select the + // port. + Port uint32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"` + // One or more labels that constrain the applicability of a rule to + // workloads with the given labels. If the VirtualService has a list of + // gateways specified in the top-level `gateways` field, it should include the reserved gateway + // `mesh` in order for this field to be applicable. + SourceLabels map[string]string `protobuf:"bytes,5,rep,name=source_labels,json=sourceLabels,proto3" json:"source_labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Names of gateways where the rule should be applied. Gateway names + // in the top-level `gateways` field of the VirtualService (if any) are overridden. The gateway + // match is independent of sourceLabels. + Gateways []string `protobuf:"bytes,6,rep,name=gateways,proto3" json:"gateways,omitempty"` + // Source namespace constraining the applicability of a rule to workloads in that namespace. + // If the VirtualService has a list of gateways specified in the top-level `gateways` field, + // it must include the reserved gateway `mesh` for this field to be applicable. + SourceNamespace string `protobuf:"bytes,7,opt,name=source_namespace,json=sourceNamespace,proto3" json:"source_namespace,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *TLSMatchAttributes) Reset() { *m = TLSMatchAttributes{} } +func (m *TLSMatchAttributes) String() string { return proto.CompactTextString(m) } +func (*TLSMatchAttributes) ProtoMessage() {} +func (*TLSMatchAttributes) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{11} +} +func (m *TLSMatchAttributes) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TLSMatchAttributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TLSMatchAttributes.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TLSMatchAttributes) XXX_Merge(src proto.Message) { + xxx_messageInfo_TLSMatchAttributes.Merge(m, src) +} +func (m *TLSMatchAttributes) XXX_Size() int { + return m.Size() +} +func (m *TLSMatchAttributes) XXX_DiscardUnknown() { + xxx_messageInfo_TLSMatchAttributes.DiscardUnknown(m) +} + +var xxx_messageInfo_TLSMatchAttributes proto.InternalMessageInfo + +func (m *TLSMatchAttributes) GetSniHosts() []string { + if m != nil { + return m.SniHosts + } + return nil +} + +func (m *TLSMatchAttributes) GetDestinationSubnets() []string { + if m != nil { + return m.DestinationSubnets + } + return nil +} + +func (m *TLSMatchAttributes) GetPort() uint32 { + if m != nil { + return m.Port + } + return 0 +} + +func (m *TLSMatchAttributes) GetSourceLabels() map[string]string { + if m != nil { + return m.SourceLabels + } + return nil +} + +func (m *TLSMatchAttributes) GetGateways() []string { + if m != nil { + return m.Gateways + } + return nil +} + +func (m *TLSMatchAttributes) GetSourceNamespace() string { + if m != nil { + return m.SourceNamespace + } + return "" +} + +// HTTPRedirect can be used to send a 301 redirect response to the caller, +// where the Authority/Host and the URI in the response can be swapped with +// the specified values. For example, the following rule redirects +// requests for /v1/getProductRatings API on the ratings service to +// /v1/bookRatings provided by the bookratings service. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - match: +// - uri: +// exact: /v1/getProductRatings +// redirect: +// uri: /v1/bookRatings +// authority: newratings.default.svc.cluster.local +// ... +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - match: +// - uri: +// exact: /v1/getProductRatings +// redirect: +// uri: /v1/bookRatings +// authority: newratings.default.svc.cluster.local +// ... +// ``` +// {{}} +// {{}} +// +type HTTPRedirect struct { + // On a redirect, overwrite the Path portion of the URL with this + // value. Note that the entire path will be replaced, irrespective of the + // request URI being matched as an exact path or prefix. + Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` + // On a redirect, overwrite the Authority/Host portion of the URL with + // this value. + Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"` + // On a redirect, Specifies the HTTP status code to use in the redirect + // response. The default response code is MOVED_PERMANENTLY (301). + RedirectCode uint32 `protobuf:"varint,3,opt,name=redirect_code,json=redirectCode,proto3" json:"redirect_code,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HTTPRedirect) Reset() { *m = HTTPRedirect{} } +func (m *HTTPRedirect) String() string { return proto.CompactTextString(m) } +func (*HTTPRedirect) ProtoMessage() {} +func (*HTTPRedirect) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{12} +} +func (m *HTTPRedirect) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HTTPRedirect) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HTTPRedirect.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HTTPRedirect) XXX_Merge(src proto.Message) { + xxx_messageInfo_HTTPRedirect.Merge(m, src) +} +func (m *HTTPRedirect) XXX_Size() int { + return m.Size() +} +func (m *HTTPRedirect) XXX_DiscardUnknown() { + xxx_messageInfo_HTTPRedirect.DiscardUnknown(m) +} + +var xxx_messageInfo_HTTPRedirect proto.InternalMessageInfo + +func (m *HTTPRedirect) GetUri() string { + if m != nil { + return m.Uri + } + return "" +} + +func (m *HTTPRedirect) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *HTTPRedirect) GetRedirectCode() uint32 { + if m != nil { + return m.RedirectCode + } + return 0 +} + +// HTTPRewrite can be used to rewrite specific parts of a HTTP request +// before forwarding the request to the destination. Rewrite primitive can +// be used only with HTTPRouteDestination. The following example +// demonstrates how to rewrite the URL prefix for api call (/ratings) to +// ratings service before making the actual API call. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - match: +// - uri: +// prefix: /ratings +// rewrite: +// uri: /v1/bookRatings +// route: +// - destination: +// host: ratings.prod.svc.cluster.local +// subset: v1 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - match: +// - uri: +// prefix: /ratings +// rewrite: +// uri: /v1/bookRatings +// route: +// - destination: +// host: ratings.prod.svc.cluster.local +// subset: v1 +// ``` +// {{}} +// {{}} +// +type HTTPRewrite struct { + // rewrite the path (or the prefix) portion of the URI with this + // value. If the original URI was matched based on prefix, the value + // provided in this field will replace the corresponding matched prefix. + Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"` + // rewrite the Authority/Host header with this value. + Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HTTPRewrite) Reset() { *m = HTTPRewrite{} } +func (m *HTTPRewrite) String() string { return proto.CompactTextString(m) } +func (*HTTPRewrite) ProtoMessage() {} +func (*HTTPRewrite) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{13} +} +func (m *HTTPRewrite) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HTTPRewrite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HTTPRewrite.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HTTPRewrite) XXX_Merge(src proto.Message) { + xxx_messageInfo_HTTPRewrite.Merge(m, src) +} +func (m *HTTPRewrite) XXX_Size() int { + return m.Size() +} +func (m *HTTPRewrite) XXX_DiscardUnknown() { + xxx_messageInfo_HTTPRewrite.DiscardUnknown(m) +} + +var xxx_messageInfo_HTTPRewrite proto.InternalMessageInfo + +func (m *HTTPRewrite) GetUri() string { + if m != nil { + return m.Uri + } + return "" +} + +func (m *HTTPRewrite) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +// Describes how to match a given string in HTTP headers. Match is +// case-sensitive. +type StringMatch struct { + // Types that are valid to be assigned to MatchType: + // *StringMatch_Exact + // *StringMatch_Prefix + // *StringMatch_Regex + MatchType isStringMatch_MatchType `protobuf_oneof:"match_type"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *StringMatch) Reset() { *m = StringMatch{} } +func (m *StringMatch) String() string { return proto.CompactTextString(m) } +func (*StringMatch) ProtoMessage() {} +func (*StringMatch) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{14} +} +func (m *StringMatch) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StringMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StringMatch.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *StringMatch) XXX_Merge(src proto.Message) { + xxx_messageInfo_StringMatch.Merge(m, src) +} +func (m *StringMatch) XXX_Size() int { + return m.Size() +} +func (m *StringMatch) XXX_DiscardUnknown() { + xxx_messageInfo_StringMatch.DiscardUnknown(m) +} + +var xxx_messageInfo_StringMatch proto.InternalMessageInfo + +type isStringMatch_MatchType interface { + isStringMatch_MatchType() + MarshalTo([]byte) (int, error) + Size() int +} + +type StringMatch_Exact struct { + Exact string `protobuf:"bytes,1,opt,name=exact,proto3,oneof"` +} +type StringMatch_Prefix struct { + Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3,oneof"` +} +type StringMatch_Regex struct { + Regex string `protobuf:"bytes,3,opt,name=regex,proto3,oneof"` +} + +func (*StringMatch_Exact) isStringMatch_MatchType() {} +func (*StringMatch_Prefix) isStringMatch_MatchType() {} +func (*StringMatch_Regex) isStringMatch_MatchType() {} + +func (m *StringMatch) GetMatchType() isStringMatch_MatchType { + if m != nil { + return m.MatchType + } + return nil +} + +func (m *StringMatch) GetExact() string { + if x, ok := m.GetMatchType().(*StringMatch_Exact); ok { + return x.Exact + } + return "" +} + +func (m *StringMatch) GetPrefix() string { + if x, ok := m.GetMatchType().(*StringMatch_Prefix); ok { + return x.Prefix + } + return "" +} + +func (m *StringMatch) GetRegex() string { + if x, ok := m.GetMatchType().(*StringMatch_Regex); ok { + return x.Regex + } + return "" +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*StringMatch) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*StringMatch_Exact)(nil), + (*StringMatch_Prefix)(nil), + (*StringMatch_Regex)(nil), + } +} + +// Describes the retry policy to use when a HTTP request fails. For +// example, the following rule sets the maximum number of retries to 3 when +// calling ratings:v1 service, with a 2s timeout per retry attempt. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - route: +// - destination: +// host: ratings.prod.svc.cluster.local +// subset: v1 +// retries: +// attempts: 3 +// perTryTimeout: 2s +// retryOn: gateway-error,connect-failure,refused-stream +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - route: +// - destination: +// host: ratings.prod.svc.cluster.local +// subset: v1 +// retries: +// attempts: 3 +// perTryTimeout: 2s +// retryOn: gateway-error,connect-failure,refused-stream +// ``` +// {{}} +// {{}} +// +type HTTPRetry struct { + // Number of retries for a given request. The interval + // between retries will be determined automatically (25ms+). Actual + // number of retries attempted depends on the request `timeout` of the + // [HTTP route](https://istio.io/docs/reference/config/networking/virtual-service/#HTTPRoute). + Attempts int32 `protobuf:"varint,1,opt,name=attempts,proto3" json:"attempts,omitempty"` + // Timeout per retry attempt for a given request. format: 1h/1m/1s/1ms. MUST BE >=1ms. + PerTryTimeout *types.Duration `protobuf:"bytes,2,opt,name=per_try_timeout,json=perTryTimeout,proto3" json:"per_try_timeout,omitempty"` + // Specifies the conditions under which retry takes place. + // One or more policies can be specified using a ‘,’ delimited list. + // See the [retry policies](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/router_filter#x-envoy-retry-on) + // and [gRPC retry policies](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/router_filter#x-envoy-retry-grpc-on) for more details. + RetryOn string `protobuf:"bytes,3,opt,name=retry_on,json=retryOn,proto3" json:"retry_on,omitempty"` + // Flag to specify whether the retries should retry to other localities. + // See the [retry plugin configuration](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/http/http_connection_management#retry-plugin-configuration) for more details. + RetryRemoteLocalities *types.BoolValue `protobuf:"bytes,4,opt,name=retry_remote_localities,json=retryRemoteLocalities,proto3" json:"retry_remote_localities,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HTTPRetry) Reset() { *m = HTTPRetry{} } +func (m *HTTPRetry) String() string { return proto.CompactTextString(m) } +func (*HTTPRetry) ProtoMessage() {} +func (*HTTPRetry) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{15} +} +func (m *HTTPRetry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HTTPRetry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HTTPRetry.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HTTPRetry) XXX_Merge(src proto.Message) { + xxx_messageInfo_HTTPRetry.Merge(m, src) +} +func (m *HTTPRetry) XXX_Size() int { + return m.Size() +} +func (m *HTTPRetry) XXX_DiscardUnknown() { + xxx_messageInfo_HTTPRetry.DiscardUnknown(m) +} + +var xxx_messageInfo_HTTPRetry proto.InternalMessageInfo + +func (m *HTTPRetry) GetAttempts() int32 { + if m != nil { + return m.Attempts + } + return 0 +} + +func (m *HTTPRetry) GetPerTryTimeout() *types.Duration { + if m != nil { + return m.PerTryTimeout + } + return nil +} + +func (m *HTTPRetry) GetRetryOn() string { + if m != nil { + return m.RetryOn + } + return "" +} + +func (m *HTTPRetry) GetRetryRemoteLocalities() *types.BoolValue { + if m != nil { + return m.RetryRemoteLocalities + } + return nil +} + +// Describes the Cross-Origin Resource Sharing (CORS) policy, for a given +// service. Refer to [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) +// for further details about cross origin resource sharing. For example, +// the following rule restricts cross origin requests to those originating +// from example.com domain using HTTP POST/GET, and sets the +// `Access-Control-Allow-Credentials` header to false. In addition, it only +// exposes `X-Foo-bar` header and sets an expiry period of 1 day. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - route: +// - destination: +// host: ratings.prod.svc.cluster.local +// subset: v1 +// corsPolicy: +// allowOrigins: +// - exact: https://example.com +// allowMethods: +// - POST +// - GET +// allowCredentials: false +// allowHeaders: +// - X-Foo-Bar +// maxAge: "24h" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - route: +// - destination: +// host: ratings.prod.svc.cluster.local +// subset: v1 +// corsPolicy: +// allowOrigins: +// - exact: https://example.com +// allowMethods: +// - POST +// - GET +// allowCredentials: false +// allowHeaders: +// - X-Foo-Bar +// maxAge: "24h" +// ``` +// {{}} +// {{}} +// +type CorsPolicy struct { + // The list of origins that are allowed to perform CORS requests. The + // content will be serialized into the Access-Control-Allow-Origin + // header. Wildcard * will allow all origins. + // $hide_from_docs + AllowOrigin []string `protobuf:"bytes,1,rep,name=allow_origin,json=allowOrigin,proto3" json:"allow_origin,omitempty"` // Deprecated: Do not use. + // String patterns that match allowed origins. + // An origin is allowed if any of the string matchers match. + // If a match is found, then the outgoing Access-Control-Allow-Origin would be set to the origin as provided by the client. + AllowOrigins []*StringMatch `protobuf:"bytes,7,rep,name=allow_origins,json=allowOrigins,proto3" json:"allow_origins,omitempty"` + // List of HTTP methods allowed to access the resource. The content will + // be serialized into the Access-Control-Allow-Methods header. + AllowMethods []string `protobuf:"bytes,2,rep,name=allow_methods,json=allowMethods,proto3" json:"allow_methods,omitempty"` + // List of HTTP headers that can be used when requesting the + // resource. Serialized to Access-Control-Allow-Headers header. + AllowHeaders []string `protobuf:"bytes,3,rep,name=allow_headers,json=allowHeaders,proto3" json:"allow_headers,omitempty"` + // A white list of HTTP headers that the browsers are allowed to + // access. Serialized into Access-Control-Expose-Headers header. + ExposeHeaders []string `protobuf:"bytes,4,rep,name=expose_headers,json=exposeHeaders,proto3" json:"expose_headers,omitempty"` + // Specifies how long the results of a preflight request can be + // cached. Translates to the `Access-Control-Max-Age` header. + MaxAge *types.Duration `protobuf:"bytes,5,opt,name=max_age,json=maxAge,proto3" json:"max_age,omitempty"` + // Indicates whether the caller is allowed to send the actual request + // (not the preflight) using credentials. Translates to + // `Access-Control-Allow-Credentials` header. + AllowCredentials *types.BoolValue `protobuf:"bytes,6,opt,name=allow_credentials,json=allowCredentials,proto3" json:"allow_credentials,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CorsPolicy) Reset() { *m = CorsPolicy{} } +func (m *CorsPolicy) String() string { return proto.CompactTextString(m) } +func (*CorsPolicy) ProtoMessage() {} +func (*CorsPolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{16} +} +func (m *CorsPolicy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CorsPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CorsPolicy.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CorsPolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_CorsPolicy.Merge(m, src) +} +func (m *CorsPolicy) XXX_Size() int { + return m.Size() +} +func (m *CorsPolicy) XXX_DiscardUnknown() { + xxx_messageInfo_CorsPolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_CorsPolicy proto.InternalMessageInfo + +// Deprecated: Do not use. +func (m *CorsPolicy) GetAllowOrigin() []string { + if m != nil { + return m.AllowOrigin + } + return nil +} + +func (m *CorsPolicy) GetAllowOrigins() []*StringMatch { + if m != nil { + return m.AllowOrigins + } + return nil +} + +func (m *CorsPolicy) GetAllowMethods() []string { + if m != nil { + return m.AllowMethods + } + return nil +} + +func (m *CorsPolicy) GetAllowHeaders() []string { + if m != nil { + return m.AllowHeaders + } + return nil +} + +func (m *CorsPolicy) GetExposeHeaders() []string { + if m != nil { + return m.ExposeHeaders + } + return nil +} + +func (m *CorsPolicy) GetMaxAge() *types.Duration { + if m != nil { + return m.MaxAge + } + return nil +} + +func (m *CorsPolicy) GetAllowCredentials() *types.BoolValue { + if m != nil { + return m.AllowCredentials + } + return nil +} + +// HTTPFaultInjection can be used to specify one or more faults to inject +// while forwarding HTTP requests to the destination specified in a route. +// Fault specification is part of a VirtualService rule. Faults include +// aborting the Http request from downstream service, and/or delaying +// proxying of requests. A fault rule MUST HAVE delay or abort or both. +// +// *Note:* Delay and abort faults are independent of one another, even if +// both are specified simultaneously. +type HTTPFaultInjection struct { + // Delay requests before forwarding, emulating various failures such as + // network issues, overloaded upstream service, etc. + Delay *HTTPFaultInjection_Delay `protobuf:"bytes,1,opt,name=delay,proto3" json:"delay,omitempty"` + // Abort Http request attempts and return error codes back to downstream + // service, giving the impression that the upstream service is faulty. + Abort *HTTPFaultInjection_Abort `protobuf:"bytes,2,opt,name=abort,proto3" json:"abort,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HTTPFaultInjection) Reset() { *m = HTTPFaultInjection{} } +func (m *HTTPFaultInjection) String() string { return proto.CompactTextString(m) } +func (*HTTPFaultInjection) ProtoMessage() {} +func (*HTTPFaultInjection) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{17} +} +func (m *HTTPFaultInjection) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HTTPFaultInjection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HTTPFaultInjection.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HTTPFaultInjection) XXX_Merge(src proto.Message) { + xxx_messageInfo_HTTPFaultInjection.Merge(m, src) +} +func (m *HTTPFaultInjection) XXX_Size() int { + return m.Size() +} +func (m *HTTPFaultInjection) XXX_DiscardUnknown() { + xxx_messageInfo_HTTPFaultInjection.DiscardUnknown(m) +} + +var xxx_messageInfo_HTTPFaultInjection proto.InternalMessageInfo + +func (m *HTTPFaultInjection) GetDelay() *HTTPFaultInjection_Delay { + if m != nil { + return m.Delay + } + return nil +} + +func (m *HTTPFaultInjection) GetAbort() *HTTPFaultInjection_Abort { + if m != nil { + return m.Abort + } + return nil +} + +// Delay specification is used to inject latency into the request +// forwarding path. The following example will introduce a 5 second delay +// in 1 out of every 1000 requests to the "v1" version of the "reviews" +// service from all pods with label env: prod +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: reviews-route +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// http: +// - match: +// - sourceLabels: +// env: prod +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v1 +// fault: +// delay: +// percentage: +// value: 0.1 +// fixedDelay: 5s +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: reviews-route +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// http: +// - match: +// - sourceLabels: +// env: prod +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v1 +// fault: +// delay: +// percentage: +// value: 0.1 +// fixedDelay: 5s +// ``` +// {{}} +// {{}} +// +// The _fixedDelay_ field is used to indicate the amount of delay in seconds. +// The optional _percentage_ field can be used to only delay a certain +// percentage of requests. If left unspecified, all request will be delayed. +type HTTPFaultInjection_Delay struct { + // Percentage of requests on which the delay will be injected (0-100). + // Use of integer `percent` value is deprecated. Use the double `percentage` + // field instead. + Percent int32 `protobuf:"varint,1,opt,name=percent,proto3" json:"percent,omitempty"` // Deprecated: Do not use. + // Types that are valid to be assigned to HttpDelayType: + // *HTTPFaultInjection_Delay_FixedDelay + // *HTTPFaultInjection_Delay_ExponentialDelay + HttpDelayType isHTTPFaultInjection_Delay_HttpDelayType `protobuf_oneof:"http_delay_type"` + // Percentage of requests on which the delay will be injected. + Percentage *Percent `protobuf:"bytes,5,opt,name=percentage,proto3" json:"percentage,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HTTPFaultInjection_Delay) Reset() { *m = HTTPFaultInjection_Delay{} } +func (m *HTTPFaultInjection_Delay) String() string { return proto.CompactTextString(m) } +func (*HTTPFaultInjection_Delay) ProtoMessage() {} +func (*HTTPFaultInjection_Delay) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{17, 0} +} +func (m *HTTPFaultInjection_Delay) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HTTPFaultInjection_Delay) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HTTPFaultInjection_Delay.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HTTPFaultInjection_Delay) XXX_Merge(src proto.Message) { + xxx_messageInfo_HTTPFaultInjection_Delay.Merge(m, src) +} +func (m *HTTPFaultInjection_Delay) XXX_Size() int { + return m.Size() +} +func (m *HTTPFaultInjection_Delay) XXX_DiscardUnknown() { + xxx_messageInfo_HTTPFaultInjection_Delay.DiscardUnknown(m) +} + +var xxx_messageInfo_HTTPFaultInjection_Delay proto.InternalMessageInfo + +type isHTTPFaultInjection_Delay_HttpDelayType interface { + isHTTPFaultInjection_Delay_HttpDelayType() + MarshalTo([]byte) (int, error) + Size() int +} + +type HTTPFaultInjection_Delay_FixedDelay struct { + FixedDelay *types.Duration `protobuf:"bytes,2,opt,name=fixed_delay,json=fixedDelay,proto3,oneof"` +} +type HTTPFaultInjection_Delay_ExponentialDelay struct { + ExponentialDelay *types.Duration `protobuf:"bytes,3,opt,name=exponential_delay,json=exponentialDelay,proto3,oneof"` +} + +func (*HTTPFaultInjection_Delay_FixedDelay) isHTTPFaultInjection_Delay_HttpDelayType() {} +func (*HTTPFaultInjection_Delay_ExponentialDelay) isHTTPFaultInjection_Delay_HttpDelayType() {} + +func (m *HTTPFaultInjection_Delay) GetHttpDelayType() isHTTPFaultInjection_Delay_HttpDelayType { + if m != nil { + return m.HttpDelayType + } + return nil +} + +// Deprecated: Do not use. +func (m *HTTPFaultInjection_Delay) GetPercent() int32 { + if m != nil { + return m.Percent + } + return 0 +} + +func (m *HTTPFaultInjection_Delay) GetFixedDelay() *types.Duration { + if x, ok := m.GetHttpDelayType().(*HTTPFaultInjection_Delay_FixedDelay); ok { + return x.FixedDelay + } + return nil +} + +func (m *HTTPFaultInjection_Delay) GetExponentialDelay() *types.Duration { + if x, ok := m.GetHttpDelayType().(*HTTPFaultInjection_Delay_ExponentialDelay); ok { + return x.ExponentialDelay + } + return nil +} + +func (m *HTTPFaultInjection_Delay) GetPercentage() *Percent { + if m != nil { + return m.Percentage + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*HTTPFaultInjection_Delay) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*HTTPFaultInjection_Delay_FixedDelay)(nil), + (*HTTPFaultInjection_Delay_ExponentialDelay)(nil), + } +} + +// Abort specification is used to prematurely abort a request with a +// pre-specified error code. The following example will return an HTTP 400 +// error code for 1 out of every 1000 requests to the "ratings" service "v1". +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - route: +// - destination: +// host: ratings.prod.svc.cluster.local +// subset: v1 +// fault: +// abort: +// percentage: +// value: 0.1 +// httpStatus: 400 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - route: +// - destination: +// host: ratings.prod.svc.cluster.local +// subset: v1 +// fault: +// abort: +// percentage: +// value: 0.1 +// httpStatus: 400 +// ``` +// {{}} +// {{}} +// +// The _httpStatus_ field is used to indicate the HTTP status code to +// return to the caller. The optional _percentage_ field can be used to only +// abort a certain percentage of requests. If not specified, all requests are +// aborted. +type HTTPFaultInjection_Abort struct { + // Types that are valid to be assigned to ErrorType: + // *HTTPFaultInjection_Abort_HttpStatus + // *HTTPFaultInjection_Abort_GrpcStatus + // *HTTPFaultInjection_Abort_Http2Error + ErrorType isHTTPFaultInjection_Abort_ErrorType `protobuf_oneof:"error_type"` + // Percentage of requests to be aborted with the error code provided. + Percentage *Percent `protobuf:"bytes,5,opt,name=percentage,proto3" json:"percentage,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *HTTPFaultInjection_Abort) Reset() { *m = HTTPFaultInjection_Abort{} } +func (m *HTTPFaultInjection_Abort) String() string { return proto.CompactTextString(m) } +func (*HTTPFaultInjection_Abort) ProtoMessage() {} +func (*HTTPFaultInjection_Abort) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{17, 1} +} +func (m *HTTPFaultInjection_Abort) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *HTTPFaultInjection_Abort) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_HTTPFaultInjection_Abort.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *HTTPFaultInjection_Abort) XXX_Merge(src proto.Message) { + xxx_messageInfo_HTTPFaultInjection_Abort.Merge(m, src) +} +func (m *HTTPFaultInjection_Abort) XXX_Size() int { + return m.Size() +} +func (m *HTTPFaultInjection_Abort) XXX_DiscardUnknown() { + xxx_messageInfo_HTTPFaultInjection_Abort.DiscardUnknown(m) +} + +var xxx_messageInfo_HTTPFaultInjection_Abort proto.InternalMessageInfo + +type isHTTPFaultInjection_Abort_ErrorType interface { + isHTTPFaultInjection_Abort_ErrorType() + MarshalTo([]byte) (int, error) + Size() int +} + +type HTTPFaultInjection_Abort_HttpStatus struct { + HttpStatus int32 `protobuf:"varint,2,opt,name=http_status,json=httpStatus,proto3,oneof"` +} +type HTTPFaultInjection_Abort_GrpcStatus struct { + GrpcStatus string `protobuf:"bytes,3,opt,name=grpc_status,json=grpcStatus,proto3,oneof"` +} +type HTTPFaultInjection_Abort_Http2Error struct { + Http2Error string `protobuf:"bytes,4,opt,name=http2_error,json=http2Error,proto3,oneof"` +} + +func (*HTTPFaultInjection_Abort_HttpStatus) isHTTPFaultInjection_Abort_ErrorType() {} +func (*HTTPFaultInjection_Abort_GrpcStatus) isHTTPFaultInjection_Abort_ErrorType() {} +func (*HTTPFaultInjection_Abort_Http2Error) isHTTPFaultInjection_Abort_ErrorType() {} + +func (m *HTTPFaultInjection_Abort) GetErrorType() isHTTPFaultInjection_Abort_ErrorType { + if m != nil { + return m.ErrorType + } + return nil +} + +func (m *HTTPFaultInjection_Abort) GetHttpStatus() int32 { + if x, ok := m.GetErrorType().(*HTTPFaultInjection_Abort_HttpStatus); ok { + return x.HttpStatus + } + return 0 +} + +func (m *HTTPFaultInjection_Abort) GetGrpcStatus() string { + if x, ok := m.GetErrorType().(*HTTPFaultInjection_Abort_GrpcStatus); ok { + return x.GrpcStatus + } + return "" +} + +func (m *HTTPFaultInjection_Abort) GetHttp2Error() string { + if x, ok := m.GetErrorType().(*HTTPFaultInjection_Abort_Http2Error); ok { + return x.Http2Error + } + return "" +} + +func (m *HTTPFaultInjection_Abort) GetPercentage() *Percent { + if m != nil { + return m.Percentage + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*HTTPFaultInjection_Abort) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*HTTPFaultInjection_Abort_HttpStatus)(nil), + (*HTTPFaultInjection_Abort_GrpcStatus)(nil), + (*HTTPFaultInjection_Abort_Http2Error)(nil), + } +} + +// PortSelector specifies the number of a port to be used for +// matching or selection for final routing. +type PortSelector struct { + // Valid port number + Number uint32 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *PortSelector) Reset() { *m = PortSelector{} } +func (m *PortSelector) String() string { return proto.CompactTextString(m) } +func (*PortSelector) ProtoMessage() {} +func (*PortSelector) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{18} +} +func (m *PortSelector) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *PortSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_PortSelector.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *PortSelector) XXX_Merge(src proto.Message) { + xxx_messageInfo_PortSelector.Merge(m, src) +} +func (m *PortSelector) XXX_Size() int { + return m.Size() +} +func (m *PortSelector) XXX_DiscardUnknown() { + xxx_messageInfo_PortSelector.DiscardUnknown(m) +} + +var xxx_messageInfo_PortSelector proto.InternalMessageInfo + +func (m *PortSelector) GetNumber() uint32 { + if m != nil { + return m.Number + } + return 0 +} + +// Percent specifies a percentage in the range of [0.0, 100.0]. +type Percent struct { + Value float64 `protobuf:"fixed64,1,opt,name=value,proto3" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Percent) Reset() { *m = Percent{} } +func (m *Percent) String() string { return proto.CompactTextString(m) } +func (*Percent) ProtoMessage() {} +func (*Percent) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{19} +} +func (m *Percent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Percent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Percent.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Percent) XXX_Merge(src proto.Message) { + xxx_messageInfo_Percent.Merge(m, src) +} +func (m *Percent) XXX_Size() int { + return m.Size() +} +func (m *Percent) XXX_DiscardUnknown() { + xxx_messageInfo_Percent.DiscardUnknown(m) +} + +var xxx_messageInfo_Percent proto.InternalMessageInfo + +func (m *Percent) GetValue() float64 { + if m != nil { + return m.Value + } + return 0 +} + +func init() { + proto.RegisterType((*VirtualService)(nil), "istio.networking.v1alpha3.VirtualService") + proto.RegisterType((*Destination)(nil), "istio.networking.v1alpha3.Destination") + proto.RegisterType((*HTTPRoute)(nil), "istio.networking.v1alpha3.HTTPRoute") + proto.RegisterType((*Delegate)(nil), "istio.networking.v1alpha3.Delegate") + proto.RegisterType((*Headers)(nil), "istio.networking.v1alpha3.Headers") + proto.RegisterType((*Headers_HeaderOperations)(nil), "istio.networking.v1alpha3.Headers.HeaderOperations") + proto.RegisterMapType((map[string]string)(nil), "istio.networking.v1alpha3.Headers.HeaderOperations.AddEntry") + proto.RegisterMapType((map[string]string)(nil), "istio.networking.v1alpha3.Headers.HeaderOperations.SetEntry") + proto.RegisterType((*TLSRoute)(nil), "istio.networking.v1alpha3.TLSRoute") + proto.RegisterType((*TCPRoute)(nil), "istio.networking.v1alpha3.TCPRoute") + proto.RegisterType((*HTTPMatchRequest)(nil), "istio.networking.v1alpha3.HTTPMatchRequest") + proto.RegisterMapType((map[string]*StringMatch)(nil), "istio.networking.v1alpha3.HTTPMatchRequest.HeadersEntry") + proto.RegisterMapType((map[string]*StringMatch)(nil), "istio.networking.v1alpha3.HTTPMatchRequest.QueryParamsEntry") + proto.RegisterMapType((map[string]string)(nil), "istio.networking.v1alpha3.HTTPMatchRequest.SourceLabelsEntry") + proto.RegisterMapType((map[string]*StringMatch)(nil), "istio.networking.v1alpha3.HTTPMatchRequest.WithoutHeadersEntry") + proto.RegisterType((*HTTPRouteDestination)(nil), "istio.networking.v1alpha3.HTTPRouteDestination") + proto.RegisterType((*RouteDestination)(nil), "istio.networking.v1alpha3.RouteDestination") + proto.RegisterType((*L4MatchAttributes)(nil), "istio.networking.v1alpha3.L4MatchAttributes") + proto.RegisterMapType((map[string]string)(nil), "istio.networking.v1alpha3.L4MatchAttributes.SourceLabelsEntry") + proto.RegisterType((*TLSMatchAttributes)(nil), "istio.networking.v1alpha3.TLSMatchAttributes") + proto.RegisterMapType((map[string]string)(nil), "istio.networking.v1alpha3.TLSMatchAttributes.SourceLabelsEntry") + proto.RegisterType((*HTTPRedirect)(nil), "istio.networking.v1alpha3.HTTPRedirect") + proto.RegisterType((*HTTPRewrite)(nil), "istio.networking.v1alpha3.HTTPRewrite") + proto.RegisterType((*StringMatch)(nil), "istio.networking.v1alpha3.StringMatch") + proto.RegisterType((*HTTPRetry)(nil), "istio.networking.v1alpha3.HTTPRetry") + proto.RegisterType((*CorsPolicy)(nil), "istio.networking.v1alpha3.CorsPolicy") + proto.RegisterType((*HTTPFaultInjection)(nil), "istio.networking.v1alpha3.HTTPFaultInjection") + proto.RegisterType((*HTTPFaultInjection_Delay)(nil), "istio.networking.v1alpha3.HTTPFaultInjection.Delay") + proto.RegisterType((*HTTPFaultInjection_Abort)(nil), "istio.networking.v1alpha3.HTTPFaultInjection.Abort") + proto.RegisterType((*PortSelector)(nil), "istio.networking.v1alpha3.PortSelector") + proto.RegisterType((*Percent)(nil), "istio.networking.v1alpha3.Percent") +} + +func init() { + proto.RegisterFile("networking/v1alpha3/virtual_service.proto", fileDescriptor_e85a9a4fa9c17a22) +} + +var fileDescriptor_e85a9a4fa9c17a22 = []byte{ + // 1989 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0x4f, 0x73, 0x1b, 0x49, + 0x15, 0x8f, 0xfe, 0x4b, 0x4f, 0x92, 0x2d, 0x77, 0x42, 0x32, 0x31, 0xa9, 0xc4, 0x4c, 0x48, 0xf0, + 0x16, 0xac, 0x5c, 0xd8, 0x40, 0xa5, 0x20, 0x9b, 0xe0, 0x3f, 0xd9, 0x75, 0x4c, 0xb2, 0x36, 0x6d, + 0xef, 0x52, 0xc5, 0x65, 0x6a, 0x34, 0xf3, 0x2c, 0x0d, 0x19, 0x4d, 0x4f, 0x7a, 0x7a, 0x6c, 0xab, + 0xf8, 0x00, 0x14, 0x27, 0x8a, 0x13, 0x17, 0x6e, 0xf0, 0x29, 0xf8, 0x04, 0x1c, 0x39, 0x71, 0xa4, + 0xb6, 0x72, 0xe0, 0xc0, 0x81, 0x8f, 0x40, 0x51, 0xdd, 0x3d, 0x23, 0x8d, 0x2c, 0x47, 0x7f, 0x42, + 0xc2, 0x9e, 0xac, 0x7e, 0xfd, 0x7e, 0xbf, 0xee, 0x79, 0xaf, 0xdf, 0x9f, 0x6e, 0xc3, 0x47, 0x01, + 0x8a, 0x73, 0xc6, 0x5f, 0x79, 0x41, 0x77, 0xe3, 0xec, 0xfb, 0xb6, 0x1f, 0xf6, 0xec, 0xad, 0x8d, + 0x33, 0x8f, 0x8b, 0xd8, 0xf6, 0xad, 0x08, 0xf9, 0x99, 0xe7, 0x60, 0x3b, 0xe4, 0x4c, 0x30, 0x72, + 0xdb, 0x8b, 0x84, 0xc7, 0xda, 0x23, 0x40, 0x3b, 0x05, 0xac, 0xde, 0xeb, 0x32, 0xd6, 0xf5, 0x71, + 0xc3, 0x0e, 0xbd, 0x8d, 0x53, 0x0f, 0x7d, 0xd7, 0xea, 0x60, 0xcf, 0x3e, 0xf3, 0x18, 0xd7, 0xd8, + 0xd5, 0xbb, 0x89, 0x82, 0x1a, 0x75, 0xe2, 0xd3, 0x0d, 0x37, 0xe6, 0xb6, 0xf0, 0x58, 0xf0, 0xb6, + 0xf9, 0x73, 0x6e, 0x87, 0x21, 0xf2, 0x48, 0xcf, 0x9b, 0xbf, 0xc9, 0xc3, 0xd2, 0x97, 0x7a, 0x57, + 0xc7, 0x7a, 0x53, 0xe4, 0x06, 0x94, 0x7a, 0x2c, 0x12, 0x91, 0x91, 0x5b, 0x2b, 0xac, 0xd7, 0xa8, + 0x1e, 0x90, 0x55, 0xa8, 0x76, 0x6d, 0x81, 0xe7, 0xf6, 0x20, 0x32, 0xf2, 0x6a, 0x62, 0x38, 0x26, + 0x8f, 0xa0, 0xd8, 0x13, 0x22, 0x34, 0x0a, 0x6b, 0x85, 0xf5, 0xfa, 0xe6, 0xb7, 0xdb, 0x6f, 0xfd, + 0x9e, 0xf6, 0xfe, 0xc9, 0xc9, 0x11, 0x65, 0xb1, 0x40, 0xaa, 0x10, 0xe4, 0x87, 0x50, 0x10, 0x7e, + 0x64, 0x94, 0x14, 0xf0, 0xfe, 0x14, 0xe0, 0xc9, 0x8b, 0x63, 0x8d, 0x93, 0xfa, 0x0a, 0xe6, 0x84, + 0x46, 0x71, 0x36, 0x6c, 0xf7, 0x28, 0x85, 0x39, 0x21, 0xf9, 0x26, 0xd4, 0xf0, 0x22, 0x64, 0x5c, + 0x58, 0x82, 0x19, 0x65, 0xfd, 0x11, 0x5a, 0x70, 0xc2, 0xcc, 0x5f, 0x43, 0x7d, 0x0f, 0x23, 0xe1, + 0x05, 0xca, 0x7c, 0xe4, 0x16, 0x14, 0xe5, 0x87, 0x1b, 0xb9, 0xb5, 0xdc, 0x7a, 0x6d, 0xa7, 0xf0, + 0xd5, 0x76, 0x9e, 0x2a, 0x01, 0xb9, 0x09, 0xe5, 0x28, 0xee, 0x44, 0x28, 0x8c, 0xbc, 0x9c, 0xa2, + 0xc9, 0x88, 0xfc, 0x04, 0x8a, 0x92, 0xc9, 0x28, 0xac, 0xe5, 0xd6, 0xeb, 0x9b, 0xdf, 0x99, 0xb2, + 0xa9, 0x23, 0xc6, 0xc5, 0x31, 0xfa, 0xe8, 0x08, 0xc6, 0xa9, 0x02, 0x99, 0x7f, 0xac, 0x42, 0x6d, + 0x68, 0x1b, 0x42, 0xa0, 0x18, 0xd8, 0x7d, 0x34, 0x56, 0xd4, 0x02, 0xea, 0x37, 0xd9, 0x86, 0x52, + 0xdf, 0x16, 0x4e, 0x4f, 0x79, 0xa5, 0xbe, 0xf9, 0xdd, 0x19, 0x46, 0x7e, 0x29, 0x75, 0x29, 0xbe, + 0x8e, 0x31, 0x12, 0x54, 0x23, 0xc9, 0x33, 0x28, 0x71, 0xc9, 0xaf, 0xfc, 0x57, 0xdf, 0xdc, 0x98, + 0xc7, 0x4f, 0x19, 0x93, 0x50, 0x8d, 0x26, 0xbb, 0x50, 0xe5, 0xe8, 0x7a, 0x1c, 0x9d, 0x79, 0x3e, + 0x56, 0x31, 0x25, 0xea, 0x74, 0x08, 0x24, 0x4f, 0xa1, 0xea, 0xa2, 0x8f, 0xf2, 0x08, 0x19, 0x37, + 0x14, 0xc9, 0x34, 0x37, 0xee, 0x25, 0xaa, 0x74, 0x08, 0x22, 0x3f, 0x85, 0x0a, 0xc7, 0x73, 0xee, + 0x09, 0x34, 0x8a, 0x0a, 0xff, 0x70, 0xe6, 0x26, 0x94, 0x36, 0x4d, 0x61, 0x64, 0x0b, 0x2a, 0xc2, + 0xeb, 0x23, 0x8b, 0x85, 0x51, 0x56, 0x0c, 0xb7, 0xdb, 0x3a, 0x58, 0xda, 0x69, 0xb0, 0xb4, 0xf7, + 0x92, 0x60, 0xa2, 0xa9, 0x26, 0x79, 0x22, 0x97, 0x15, 0xdc, 0xc3, 0xc8, 0xa8, 0x28, 0xd0, 0xcc, + 0xd3, 0x8e, 0x82, 0x0f, 0x68, 0x0a, 0x22, 0xbb, 0x50, 0x3a, 0xb5, 0x63, 0x5f, 0x18, 0x55, 0x85, + 0xfe, 0x78, 0x06, 0xfa, 0x53, 0xa9, 0xfb, 0x3c, 0xf8, 0x15, 0x3a, 0xda, 0x03, 0x0a, 0x4b, 0x9e, + 0x40, 0xb9, 0xef, 0x71, 0xce, 0xb8, 0x51, 0x9b, 0xf9, 0xe9, 0x59, 0x07, 0x26, 0x28, 0xf2, 0x19, + 0x2c, 0xe9, 0x5f, 0x56, 0x88, 0xdc, 0xc1, 0x40, 0x18, 0x44, 0xf1, 0xdc, 0x99, 0x30, 0xc0, 0x17, + 0xcf, 0x03, 0xb1, 0xb5, 0xf9, 0xa5, 0xed, 0xc7, 0xb8, 0x93, 0x37, 0x72, 0xb4, 0xa9, 0x71, 0x47, + 0x1a, 0x46, 0x0e, 0x61, 0x65, 0x9c, 0xc8, 0xee, 0xa2, 0x71, 0x5d, 0x71, 0x99, 0xd3, 0x02, 0x40, + 0x2b, 0xd3, 0xd6, 0x18, 0x9b, 0xdd, 0x45, 0xf2, 0x29, 0xd4, 0x1d, 0xc6, 0x23, 0x2b, 0x64, 0xbe, + 0xe7, 0x0c, 0x0c, 0x50, 0x54, 0x0f, 0xa6, 0x50, 0xed, 0x32, 0x1e, 0x1d, 0x29, 0x65, 0x0a, 0xce, + 0xf0, 0x37, 0x79, 0x0c, 0x95, 0x1e, 0xda, 0x2e, 0xf2, 0xc8, 0x68, 0xcd, 0xdc, 0xce, 0xbe, 0xd6, + 0xa4, 0x29, 0xe4, 0xa0, 0x58, 0x2d, 0xb5, 0xca, 0x07, 0xc5, 0x6a, 0xbd, 0xd5, 0xa2, 0x2b, 0xe7, + 0xd8, 0x89, 0x98, 0xf3, 0x0a, 0x85, 0x15, 0x87, 0x5d, 0x6e, 0xbb, 0x48, 0x97, 0x64, 0x06, 0x0d, + 0x5c, 0x2b, 0x51, 0xa7, 0xb7, 0x38, 0xf6, 0xd9, 0x19, 0x5a, 0x1c, 0xa3, 0x90, 0x05, 0x11, 0x8e, + 0x26, 0x12, 0xc5, 0x89, 0x89, 0x9b, 0x43, 0x84, 0x0a, 0xd0, 0x91, 0x7c, 0x08, 0x18, 0x93, 0x9b, + 0x8f, 0xa1, 0x9a, 0x86, 0xc0, 0x30, 0x39, 0xe4, 0x32, 0xc9, 0xe1, 0x0e, 0xd4, 0xe4, 0xdf, 0x28, + 0xb4, 0x1d, 0x4c, 0xd2, 0xd2, 0x48, 0x60, 0xfe, 0xb3, 0x00, 0x95, 0xe4, 0x1b, 0xc9, 0x4b, 0x79, + 0x7e, 0x15, 0xb9, 0x22, 0xa8, 0x6f, 0x6e, 0xcd, 0x36, 0x4c, 0xf2, 0xf7, 0x30, 0x44, 0x1d, 0x0d, + 0x11, 0x4d, 0x39, 0xc8, 0xa1, 0xcc, 0x05, 0xfa, 0xe3, 0xd4, 0xba, 0xef, 0xc8, 0x37, 0x24, 0x59, + 0xfd, 0x4b, 0x1e, 0x5a, 0x97, 0xa7, 0xc9, 0xe7, 0x50, 0x90, 0xf9, 0x56, 0x67, 0xbe, 0xc7, 0xef, + 0xb0, 0x40, 0xfb, 0x18, 0xc5, 0xb3, 0x40, 0x06, 0xa2, 0x24, 0x92, 0x7c, 0xb6, 0xeb, 0x26, 0x69, + 0xf0, 0x9d, 0xf8, 0xb6, 0x5d, 0x37, 0xe1, 0xb3, 0x5d, 0x57, 0x96, 0x04, 0xed, 0x50, 0x55, 0x01, + 0x6b, 0x34, 0x19, 0xad, 0xfe, 0x08, 0xaa, 0xe9, 0xc2, 0xa4, 0x05, 0x85, 0x57, 0x38, 0x48, 0xbc, + 0x26, 0x7f, 0xca, 0x3a, 0x7b, 0x26, 0x03, 0x2b, 0x71, 0x98, 0x1e, 0xfc, 0x38, 0xff, 0x28, 0x27, + 0x71, 0xe9, 0x02, 0x8b, 0xe0, 0xcc, 0x3f, 0xe4, 0xa0, 0x9a, 0x16, 0x4a, 0xb2, 0x3f, 0x5e, 0x30, + 0x3e, 0x9e, 0x5e, 0x5c, 0x55, 0xbd, 0xd8, 0x16, 0x82, 0x7b, 0x9d, 0x58, 0x60, 0xa4, 0x0b, 0x5e, + 0x52, 0x37, 0xb6, 0xc7, 0xeb, 0xc6, 0xb4, 0xd2, 0xf3, 0x96, 0x9a, 0x61, 0xfe, 0x5e, 0xee, 0x2c, + 0xa9, 0xc5, 0x64, 0x67, 0x7c, 0x67, 0xdf, 0x9b, 0xc2, 0xf7, 0xe2, 0x07, 0x97, 0x36, 0xf6, 0x1e, + 0xf7, 0xf4, 0xe7, 0x1a, 0xb4, 0x2e, 0x97, 0xca, 0x61, 0x74, 0xd5, 0x33, 0xd1, 0xf5, 0x08, 0x0a, + 0x31, 0xf7, 0x92, 0x78, 0x99, 0x96, 0x6b, 0x8f, 0x05, 0xf7, 0x82, 0xae, 0xe6, 0x93, 0x10, 0x99, + 0xa8, 0x23, 0xa7, 0x87, 0xfd, 0x34, 0x38, 0xe6, 0x05, 0x27, 0x28, 0x95, 0xe8, 0x51, 0xf4, 0x98, + 0x9b, 0x14, 0xda, 0xb9, 0xf1, 0x1a, 0x45, 0xf6, 0xa0, 0x66, 0xc7, 0xa2, 0xc7, 0xb8, 0x27, 0x06, + 0x73, 0x94, 0xc9, 0x2c, 0xc5, 0x08, 0x48, 0xe8, 0x28, 0x99, 0xea, 0x46, 0xed, 0xd1, 0x02, 0xcd, + 0x47, 0x1a, 0x43, 0x3a, 0x5c, 0x52, 0x22, 0x69, 0x67, 0xd5, 0x2d, 0xc9, 0xca, 0xdb, 0xd4, 0x4d, + 0x10, 0xe9, 0x40, 0x33, 0x62, 0x31, 0x77, 0xd0, 0xf2, 0xed, 0x0e, 0xfa, 0xb2, 0xc2, 0xca, 0xd5, + 0x3e, 0x59, 0x64, 0xb5, 0x63, 0x45, 0xf0, 0x42, 0xe1, 0xf5, 0x92, 0x8d, 0x28, 0x23, 0x1a, 0x6b, + 0x63, 0xab, 0x97, 0xda, 0x58, 0x0b, 0x1a, 0xaf, 0x63, 0xe4, 0x03, 0x2b, 0xb4, 0xb9, 0xdd, 0x8f, + 0x8c, 0xda, 0xec, 0xfc, 0x70, 0x79, 0xf9, 0x9f, 0x4b, 0xfc, 0x91, 0x82, 0xeb, 0xd5, 0xeb, 0xaf, + 0x47, 0x12, 0xf2, 0x10, 0x96, 0xbd, 0x6e, 0xc0, 0x38, 0x5a, 0x31, 0xf7, 0x2c, 0xc7, 0x8e, 0x50, + 0x55, 0xb8, 0x2a, 0x6d, 0x6a, 0xf1, 0x17, 0xdc, 0xdb, 0xb5, 0x23, 0x24, 0x3d, 0x58, 0x3e, 0xf7, + 0x44, 0x8f, 0xc5, 0xc3, 0x0a, 0x60, 0x34, 0xd4, 0x5e, 0x9e, 0x2e, 0xb2, 0x97, 0x5f, 0x68, 0x8a, + 0x31, 0xfb, 0x2f, 0x9d, 0x8f, 0x09, 0xc9, 0x47, 0xd0, 0x4a, 0x4c, 0x3e, 0xaa, 0x1f, 0x4d, 0x75, + 0xf4, 0x97, 0xb5, 0xfc, 0xf3, 0x54, 0xbc, 0xda, 0x81, 0x46, 0x96, 0xea, 0x8a, 0xc4, 0xf4, 0x38, + 0x9b, 0x98, 0xe6, 0x3f, 0x69, 0x99, 0xc4, 0xf7, 0x14, 0x56, 0x26, 0x1c, 0xb8, 0x50, 0xe6, 0x3c, + 0x85, 0xd6, 0x65, 0x17, 0x7c, 0x90, 0x8d, 0x7a, 0x70, 0xfd, 0x0a, 0xf3, 0x7e, 0x88, 0xa5, 0xcc, + 0x3f, 0xe5, 0xe1, 0xc6, 0x55, 0xed, 0x38, 0x79, 0x09, 0x75, 0x77, 0x34, 0x9c, 0x23, 0x3d, 0x65, + 0xc0, 0x3a, 0xbf, 0x67, 0xf1, 0xb2, 0x88, 0x9d, 0xa3, 0xd7, 0xed, 0xe9, 0x7b, 0x4d, 0x89, 0x26, + 0xa3, 0x6c, 0x2b, 0x55, 0x79, 0x97, 0x56, 0xaa, 0xd0, 0xaa, 0xfc, 0x1f, 0x3a, 0xa4, 0x01, 0xb4, + 0xbe, 0x26, 0x03, 0x99, 0xff, 0xca, 0xc3, 0xca, 0x44, 0x9d, 0x22, 0x1b, 0x70, 0x3d, 0x03, 0xb6, + 0xa2, 0xb8, 0x13, 0xe0, 0xf0, 0x4e, 0x4d, 0x32, 0x53, 0xc7, 0x7a, 0x66, 0x98, 0x11, 0xf3, 0x99, + 0x8c, 0x78, 0x7f, 0x98, 0x11, 0x35, 0x5e, 0x95, 0x81, 0x5a, 0x9a, 0xd2, 0x34, 0x92, 0x38, 0x97, + 0xd3, 0xa6, 0xbe, 0x16, 0x3f, 0x59, 0xa4, 0xac, 0x2e, 0x94, 0x37, 0x4b, 0x97, 0xf2, 0xe6, 0x55, + 0x49, 0xa4, 0x7c, 0x75, 0x12, 0xf9, 0x5f, 0x03, 0xdc, 0xfc, 0x4f, 0x1e, 0xc8, 0x64, 0xbb, 0x42, + 0xd6, 0xa0, 0x16, 0x05, 0x9e, 0x95, 0x79, 0xb7, 0xd0, 0x0e, 0xac, 0x46, 0x81, 0xb7, 0xaf, 0xde, + 0x2f, 0xde, 0xe2, 0x8f, 0xfc, 0x4c, 0x7f, 0x14, 0x32, 0xfe, 0x70, 0x2f, 0x9b, 0xba, 0x34, 0x33, + 0x2d, 0x4f, 0x6e, 0x76, 0x21, 0x5b, 0x97, 0xe7, 0xb0, 0x75, 0xe5, 0xc3, 0xd8, 0xfa, 0xa0, 0x58, + 0x2d, 0xb6, 0x4a, 0x74, 0xfc, 0x04, 0x9a, 0x0e, 0x34, 0xb2, 0x57, 0x7a, 0x49, 0x98, 0x36, 0x47, + 0x35, 0xdd, 0xf4, 0xdc, 0xc9, 0x36, 0x1d, 0xc9, 0x65, 0x64, 0xd4, 0x4c, 0xdc, 0x87, 0x66, 0xfa, + 0x08, 0x60, 0x39, 0xcc, 0xc5, 0xc4, 0xbe, 0x8d, 0x54, 0xb8, 0xcb, 0x5c, 0x34, 0x3f, 0x81, 0x7a, + 0xe6, 0xca, 0xbe, 0xe8, 0x1a, 0x26, 0x42, 0x3d, 0x93, 0x4c, 0xc9, 0x4d, 0x28, 0xe1, 0x85, 0xed, + 0x24, 0x6f, 0x39, 0xfb, 0xd7, 0xa8, 0x1e, 0x12, 0x03, 0xca, 0x21, 0xc7, 0x53, 0xef, 0x42, 0x33, + 0xec, 0x5f, 0xa3, 0xc9, 0x58, 0x22, 0x38, 0x76, 0xf1, 0x42, 0xc7, 0x9b, 0x44, 0xa8, 0xe1, 0x4e, + 0x03, 0x40, 0xb5, 0x9f, 0x96, 0x18, 0x84, 0x68, 0xfe, 0x23, 0x97, 0x3c, 0xda, 0xc8, 0x2b, 0x3e, + 0xb9, 0x07, 0x55, 0x5b, 0x08, 0xec, 0x87, 0xea, 0x04, 0xe6, 0xd6, 0x4b, 0xc9, 0x09, 0x4c, 0x85, + 0x64, 0x1b, 0x96, 0x43, 0xe4, 0x96, 0xe0, 0x03, 0x2b, 0x7d, 0x77, 0xc8, 0xcf, 0x7a, 0x77, 0x68, + 0x86, 0xc8, 0x4f, 0xf8, 0xe0, 0x24, 0x79, 0x7d, 0xb8, 0x2d, 0xaf, 0x5b, 0x92, 0x80, 0x05, 0x49, + 0x2a, 0x50, 0x0f, 0x0b, 0x83, 0xc3, 0x80, 0x50, 0xb8, 0xa5, 0xa7, 0x64, 0xe2, 0x14, 0x68, 0xf9, + 0xcc, 0xb1, 0x7d, 0x4f, 0x78, 0x18, 0x25, 0x8d, 0xdf, 0xea, 0xc4, 0x2a, 0x3b, 0x8c, 0xf9, 0xea, + 0x6a, 0x4f, 0xbf, 0xa1, 0xa0, 0x54, 0x21, 0x5f, 0x0c, 0x81, 0xe6, 0xbf, 0xf3, 0x00, 0xa3, 0x0b, + 0x36, 0x79, 0x00, 0x0d, 0xdb, 0xf7, 0xd9, 0xb9, 0xc5, 0xb8, 0xd7, 0xf5, 0x82, 0x24, 0xce, 0xf2, + 0x46, 0x8e, 0xd6, 0x95, 0xfc, 0x50, 0x89, 0xc9, 0xcf, 0xa0, 0x99, 0x55, 0x4b, 0xdb, 0xb8, 0x79, + 0x4b, 0x5f, 0x23, 0xc3, 0x15, 0xc9, 0xe3, 0xa2, 0xc9, 0x74, 0x47, 0x9b, 0x06, 0xac, 0x56, 0x7a, + 0xa9, 0x65, 0x23, 0xa5, 0xb4, 0x50, 0x15, 0x32, 0x4a, 0x69, 0xab, 0xf3, 0x00, 0x96, 0xf0, 0x22, + 0x64, 0xa3, 0x1a, 0xa3, 0xf2, 0x64, 0x8d, 0x36, 0xb5, 0x34, 0x55, 0xdb, 0x84, 0x4a, 0xdf, 0xbe, + 0xb0, 0xec, 0x2e, 0x1a, 0xa5, 0x59, 0xde, 0x29, 0xf7, 0xed, 0x8b, 0xed, 0x2e, 0x92, 0xcf, 0x60, + 0x45, 0xaf, 0xef, 0x70, 0x74, 0x31, 0x10, 0x9e, 0xed, 0x47, 0xc9, 0x9b, 0xd2, 0x34, 0xab, 0xb7, + 0x14, 0x68, 0x77, 0x84, 0x31, 0x7f, 0x57, 0x02, 0x32, 0xf9, 0xec, 0x43, 0x9e, 0x43, 0xc9, 0x45, + 0xdf, 0x1e, 0xcc, 0x73, 0x65, 0x9f, 0x40, 0xb7, 0xf7, 0x24, 0x94, 0x6a, 0x06, 0x49, 0x65, 0x77, + 0xd2, 0x32, 0xb3, 0x30, 0xd5, 0xb6, 0x84, 0x52, 0xcd, 0xb0, 0xfa, 0xdb, 0x3c, 0x94, 0x14, 0x37, + 0xb9, 0x03, 0x95, 0xf4, 0x21, 0x49, 0x9f, 0x7c, 0x79, 0x26, 0x52, 0x11, 0xd9, 0x86, 0xfa, 0xa9, + 0x77, 0x81, 0xae, 0xa5, 0xbf, 0x61, 0xd6, 0x99, 0x57, 0x61, 0xb3, 0x7f, 0x8d, 0x82, 0x02, 0xe9, + 0x05, 0xf6, 0x61, 0x45, 0x7a, 0x29, 0xd0, 0x76, 0x4a, 0x88, 0x0a, 0x33, 0x88, 0xf6, 0xaf, 0xd1, + 0x56, 0x06, 0xa5, 0x99, 0x76, 0x00, 0x32, 0x4f, 0x55, 0xa5, 0xb9, 0x9f, 0xaa, 0x32, 0xa8, 0x9d, + 0x15, 0x58, 0xee, 0x09, 0x11, 0xea, 0x6d, 0xa8, 0x54, 0xb0, 0xfa, 0xf7, 0x1c, 0x94, 0x94, 0x71, + 0xc8, 0x43, 0xa8, 0xab, 0xc9, 0x48, 0xd8, 0x22, 0x8e, 0x74, 0xab, 0x30, 0xfc, 0x24, 0x39, 0x73, + 0xac, 0x26, 0xc8, 0xb7, 0xa0, 0xde, 0xe5, 0xa1, 0x93, 0xea, 0xa5, 0x89, 0x06, 0xa4, 0x70, 0xa4, + 0x22, 0x01, 0x9b, 0x16, 0xaa, 0xb7, 0xbe, 0x62, 0xaa, 0xa2, 0x84, 0xcf, 0xd4, 0x4b, 0xde, 0xfb, + 0xf8, 0x9c, 0x06, 0x80, 0x5a, 0x40, 0x7d, 0xc9, 0x41, 0xb1, 0x9a, 0x6b, 0xe5, 0x87, 0xce, 0x33, + 0x37, 0xa1, 0x91, 0x7d, 0xae, 0x96, 0x4d, 0x50, 0x10, 0xf7, 0x3b, 0xc8, 0x95, 0xa7, 0x9b, 0x34, + 0x19, 0x1d, 0x14, 0xab, 0xf9, 0x56, 0x41, 0xdf, 0x97, 0xcd, 0x7b, 0x50, 0x49, 0x1f, 0x08, 0x87, + 0xc5, 0x45, 0x6a, 0xe7, 0x92, 0xe2, 0xb2, 0xd3, 0xfe, 0xeb, 0x9b, 0xbb, 0xb9, 0xbf, 0xbd, 0xb9, + 0x9b, 0xfb, 0xea, 0xcd, 0xdd, 0xdc, 0x2f, 0xd7, 0xf4, 0x76, 0x3d, 0xa6, 0xfe, 0xcb, 0x71, 0xc5, + 0xbf, 0x4d, 0x3a, 0x65, 0xe5, 0xdb, 0xad, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0xc4, 0xf5, 0xff, + 0x26, 0x54, 0x19, 0x00, 0x00, +} + +func (m *VirtualService) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *VirtualService) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VirtualService) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.ExportTo) > 0 { + for iNdEx := len(m.ExportTo) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ExportTo[iNdEx]) + copy(dAtA[i:], m.ExportTo[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.ExportTo[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Tls) > 0 { + for iNdEx := len(m.Tls) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tls[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.Tcp) > 0 { + for iNdEx := len(m.Tcp) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tcp[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Http) > 0 { + for iNdEx := len(m.Http) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Http[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Gateways) > 0 { + for iNdEx := len(m.Gateways) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Gateways[iNdEx]) + copy(dAtA[i:], m.Gateways[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Gateways[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Hosts) > 0 { + for iNdEx := len(m.Hosts) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Hosts[iNdEx]) + copy(dAtA[i:], m.Hosts[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Hosts[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Destination) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Destination) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Destination) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Port != nil { + { + size, err := m.Port.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Subset) > 0 { + i -= len(m.Subset) + copy(dAtA[i:], m.Subset) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Subset))) + i-- + dAtA[i] = 0x12 + } + if len(m.Host) > 0 { + i -= len(m.Host) + copy(dAtA[i:], m.Host) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Host))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HTTPRoute) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HTTPRoute) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPRoute) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Delegate != nil { + { + size, err := m.Delegate.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa2 + } + if m.MirrorPercentage != nil { + { + size, err := m.MirrorPercentage.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x9a + } + if m.MirrorPercent != nil { + { + size, err := m.MirrorPercent.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } + if m.Headers != nil { + { + size, err := m.Headers.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 + } + if m.CorsPolicy != nil { + { + size, err := m.CorsPolicy.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + } + if m.Mirror != nil { + { + size, err := m.Mirror.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } + if m.Fault != nil { + { + size, err := m.Fault.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + if m.Retries != nil { + { + size, err := m.Retries.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.Timeout != nil { + { + size, err := m.Timeout.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.Rewrite != nil { + { + size, err := m.Rewrite.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Redirect != nil { + { + size, err := m.Redirect.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.Route) > 0 { + for iNdEx := len(m.Route) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Route[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Match) > 0 { + for iNdEx := len(m.Match) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Match[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *Delegate) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Delegate) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Delegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Namespace) > 0 { + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Headers) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Headers) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Headers) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Response != nil { + { + size, err := m.Response.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Request != nil { + { + size, err := m.Request.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Headers_HeaderOperations) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Headers_HeaderOperations) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Headers_HeaderOperations) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Remove) > 0 { + for iNdEx := len(m.Remove) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Remove[iNdEx]) + copy(dAtA[i:], m.Remove[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Remove[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Add) > 0 { + for k := range m.Add { + v := m.Add[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintVirtualService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Set) > 0 { + for k := range m.Set { + v := m.Set[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintVirtualService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *TLSRoute) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TLSRoute) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TLSRoute) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Route) > 0 { + for iNdEx := len(m.Route) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Route[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Match) > 0 { + for iNdEx := len(m.Match) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Match[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *TCPRoute) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TCPRoute) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TCPRoute) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Route) > 0 { + for iNdEx := len(m.Route) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Route[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.Match) > 0 { + for iNdEx := len(m.Match) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Match[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *HTTPMatchRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HTTPMatchRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPMatchRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.SourceNamespace) > 0 { + i -= len(m.SourceNamespace) + copy(dAtA[i:], m.SourceNamespace) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.SourceNamespace))) + i-- + dAtA[i] = 0x6a + } + if len(m.WithoutHeaders) > 0 { + for k := range m.WithoutHeaders { + v := m.WithoutHeaders[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintVirtualService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x62 + } + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x5a + } + if m.IgnoreUriCase { + i-- + if m.IgnoreUriCase { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x50 + } + if len(m.QueryParams) > 0 { + for k := range m.QueryParams { + v := m.QueryParams[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintVirtualService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x4a + } + } + if len(m.Gateways) > 0 { + for iNdEx := len(m.Gateways) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Gateways[iNdEx]) + copy(dAtA[i:], m.Gateways[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Gateways[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if len(m.SourceLabels) > 0 { + for k := range m.SourceLabels { + v := m.SourceLabels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintVirtualService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x3a + } + } + if m.Port != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x30 + } + if len(m.Headers) > 0 { + for k := range m.Headers { + v := m.Headers[k] + baseI := i + if v != nil { + { + size, err := v.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintVirtualService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + if m.Authority != nil { + { + size, err := m.Authority.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if m.Method != nil { + { + size, err := m.Method.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.Scheme != nil { + { + size, err := m.Scheme.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Uri != nil { + { + size, err := m.Uri.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HTTPRouteDestination) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HTTPRouteDestination) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPRouteDestination) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Headers != nil { + { + size, err := m.Headers.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + if m.Weight != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Weight)) + i-- + dAtA[i] = 0x10 + } + if m.Destination != nil { + { + size, err := m.Destination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RouteDestination) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RouteDestination) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RouteDestination) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Weight != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Weight)) + i-- + dAtA[i] = 0x10 + } + if m.Destination != nil { + { + size, err := m.Destination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *L4MatchAttributes) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *L4MatchAttributes) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *L4MatchAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.SourceNamespace) > 0 { + i -= len(m.SourceNamespace) + copy(dAtA[i:], m.SourceNamespace) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.SourceNamespace))) + i-- + dAtA[i] = 0x32 + } + if len(m.Gateways) > 0 { + for iNdEx := len(m.Gateways) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Gateways[iNdEx]) + copy(dAtA[i:], m.Gateways[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Gateways[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.SourceLabels) > 0 { + for k := range m.SourceLabels { + v := m.SourceLabels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintVirtualService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x22 + } + } + if len(m.SourceSubnet) > 0 { + i -= len(m.SourceSubnet) + copy(dAtA[i:], m.SourceSubnet) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.SourceSubnet))) + i-- + dAtA[i] = 0x1a + } + if m.Port != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x10 + } + if len(m.DestinationSubnets) > 0 { + for iNdEx := len(m.DestinationSubnets) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DestinationSubnets[iNdEx]) + copy(dAtA[i:], m.DestinationSubnets[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.DestinationSubnets[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *TLSMatchAttributes) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TLSMatchAttributes) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TLSMatchAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.SourceNamespace) > 0 { + i -= len(m.SourceNamespace) + copy(dAtA[i:], m.SourceNamespace) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.SourceNamespace))) + i-- + dAtA[i] = 0x3a + } + if len(m.Gateways) > 0 { + for iNdEx := len(m.Gateways) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Gateways[iNdEx]) + copy(dAtA[i:], m.Gateways[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Gateways[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.SourceLabels) > 0 { + for k := range m.SourceLabels { + v := m.SourceLabels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintVirtualService(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintVirtualService(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintVirtualService(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x2a + } + } + if m.Port != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x18 + } + if len(m.DestinationSubnets) > 0 { + for iNdEx := len(m.DestinationSubnets) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.DestinationSubnets[iNdEx]) + copy(dAtA[i:], m.DestinationSubnets[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.DestinationSubnets[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.SniHosts) > 0 { + for iNdEx := len(m.SniHosts) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SniHosts[iNdEx]) + copy(dAtA[i:], m.SniHosts[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.SniHosts[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *HTTPRedirect) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HTTPRedirect) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPRedirect) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.RedirectCode != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.RedirectCode)) + i-- + dAtA[i] = 0x18 + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0x12 + } + if len(m.Uri) > 0 { + i -= len(m.Uri) + copy(dAtA[i:], m.Uri) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Uri))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HTTPRewrite) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HTTPRewrite) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPRewrite) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0x12 + } + if len(m.Uri) > 0 { + i -= len(m.Uri) + copy(dAtA[i:], m.Uri) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Uri))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StringMatch) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *StringMatch) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StringMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.MatchType != nil { + { + size := m.MatchType.Size() + i -= size + if _, err := m.MatchType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *StringMatch_Exact) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *StringMatch_Exact) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Exact) + copy(dAtA[i:], m.Exact) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Exact))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} +func (m *StringMatch_Prefix) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *StringMatch_Prefix) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Prefix) + copy(dAtA[i:], m.Prefix) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Prefix))) + i-- + dAtA[i] = 0x12 + return len(dAtA) - i, nil +} +func (m *StringMatch_Regex) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *StringMatch_Regex) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Regex) + copy(dAtA[i:], m.Regex) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Regex))) + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil +} +func (m *HTTPRetry) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HTTPRetry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPRetry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.RetryRemoteLocalities != nil { + { + size, err := m.RetryRemoteLocalities.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + if len(m.RetryOn) > 0 { + i -= len(m.RetryOn) + copy(dAtA[i:], m.RetryOn) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.RetryOn))) + i-- + dAtA[i] = 0x1a + } + if m.PerTryTimeout != nil { + { + size, err := m.PerTryTimeout.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Attempts != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Attempts)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *CorsPolicy) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CorsPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CorsPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.AllowOrigins) > 0 { + for iNdEx := len(m.AllowOrigins) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AllowOrigins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if m.AllowCredentials != nil { + { + size, err := m.AllowCredentials.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.MaxAge != nil { + { + size, err := m.MaxAge.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.ExposeHeaders) > 0 { + for iNdEx := len(m.ExposeHeaders) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ExposeHeaders[iNdEx]) + copy(dAtA[i:], m.ExposeHeaders[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.ExposeHeaders[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.AllowHeaders) > 0 { + for iNdEx := len(m.AllowHeaders) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AllowHeaders[iNdEx]) + copy(dAtA[i:], m.AllowHeaders[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.AllowHeaders[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.AllowMethods) > 0 { + for iNdEx := len(m.AllowMethods) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AllowMethods[iNdEx]) + copy(dAtA[i:], m.AllowMethods[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.AllowMethods[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.AllowOrigin) > 0 { + for iNdEx := len(m.AllowOrigin) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AllowOrigin[iNdEx]) + copy(dAtA[i:], m.AllowOrigin[iNdEx]) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.AllowOrigin[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *HTTPFaultInjection) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HTTPFaultInjection) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPFaultInjection) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Abort != nil { + { + size, err := m.Abort.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if m.Delay != nil { + { + size, err := m.Delay.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *HTTPFaultInjection_Delay) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HTTPFaultInjection_Delay) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPFaultInjection_Delay) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Percentage != nil { + { + size, err := m.Percentage.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.HttpDelayType != nil { + { + size := m.HttpDelayType.Size() + i -= size + if _, err := m.HttpDelayType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + if m.Percent != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Percent)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *HTTPFaultInjection_Delay_FixedDelay) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *HTTPFaultInjection_Delay_FixedDelay) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.FixedDelay != nil { + { + size, err := m.FixedDelay.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *HTTPFaultInjection_Delay_ExponentialDelay) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *HTTPFaultInjection_Delay_ExponentialDelay) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.ExponentialDelay != nil { + { + size, err := m.ExponentialDelay.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + return len(dAtA) - i, nil +} +func (m *HTTPFaultInjection_Abort) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *HTTPFaultInjection_Abort) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HTTPFaultInjection_Abort) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Percentage != nil { + { + size, err := m.Percentage.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if m.ErrorType != nil { + { + size := m.ErrorType.Size() + i -= size + if _, err := m.ErrorType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *HTTPFaultInjection_Abort_HttpStatus) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *HTTPFaultInjection_Abort_HttpStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i = encodeVarintVirtualService(dAtA, i, uint64(m.HttpStatus)) + i-- + dAtA[i] = 0x10 + return len(dAtA) - i, nil +} +func (m *HTTPFaultInjection_Abort_GrpcStatus) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *HTTPFaultInjection_Abort_GrpcStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.GrpcStatus) + copy(dAtA[i:], m.GrpcStatus) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.GrpcStatus))) + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil +} +func (m *HTTPFaultInjection_Abort_Http2Error) MarshalTo(dAtA []byte) (int, error) { + return m.MarshalToSizedBuffer(dAtA[:m.Size()]) +} + +func (m *HTTPFaultInjection_Abort_Http2Error) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Http2Error) + copy(dAtA[i:], m.Http2Error) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Http2Error))) + i-- + dAtA[i] = 0x22 + return len(dAtA) - i, nil +} +func (m *PortSelector) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *PortSelector) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PortSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Number != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Number)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *Percent) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Percent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Percent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Value != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value)))) + i-- + dAtA[i] = 0x9 + } + return len(dAtA) - i, nil +} + +func encodeVarintVirtualService(dAtA []byte, offset int, v uint64) int { + offset -= sovVirtualService(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *VirtualService) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Hosts) > 0 { + for _, s := range m.Hosts { + l = len(s) + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if len(m.Gateways) > 0 { + for _, s := range m.Gateways { + l = len(s) + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if len(m.Http) > 0 { + for _, e := range m.Http { + l = e.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if len(m.Tcp) > 0 { + for _, e := range m.Tcp { + l = e.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if len(m.Tls) > 0 { + for _, e := range m.Tls { + l = e.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if len(m.ExportTo) > 0 { + for _, s := range m.ExportTo { + l = len(s) + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Destination) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Host) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) + } + l = len(m.Subset) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.Port != nil { + l = m.Port.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *HTTPRoute) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Match) > 0 { + for _, e := range m.Match { + l = e.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if len(m.Route) > 0 { + for _, e := range m.Route { + l = e.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if m.Redirect != nil { + l = m.Redirect.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.Rewrite != nil { + l = m.Rewrite.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.Timeout != nil { + l = m.Timeout.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.Retries != nil { + l = m.Retries.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.Fault != nil { + l = m.Fault.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.Mirror != nil { + l = m.Mirror.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.CorsPolicy != nil { + l = m.CorsPolicy.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.Headers != nil { + l = m.Headers.Size() + n += 2 + l + sovVirtualService(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 2 + l + sovVirtualService(uint64(l)) + } + if m.MirrorPercent != nil { + l = m.MirrorPercent.Size() + n += 2 + l + sovVirtualService(uint64(l)) + } + if m.MirrorPercentage != nil { + l = m.MirrorPercentage.Size() + n += 2 + l + sovVirtualService(uint64(l)) + } + if m.Delegate != nil { + l = m.Delegate.Size() + n += 2 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Delegate) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) + } + l = len(m.Namespace) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Headers) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Request != nil { + l = m.Request.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.Response != nil { + l = m.Response.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Headers_HeaderOperations) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Set) > 0 { + for k, v := range m.Set { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovVirtualService(uint64(len(k))) + 1 + len(v) + sovVirtualService(uint64(len(v))) + n += mapEntrySize + 1 + sovVirtualService(uint64(mapEntrySize)) + } + } + if len(m.Add) > 0 { + for k, v := range m.Add { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovVirtualService(uint64(len(k))) + 1 + len(v) + sovVirtualService(uint64(len(v))) + n += mapEntrySize + 1 + sovVirtualService(uint64(mapEntrySize)) + } + } + if len(m.Remove) > 0 { + for _, s := range m.Remove { + l = len(s) + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *TLSRoute) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Match) > 0 { + for _, e := range m.Match { + l = e.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if len(m.Route) > 0 { + for _, e := range m.Route { + l = e.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *TCPRoute) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Match) > 0 { + for _, e := range m.Match { + l = e.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if len(m.Route) > 0 { + for _, e := range m.Route { + l = e.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *HTTPMatchRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Uri != nil { + l = m.Uri.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.Scheme != nil { + l = m.Scheme.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.Method != nil { + l = m.Method.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.Authority != nil { + l = m.Authority.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if len(m.Headers) > 0 { + for k, v := range m.Headers { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovVirtualService(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovVirtualService(uint64(len(k))) + l + n += mapEntrySize + 1 + sovVirtualService(uint64(mapEntrySize)) + } + } + if m.Port != 0 { + n += 1 + sovVirtualService(uint64(m.Port)) + } + if len(m.SourceLabels) > 0 { + for k, v := range m.SourceLabels { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovVirtualService(uint64(len(k))) + 1 + len(v) + sovVirtualService(uint64(len(v))) + n += mapEntrySize + 1 + sovVirtualService(uint64(mapEntrySize)) + } + } + if len(m.Gateways) > 0 { + for _, s := range m.Gateways { + l = len(s) + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if len(m.QueryParams) > 0 { + for k, v := range m.QueryParams { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovVirtualService(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovVirtualService(uint64(len(k))) + l + n += mapEntrySize + 1 + sovVirtualService(uint64(mapEntrySize)) + } + } + if m.IgnoreUriCase { + n += 2 + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) + } + if len(m.WithoutHeaders) > 0 { + for k, v := range m.WithoutHeaders { + _ = k + _ = v + l = 0 + if v != nil { + l = v.Size() + l += 1 + sovVirtualService(uint64(l)) + } + mapEntrySize := 1 + len(k) + sovVirtualService(uint64(len(k))) + l + n += mapEntrySize + 1 + sovVirtualService(uint64(mapEntrySize)) + } + } + l = len(m.SourceNamespace) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *HTTPRouteDestination) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Destination != nil { + l = m.Destination.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.Weight != 0 { + n += 1 + sovVirtualService(uint64(m.Weight)) + } + if m.Headers != nil { + l = m.Headers.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RouteDestination) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Destination != nil { + l = m.Destination.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.Weight != 0 { + n += 1 + sovVirtualService(uint64(m.Weight)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *L4MatchAttributes) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.DestinationSubnets) > 0 { + for _, s := range m.DestinationSubnets { + l = len(s) + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if m.Port != 0 { + n += 1 + sovVirtualService(uint64(m.Port)) + } + l = len(m.SourceSubnet) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) + } + if len(m.SourceLabels) > 0 { + for k, v := range m.SourceLabels { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovVirtualService(uint64(len(k))) + 1 + len(v) + sovVirtualService(uint64(len(v))) + n += mapEntrySize + 1 + sovVirtualService(uint64(mapEntrySize)) + } + } + if len(m.Gateways) > 0 { + for _, s := range m.Gateways { + l = len(s) + n += 1 + l + sovVirtualService(uint64(l)) + } + } + l = len(m.SourceNamespace) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *TLSMatchAttributes) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.SniHosts) > 0 { + for _, s := range m.SniHosts { + l = len(s) + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if len(m.DestinationSubnets) > 0 { + for _, s := range m.DestinationSubnets { + l = len(s) + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if m.Port != 0 { + n += 1 + sovVirtualService(uint64(m.Port)) + } + if len(m.SourceLabels) > 0 { + for k, v := range m.SourceLabels { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovVirtualService(uint64(len(k))) + 1 + len(v) + sovVirtualService(uint64(len(v))) + n += mapEntrySize + 1 + sovVirtualService(uint64(mapEntrySize)) + } + } + if len(m.Gateways) > 0 { + for _, s := range m.Gateways { + l = len(s) + n += 1 + l + sovVirtualService(uint64(l)) + } + } + l = len(m.SourceNamespace) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *HTTPRedirect) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Uri) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) + } + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.RedirectCode != 0 { + n += 1 + sovVirtualService(uint64(m.RedirectCode)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *HTTPRewrite) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Uri) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) + } + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *StringMatch) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MatchType != nil { + n += m.MatchType.Size() + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *StringMatch_Exact) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Exact) + n += 1 + l + sovVirtualService(uint64(l)) + return n +} +func (m *StringMatch_Prefix) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Prefix) + n += 1 + l + sovVirtualService(uint64(l)) + return n +} +func (m *StringMatch_Regex) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Regex) + n += 1 + l + sovVirtualService(uint64(l)) + return n +} +func (m *HTTPRetry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Attempts != 0 { + n += 1 + sovVirtualService(uint64(m.Attempts)) + } + if m.PerTryTimeout != nil { + l = m.PerTryTimeout.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + l = len(m.RetryOn) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.RetryRemoteLocalities != nil { + l = m.RetryRemoteLocalities.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *CorsPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.AllowOrigin) > 0 { + for _, s := range m.AllowOrigin { + l = len(s) + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if len(m.AllowMethods) > 0 { + for _, s := range m.AllowMethods { + l = len(s) + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if len(m.AllowHeaders) > 0 { + for _, s := range m.AllowHeaders { + l = len(s) + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if len(m.ExposeHeaders) > 0 { + for _, s := range m.ExposeHeaders { + l = len(s) + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if m.MaxAge != nil { + l = m.MaxAge.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.AllowCredentials != nil { + l = m.AllowCredentials.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if len(m.AllowOrigins) > 0 { + for _, e := range m.AllowOrigins { + l = e.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *HTTPFaultInjection) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Delay != nil { + l = m.Delay.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.Abort != nil { + l = m.Abort.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *HTTPFaultInjection_Delay) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Percent != 0 { + n += 1 + sovVirtualService(uint64(m.Percent)) + } + if m.HttpDelayType != nil { + n += m.HttpDelayType.Size() + } + if m.Percentage != nil { + l = m.Percentage.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *HTTPFaultInjection_Delay_FixedDelay) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.FixedDelay != nil { + l = m.FixedDelay.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + return n +} +func (m *HTTPFaultInjection_Delay_ExponentialDelay) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ExponentialDelay != nil { + l = m.ExponentialDelay.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + return n +} +func (m *HTTPFaultInjection_Abort) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ErrorType != nil { + n += m.ErrorType.Size() + } + if m.Percentage != nil { + l = m.Percentage.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *HTTPFaultInjection_Abort_HttpStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + n += 1 + sovVirtualService(uint64(m.HttpStatus)) + return n +} +func (m *HTTPFaultInjection_Abort_GrpcStatus) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.GrpcStatus) + n += 1 + l + sovVirtualService(uint64(l)) + return n +} +func (m *HTTPFaultInjection_Abort_Http2Error) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Http2Error) + n += 1 + l + sovVirtualService(uint64(l)) + return n +} +func (m *PortSelector) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Number != 0 { + n += 1 + sovVirtualService(uint64(m.Number)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *Percent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Value != 0 { + n += 9 + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovVirtualService(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozVirtualService(x uint64) (n int) { + return sovVirtualService(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *VirtualService) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: VirtualService: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: VirtualService: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Hosts", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Hosts = append(m.Hosts, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gateways", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Gateways = append(m.Gateways, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Http", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Http = append(m.Http, &HTTPRoute{}) + if err := m.Http[len(m.Http)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tcp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tcp = append(m.Tcp, &TCPRoute{}) + if err := m.Tcp[len(m.Tcp)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tls", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tls = append(m.Tls, &TLSRoute{}) + if err := m.Tls[len(m.Tls)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExportTo", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExportTo = append(m.ExportTo, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Destination) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Destination: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Destination: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Host", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Host = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subset", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subset = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Port == nil { + m.Port = &PortSelector{} + } + if err := m.Port.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HTTPRoute) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HTTPRoute: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HTTPRoute: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Match", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Match = append(m.Match, &HTTPMatchRequest{}) + if err := m.Match[len(m.Match)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Route", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Route = append(m.Route, &HTTPRouteDestination{}) + if err := m.Route[len(m.Route)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Redirect", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Redirect == nil { + m.Redirect = &HTTPRedirect{} + } + if err := m.Redirect.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rewrite", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Rewrite == nil { + m.Rewrite = &HTTPRewrite{} + } + if err := m.Rewrite.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Timeout == nil { + m.Timeout = &types.Duration{} + } + if err := m.Timeout.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Retries", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Retries == nil { + m.Retries = &HTTPRetry{} + } + if err := m.Retries.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Fault", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Fault == nil { + m.Fault = &HTTPFaultInjection{} + } + if err := m.Fault.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Mirror", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Mirror == nil { + m.Mirror = &Destination{} + } + if err := m.Mirror.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CorsPolicy", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.CorsPolicy == nil { + m.CorsPolicy = &CorsPolicy{} + } + if err := m.CorsPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 16: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Headers == nil { + m.Headers = &Headers{} + } + if err := m.Headers.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MirrorPercent", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MirrorPercent == nil { + m.MirrorPercent = &types.UInt32Value{} + } + if err := m.MirrorPercent.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 19: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MirrorPercentage", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MirrorPercentage == nil { + m.MirrorPercentage = &Percent{} + } + if err := m.MirrorPercentage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 20: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delegate", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Delegate == nil { + m.Delegate = &Delegate{} + } + if err := m.Delegate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Delegate) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Delegate: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Delegate: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Namespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Headers) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Headers: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Headers: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Request", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Request == nil { + m.Request = &Headers_HeaderOperations{} + } + if err := m.Request.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Response == nil { + m.Response = &Headers_HeaderOperations{} + } + if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Headers_HeaderOperations) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HeaderOperations: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HeaderOperations: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Set", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Set == nil { + m.Set = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthVirtualService + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthVirtualService + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthVirtualService + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthVirtualService + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Set[mapkey] = mapvalue + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Add", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Add == nil { + m.Add = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthVirtualService + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthVirtualService + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthVirtualService + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthVirtualService + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Add[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Remove", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Remove = append(m.Remove, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TLSRoute) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TLSRoute: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TLSRoute: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Match", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Match = append(m.Match, &TLSMatchAttributes{}) + if err := m.Match[len(m.Match)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Route", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Route = append(m.Route, &RouteDestination{}) + if err := m.Route[len(m.Route)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TCPRoute) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TCPRoute: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TCPRoute: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Match", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Match = append(m.Match, &L4MatchAttributes{}) + if err := m.Match[len(m.Match)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Route", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Route = append(m.Route, &RouteDestination{}) + if err := m.Route[len(m.Route)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HTTPMatchRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HTTPMatchRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HTTPMatchRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Uri == nil { + m.Uri = &StringMatch{} + } + if err := m.Uri.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Scheme", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Scheme == nil { + m.Scheme = &StringMatch{} + } + if err := m.Scheme.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Method", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Method == nil { + m.Method = &StringMatch{} + } + if err := m.Method.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Authority == nil { + m.Authority = &StringMatch{} + } + if err := m.Authority.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Headers == nil { + m.Headers = make(map[string]*StringMatch) + } + var mapkey string + var mapvalue *StringMatch + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthVirtualService + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthVirtualService + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthVirtualService + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &StringMatch{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Headers[mapkey] = mapvalue + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + m.Port = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Port |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceLabels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SourceLabels == nil { + m.SourceLabels = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthVirtualService + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthVirtualService + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthVirtualService + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthVirtualService + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.SourceLabels[mapkey] = mapvalue + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gateways", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Gateways = append(m.Gateways, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field QueryParams", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.QueryParams == nil { + m.QueryParams = make(map[string]*StringMatch) + } + var mapkey string + var mapvalue *StringMatch + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthVirtualService + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthVirtualService + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthVirtualService + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &StringMatch{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.QueryParams[mapkey] = mapvalue + iNdEx = postIndex + case 10: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IgnoreUriCase", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IgnoreUriCase = bool(v != 0) + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WithoutHeaders", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.WithoutHeaders == nil { + m.WithoutHeaders = make(map[string]*StringMatch) + } + var mapkey string + var mapvalue *StringMatch + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthVirtualService + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthVirtualService + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var mapmsglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapmsglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if mapmsglen < 0 { + return ErrInvalidLengthVirtualService + } + postmsgIndex := iNdEx + mapmsglen + if postmsgIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postmsgIndex > l { + return io.ErrUnexpectedEOF + } + mapvalue = &StringMatch{} + if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { + return err + } + iNdEx = postmsgIndex + } else { + iNdEx = entryPreIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.WithoutHeaders[mapkey] = mapvalue + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceNamespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourceNamespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HTTPRouteDestination) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HTTPRouteDestination: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HTTPRouteDestination: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Destination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Destination == nil { + m.Destination = &Destination{} + } + if err := m.Destination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) + } + m.Weight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Weight |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Headers == nil { + m.Headers = &Headers{} + } + if err := m.Headers.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RouteDestination) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RouteDestination: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RouteDestination: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Destination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Destination == nil { + m.Destination = &Destination{} + } + if err := m.Destination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) + } + m.Weight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Weight |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *L4MatchAttributes) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: L4MatchAttributes: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: L4MatchAttributes: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestinationSubnets", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestinationSubnets = append(m.DestinationSubnets, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + m.Port = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Port |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceSubnet", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourceSubnet = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceLabels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SourceLabels == nil { + m.SourceLabels = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthVirtualService + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthVirtualService + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthVirtualService + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthVirtualService + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.SourceLabels[mapkey] = mapvalue + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gateways", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Gateways = append(m.Gateways, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceNamespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourceNamespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TLSMatchAttributes) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TLSMatchAttributes: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TLSMatchAttributes: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SniHosts", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SniHosts = append(m.SniHosts, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DestinationSubnets", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DestinationSubnets = append(m.DestinationSubnets, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + } + m.Port = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Port |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceLabels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SourceLabels == nil { + m.SourceLabels = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthVirtualService + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthVirtualService + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthVirtualService + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthVirtualService + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.SourceLabels[mapkey] = mapvalue + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Gateways", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Gateways = append(m.Gateways, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SourceNamespace", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SourceNamespace = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HTTPRedirect) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HTTPRedirect: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HTTPRedirect: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uri = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RedirectCode", wireType) + } + m.RedirectCode = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RedirectCode |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HTTPRewrite) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HTTPRewrite: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HTTPRewrite: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Uri", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Uri = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StringMatch) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: StringMatch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StringMatch: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Exact", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MatchType = &StringMatch_Exact{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Prefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MatchType = &StringMatch_Prefix{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Regex", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MatchType = &StringMatch_Regex{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HTTPRetry) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HTTPRetry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HTTPRetry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Attempts", wireType) + } + m.Attempts = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Attempts |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PerTryTimeout", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PerTryTimeout == nil { + m.PerTryTimeout = &types.Duration{} + } + if err := m.PerTryTimeout.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RetryOn", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RetryOn = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RetryRemoteLocalities", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RetryRemoteLocalities == nil { + m.RetryRemoteLocalities = &types.BoolValue{} + } + if err := m.RetryRemoteLocalities.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CorsPolicy) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CorsPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CorsPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowOrigin", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllowOrigin = append(m.AllowOrigin, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowMethods", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllowMethods = append(m.AllowMethods, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowHeaders", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllowHeaders = append(m.AllowHeaders, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExposeHeaders", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExposeHeaders = append(m.ExposeHeaders, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxAge", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MaxAge == nil { + m.MaxAge = &types.Duration{} + } + if err := m.MaxAge.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowCredentials", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.AllowCredentials == nil { + m.AllowCredentials = &types.BoolValue{} + } + if err := m.AllowCredentials.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowOrigins", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllowOrigins = append(m.AllowOrigins, &StringMatch{}) + if err := m.AllowOrigins[len(m.AllowOrigins)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HTTPFaultInjection) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: HTTPFaultInjection: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: HTTPFaultInjection: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Delay", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Delay == nil { + m.Delay = &HTTPFaultInjection_Delay{} + } + if err := m.Delay.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Abort", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Abort == nil { + m.Abort = &HTTPFaultInjection_Abort{} + } + if err := m.Abort.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HTTPFaultInjection_Delay) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Delay: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Delay: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Percent", wireType) + } + m.Percent = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Percent |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FixedDelay", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &types.Duration{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.HttpDelayType = &HTTPFaultInjection_Delay_FixedDelay{v} + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExponentialDelay", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + v := &types.Duration{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.HttpDelayType = &HTTPFaultInjection_Delay_ExponentialDelay{v} + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Percentage", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Percentage == nil { + m.Percentage = &Percent{} + } + if err := m.Percentage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *HTTPFaultInjection_Abort) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Abort: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Abort: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HttpStatus", wireType) + } + var v int32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int32(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ErrorType = &HTTPFaultInjection_Abort_HttpStatus{v} + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GrpcStatus", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ErrorType = &HTTPFaultInjection_Abort_GrpcStatus{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Http2Error", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ErrorType = &HTTPFaultInjection_Abort_Http2Error{string(dAtA[iNdEx:postIndex])} + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Percentage", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthVirtualService + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthVirtualService + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Percentage == nil { + m.Percentage = &Percent{} + } + if err := m.Percentage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *PortSelector) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: PortSelector: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: PortSelector: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Number", wireType) + } + m.Number = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Number |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Percent) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowVirtualService + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Percent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Percent: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Value = float64(math.Float64frombits(v)) + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthVirtualService + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipVirtualService(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowVirtualService + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowVirtualService + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowVirtualService + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthVirtualService + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthVirtualService + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowVirtualService + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipVirtualService(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthVirtualService + } + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthVirtualService = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowVirtualService = fmt.Errorf("proto: integer overflow") +) diff --git a/vendor/istio.io/api/networking/v1alpha3/virtual_service.pb.html b/vendor/istio.io/api/networking/v1alpha3/virtual_service.pb.html new file mode 100644 index 0000000000..aba8e46cb0 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/virtual_service.pb.html @@ -0,0 +1,2784 @@ +--- +title: Virtual Service +description: Configuration affecting label/content routing, sni routing, etc. +location: https://istio.io/docs/reference/config/networking/virtual-service.html +layout: protoc-gen-docs +generator: protoc-gen-docs +schema: istio.networking.v1alpha3.VirtualService +aliases: [/docs/reference/config/networking/v1alpha3/virtual-service] +number_of_entries: 24 +--- +

Configuration affecting traffic routing. Here are a few terms useful to define +in the context of traffic routing.

+ +

Service a unit of application behavior bound to a unique name in a +service registry. Services consist of multiple network endpoints +implemented by workload instances running on pods, containers, VMs etc.

+ +

Service versions (a.k.a. subsets) - In a continuous deployment +scenario, for a given service, there can be distinct subsets of +instances running different variants of the application binary. These +variants are not necessarily different API versions. They could be +iterative changes to the same service, deployed in different +environments (prod, staging, dev, etc.). Common scenarios where this +occurs include A/B testing, canary rollouts, etc. The choice of a +particular version can be decided based on various criterion (headers, +url, etc.) and/or by weights assigned to each version. Each service has +a default version consisting of all its instances.

+ +

Source - A downstream client calling a service.

+ +

Host - The address used by a client when attempting to connect to a +service.

+ +

Access model - Applications address only the destination service +(Host) without knowledge of individual service versions (subsets). The +actual choice of the version is determined by the proxy/sidecar, enabling the +application code to decouple itself from the evolution of dependent +services.

+ +

A VirtualService defines a set of traffic routing rules to apply when a host is +addressed. Each routing rule defines matching criteria for traffic of a specific +protocol. If the traffic is matched, then it is sent to a named destination service +(or subset/version of it) defined in the registry.

+ +

The source of traffic can also be matched in a routing rule. This allows routing +to be customized for specific client contexts.

+ +

The following example on Kubernetes, routes all HTTP traffic by default to +pods of the reviews service with label “version: v1”. In addition, +HTTP requests with path starting with /wpcatalog/ or /consumercatalog/ will +be rewritten to /newcatalog and sent to pods with label “version: v2”.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: reviews-route
+spec:
+  hosts:
+  - reviews.prod.svc.cluster.local
+  http:
+  - name: "reviews-v2-routes"
+    match:
+    - uri:
+        prefix: "/wpcatalog"
+    - uri:
+        prefix: "/consumercatalog"
+    rewrite:
+      uri: "/newcatalog"
+    route:
+    - destination:
+        host: reviews.prod.svc.cluster.local
+        subset: v2
+  - name: "reviews-v1-route"
+    route:
+    - destination:
+        host: reviews.prod.svc.cluster.local
+        subset: v1
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: VirtualService
+metadata:
+  name: reviews-route
+spec:
+  hosts:
+  - reviews.prod.svc.cluster.local
+  http:
+  - name: "reviews-v2-routes"
+    match:
+    - uri:
+        prefix: "/wpcatalog"
+    - uri:
+        prefix: "/consumercatalog"
+    rewrite:
+      uri: "/newcatalog"
+    route:
+    - destination:
+        host: reviews.prod.svc.cluster.local
+        subset: v2
+  - name: "reviews-v1-route"
+    route:
+    - destination:
+        host: reviews.prod.svc.cluster.local
+        subset: v1
+
+ +

{{}} +{{}}

+ +

A subset/version of a route destination is identified with a reference +to a named service subset which must be declared in a corresponding +DestinationRule.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: DestinationRule
+metadata:
+  name: reviews-destination
+spec:
+  host: reviews.prod.svc.cluster.local
+  subsets:
+  - name: v1
+    labels:
+      version: v1
+  - name: v2
+    labels:
+      version: v2
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: DestinationRule
+metadata:
+  name: reviews-destination
+spec:
+  host: reviews.prod.svc.cluster.local
+  subsets:
+  - name: v1
+    labels:
+      version: v1
+  - name: v2
+    labels:
+      version: v2
+
+ +

{{}} +{{}}

+ +

VirtualService

+
+

Configuration affecting traffic routing.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
hostsstring[] +

The destination hosts to which traffic is being sent. Could +be a DNS name with wildcard prefix or an IP address. Depending on the +platform, short-names can also be used instead of a FQDN (i.e. has no +dots in the name). In such a scenario, the FQDN of the host would be +derived based on the underlying platform.

+ +

A single VirtualService can be used to describe all the traffic +properties of the corresponding hosts, including those for multiple +HTTP and TCP ports. Alternatively, the traffic properties of a host +can be defined using more than one VirtualService, with certain +caveats. Refer to the +Operations Guide +for details.

+ +

Note for Kubernetes users: When short names are used (e.g. “reviews” +instead of “reviews.default.svc.cluster.local”), Istio will interpret +the short name based on the namespace of the rule, not the service. A +rule in the “default” namespace containing a host “reviews” will be +interpreted as “reviews.default.svc.cluster.local”, irrespective of +the actual namespace associated with the reviews service. To avoid +potential misconfigurations, it is recommended to always use fully +qualified domain names over short names.

+ +

The hosts field applies to both HTTP and TCP services. Service inside +the mesh, i.e., those found in the service registry, must always be +referred to using their alphanumeric names. IP addresses are allowed +only for services defined via the Gateway.

+ +

Note: It must be empty for a delegate VirtualService.

+ +
+No +
gatewaysstring[] +

The names of gateways and sidecars that should apply these routes. +Gateways in other namespaces may be referred to by +<gateway namespace>/<gateway name>; specifying a gateway with no +namespace qualifier is the same as specifying the VirtualService’s +namespace. A single VirtualService is used for sidecars inside the mesh as +well as for one or more gateways. The selection condition imposed by this +field can be overridden using the source field in the match conditions +of protocol-specific routes. The reserved word mesh is used to imply +all the sidecars in the mesh. When this field is omitted, the default +gateway (mesh) will be used, which would apply the rule to all +sidecars in the mesh. If a list of gateway names is provided, the +rules will apply only to the gateways. To apply the rules to both +gateways and sidecars, specify mesh as one of the gateway names.

+ +
+No +
httpHTTPRoute[] +

An ordered list of route rules for HTTP traffic. HTTP routes will be +applied to platform service ports named ‘http-’/‘http2-’/‘grpc-*’, gateway +ports with protocol HTTP/HTTP2/GRPC/ TLS-terminated-HTTPS and service +entry ports using HTTP/HTTP2/GRPC protocols. The first rule matching +an incoming request is used.

+ +
+No +
tlsTLSRoute[] +

An ordered list of route rule for non-terminated TLS & HTTPS +traffic. Routing is typically performed using the SNI value presented +by the ClientHello message. TLS routes will be applied to platform +service ports named ‘https-’, ‘tls-’, unterminated gateway ports using +HTTPS/TLS protocols (i.e. with “passthrough” TLS mode) and service +entry ports using HTTPS/TLS protocols. The first rule matching an +incoming request is used. NOTE: Traffic ‘https-’ or ‘tls-’ ports +without associated virtual service will be treated as opaque TCP +traffic.

+ +
+No +
tcpTCPRoute[] +

An ordered list of route rules for opaque TCP traffic. TCP routes will +be applied to any port that is not a HTTP or TLS port. The first rule +matching an incoming request is used.

+ +
+No +
exportTostring[] +

A list of namespaces to which this virtual service is exported. Exporting a +virtual service allows it to be used by sidecars and gateways defined in +other namespaces. This feature provides a mechanism for service owners +and mesh administrators to control the visibility of virtual services +across namespace boundaries.

+ +

If no namespaces are specified then the virtual service is exported to all +namespaces by default.

+ +

The value “.” is reserved and defines an export to the same namespace that +the virtual service is declared in. Similarly the value “*” is reserved and +defines an export to all namespaces.

+ +

NOTE: in the current release, the exportTo value is restricted to +“.” or “*” (i.e., the current namespace or all namespaces).

+ +
+No +
+
+

Destination

+
+

Destination indicates the network addressable service to which the +request/connection will be sent after processing a routing rule. The +destination.host should unambiguously refer to a service in the service +registry. Istio’s service registry is composed of all the services found +in the platform’s service registry (e.g., Kubernetes services, Consul +services), as well as services declared through the +ServiceEntry resource.

+ +

Note for Kubernetes users: When short names are used (e.g. “reviews” +instead of “reviews.default.svc.cluster.local”), Istio will interpret +the short name based on the namespace of the rule, not the service. A +rule in the “default” namespace containing a host “reviews will be +interpreted as “reviews.default.svc.cluster.local”, irrespective of the +actual namespace associated with the reviews service. To avoid potential +misconfigurations, it is recommended to always use fully qualified +domain names over short names.

+ +

The following Kubernetes example routes all traffic by default to pods +of the reviews service with label “version: v1” (i.e., subset v1), and +some to subset v2, in a Kubernetes environment.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: reviews-route
+  namespace: foo
+spec:
+  hosts:
+  - reviews # interpreted as reviews.foo.svc.cluster.local
+  http:
+  - match:
+    - uri:
+        prefix: "/wpcatalog"
+    - uri:
+        prefix: "/consumercatalog"
+    rewrite:
+      uri: "/newcatalog"
+    route:
+    - destination:
+        host: reviews # interpreted as reviews.foo.svc.cluster.local
+        subset: v2
+  - route:
+    - destination:
+        host: reviews # interpreted as reviews.foo.svc.cluster.local
+        subset: v1
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: VirtualService
+metadata:
+  name: reviews-route
+  namespace: foo
+spec:
+  hosts:
+  - reviews # interpreted as reviews.foo.svc.cluster.local
+  http:
+  - match:
+    - uri:
+        prefix: "/wpcatalog"
+    - uri:
+        prefix: "/consumercatalog"
+    rewrite:
+      uri: "/newcatalog"
+    route:
+    - destination:
+        host: reviews # interpreted as reviews.foo.svc.cluster.local
+        subset: v2
+  - route:
+    - destination:
+        host: reviews # interpreted as reviews.foo.svc.cluster.local
+        subset: v1
+
+ +

{{}} +{{}}

+ +

And the associated DestinationRule

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: DestinationRule
+metadata:
+  name: reviews-destination
+  namespace: foo
+spec:
+  host: reviews # interpreted as reviews.foo.svc.cluster.local
+  subsets:
+  - name: v1
+    labels:
+      version: v1
+  - name: v2
+    labels:
+      version: v2
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: DestinationRule
+metadata:
+  name: reviews-destination
+  namespace: foo
+spec:
+  host: reviews # interpreted as reviews.foo.svc.cluster.local
+  subsets:
+  - name: v1
+    labels:
+      version: v1
+  - name: v2
+    labels:
+      version: v2
+
+ +

{{}} +{{}}

+ +

The following VirtualService sets a timeout of 5s for all calls to +productpage.prod.svc.cluster.local service in Kubernetes. Notice that +there are no subsets defined in this rule. Istio will fetch all +instances of productpage.prod.svc.cluster.local service from the service +registry and populate the sidecar’s load balancing pool. Also, notice +that this rule is set in the istio-system namespace but uses the fully +qualified domain name of the productpage service, +productpage.prod.svc.cluster.local. Therefore the rule’s namespace does +not have an impact in resolving the name of the productpage service.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: my-productpage-rule
+  namespace: istio-system
+spec:
+  hosts:
+  - productpage.prod.svc.cluster.local # ignores rule namespace
+  http:
+  - timeout: 5s
+    route:
+    - destination:
+        host: productpage.prod.svc.cluster.local
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: VirtualService
+metadata:
+  name: my-productpage-rule
+  namespace: istio-system
+spec:
+  hosts:
+  - productpage.prod.svc.cluster.local # ignores rule namespace
+  http:
+  - timeout: 5s
+    route:
+    - destination:
+        host: productpage.prod.svc.cluster.local
+
+ +

{{}} +{{}}

+ +

To control routing for traffic bound to services outside the mesh, external +services must first be added to Istio’s internal service registry using the +ServiceEntry resource. VirtualServices can then be defined to control traffic +bound to these external services. For example, the following rules define a +Service for wikipedia.org and set a timeout of 5s for HTTP requests.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: ServiceEntry
+metadata:
+  name: external-svc-wikipedia
+spec:
+  hosts:
+  - wikipedia.org
+  location: MESH_EXTERNAL
+  ports:
+  - number: 80
+    name: example-http
+    protocol: HTTP
+  resolution: DNS
+
+apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: my-wiki-rule
+spec:
+  hosts:
+  - wikipedia.org
+  http:
+  - timeout: 5s
+    route:
+    - destination:
+        host: wikipedia.org
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: ServiceEntry
+metadata:
+  name: external-svc-wikipedia
+spec:
+  hosts:
+  - wikipedia.org
+  location: MESH_EXTERNAL
+  ports:
+  - number: 80
+    name: example-http
+    protocol: HTTP
+  resolution: DNS
+
+apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: my-wiki-rule
+spec:
+  hosts:
+  - wikipedia.org
+  http:
+  - timeout: 5s
+    route:
+    - destination:
+        host: wikipedia.org
+
+ +

{{}} +{{}}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
hoststring +

The name of a service from the service registry. Service +names are looked up from the platform’s service registry (e.g., +Kubernetes services, Consul services, etc.) and from the hosts +declared by ServiceEntry. Traffic forwarded to +destinations that are not found in either of the two, will be dropped.

+ +

Note for Kubernetes users: When short names are used (e.g. “reviews” +instead of “reviews.default.svc.cluster.local”), Istio will interpret +the short name based on the namespace of the rule, not the service. A +rule in the “default” namespace containing a host “reviews will be +interpreted as “reviews.default.svc.cluster.local”, irrespective of +the actual namespace associated with the reviews service. To avoid +potential misconfiguration, it is recommended to always use fully +qualified domain names over short names.

+ +
+Yes +
subsetstring +

The name of a subset within the service. Applicable only to services +within the mesh. The subset must be defined in a corresponding +DestinationRule.

+ +
+No +
portPortSelector +

Specifies the port on the host that is being addressed. If a service +exposes only a single port it is not required to explicitly select the +port.

+ +
+No +
+
+

HTTPRoute

+
+

Describes match conditions and actions for routing HTTP/1.1, HTTP2, and +gRPC traffic. See VirtualService for usage examples.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
namestring +

The name assigned to the route for debugging purposes. The +route’s name will be concatenated with the match’s name and will +be logged in the access logs for requests matching this +route/match.

+ +
+No +
matchHTTPMatchRequest[] +

Match conditions to be satisfied for the rule to be +activated. All conditions inside a single match block have AND +semantics, while the list of match blocks have OR semantics. The rule +is matched if any one of the match blocks succeed.

+ +
+No +
routeHTTPRouteDestination[] +

A HTTP rule can either redirect or forward (default) traffic. The +forwarding target can be one of several versions of a service (see +glossary in beginning of document). Weights associated with the +service version determine the proportion of traffic it receives.

+ +
+No +
redirectHTTPRedirect +

A HTTP rule can either redirect or forward (default) traffic. If +traffic passthrough option is specified in the rule, +route/redirect will be ignored. The redirect primitive can be used to +send a HTTP 301 redirect to a different URI or Authority.

+ +
+No +
delegateDelegate +

Delegate is used to specify the particular VirtualService which +can be used to define delegate HTTPRoute. +It can be set only when Route and Redirect are empty, and the route rules of the +delegate VirtualService will be merged with that in the current one. +NOTE: + 1. Only one level delegation is supported. + 2. The delegate’s HTTPMatchRequest must be a strict subset of the root’s, + otherwise there is a conflict and the HTTPRoute will not take effect.

+ +
+No +
rewriteHTTPRewrite +

Rewrite HTTP URIs and Authority headers. Rewrite cannot be used with +Redirect primitive. Rewrite will be performed before forwarding.

+ +
+No +
timeoutDuration +

Timeout for HTTP requests.

+ +
+No +
retriesHTTPRetry +

Retry policy for HTTP requests.

+ +
+No +
faultHTTPFaultInjection +

Fault injection policy to apply on HTTP traffic at the client side. +Note that timeouts or retries will not be enabled when faults are +enabled on the client side.

+ +
+No +
mirrorDestination +

Mirror HTTP traffic to a another destination in addition to forwarding +the requests to the intended destination. Mirrored traffic is on a +best effort basis where the sidecar/gateway will not wait for the +mirrored cluster to respond before returning the response from the +original destination. Statistics will be generated for the mirrored +destination.

+ +
+No +
mirrorPercentagePercent +

Percentage of the traffic to be mirrored by the mirror field. +If this field is absent, all the traffic (100%) will be mirrored. +Max value is 100.

+ +
+No +
corsPolicyCorsPolicy +

Cross-Origin Resource Sharing policy (CORS). Refer to +CORS +for further details about cross origin resource sharing.

+ +
+No +
headersHeaders +

Header manipulation rules

+ +
+No +
mirrorPercentUInt32Value +

Percentage of the traffic to be mirrored by the mirror field. +Use of integer mirror_percent value is deprecated. Use the +double mirror_percentage field instead

+ +
+No +
+
+

Delegate

+
+

Describes the delegate VirtualService. +The following routing rules forward the traffic to /productpage by a delegate VirtualService named productpage, +forward the traffic to /reviews by a delegate VirtualService named reviews.

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: bookinfo
+spec:
+  hosts:
+  - "bookinfo.com"
+  gateways:
+  - mygateway
+  http:
+  - match:
+    - uri:
+        prefix: "/productpage"
+    delegate:
+       name: productpage
+       namespace: nsA
+  - match:
+    - uri:
+        prefix: "/reviews"
+    delegate:
+        name: reviews
+        namespace: nsB
+
+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: productpage
+  namespace: nsA
+spec:
+  http:
+  - match:
+     - uri:
+        prefix: "/productpage/v1/"
+    route:
+    - destination:
+        host: productpage-v1.nsA.svc.cluster.local
+  - route:
+    - destination:
+        host: productpage.nsA.svc.cluster.local
+
+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: reviews
+  namespace: nsB
+spec:
+  http:
+  - route:
+    - destination:
+        host: reviews.nsB.svc.cluster.local
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
namestring +

Name specifies the name of the delegate VirtualService.

+ +
+No +
namespacestring +

Namespace specifies the namespace where the delegate VirtualService resides. +By default, it is same to the root’s.

+ +
+No +
+
+

Headers

+
+ + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
requestHeaderOperations +

Header manipulation rules to apply before forwarding a request +to the destination service

+ +
+No +
responseHeaderOperations +

Header manipulation rules to apply before returning a response +to the caller

+ +
+No +
+
+

TLSRoute

+
+

Describes match conditions and actions for routing unterminated TLS +traffic (TLS/HTTPS) The following routing rule forwards unterminated TLS +traffic arriving at port 443 of gateway called “mygateway” to internal +services in the mesh based on the SNI value.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: bookinfo-sni
+spec:
+  hosts:
+  - "*.bookinfo.com"
+  gateways:
+  - mygateway
+  tls:
+  - match:
+    - port: 443
+      sniHosts:
+      - login.bookinfo.com
+    route:
+    - destination:
+        host: login.prod.svc.cluster.local
+  - match:
+    - port: 443
+      sniHosts:
+      - reviews.bookinfo.com
+    route:
+    - destination:
+        host: reviews.prod.svc.cluster.local
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: VirtualService
+metadata:
+  name: bookinfo-sni
+spec:
+  hosts:
+  - "*.bookinfo.com"
+  gateways:
+  - mygateway
+  tls:
+  - match:
+    - port: 443
+      sniHosts:
+      - login.bookinfo.com
+    route:
+    - destination:
+        host: login.prod.svc.cluster.local
+  - match:
+    - port: 443
+      sniHosts:
+      - reviews.bookinfo.com
+    route:
+    - destination:
+        host: reviews.prod.svc.cluster.local
+
+ +

{{}} +{{}}

+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
matchTLSMatchAttributes[] +

Match conditions to be satisfied for the rule to be +activated. All conditions inside a single match block have AND +semantics, while the list of match blocks have OR semantics. The rule +is matched if any one of the match blocks succeed.

+ +
+Yes +
routeRouteDestination[] +

The destination to which the connection should be forwarded to.

+ +
+No +
+
+

TCPRoute

+
+

Describes match conditions and actions for routing TCP traffic. The +following routing rule forwards traffic arriving at port 27017 for +mongo.prod.svc.cluster.local to another Mongo server on port 5555.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: bookinfo-Mongo
+spec:
+  hosts:
+  - mongo.prod.svc.cluster.local
+  tcp:
+  - match:
+    - port: 27017
+    route:
+    - destination:
+        host: mongo.backup.svc.cluster.local
+        port:
+          number: 5555
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: VirtualService
+metadata:
+  name: bookinfo-Mongo
+spec:
+  hosts:
+  - mongo.prod.svc.cluster.local
+  tcp:
+  - match:
+    - port: 27017
+    route:
+    - destination:
+        host: mongo.backup.svc.cluster.local
+        port:
+          number: 5555
+
+ +

{{}} +{{}}

+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
matchL4MatchAttributes[] +

Match conditions to be satisfied for the rule to be +activated. All conditions inside a single match block have AND +semantics, while the list of match blocks have OR semantics. The rule +is matched if any one of the match blocks succeed.

+ +
+No +
routeRouteDestination[] +

The destination to which the connection should be forwarded to.

+ +
+No +
+
+

HTTPMatchRequest

+
+

HttpMatchRequest specifies a set of criterion to be met in order for the +rule to be applied to the HTTP request. For example, the following +restricts the rule to match only requests where the URL path +starts with /ratings/v2/ and the request contains a custom end-user header +with value jason.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: ratings-route
+spec:
+  hosts:
+  - ratings.prod.svc.cluster.local
+  http:
+  - match:
+    - headers:
+        end-user:
+          exact: jason
+      uri:
+        prefix: "/ratings/v2/"
+      ignoreUriCase: true
+    route:
+    - destination:
+        host: ratings.prod.svc.cluster.local
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: VirtualService
+metadata:
+  name: ratings-route
+spec:
+  hosts:
+  - ratings.prod.svc.cluster.local
+  http:
+  - match:
+    - headers:
+        end-user:
+          exact: jason
+      uri:
+        prefix: "/ratings/v2/"
+      ignoreUriCase: true
+    route:
+    - destination:
+        host: ratings.prod.svc.cluster.local
+
+ +

{{}} +{{}}

+ +

HTTPMatchRequest CANNOT be empty. +Note: No regex string match can be set when delegate VirtualService is specified.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
namestring +

The name assigned to a match. The match’s name will be +concatenated with the parent route’s name and will be logged in +the access logs for requests matching this route.

+ +
+No +
uriStringMatch +

URI to match +values are case-sensitive and formatted as follows:

+ +
    +
  • exact: "value" for exact string match

  • + +
  • prefix: "value" for prefix-based match

  • + +
  • regex: "value" for ECMAscript style regex-based match

  • +
+ +

Note: Case-insensitive matching could be enabled via the +ignore_uri_case flag.

+ +
+No +
schemeStringMatch +

URI Scheme +values are case-sensitive and formatted as follows:

+ +
    +
  • exact: "value" for exact string match

  • + +
  • prefix: "value" for prefix-based match

  • + +
  • regex: "value" for ECMAscript style regex-based match

  • +
+ +
+No +
methodStringMatch +

HTTP Method +values are case-sensitive and formatted as follows:

+ +
    +
  • exact: "value" for exact string match

  • + +
  • prefix: "value" for prefix-based match

  • + +
  • regex: "value" for ECMAscript style regex-based match

  • +
+ +
+No +
authorityStringMatch +

HTTP Authority +values are case-sensitive and formatted as follows:

+ +
    +
  • exact: "value" for exact string match

  • + +
  • prefix: "value" for prefix-based match

  • + +
  • regex: "value" for ECMAscript style regex-based match

  • +
+ +
+No +
headersmap<string, StringMatch> +

The header keys must be lowercase and use hyphen as the separator, +e.g. x-request-id.

+ +

Header values are case-sensitive and formatted as follows:

+ +
    +
  • exact: "value" for exact string match

  • + +
  • prefix: "value" for prefix-based match

  • + +
  • regex: "value" for ECMAscript style regex-based match

  • +
+ +

If the value is empty and only the name of header is specfied, presence of the header is checked. +Note: The keys uri, scheme, method, and authority will be ignored.

+ +
+No +
portuint32 +

Specifies the ports on the host that is being addressed. Many services +only expose a single port or label ports with the protocols they support, +in these cases it is not required to explicitly select the port.

+ +
+No +
sourceLabelsmap<string, string> +

One or more labels that constrain the applicability of a rule to +workloads with the given labels. If the VirtualService has a list of +gateways specified in the top-level gateways field, it must include the reserved gateway +mesh for this field to be applicable.

+ +
+No +
gatewaysstring[] +

Names of gateways where the rule should be applied. Gateway names +in the top-level gateways field of the VirtualService (if any) are overridden. The gateway +match is independent of sourceLabels.

+ +
+No +
queryParamsmap<string, StringMatch> +

Query parameters for matching.

+ +

Ex: +- For a query parameter like “?key=true”, the map key would be “key” and + the string match could be defined as exact: "true". +- For a query parameter like “?key”, the map key would be “key” and the + string match could be defined as exact: "". +- For a query parameter like “?key=123”, the map key would be “key” and the + string match could be defined as regex: "\d+$". Note that this + configuration will only match values like “123” but not “a123” or “123a”.

+ +

Note: prefix matching is currently not supported.

+ +
+No +
ignoreUriCasebool +

Flag to specify whether the URI matching should be case-insensitive.

+ +

Note: The case will be ignored only in the case of exact and prefix +URI matches.

+ +
+No +
withoutHeadersmap<string, StringMatch> +

withoutHeader has the same syntax with the header, but has opposite meaning. +If a header is matched with a matching rule among withoutHeader, the traffic becomes not matched one.

+ +
+No +
sourceNamespacestring +

Source namespace constraining the applicability of a rule to workloads in that namespace. +If the VirtualService has a list of gateways specified in the top-level gateways field, +it must include the reserved gateway mesh for this field to be applicable.

+ +
+No +
+
+

HTTPRouteDestination

+
+

Each routing rule is associated with one or more service versions (see +glossary in beginning of document). Weights associated with the version +determine the proportion of traffic it receives. For example, the +following rule will route 25% of traffic for the “reviews” service to +instances with the “v2” tag and the remaining traffic (i.e., 75%) to +“v1”.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: reviews-route
+spec:
+  hosts:
+  - reviews.prod.svc.cluster.local
+  http:
+  - route:
+    - destination:
+        host: reviews.prod.svc.cluster.local
+        subset: v2
+      weight: 25
+    - destination:
+        host: reviews.prod.svc.cluster.local
+        subset: v1
+      weight: 75
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: VirtualService
+metadata:
+  name: reviews-route
+spec:
+  hosts:
+  - reviews.prod.svc.cluster.local
+  http:
+  - route:
+    - destination:
+        host: reviews.prod.svc.cluster.local
+        subset: v2
+      weight: 25
+    - destination:
+        host: reviews.prod.svc.cluster.local
+        subset: v1
+      weight: 75
+
+ +

{{}} +{{}}

+ +

And the associated DestinationRule

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: DestinationRule
+metadata:
+  name: reviews-destination
+spec:
+  host: reviews.prod.svc.cluster.local
+  subsets:
+  - name: v1
+    labels:
+      version: v1
+  - name: v2
+    labels:
+      version: v2
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: DestinationRule
+metadata:
+  name: reviews-destination
+spec:
+  host: reviews.prod.svc.cluster.local
+  subsets:
+  - name: v1
+    labels:
+      version: v1
+  - name: v2
+    labels:
+      version: v2
+
+ +

{{}} +{{}}

+ +

Traffic can also be split across two entirely different services without +having to define new subsets. For example, the following rule forwards 25% of +traffic to reviews.com to dev.reviews.com

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: reviews-route-two-domains
+spec:
+  hosts:
+  - reviews.com
+  http:
+  - route:
+    - destination:
+        host: dev.reviews.com
+      weight: 25
+    - destination:
+        host: reviews.com
+      weight: 75
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: VirtualService
+metadata:
+  name: reviews-route-two-domains
+spec:
+  hosts:
+  - reviews.com
+  http:
+  - route:
+    - destination:
+        host: dev.reviews.com
+      weight: 25
+    - destination:
+        host: reviews.com
+      weight: 75
+
+ +

{{}} +{{}}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
destinationDestination +

Destination uniquely identifies the instances of a service +to which the request/connection should be forwarded to.

+ +
+Yes +
weightint32 +

The proportion of traffic to be forwarded to the service +version. (0-100). Sum of weights across destinations SHOULD BE == 100. +If there is only one destination in a rule, the weight value is assumed to +be 100.

+ +
+No +
headersHeaders +

Header manipulation rules

+ +
+No +
+
+

RouteDestination

+
+

L4 routing rule weighted destination.

+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
destinationDestination +

Destination uniquely identifies the instances of a service +to which the request/connection should be forwarded to.

+ +
+Yes +
weightint32 +

The proportion of traffic to be forwarded to the service +version. If there is only one destination in a rule, all traffic will be +routed to it irrespective of the weight.

+ +
+No +
+
+

L4MatchAttributes

+
+

L4 connection match attributes. Note that L4 connection matching support +is incomplete.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
destinationSubnetsstring[] +

IPv4 or IPv6 ip addresses of destination with optional subnet. E.g., +a.b.c.d/xx form or just a.b.c.d.

+ +
+No +
portuint32 +

Specifies the port on the host that is being addressed. Many services +only expose a single port or label ports with the protocols they support, +in these cases it is not required to explicitly select the port.

+ +
+No +
sourceLabelsmap<string, string> +

One or more labels that constrain the applicability of a rule to +workloads with the given labels. If the VirtualService has a list of +gateways specified in the top-level gateways field, it should include the reserved gateway +mesh in order for this field to be applicable.

+ +
+No +
gatewaysstring[] +

Names of gateways where the rule should be applied. Gateway names +in the top-level gateways field of the VirtualService (if any) are overridden. The gateway +match is independent of sourceLabels.

+ +
+No +
sourceNamespacestring +

Source namespace constraining the applicability of a rule to workloads in that namespace. +If the VirtualService has a list of gateways specified in the top-level gateways field, +it must include the reserved gateway mesh for this field to be applicable.

+ +
+No +
+
+

TLSMatchAttributes

+
+

TLS connection match attributes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
sniHostsstring[] +

SNI (server name indicator) to match on. Wildcard prefixes +can be used in the SNI value, e.g., *.com will match foo.example.com +as well as example.com. An SNI value must be a subset (i.e., fall +within the domain) of the corresponding virtual serivce’s hosts.

+ +
+Yes +
destinationSubnetsstring[] +

IPv4 or IPv6 ip addresses of destination with optional subnet. E.g., +a.b.c.d/xx form or just a.b.c.d.

+ +
+No +
portuint32 +

Specifies the port on the host that is being addressed. Many services +only expose a single port or label ports with the protocols they +support, in these cases it is not required to explicitly select the +port.

+ +
+No +
sourceLabelsmap<string, string> +

One or more labels that constrain the applicability of a rule to +workloads with the given labels. If the VirtualService has a list of +gateways specified in the top-level gateways field, it should include the reserved gateway +mesh in order for this field to be applicable.

+ +
+No +
gatewaysstring[] +

Names of gateways where the rule should be applied. Gateway names +in the top-level gateways field of the VirtualService (if any) are overridden. The gateway +match is independent of sourceLabels.

+ +
+No +
sourceNamespacestring +

Source namespace constraining the applicability of a rule to workloads in that namespace. +If the VirtualService has a list of gateways specified in the top-level gateways field, +it must include the reserved gateway mesh for this field to be applicable.

+ +
+No +
+
+

HTTPRedirect

+
+

HTTPRedirect can be used to send a 301 redirect response to the caller, +where the Authority/Host and the URI in the response can be swapped with +the specified values. For example, the following rule redirects +requests for /v1/getProductRatings API on the ratings service to +/v1/bookRatings provided by the bookratings service.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: ratings-route
+spec:
+  hosts:
+  - ratings.prod.svc.cluster.local
+  http:
+  - match:
+    - uri:
+        exact: /v1/getProductRatings
+    redirect:
+      uri: /v1/bookRatings
+      authority: newratings.default.svc.cluster.local
+  ...
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: VirtualService
+metadata:
+  name: ratings-route
+spec:
+  hosts:
+  - ratings.prod.svc.cluster.local
+  http:
+  - match:
+    - uri:
+        exact: /v1/getProductRatings
+    redirect:
+      uri: /v1/bookRatings
+      authority: newratings.default.svc.cluster.local
+  ...
+
+ +

{{}} +{{}}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
uristring +

On a redirect, overwrite the Path portion of the URL with this +value. Note that the entire path will be replaced, irrespective of the +request URI being matched as an exact path or prefix.

+ +
+No +
authoritystring +

On a redirect, overwrite the Authority/Host portion of the URL with +this value.

+ +
+No +
redirectCodeuint32 +

On a redirect, Specifies the HTTP status code to use in the redirect +response. The default response code is MOVED_PERMANENTLY (301).

+ +
+No +
+
+

HTTPRewrite

+
+

HTTPRewrite can be used to rewrite specific parts of a HTTP request +before forwarding the request to the destination. Rewrite primitive can +be used only with HTTPRouteDestination. The following example +demonstrates how to rewrite the URL prefix for api call (/ratings) to +ratings service before making the actual API call.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: ratings-route
+spec:
+  hosts:
+  - ratings.prod.svc.cluster.local
+  http:
+  - match:
+    - uri:
+        prefix: /ratings
+    rewrite:
+      uri: /v1/bookRatings
+    route:
+    - destination:
+        host: ratings.prod.svc.cluster.local
+        subset: v1
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: VirtualService
+metadata:
+  name: ratings-route
+spec:
+  hosts:
+  - ratings.prod.svc.cluster.local
+  http:
+  - match:
+    - uri:
+        prefix: /ratings
+    rewrite:
+      uri: /v1/bookRatings
+    route:
+    - destination:
+        host: ratings.prod.svc.cluster.local
+        subset: v1
+
+ +

{{}} +{{}}

+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
uristring +

rewrite the path (or the prefix) portion of the URI with this +value. If the original URI was matched based on prefix, the value +provided in this field will replace the corresponding matched prefix.

+ +
+No +
authoritystring +

rewrite the Authority/Host header with this value.

+ +
+No +
+
+

StringMatch

+
+

Describes how to match a given string in HTTP headers. Match is +case-sensitive.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
exactstring (oneof) +

exact string match

+ +
+No +
prefixstring (oneof) +

prefix-based match

+ +
+No +
regexstring (oneof) +

RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).

+ +
+No +
+
+

HTTPRetry

+
+

Describes the retry policy to use when a HTTP request fails. For +example, the following rule sets the maximum number of retries to 3 when +calling ratings:v1 service, with a 2s timeout per retry attempt.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: ratings-route
+spec:
+  hosts:
+  - ratings.prod.svc.cluster.local
+  http:
+  - route:
+    - destination:
+        host: ratings.prod.svc.cluster.local
+        subset: v1
+    retries:
+      attempts: 3
+      perTryTimeout: 2s
+      retryOn: gateway-error,connect-failure,refused-stream
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: VirtualService
+metadata:
+  name: ratings-route
+spec:
+  hosts:
+  - ratings.prod.svc.cluster.local
+  http:
+  - route:
+    - destination:
+        host: ratings.prod.svc.cluster.local
+        subset: v1
+    retries:
+      attempts: 3
+      perTryTimeout: 2s
+      retryOn: gateway-error,connect-failure,refused-stream
+
+ +

{{}} +{{}}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
attemptsint32 +

Number of retries for a given request. The interval +between retries will be determined automatically (25ms+). Actual +number of retries attempted depends on the request timeout of the +HTTP route.

+ +
+Yes +
perTryTimeoutDuration +

Timeout per retry attempt for a given request. format: 1h/1m/1s/1ms. MUST BE >=1ms.

+ +
+No +
retryOnstring +

Specifies the conditions under which retry takes place. +One or more policies can be specified using a ‘,’ delimited list. +See the retry policies +and gRPC retry policies for more details.

+ +
+No +
retryRemoteLocalitiesBoolValue +

Flag to specify whether the retries should retry to other localities. +See the retry plugin configuration for more details.

+ +
+No +
+
+

CorsPolicy

+
+

Describes the Cross-Origin Resource Sharing (CORS) policy, for a given +service. Refer to CORS +for further details about cross origin resource sharing. For example, +the following rule restricts cross origin requests to those originating +from example.com domain using HTTP POST/GET, and sets the +Access-Control-Allow-Credentials header to false. In addition, it only +exposes X-Foo-bar header and sets an expiry period of 1 day.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: ratings-route
+spec:
+  hosts:
+  - ratings.prod.svc.cluster.local
+  http:
+  - route:
+    - destination:
+        host: ratings.prod.svc.cluster.local
+        subset: v1
+    corsPolicy:
+      allowOrigins:
+      - exact: https://example.com
+      allowMethods:
+      - POST
+      - GET
+      allowCredentials: false
+      allowHeaders:
+      - X-Foo-Bar
+      maxAge: "24h"
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: VirtualService
+metadata:
+  name: ratings-route
+spec:
+  hosts:
+  - ratings.prod.svc.cluster.local
+  http:
+  - route:
+    - destination:
+        host: ratings.prod.svc.cluster.local
+        subset: v1
+    corsPolicy:
+      allowOrigins:
+      - exact: https://example.com
+      allowMethods:
+      - POST
+      - GET
+      allowCredentials: false
+      allowHeaders:
+      - X-Foo-Bar
+      maxAge: "24h"
+
+ +

{{}} +{{}}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
allowOriginsStringMatch[] +

String patterns that match allowed origins. +An origin is allowed if any of the string matchers match. +If a match is found, then the outgoing Access-Control-Allow-Origin would be set to the origin as provided by the client.

+ +
+No +
allowMethodsstring[] +

List of HTTP methods allowed to access the resource. The content will +be serialized into the Access-Control-Allow-Methods header.

+ +
+No +
allowHeadersstring[] +

List of HTTP headers that can be used when requesting the +resource. Serialized to Access-Control-Allow-Headers header.

+ +
+No +
exposeHeadersstring[] +

A white list of HTTP headers that the browsers are allowed to +access. Serialized into Access-Control-Expose-Headers header.

+ +
+No +
maxAgeDuration +

Specifies how long the results of a preflight request can be +cached. Translates to the Access-Control-Max-Age header.

+ +
+No +
allowCredentialsBoolValue +

Indicates whether the caller is allowed to send the actual request +(not the preflight) using credentials. Translates to +Access-Control-Allow-Credentials header.

+ +
+No +
+
+

HTTPFaultInjection

+
+

HTTPFaultInjection can be used to specify one or more faults to inject +while forwarding HTTP requests to the destination specified in a route. +Fault specification is part of a VirtualService rule. Faults include +aborting the Http request from downstream service, and/or delaying +proxying of requests. A fault rule MUST HAVE delay or abort or both.

+ +

Note: Delay and abort faults are independent of one another, even if +both are specified simultaneously.

+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
delayDelay +

Delay requests before forwarding, emulating various failures such as +network issues, overloaded upstream service, etc.

+ +
+No +
abortAbort +

Abort Http request attempts and return error codes back to downstream +service, giving the impression that the upstream service is faulty.

+ +
+No +
+
+

PortSelector

+
+

PortSelector specifies the number of a port to be used for +matching or selection for final routing.

+ + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
numberuint32 +

Valid port number

+ +
+No +
+
+

Percent

+
+

Percent specifies a percentage in the range of [0.0, 100.0].

+ + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
valuedouble + +No +
+
+

Headers.HeaderOperations

+
+

HeaderOperations Describes the header manipulations to apply

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
setmap<string, string> +

Overwrite the headers specified by key with the given values

+ +
+No +
addmap<string, string> +

Append the given values to the headers specified by keys +(will create a comma-separated list of values)

+ +
+No +
removestring[] +

Remove a the specified headers

+ +
+No +
+
+

HTTPFaultInjection.Delay

+
+

Delay specification is used to inject latency into the request +forwarding path. The following example will introduce a 5 second delay +in 1 out of every 1000 requests to the “v1” version of the “reviews” +service from all pods with label env: prod

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: reviews-route
+spec:
+  hosts:
+  - reviews.prod.svc.cluster.local
+  http:
+  - match:
+    - sourceLabels:
+        env: prod
+    route:
+    - destination:
+        host: reviews.prod.svc.cluster.local
+        subset: v1
+    fault:
+      delay:
+        percentage:
+          value: 0.1
+        fixedDelay: 5s
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: VirtualService
+metadata:
+  name: reviews-route
+spec:
+  hosts:
+  - reviews.prod.svc.cluster.local
+  http:
+  - match:
+    - sourceLabels:
+        env: prod
+    route:
+    - destination:
+        host: reviews.prod.svc.cluster.local
+        subset: v1
+    fault:
+      delay:
+        percentage:
+          value: 0.1
+        fixedDelay: 5s
+
+ +

{{}} +{{}}

+ +

The fixedDelay field is used to indicate the amount of delay in seconds. +The optional percentage field can be used to only delay a certain +percentage of requests. If left unspecified, all request will be delayed.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
fixedDelayDuration (oneof) +

Add a fixed delay before forwarding the request. Format: +1h/1m/1s/1ms. MUST be >=1ms.

+ +
+Yes +
percentagePercent +

Percentage of requests on which the delay will be injected.

+ +
+No +
percentint32 +

Percentage of requests on which the delay will be injected (0-100). +Use of integer percent value is deprecated. Use the double percentage +field instead.

+ +
+No +
+
+

HTTPFaultInjection.Abort

+
+

Abort specification is used to prematurely abort a request with a +pre-specified error code. The following example will return an HTTP 400 +error code for 1 out of every 1000 requests to the “ratings” service “v1”.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: ratings-route
+spec:
+  hosts:
+  - ratings.prod.svc.cluster.local
+  http:
+  - route:
+    - destination:
+        host: ratings.prod.svc.cluster.local
+        subset: v1
+    fault:
+      abort:
+        percentage:
+          value: 0.1
+        httpStatus: 400
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: VirtualService
+metadata:
+  name: ratings-route
+spec:
+  hosts:
+  - ratings.prod.svc.cluster.local
+  http:
+  - route:
+    - destination:
+        host: ratings.prod.svc.cluster.local
+        subset: v1
+    fault:
+      abort:
+        percentage:
+          value: 0.1
+        httpStatus: 400
+
+ +

{{}} +{{}}

+ +

The httpStatus field is used to indicate the HTTP status code to +return to the caller. The optional percentage field can be used to only +abort a certain percentage of requests. If not specified, all requests are +aborted.

+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
httpStatusint32 (oneof) +

HTTP status code to use to abort the Http request.

+ +
+Yes +
percentagePercent +

Percentage of requests to be aborted with the error code provided.

+ +
+No +
+
+

google.protobuf.UInt32Value

+
+

Wrapper message for uint32.

+ +

The JSON representation for UInt32Value is JSON number.

+ + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
valueuint32 +

The uint32 value.

+ +
+No +
+
diff --git a/vendor/istio.io/api/networking/v1alpha3/virtual_service.proto b/vendor/istio.io/api/networking/v1alpha3/virtual_service.proto new file mode 100644 index 0000000000..d090f9d106 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/virtual_service.proto @@ -0,0 +1,1842 @@ +// Copyright 2017-2018 Istio Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "google/api/field_behavior.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/wrappers.proto"; + +// $schema: istio.networking.v1alpha3.VirtualService +// $title: Virtual Service +// $description: Configuration affecting label/content routing, sni routing, etc. +// $location: https://istio.io/docs/reference/config/networking/virtual-service.html +// $aliases: [/docs/reference/config/networking/v1alpha3/virtual-service] + +// Configuration affecting traffic routing. Here are a few terms useful to define +// in the context of traffic routing. +// +// `Service` a unit of application behavior bound to a unique name in a +// service registry. Services consist of multiple network *endpoints* +// implemented by workload instances running on pods, containers, VMs etc. +// +// `Service versions (a.k.a. subsets)` - In a continuous deployment +// scenario, for a given service, there can be distinct subsets of +// instances running different variants of the application binary. These +// variants are not necessarily different API versions. They could be +// iterative changes to the same service, deployed in different +// environments (prod, staging, dev, etc.). Common scenarios where this +// occurs include A/B testing, canary rollouts, etc. The choice of a +// particular version can be decided based on various criterion (headers, +// url, etc.) and/or by weights assigned to each version. Each service has +// a default version consisting of all its instances. +// +// `Source` - A downstream client calling a service. +// +// `Host` - The address used by a client when attempting to connect to a +// service. +// +// `Access model` - Applications address only the destination service +// (Host) without knowledge of individual service versions (subsets). The +// actual choice of the version is determined by the proxy/sidecar, enabling the +// application code to decouple itself from the evolution of dependent +// services. +// +// A `VirtualService` defines a set of traffic routing rules to apply when a host is +// addressed. Each routing rule defines matching criteria for traffic of a specific +// protocol. If the traffic is matched, then it is sent to a named destination service +// (or subset/version of it) defined in the registry. +// +// The source of traffic can also be matched in a routing rule. This allows routing +// to be customized for specific client contexts. +// +// The following example on Kubernetes, routes all HTTP traffic by default to +// pods of the reviews service with label "version: v1". In addition, +// HTTP requests with path starting with /wpcatalog/ or /consumercatalog/ will +// be rewritten to /newcatalog and sent to pods with label "version: v2". +// +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: reviews-route +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// http: +// - name: "reviews-v2-routes" +// match: +// - uri: +// prefix: "/wpcatalog" +// - uri: +// prefix: "/consumercatalog" +// rewrite: +// uri: "/newcatalog" +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v2 +// - name: "reviews-v1-route" +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v1 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: reviews-route +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// http: +// - name: "reviews-v2-routes" +// match: +// - uri: +// prefix: "/wpcatalog" +// - uri: +// prefix: "/consumercatalog" +// rewrite: +// uri: "/newcatalog" +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v2 +// - name: "reviews-v1-route" +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v1 +// ``` +// {{}} +// {{}} +// +// A subset/version of a route destination is identified with a reference +// to a named service subset which must be declared in a corresponding +// `DestinationRule`. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: reviews-destination +// spec: +// host: reviews.prod.svc.cluster.local +// subsets: +// - name: v1 +// labels: +// version: v1 +// - name: v2 +// labels: +// version: v2 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: reviews-destination +// spec: +// host: reviews.prod.svc.cluster.local +// subsets: +// - name: v1 +// labels: +// version: v1 +// - name: v2 +// labels: +// version: v2 +// ``` +// {{}} +// {{}} +// +package istio.networking.v1alpha3; + +option go_package = "istio.io/api/networking/v1alpha3"; + +// Configuration affecting traffic routing. +// +// +// +// +message VirtualService { + // The destination hosts to which traffic is being sent. Could + // be a DNS name with wildcard prefix or an IP address. Depending on the + // platform, short-names can also be used instead of a FQDN (i.e. has no + // dots in the name). In such a scenario, the FQDN of the host would be + // derived based on the underlying platform. + // + // A single VirtualService can be used to describe all the traffic + // properties of the corresponding hosts, including those for multiple + // HTTP and TCP ports. Alternatively, the traffic properties of a host + // can be defined using more than one VirtualService, with certain + // caveats. Refer to the + // [Operations Guide](https://istio.io/docs/ops/best-practices/traffic-management/#split-virtual-services) + // for details. + // + // *Note for Kubernetes users*: When short names are used (e.g. "reviews" + // instead of "reviews.default.svc.cluster.local"), Istio will interpret + // the short name based on the namespace of the rule, not the service. A + // rule in the "default" namespace containing a host "reviews" will be + // interpreted as "reviews.default.svc.cluster.local", irrespective of + // the actual namespace associated with the reviews service. _To avoid + // potential misconfigurations, it is recommended to always use fully + // qualified domain names over short names._ + // + // The hosts field applies to both HTTP and TCP services. Service inside + // the mesh, i.e., those found in the service registry, must always be + // referred to using their alphanumeric names. IP addresses are allowed + // only for services defined via the Gateway. + // + // *Note*: It must be empty for a delegate VirtualService. + repeated string hosts = 1; + + // The names of gateways and sidecars that should apply these routes. + // Gateways in other namespaces may be referred to by + // `/`; specifying a gateway with no + // namespace qualifier is the same as specifying the VirtualService's + // namespace. A single VirtualService is used for sidecars inside the mesh as + // well as for one or more gateways. The selection condition imposed by this + // field can be overridden using the source field in the match conditions + // of protocol-specific routes. The reserved word `mesh` is used to imply + // all the sidecars in the mesh. When this field is omitted, the default + // gateway (`mesh`) will be used, which would apply the rule to all + // sidecars in the mesh. If a list of gateway names is provided, the + // rules will apply only to the gateways. To apply the rules to both + // gateways and sidecars, specify `mesh` as one of the gateway names. + repeated string gateways = 2; + + // An ordered list of route rules for HTTP traffic. HTTP routes will be + // applied to platform service ports named 'http-*'/'http2-*'/'grpc-*', gateway + // ports with protocol HTTP/HTTP2/GRPC/ TLS-terminated-HTTPS and service + // entry ports using HTTP/HTTP2/GRPC protocols. The first rule matching + // an incoming request is used. + repeated HTTPRoute http = 3; + + // An ordered list of route rule for non-terminated TLS & HTTPS + // traffic. Routing is typically performed using the SNI value presented + // by the ClientHello message. TLS routes will be applied to platform + // service ports named 'https-*', 'tls-*', unterminated gateway ports using + // HTTPS/TLS protocols (i.e. with "passthrough" TLS mode) and service + // entry ports using HTTPS/TLS protocols. The first rule matching an + // incoming request is used. NOTE: Traffic 'https-*' or 'tls-*' ports + // without associated virtual service will be treated as opaque TCP + // traffic. + repeated TLSRoute tls = 5; + + // An ordered list of route rules for opaque TCP traffic. TCP routes will + // be applied to any port that is not a HTTP or TLS port. The first rule + // matching an incoming request is used. + repeated TCPRoute tcp = 4; + + // A list of namespaces to which this virtual service is exported. Exporting a + // virtual service allows it to be used by sidecars and gateways defined in + // other namespaces. This feature provides a mechanism for service owners + // and mesh administrators to control the visibility of virtual services + // across namespace boundaries. + // + // If no namespaces are specified then the virtual service is exported to all + // namespaces by default. + // + // The value "." is reserved and defines an export to the same namespace that + // the virtual service is declared in. Similarly the value "*" is reserved and + // defines an export to all namespaces. + // + // NOTE: in the current release, the `exportTo` value is restricted to + // "." or "*" (i.e., the current namespace or all namespaces). + repeated string export_to = 6; +} + +// Destination indicates the network addressable service to which the +// request/connection will be sent after processing a routing rule. The +// destination.host should unambiguously refer to a service in the service +// registry. Istio's service registry is composed of all the services found +// in the platform's service registry (e.g., Kubernetes services, Consul +// services), as well as services declared through the +// [ServiceEntry](https://istio.io/docs/reference/config/networking/service-entry/#ServiceEntry) resource. +// +// *Note for Kubernetes users*: When short names are used (e.g. "reviews" +// instead of "reviews.default.svc.cluster.local"), Istio will interpret +// the short name based on the namespace of the rule, not the service. A +// rule in the "default" namespace containing a host "reviews will be +// interpreted as "reviews.default.svc.cluster.local", irrespective of the +// actual namespace associated with the reviews service. _To avoid potential +// misconfigurations, it is recommended to always use fully qualified +// domain names over short names._ +// +// The following Kubernetes example routes all traffic by default to pods +// of the reviews service with label "version: v1" (i.e., subset v1), and +// some to subset v2, in a Kubernetes environment. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: reviews-route +// namespace: foo +// spec: +// hosts: +// - reviews # interpreted as reviews.foo.svc.cluster.local +// http: +// - match: +// - uri: +// prefix: "/wpcatalog" +// - uri: +// prefix: "/consumercatalog" +// rewrite: +// uri: "/newcatalog" +// route: +// - destination: +// host: reviews # interpreted as reviews.foo.svc.cluster.local +// subset: v2 +// - route: +// - destination: +// host: reviews # interpreted as reviews.foo.svc.cluster.local +// subset: v1 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: reviews-route +// namespace: foo +// spec: +// hosts: +// - reviews # interpreted as reviews.foo.svc.cluster.local +// http: +// - match: +// - uri: +// prefix: "/wpcatalog" +// - uri: +// prefix: "/consumercatalog" +// rewrite: +// uri: "/newcatalog" +// route: +// - destination: +// host: reviews # interpreted as reviews.foo.svc.cluster.local +// subset: v2 +// - route: +// - destination: +// host: reviews # interpreted as reviews.foo.svc.cluster.local +// subset: v1 +// ``` +// {{}} +// {{}} +// +// And the associated DestinationRule +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: reviews-destination +// namespace: foo +// spec: +// host: reviews # interpreted as reviews.foo.svc.cluster.local +// subsets: +// - name: v1 +// labels: +// version: v1 +// - name: v2 +// labels: +// version: v2 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: reviews-destination +// namespace: foo +// spec: +// host: reviews # interpreted as reviews.foo.svc.cluster.local +// subsets: +// - name: v1 +// labels: +// version: v1 +// - name: v2 +// labels: +// version: v2 +// ``` +// {{}} +// {{}} +// +// The following VirtualService sets a timeout of 5s for all calls to +// productpage.prod.svc.cluster.local service in Kubernetes. Notice that +// there are no subsets defined in this rule. Istio will fetch all +// instances of productpage.prod.svc.cluster.local service from the service +// registry and populate the sidecar's load balancing pool. Also, notice +// that this rule is set in the istio-system namespace but uses the fully +// qualified domain name of the productpage service, +// productpage.prod.svc.cluster.local. Therefore the rule's namespace does +// not have an impact in resolving the name of the productpage service. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: my-productpage-rule +// namespace: istio-system +// spec: +// hosts: +// - productpage.prod.svc.cluster.local # ignores rule namespace +// http: +// - timeout: 5s +// route: +// - destination: +// host: productpage.prod.svc.cluster.local +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: my-productpage-rule +// namespace: istio-system +// spec: +// hosts: +// - productpage.prod.svc.cluster.local # ignores rule namespace +// http: +// - timeout: 5s +// route: +// - destination: +// host: productpage.prod.svc.cluster.local +// ``` +// {{}} +// {{}} +// +// To control routing for traffic bound to services outside the mesh, external +// services must first be added to Istio's internal service registry using the +// ServiceEntry resource. VirtualServices can then be defined to control traffic +// bound to these external services. For example, the following rules define a +// Service for wikipedia.org and set a timeout of 5s for HTTP requests. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: external-svc-wikipedia +// spec: +// hosts: +// - wikipedia.org +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: example-http +// protocol: HTTP +// resolution: DNS +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: my-wiki-rule +// spec: +// hosts: +// - wikipedia.org +// http: +// - timeout: 5s +// route: +// - destination: +// host: wikipedia.org +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: external-svc-wikipedia +// spec: +// hosts: +// - wikipedia.org +// location: MESH_EXTERNAL +// ports: +// - number: 80 +// name: example-http +// protocol: HTTP +// resolution: DNS +// +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: my-wiki-rule +// spec: +// hosts: +// - wikipedia.org +// http: +// - timeout: 5s +// route: +// - destination: +// host: wikipedia.org +// ``` +// {{}} +// {{}} +// +message Destination { + // The name of a service from the service registry. Service + // names are looked up from the platform's service registry (e.g., + // Kubernetes services, Consul services, etc.) and from the hosts + // declared by [ServiceEntry](https://istio.io/docs/reference/config/networking/service-entry/#ServiceEntry). Traffic forwarded to + // destinations that are not found in either of the two, will be dropped. + // + // *Note for Kubernetes users*: When short names are used (e.g. "reviews" + // instead of "reviews.default.svc.cluster.local"), Istio will interpret + // the short name based on the namespace of the rule, not the service. A + // rule in the "default" namespace containing a host "reviews will be + // interpreted as "reviews.default.svc.cluster.local", irrespective of + // the actual namespace associated with the reviews service. To avoid + // potential misconfiguration, it is recommended to always use fully + // qualified domain names over short names. + string host = 1 [(google.api.field_behavior) = REQUIRED]; + + // The name of a subset within the service. Applicable only to services + // within the mesh. The subset must be defined in a corresponding + // DestinationRule. + string subset = 2; + + // Specifies the port on the host that is being addressed. If a service + // exposes only a single port it is not required to explicitly select the + // port. + PortSelector port = 3; +} + +// Describes match conditions and actions for routing HTTP/1.1, HTTP2, and +// gRPC traffic. See VirtualService for usage examples. +message HTTPRoute { + // The name assigned to the route for debugging purposes. The + // route's name will be concatenated with the match's name and will + // be logged in the access logs for requests matching this + // route/match. + string name = 17; + + // Match conditions to be satisfied for the rule to be + // activated. All conditions inside a single match block have AND + // semantics, while the list of match blocks have OR semantics. The rule + // is matched if any one of the match blocks succeed. + repeated HTTPMatchRequest match = 1; + + // A HTTP rule can either redirect or forward (default) traffic. The + // forwarding target can be one of several versions of a service (see + // glossary in beginning of document). Weights associated with the + // service version determine the proportion of traffic it receives. + repeated HTTPRouteDestination route = 2; + + // A HTTP rule can either redirect or forward (default) traffic. If + // traffic passthrough option is specified in the rule, + // route/redirect will be ignored. The redirect primitive can be used to + // send a HTTP 301 redirect to a different URI or Authority. + HTTPRedirect redirect = 3; + + // Delegate is used to specify the particular VirtualService which + // can be used to define delegate HTTPRoute. + // It can be set only when `Route` and `Redirect` are empty, and the route rules of the + // delegate VirtualService will be merged with that in the current one. + // **NOTE**: + // 1. Only one level delegation is supported. + // 2. The delegate's HTTPMatchRequest must be a strict subset of the root's, + // otherwise there is a conflict and the HTTPRoute will not take effect. + Delegate delegate = 20; + + // Rewrite HTTP URIs and Authority headers. Rewrite cannot be used with + // Redirect primitive. Rewrite will be performed before forwarding. + HTTPRewrite rewrite = 4; + + reserved 5; + reserved "websocket_upgrade"; + + // Timeout for HTTP requests. + google.protobuf.Duration timeout = 6; + + // Retry policy for HTTP requests. + HTTPRetry retries = 7; + + // Fault injection policy to apply on HTTP traffic at the client side. + // Note that timeouts or retries will not be enabled when faults are + // enabled on the client side. + HTTPFaultInjection fault = 8; + + // Mirror HTTP traffic to a another destination in addition to forwarding + // the requests to the intended destination. Mirrored traffic is on a + // best effort basis where the sidecar/gateway will not wait for the + // mirrored cluster to respond before returning the response from the + // original destination. Statistics will be generated for the mirrored + // destination. + Destination mirror = 9; + + // Percentage of the traffic to be mirrored by the `mirror` field. + // Use of integer `mirror_percent` value is deprecated. Use the + // double `mirror_percentage` field instead + google.protobuf.UInt32Value mirror_percent = 18 [deprecated=true]; + + // Percentage of the traffic to be mirrored by the `mirror` field. + // If this field is absent, all the traffic (100%) will be mirrored. + // Max value is 100. + Percent mirror_percentage = 19; + + // Cross-Origin Resource Sharing policy (CORS). Refer to + // [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) + // for further details about cross origin resource sharing. + CorsPolicy cors_policy = 10; + + reserved 11 to 15; + reserved "append_headers", "remove_response_headers", "append_response_headers","remove_request_headers", "append_request_headers"; + + // Header manipulation rules + Headers headers = 16; + + // $hide_from_docs + // Next available field number: 21 +} + + +// Describes the delegate VirtualService. +// The following routing rules forward the traffic to `/productpage` by a delegate VirtualService named `productpage`, +// forward the traffic to `/reviews` by a delegate VirtualService named `reviews`. +// +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo +// spec: +// hosts: +// - "bookinfo.com" +// gateways: +// - mygateway +// http: +// - match: +// - uri: +// prefix: "/productpage" +// delegate: +// name: productpage +// namespace: nsA +// - match: +// - uri: +// prefix: "/reviews" +// delegate: +// name: reviews +// namespace: nsB +// ``` +// +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: productpage +// namespace: nsA +// spec: +// http: +// - match: +// - uri: +// prefix: "/productpage/v1/" +// route: +// - destination: +// host: productpage-v1.nsA.svc.cluster.local +// - route: +// - destination: +// host: productpage.nsA.svc.cluster.local +// ``` +// +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: reviews +// namespace: nsB +// spec: +// http: +// - route: +// - destination: +// host: reviews.nsB.svc.cluster.local +// ``` +message Delegate { + // Name specifies the name of the delegate VirtualService. + string name = 1; + // Namespace specifies the namespace where the delegate VirtualService resides. + // By default, it is same to the root's. + string namespace = 2; +} + + +// Message headers can be manipulated when Envoy forwards requests to, +// or responses from, a destination service. Header manipulation rules can +// be specified for a specific route destination or for all destinations. +// The following VirtualService adds a `test` header with the value `true` +// to requests that are routed to any `reviews` service destination. +// It also romoves the `foo` response header, but only from responses +// coming from the `v1` subset (version) of the `reviews` service. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: reviews-route +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// http: +// - headers: +// request: +// set: +// test: true +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v2 +// weight: 25 +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v1 +// headers: +// response: +// remove: +// - foo +// weight: 75 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: reviews-route +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// http: +// - headers: +// request: +// set: +// test: true +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v2 +// weight: 25 +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v1 +// headers: +// response: +// remove: +// - foo +// weight: 75 +// ``` +// {{}} +// {{}} + +message Headers { + // Header manipulation rules to apply before forwarding a request + // to the destination service + HeaderOperations request = 1; + // Header manipulation rules to apply before returning a response + // to the caller + HeaderOperations response = 2; + + // HeaderOperations Describes the header manipulations to apply + message HeaderOperations { + // Overwrite the headers specified by key with the given values + map set = 1; + // Append the given values to the headers specified by keys + // (will create a comma-separated list of values) + map add = 2; + // Remove a the specified headers + repeated string remove = 3; + } +} + +// Describes match conditions and actions for routing unterminated TLS +// traffic (TLS/HTTPS) The following routing rule forwards unterminated TLS +// traffic arriving at port 443 of gateway called "mygateway" to internal +// services in the mesh based on the SNI value. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo-sni +// spec: +// hosts: +// - "*.bookinfo.com" +// gateways: +// - mygateway +// tls: +// - match: +// - port: 443 +// sniHosts: +// - login.bookinfo.com +// route: +// - destination: +// host: login.prod.svc.cluster.local +// - match: +// - port: 443 +// sniHosts: +// - reviews.bookinfo.com +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: bookinfo-sni +// spec: +// hosts: +// - "*.bookinfo.com" +// gateways: +// - mygateway +// tls: +// - match: +// - port: 443 +// sniHosts: +// - login.bookinfo.com +// route: +// - destination: +// host: login.prod.svc.cluster.local +// - match: +// - port: 443 +// sniHosts: +// - reviews.bookinfo.com +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// ``` +// {{}} +// {{}} +message TLSRoute { + // Match conditions to be satisfied for the rule to be + // activated. All conditions inside a single match block have AND + // semantics, while the list of match blocks have OR semantics. The rule + // is matched if any one of the match blocks succeed. + repeated TLSMatchAttributes match = 1 [(google.api.field_behavior) = REQUIRED]; + + // The destination to which the connection should be forwarded to. + repeated RouteDestination route = 2; +} + +// Describes match conditions and actions for routing TCP traffic. The +// following routing rule forwards traffic arriving at port 27017 for +// mongo.prod.svc.cluster.local to another Mongo server on port 5555. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo-Mongo +// spec: +// hosts: +// - mongo.prod.svc.cluster.local +// tcp: +// - match: +// - port: 27017 +// route: +// - destination: +// host: mongo.backup.svc.cluster.local +// port: +// number: 5555 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: bookinfo-Mongo +// spec: +// hosts: +// - mongo.prod.svc.cluster.local +// tcp: +// - match: +// - port: 27017 +// route: +// - destination: +// host: mongo.backup.svc.cluster.local +// port: +// number: 5555 +// ``` +// {{}} +// {{}} +message TCPRoute { + // Match conditions to be satisfied for the rule to be + // activated. All conditions inside a single match block have AND + // semantics, while the list of match blocks have OR semantics. The rule + // is matched if any one of the match blocks succeed. + repeated L4MatchAttributes match = 1; + + // The destination to which the connection should be forwarded to. + repeated RouteDestination route = 2; +} + +// HttpMatchRequest specifies a set of criterion to be met in order for the +// rule to be applied to the HTTP request. For example, the following +// restricts the rule to match only requests where the URL path +// starts with /ratings/v2/ and the request contains a custom `end-user` header +// with value `jason`. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - match: +// - headers: +// end-user: +// exact: jason +// uri: +// prefix: "/ratings/v2/" +// ignoreUriCase: true +// route: +// - destination: +// host: ratings.prod.svc.cluster.local +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - match: +// - headers: +// end-user: +// exact: jason +// uri: +// prefix: "/ratings/v2/" +// ignoreUriCase: true +// route: +// - destination: +// host: ratings.prod.svc.cluster.local +// ``` +// {{}} +// {{}} +// +// HTTPMatchRequest CANNOT be empty. +// **Note:** No regex string match can be set when delegate VirtualService is specified. +message HTTPMatchRequest { + // The name assigned to a match. The match's name will be + // concatenated with the parent route's name and will be logged in + // the access logs for requests matching this route. + string name = 11; + + // URI to match + // values are case-sensitive and formatted as follows: + // + // - `exact: "value"` for exact string match + // + // - `prefix: "value"` for prefix-based match + // + // - `regex: "value"` for ECMAscript style regex-based match + // + // **Note:** Case-insensitive matching could be enabled via the + // `ignore_uri_case` flag. + StringMatch uri = 1; + + // URI Scheme + // values are case-sensitive and formatted as follows: + // + // - `exact: "value"` for exact string match + // + // - `prefix: "value"` for prefix-based match + // + // - `regex: "value"` for ECMAscript style regex-based match + // + StringMatch scheme = 2; + + // HTTP Method + // values are case-sensitive and formatted as follows: + // + // - `exact: "value"` for exact string match + // + // - `prefix: "value"` for prefix-based match + // + // - `regex: "value"` for ECMAscript style regex-based match + // + StringMatch method = 3; + + // HTTP Authority + // values are case-sensitive and formatted as follows: + // + // - `exact: "value"` for exact string match + // + // - `prefix: "value"` for prefix-based match + // + // - `regex: "value"` for ECMAscript style regex-based match + // + StringMatch authority = 4; + + // The header keys must be lowercase and use hyphen as the separator, + // e.g. _x-request-id_. + // + // Header values are case-sensitive and formatted as follows: + // + // - `exact: "value"` for exact string match + // + // - `prefix: "value"` for prefix-based match + // + // - `regex: "value"` for ECMAscript style regex-based match + // + // If the value is empty and only the name of header is specfied, presence of the header is checked. + // **Note:** The keys `uri`, `scheme`, `method`, and `authority` will be ignored. + map headers = 5; + + // Specifies the ports on the host that is being addressed. Many services + // only expose a single port or label ports with the protocols they support, + // in these cases it is not required to explicitly select the port. + uint32 port = 6; + + // One or more labels that constrain the applicability of a rule to + // workloads with the given labels. If the VirtualService has a list of + // gateways specified in the top-level `gateways` field, it must include the reserved gateway + // `mesh` for this field to be applicable. + map source_labels = 7; + + // Names of gateways where the rule should be applied. Gateway names + // in the top-level `gateways` field of the VirtualService (if any) are overridden. The gateway + // match is independent of sourceLabels. + repeated string gateways = 8; + + // Query parameters for matching. + // + // Ex: + // - For a query parameter like "?key=true", the map key would be "key" and + // the string match could be defined as `exact: "true"`. + // - For a query parameter like "?key", the map key would be "key" and the + // string match could be defined as `exact: ""`. + // - For a query parameter like "?key=123", the map key would be "key" and the + // string match could be defined as `regex: "\d+$"`. Note that this + // configuration will only match values like "123" but not "a123" or "123a". + // + // **Note:** `prefix` matching is currently not supported. + map query_params = 9; + + // Flag to specify whether the URI matching should be case-insensitive. + // + // **Note:** The case will be ignored only in the case of `exact` and `prefix` + // URI matches. + bool ignore_uri_case = 10; + + // withoutHeader has the same syntax with the header, but has opposite meaning. + // If a header is matched with a matching rule among withoutHeader, the traffic becomes not matched one. + map without_headers = 12; + + // Source namespace constraining the applicability of a rule to workloads in that namespace. + // If the VirtualService has a list of gateways specified in the top-level `gateways` field, + // it must include the reserved gateway `mesh` for this field to be applicable. + string source_namespace = 13; +} + +// Each routing rule is associated with one or more service versions (see +// glossary in beginning of document). Weights associated with the version +// determine the proportion of traffic it receives. For example, the +// following rule will route 25% of traffic for the "reviews" service to +// instances with the "v2" tag and the remaining traffic (i.e., 75%) to +// "v1". +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: reviews-route +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// http: +// - route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v2 +// weight: 25 +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v1 +// weight: 75 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: reviews-route +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// http: +// - route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v2 +// weight: 25 +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v1 +// weight: 75 +// ``` +// {{}} +// {{}} +// +// And the associated DestinationRule +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: reviews-destination +// spec: +// host: reviews.prod.svc.cluster.local +// subsets: +// - name: v1 +// labels: +// version: v1 +// - name: v2 +// labels: +// version: v2 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: reviews-destination +// spec: +// host: reviews.prod.svc.cluster.local +// subsets: +// - name: v1 +// labels: +// version: v1 +// - name: v2 +// labels: +// version: v2 +// ``` +// {{}} +// {{}} +// +// Traffic can also be split across two entirely different services without +// having to define new subsets. For example, the following rule forwards 25% of +// traffic to reviews.com to dev.reviews.com +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: reviews-route-two-domains +// spec: +// hosts: +// - reviews.com +// http: +// - route: +// - destination: +// host: dev.reviews.com +// weight: 25 +// - destination: +// host: reviews.com +// weight: 75 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: reviews-route-two-domains +// spec: +// hosts: +// - reviews.com +// http: +// - route: +// - destination: +// host: dev.reviews.com +// weight: 25 +// - destination: +// host: reviews.com +// weight: 75 +// ``` +// {{}} +// {{}} +// +message HTTPRouteDestination { + // Destination uniquely identifies the instances of a service + // to which the request/connection should be forwarded to. + Destination destination = 1 [(google.api.field_behavior) = REQUIRED]; + + // The proportion of traffic to be forwarded to the service + // version. (0-100). Sum of weights across destinations SHOULD BE == 100. + // If there is only one destination in a rule, the weight value is assumed to + // be 100. + int32 weight = 2; + + reserved 3 to 6; + reserved "remove_response_headers", "append_response_headers", "remove_request_headers", "append_request_headers"; + + // Header manipulation rules + Headers headers = 7; +} + +// L4 routing rule weighted destination. +message RouteDestination { + // Destination uniquely identifies the instances of a service + // to which the request/connection should be forwarded to. + Destination destination = 1 [(google.api.field_behavior) = REQUIRED]; + + // The proportion of traffic to be forwarded to the service + // version. If there is only one destination in a rule, all traffic will be + // routed to it irrespective of the weight. + int32 weight = 2; +} + +// L4 connection match attributes. Note that L4 connection matching support +// is incomplete. +message L4MatchAttributes { + // IPv4 or IPv6 ip addresses of destination with optional subnet. E.g., + // a.b.c.d/xx form or just a.b.c.d. + repeated string destination_subnets = 1; + + // Specifies the port on the host that is being addressed. Many services + // only expose a single port or label ports with the protocols they support, + // in these cases it is not required to explicitly select the port. + uint32 port = 2; + + // IPv4 or IPv6 ip address of source with optional subnet. E.g., a.b.c.d/xx + // form or just a.b.c.d + // $hide_from_docs + string source_subnet = 3; + + // One or more labels that constrain the applicability of a rule to + // workloads with the given labels. If the VirtualService has a list of + // gateways specified in the top-level `gateways` field, it should include the reserved gateway + // `mesh` in order for this field to be applicable. + map source_labels = 4; + + // Names of gateways where the rule should be applied. Gateway names + // in the top-level `gateways` field of the VirtualService (if any) are overridden. The gateway + // match is independent of sourceLabels. + repeated string gateways = 5; + + // Source namespace constraining the applicability of a rule to workloads in that namespace. + // If the VirtualService has a list of gateways specified in the top-level `gateways` field, + // it must include the reserved gateway `mesh` for this field to be applicable. + string source_namespace = 6; +} + +// TLS connection match attributes. +message TLSMatchAttributes { + // SNI (server name indicator) to match on. Wildcard prefixes + // can be used in the SNI value, e.g., *.com will match foo.example.com + // as well as example.com. An SNI value must be a subset (i.e., fall + // within the domain) of the corresponding virtual serivce's hosts. + repeated string sni_hosts = 1 [(google.api.field_behavior) = REQUIRED]; + + // IPv4 or IPv6 ip addresses of destination with optional subnet. E.g., + // a.b.c.d/xx form or just a.b.c.d. + repeated string destination_subnets = 2; + + // Specifies the port on the host that is being addressed. Many services + // only expose a single port or label ports with the protocols they + // support, in these cases it is not required to explicitly select the + // port. + uint32 port = 3; + + reserved 4; + reserved "source_subnet"; + + // One or more labels that constrain the applicability of a rule to + // workloads with the given labels. If the VirtualService has a list of + // gateways specified in the top-level `gateways` field, it should include the reserved gateway + // `mesh` in order for this field to be applicable. + map source_labels = 5; + + // Names of gateways where the rule should be applied. Gateway names + // in the top-level `gateways` field of the VirtualService (if any) are overridden. The gateway + // match is independent of sourceLabels. + repeated string gateways = 6; + + // Source namespace constraining the applicability of a rule to workloads in that namespace. + // If the VirtualService has a list of gateways specified in the top-level `gateways` field, + // it must include the reserved gateway `mesh` for this field to be applicable. + string source_namespace = 7; +} + +// HTTPRedirect can be used to send a 301 redirect response to the caller, +// where the Authority/Host and the URI in the response can be swapped with +// the specified values. For example, the following rule redirects +// requests for /v1/getProductRatings API on the ratings service to +// /v1/bookRatings provided by the bookratings service. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - match: +// - uri: +// exact: /v1/getProductRatings +// redirect: +// uri: /v1/bookRatings +// authority: newratings.default.svc.cluster.local +// ... +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - match: +// - uri: +// exact: /v1/getProductRatings +// redirect: +// uri: /v1/bookRatings +// authority: newratings.default.svc.cluster.local +// ... +// ``` +// {{}} +// {{}} +// +message HTTPRedirect { + // On a redirect, overwrite the Path portion of the URL with this + // value. Note that the entire path will be replaced, irrespective of the + // request URI being matched as an exact path or prefix. + string uri = 1; + + // On a redirect, overwrite the Authority/Host portion of the URL with + // this value. + string authority = 2; + + // On a redirect, Specifies the HTTP status code to use in the redirect + // response. The default response code is MOVED_PERMANENTLY (301). + uint32 redirect_code = 3; +} + +// HTTPRewrite can be used to rewrite specific parts of a HTTP request +// before forwarding the request to the destination. Rewrite primitive can +// be used only with HTTPRouteDestination. The following example +// demonstrates how to rewrite the URL prefix for api call (/ratings) to +// ratings service before making the actual API call. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - match: +// - uri: +// prefix: /ratings +// rewrite: +// uri: /v1/bookRatings +// route: +// - destination: +// host: ratings.prod.svc.cluster.local +// subset: v1 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - match: +// - uri: +// prefix: /ratings +// rewrite: +// uri: /v1/bookRatings +// route: +// - destination: +// host: ratings.prod.svc.cluster.local +// subset: v1 +// ``` +// {{}} +// {{}} +// +message HTTPRewrite { + // rewrite the path (or the prefix) portion of the URI with this + // value. If the original URI was matched based on prefix, the value + // provided in this field will replace the corresponding matched prefix. + string uri = 1; + + // rewrite the Authority/Host header with this value. + string authority = 2; +} + +// Describes how to match a given string in HTTP headers. Match is +// case-sensitive. +message StringMatch { + oneof match_type { + + // exact string match + string exact = 1; + + // prefix-based match + string prefix = 2; + + // RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax). + string regex = 3; + } +} + +// Describes the retry policy to use when a HTTP request fails. For +// example, the following rule sets the maximum number of retries to 3 when +// calling ratings:v1 service, with a 2s timeout per retry attempt. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - route: +// - destination: +// host: ratings.prod.svc.cluster.local +// subset: v1 +// retries: +// attempts: 3 +// perTryTimeout: 2s +// retryOn: gateway-error,connect-failure,refused-stream +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - route: +// - destination: +// host: ratings.prod.svc.cluster.local +// subset: v1 +// retries: +// attempts: 3 +// perTryTimeout: 2s +// retryOn: gateway-error,connect-failure,refused-stream +// ``` +// {{}} +// {{}} +// +message HTTPRetry { + // Number of retries for a given request. The interval + // between retries will be determined automatically (25ms+). Actual + // number of retries attempted depends on the request `timeout` of the + // [HTTP route](https://istio.io/docs/reference/config/networking/virtual-service/#HTTPRoute). + int32 attempts = 1 [(google.api.field_behavior) = REQUIRED]; + + // Timeout per retry attempt for a given request. format: 1h/1m/1s/1ms. MUST BE >=1ms. + google.protobuf.Duration per_try_timeout = 2; + + // Specifies the conditions under which retry takes place. + // One or more policies can be specified using a ‘,’ delimited list. + // See the [retry policies](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/router_filter#x-envoy-retry-on) + // and [gRPC retry policies](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/router_filter#x-envoy-retry-grpc-on) for more details. + string retry_on = 3; + + // Flag to specify whether the retries should retry to other localities. + // See the [retry plugin configuration](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/http/http_connection_management#retry-plugin-configuration) for more details. + google.protobuf.BoolValue retry_remote_localities = 4; +} + +// Describes the Cross-Origin Resource Sharing (CORS) policy, for a given +// service. Refer to [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) +// for further details about cross origin resource sharing. For example, +// the following rule restricts cross origin requests to those originating +// from example.com domain using HTTP POST/GET, and sets the +// `Access-Control-Allow-Credentials` header to false. In addition, it only +// exposes `X-Foo-bar` header and sets an expiry period of 1 day. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - route: +// - destination: +// host: ratings.prod.svc.cluster.local +// subset: v1 +// corsPolicy: +// allowOrigins: +// - exact: https://example.com +// allowMethods: +// - POST +// - GET +// allowCredentials: false +// allowHeaders: +// - X-Foo-Bar +// maxAge: "24h" +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: ratings-route +// spec: +// hosts: +// - ratings.prod.svc.cluster.local +// http: +// - route: +// - destination: +// host: ratings.prod.svc.cluster.local +// subset: v1 +// corsPolicy: +// allowOrigins: +// - exact: https://example.com +// allowMethods: +// - POST +// - GET +// allowCredentials: false +// allowHeaders: +// - X-Foo-Bar +// maxAge: "24h" +// ``` +// {{}} +// {{}} +// +message CorsPolicy { + // The list of origins that are allowed to perform CORS requests. The + // content will be serialized into the Access-Control-Allow-Origin + // header. Wildcard * will allow all origins. + // $hide_from_docs + repeated string allow_origin = 1 [deprecated=true]; + + // String patterns that match allowed origins. + // An origin is allowed if any of the string matchers match. + // If a match is found, then the outgoing Access-Control-Allow-Origin would be set to the origin as provided by the client. + repeated StringMatch allow_origins = 7; + + // List of HTTP methods allowed to access the resource. The content will + // be serialized into the Access-Control-Allow-Methods header. + repeated string allow_methods = 2; + + // List of HTTP headers that can be used when requesting the + // resource. Serialized to Access-Control-Allow-Headers header. + repeated string allow_headers = 3; + + // A white list of HTTP headers that the browsers are allowed to + // access. Serialized into Access-Control-Expose-Headers header. + repeated string expose_headers = 4; + + // Specifies how long the results of a preflight request can be + // cached. Translates to the `Access-Control-Max-Age` header. + google.protobuf.Duration max_age = 5; + + // Indicates whether the caller is allowed to send the actual request + // (not the preflight) using credentials. Translates to + // `Access-Control-Allow-Credentials` header. + google.protobuf.BoolValue allow_credentials = 6; +} + +// HTTPFaultInjection can be used to specify one or more faults to inject +// while forwarding HTTP requests to the destination specified in a route. +// Fault specification is part of a VirtualService rule. Faults include +// aborting the Http request from downstream service, and/or delaying +// proxying of requests. A fault rule MUST HAVE delay or abort or both. +// +// *Note:* Delay and abort faults are independent of one another, even if +// both are specified simultaneously. +message HTTPFaultInjection { + // Delay requests before forwarding, emulating various failures such as + // network issues, overloaded upstream service, etc. + Delay delay = 1; + + // Abort Http request attempts and return error codes back to downstream + // service, giving the impression that the upstream service is faulty. + Abort abort = 2; + + // Delay specification is used to inject latency into the request + // forwarding path. The following example will introduce a 5 second delay + // in 1 out of every 1000 requests to the "v1" version of the "reviews" + // service from all pods with label env: prod + // + // {{}} + // {{}} + // ```yaml + // apiVersion: networking.istio.io/v1alpha3 + // kind: VirtualService + // metadata: + // name: reviews-route + // spec: + // hosts: + // - reviews.prod.svc.cluster.local + // http: + // - match: + // - sourceLabels: + // env: prod + // route: + // - destination: + // host: reviews.prod.svc.cluster.local + // subset: v1 + // fault: + // delay: + // percentage: + // value: 0.1 + // fixedDelay: 5s + // ``` + // {{}} + // + // {{}} + // ```yaml + // apiVersion: networking.istio.io/v1beta1 + // kind: VirtualService + // metadata: + // name: reviews-route + // spec: + // hosts: + // - reviews.prod.svc.cluster.local + // http: + // - match: + // - sourceLabels: + // env: prod + // route: + // - destination: + // host: reviews.prod.svc.cluster.local + // subset: v1 + // fault: + // delay: + // percentage: + // value: 0.1 + // fixedDelay: 5s + // ``` + // {{}} + // {{}} + // + // The _fixedDelay_ field is used to indicate the amount of delay in seconds. + // The optional _percentage_ field can be used to only delay a certain + // percentage of requests. If left unspecified, all request will be delayed. + message Delay { + // Percentage of requests on which the delay will be injected (0-100). + // Use of integer `percent` value is deprecated. Use the double `percentage` + // field instead. + int32 percent = 1 [deprecated=true]; + + oneof http_delay_type { + // Add a fixed delay before forwarding the request. Format: + // 1h/1m/1s/1ms. MUST be >=1ms. + google.protobuf.Duration fixed_delay = 2 [(google.api.field_behavior) = REQUIRED]; + + // $hide_from_docs + google.protobuf.Duration exponential_delay = 3 ; + } + + // Percentage of requests on which the delay will be injected. + Percent percentage = 5; + } + + // Abort specification is used to prematurely abort a request with a + // pre-specified error code. The following example will return an HTTP 400 + // error code for 1 out of every 1000 requests to the "ratings" service "v1". + // + // {{}} + // {{}} + // ```yaml + // apiVersion: networking.istio.io/v1alpha3 + // kind: VirtualService + // metadata: + // name: ratings-route + // spec: + // hosts: + // - ratings.prod.svc.cluster.local + // http: + // - route: + // - destination: + // host: ratings.prod.svc.cluster.local + // subset: v1 + // fault: + // abort: + // percentage: + // value: 0.1 + // httpStatus: 400 + // ``` + // {{}} + // + // {{}} + // ```yaml + // apiVersion: networking.istio.io/v1beta1 + // kind: VirtualService + // metadata: + // name: ratings-route + // spec: + // hosts: + // - ratings.prod.svc.cluster.local + // http: + // - route: + // - destination: + // host: ratings.prod.svc.cluster.local + // subset: v1 + // fault: + // abort: + // percentage: + // value: 0.1 + // httpStatus: 400 + // ``` + // {{}} + // {{}} + // + // The _httpStatus_ field is used to indicate the HTTP status code to + // return to the caller. The optional _percentage_ field can be used to only + // abort a certain percentage of requests. If not specified, all requests are + // aborted. + message Abort { + reserved 1; + reserved "percent"; + + oneof error_type { + // HTTP status code to use to abort the Http request. + int32 http_status = 2 [(google.api.field_behavior) = REQUIRED]; + + // $hide_from_docs + string grpc_status = 3; + + // $hide_from_docs + string http2_error = 4; + } + + // Percentage of requests to be aborted with the error code provided. + Percent percentage = 5; + } +} + +// PortSelector specifies the number of a port to be used for +// matching or selection for final routing. +message PortSelector { + // Valid port number + uint32 number = 1; + + reserved 2; + reserved "name"; +} + +// Percent specifies a percentage in the range of [0.0, 100.0]. +message Percent { + double value = 1; +} diff --git a/vendor/istio.io/api/networking/v1alpha3/virtual_service_deepcopy.gen.go b/vendor/istio.io/api/networking/v1alpha3/virtual_service_deepcopy.gen.go new file mode 100644 index 0000000000..f98675dac3 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/virtual_service_deepcopy.gen.go @@ -0,0 +1,533 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/virtual_service.proto + +// Configuration affecting traffic routing. Here are a few terms useful to define +// in the context of traffic routing. +// +// `Service` a unit of application behavior bound to a unique name in a +// service registry. Services consist of multiple network *endpoints* +// implemented by workload instances running on pods, containers, VMs etc. +// +// `Service versions (a.k.a. subsets)` - In a continuous deployment +// scenario, for a given service, there can be distinct subsets of +// instances running different variants of the application binary. These +// variants are not necessarily different API versions. They could be +// iterative changes to the same service, deployed in different +// environments (prod, staging, dev, etc.). Common scenarios where this +// occurs include A/B testing, canary rollouts, etc. The choice of a +// particular version can be decided based on various criterion (headers, +// url, etc.) and/or by weights assigned to each version. Each service has +// a default version consisting of all its instances. +// +// `Source` - A downstream client calling a service. +// +// `Host` - The address used by a client when attempting to connect to a +// service. +// +// `Access model` - Applications address only the destination service +// (Host) without knowledge of individual service versions (subsets). The +// actual choice of the version is determined by the proxy/sidecar, enabling the +// application code to decouple itself from the evolution of dependent +// services. +// +// A `VirtualService` defines a set of traffic routing rules to apply when a host is +// addressed. Each routing rule defines matching criteria for traffic of a specific +// protocol. If the traffic is matched, then it is sent to a named destination service +// (or subset/version of it) defined in the registry. +// +// The source of traffic can also be matched in a routing rule. This allows routing +// to be customized for specific client contexts. +// +// The following example on Kubernetes, routes all HTTP traffic by default to +// pods of the reviews service with label "version: v1". In addition, +// HTTP requests with path starting with /wpcatalog/ or /consumercatalog/ will +// be rewritten to /newcatalog and sent to pods with label "version: v2". +// +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: reviews-route +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// http: +// - name: "reviews-v2-routes" +// match: +// - uri: +// prefix: "/wpcatalog" +// - uri: +// prefix: "/consumercatalog" +// rewrite: +// uri: "/newcatalog" +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v2 +// - name: "reviews-v1-route" +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v1 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: reviews-route +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// http: +// - name: "reviews-v2-routes" +// match: +// - uri: +// prefix: "/wpcatalog" +// - uri: +// prefix: "/consumercatalog" +// rewrite: +// uri: "/newcatalog" +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v2 +// - name: "reviews-v1-route" +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v1 +// ``` +// {{}} +// {{}} +// +// A subset/version of a route destination is identified with a reference +// to a named service subset which must be declared in a corresponding +// `DestinationRule`. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: reviews-destination +// spec: +// host: reviews.prod.svc.cluster.local +// subsets: +// - name: v1 +// labels: +// version: v1 +// - name: v2 +// labels: +// version: v2 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: reviews-destination +// spec: +// host: reviews.prod.svc.cluster.local +// subsets: +// - name: v1 +// labels: +// version: v1 +// - name: v2 +// labels: +// version: v2 +// ``` +// {{}} +// {{}} +// + +package v1alpha3 + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// DeepCopyInto supports using VirtualService within kubernetes types, where deepcopy-gen is used. +func (in *VirtualService) DeepCopyInto(out *VirtualService) { + p := proto.Clone(in).(*VirtualService) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualService. Required by controller-gen. +func (in *VirtualService) DeepCopy() *VirtualService { + if in == nil { + return nil + } + out := new(VirtualService) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using Destination within kubernetes types, where deepcopy-gen is used. +func (in *Destination) DeepCopyInto(out *Destination) { + p := proto.Clone(in).(*Destination) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Destination. Required by controller-gen. +func (in *Destination) DeepCopy() *Destination { + if in == nil { + return nil + } + out := new(Destination) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using HTTPRoute within kubernetes types, where deepcopy-gen is used. +func (in *HTTPRoute) DeepCopyInto(out *HTTPRoute) { + p := proto.Clone(in).(*HTTPRoute) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRoute. Required by controller-gen. +func (in *HTTPRoute) DeepCopy() *HTTPRoute { + if in == nil { + return nil + } + out := new(HTTPRoute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using Delegate within kubernetes types, where deepcopy-gen is used. +func (in *Delegate) DeepCopyInto(out *Delegate) { + p := proto.Clone(in).(*Delegate) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Delegate. Required by controller-gen. +func (in *Delegate) DeepCopy() *Delegate { + if in == nil { + return nil + } + out := new(Delegate) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using Headers within kubernetes types, where deepcopy-gen is used. +func (in *Headers) DeepCopyInto(out *Headers) { + p := proto.Clone(in).(*Headers) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Headers. Required by controller-gen. +func (in *Headers) DeepCopy() *Headers { + if in == nil { + return nil + } + out := new(Headers) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using Headers_HeaderOperations within kubernetes types, where deepcopy-gen is used. +func (in *Headers_HeaderOperations) DeepCopyInto(out *Headers_HeaderOperations) { + p := proto.Clone(in).(*Headers_HeaderOperations) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Headers_HeaderOperations. Required by controller-gen. +func (in *Headers_HeaderOperations) DeepCopy() *Headers_HeaderOperations { + if in == nil { + return nil + } + out := new(Headers_HeaderOperations) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using TLSRoute within kubernetes types, where deepcopy-gen is used. +func (in *TLSRoute) DeepCopyInto(out *TLSRoute) { + p := proto.Clone(in).(*TLSRoute) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSRoute. Required by controller-gen. +func (in *TLSRoute) DeepCopy() *TLSRoute { + if in == nil { + return nil + } + out := new(TLSRoute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using TCPRoute within kubernetes types, where deepcopy-gen is used. +func (in *TCPRoute) DeepCopyInto(out *TCPRoute) { + p := proto.Clone(in).(*TCPRoute) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TCPRoute. Required by controller-gen. +func (in *TCPRoute) DeepCopy() *TCPRoute { + if in == nil { + return nil + } + out := new(TCPRoute) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using HTTPMatchRequest within kubernetes types, where deepcopy-gen is used. +func (in *HTTPMatchRequest) DeepCopyInto(out *HTTPMatchRequest) { + p := proto.Clone(in).(*HTTPMatchRequest) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPMatchRequest. Required by controller-gen. +func (in *HTTPMatchRequest) DeepCopy() *HTTPMatchRequest { + if in == nil { + return nil + } + out := new(HTTPMatchRequest) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using HTTPRouteDestination within kubernetes types, where deepcopy-gen is used. +func (in *HTTPRouteDestination) DeepCopyInto(out *HTTPRouteDestination) { + p := proto.Clone(in).(*HTTPRouteDestination) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRouteDestination. Required by controller-gen. +func (in *HTTPRouteDestination) DeepCopy() *HTTPRouteDestination { + if in == nil { + return nil + } + out := new(HTTPRouteDestination) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using RouteDestination within kubernetes types, where deepcopy-gen is used. +func (in *RouteDestination) DeepCopyInto(out *RouteDestination) { + p := proto.Clone(in).(*RouteDestination) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RouteDestination. Required by controller-gen. +func (in *RouteDestination) DeepCopy() *RouteDestination { + if in == nil { + return nil + } + out := new(RouteDestination) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using L4MatchAttributes within kubernetes types, where deepcopy-gen is used. +func (in *L4MatchAttributes) DeepCopyInto(out *L4MatchAttributes) { + p := proto.Clone(in).(*L4MatchAttributes) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new L4MatchAttributes. Required by controller-gen. +func (in *L4MatchAttributes) DeepCopy() *L4MatchAttributes { + if in == nil { + return nil + } + out := new(L4MatchAttributes) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using TLSMatchAttributes within kubernetes types, where deepcopy-gen is used. +func (in *TLSMatchAttributes) DeepCopyInto(out *TLSMatchAttributes) { + p := proto.Clone(in).(*TLSMatchAttributes) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLSMatchAttributes. Required by controller-gen. +func (in *TLSMatchAttributes) DeepCopy() *TLSMatchAttributes { + if in == nil { + return nil + } + out := new(TLSMatchAttributes) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using HTTPRedirect within kubernetes types, where deepcopy-gen is used. +func (in *HTTPRedirect) DeepCopyInto(out *HTTPRedirect) { + p := proto.Clone(in).(*HTTPRedirect) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRedirect. Required by controller-gen. +func (in *HTTPRedirect) DeepCopy() *HTTPRedirect { + if in == nil { + return nil + } + out := new(HTTPRedirect) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using HTTPRewrite within kubernetes types, where deepcopy-gen is used. +func (in *HTTPRewrite) DeepCopyInto(out *HTTPRewrite) { + p := proto.Clone(in).(*HTTPRewrite) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRewrite. Required by controller-gen. +func (in *HTTPRewrite) DeepCopy() *HTTPRewrite { + if in == nil { + return nil + } + out := new(HTTPRewrite) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using StringMatch within kubernetes types, where deepcopy-gen is used. +func (in *StringMatch) DeepCopyInto(out *StringMatch) { + p := proto.Clone(in).(*StringMatch) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StringMatch. Required by controller-gen. +func (in *StringMatch) DeepCopy() *StringMatch { + if in == nil { + return nil + } + out := new(StringMatch) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using HTTPRetry within kubernetes types, where deepcopy-gen is used. +func (in *HTTPRetry) DeepCopyInto(out *HTTPRetry) { + p := proto.Clone(in).(*HTTPRetry) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPRetry. Required by controller-gen. +func (in *HTTPRetry) DeepCopy() *HTTPRetry { + if in == nil { + return nil + } + out := new(HTTPRetry) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using CorsPolicy within kubernetes types, where deepcopy-gen is used. +func (in *CorsPolicy) DeepCopyInto(out *CorsPolicy) { + p := proto.Clone(in).(*CorsPolicy) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CorsPolicy. Required by controller-gen. +func (in *CorsPolicy) DeepCopy() *CorsPolicy { + if in == nil { + return nil + } + out := new(CorsPolicy) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using HTTPFaultInjection within kubernetes types, where deepcopy-gen is used. +func (in *HTTPFaultInjection) DeepCopyInto(out *HTTPFaultInjection) { + p := proto.Clone(in).(*HTTPFaultInjection) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPFaultInjection. Required by controller-gen. +func (in *HTTPFaultInjection) DeepCopy() *HTTPFaultInjection { + if in == nil { + return nil + } + out := new(HTTPFaultInjection) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using HTTPFaultInjection_Delay within kubernetes types, where deepcopy-gen is used. +func (in *HTTPFaultInjection_Delay) DeepCopyInto(out *HTTPFaultInjection_Delay) { + p := proto.Clone(in).(*HTTPFaultInjection_Delay) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPFaultInjection_Delay. Required by controller-gen. +func (in *HTTPFaultInjection_Delay) DeepCopy() *HTTPFaultInjection_Delay { + if in == nil { + return nil + } + out := new(HTTPFaultInjection_Delay) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using HTTPFaultInjection_Abort within kubernetes types, where deepcopy-gen is used. +func (in *HTTPFaultInjection_Abort) DeepCopyInto(out *HTTPFaultInjection_Abort) { + p := proto.Clone(in).(*HTTPFaultInjection_Abort) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPFaultInjection_Abort. Required by controller-gen. +func (in *HTTPFaultInjection_Abort) DeepCopy() *HTTPFaultInjection_Abort { + if in == nil { + return nil + } + out := new(HTTPFaultInjection_Abort) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using PortSelector within kubernetes types, where deepcopy-gen is used. +func (in *PortSelector) DeepCopyInto(out *PortSelector) { + p := proto.Clone(in).(*PortSelector) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PortSelector. Required by controller-gen. +func (in *PortSelector) DeepCopy() *PortSelector { + if in == nil { + return nil + } + out := new(PortSelector) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto supports using Percent within kubernetes types, where deepcopy-gen is used. +func (in *Percent) DeepCopyInto(out *Percent) { + p := proto.Clone(in).(*Percent) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Percent. Required by controller-gen. +func (in *Percent) DeepCopy() *Percent { + if in == nil { + return nil + } + out := new(Percent) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/istio.io/api/networking/v1alpha3/virtual_service_json.gen.go b/vendor/istio.io/api/networking/v1alpha3/virtual_service_json.gen.go new file mode 100644 index 0000000000..4f4fbbb5a2 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/virtual_service_json.gen.go @@ -0,0 +1,425 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/virtual_service.proto + +// Configuration affecting traffic routing. Here are a few terms useful to define +// in the context of traffic routing. +// +// `Service` a unit of application behavior bound to a unique name in a +// service registry. Services consist of multiple network *endpoints* +// implemented by workload instances running on pods, containers, VMs etc. +// +// `Service versions (a.k.a. subsets)` - In a continuous deployment +// scenario, for a given service, there can be distinct subsets of +// instances running different variants of the application binary. These +// variants are not necessarily different API versions. They could be +// iterative changes to the same service, deployed in different +// environments (prod, staging, dev, etc.). Common scenarios where this +// occurs include A/B testing, canary rollouts, etc. The choice of a +// particular version can be decided based on various criterion (headers, +// url, etc.) and/or by weights assigned to each version. Each service has +// a default version consisting of all its instances. +// +// `Source` - A downstream client calling a service. +// +// `Host` - The address used by a client when attempting to connect to a +// service. +// +// `Access model` - Applications address only the destination service +// (Host) without knowledge of individual service versions (subsets). The +// actual choice of the version is determined by the proxy/sidecar, enabling the +// application code to decouple itself from the evolution of dependent +// services. +// +// A `VirtualService` defines a set of traffic routing rules to apply when a host is +// addressed. Each routing rule defines matching criteria for traffic of a specific +// protocol. If the traffic is matched, then it is sent to a named destination service +// (or subset/version of it) defined in the registry. +// +// The source of traffic can also be matched in a routing rule. This allows routing +// to be customized for specific client contexts. +// +// The following example on Kubernetes, routes all HTTP traffic by default to +// pods of the reviews service with label "version: v1". In addition, +// HTTP requests with path starting with /wpcatalog/ or /consumercatalog/ will +// be rewritten to /newcatalog and sent to pods with label "version: v2". +// +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: reviews-route +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// http: +// - name: "reviews-v2-routes" +// match: +// - uri: +// prefix: "/wpcatalog" +// - uri: +// prefix: "/consumercatalog" +// rewrite: +// uri: "/newcatalog" +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v2 +// - name: "reviews-v1-route" +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v1 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: VirtualService +// metadata: +// name: reviews-route +// spec: +// hosts: +// - reviews.prod.svc.cluster.local +// http: +// - name: "reviews-v2-routes" +// match: +// - uri: +// prefix: "/wpcatalog" +// - uri: +// prefix: "/consumercatalog" +// rewrite: +// uri: "/newcatalog" +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v2 +// - name: "reviews-v1-route" +// route: +// - destination: +// host: reviews.prod.svc.cluster.local +// subset: v1 +// ``` +// {{}} +// {{}} +// +// A subset/version of a route destination is identified with a reference +// to a named service subset which must be declared in a corresponding +// `DestinationRule`. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: DestinationRule +// metadata: +// name: reviews-destination +// spec: +// host: reviews.prod.svc.cluster.local +// subsets: +// - name: v1 +// labels: +// version: v1 +// - name: v2 +// labels: +// version: v2 +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: DestinationRule +// metadata: +// name: reviews-destination +// spec: +// host: reviews.prod.svc.cluster.local +// subsets: +// - name: v1 +// labels: +// version: v1 +// - name: v2 +// labels: +// version: v2 +// ``` +// {{}} +// {{}} +// + +package v1alpha3 + +import ( + bytes "bytes" + fmt "fmt" + github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" + proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// MarshalJSON is a custom marshaler for VirtualService +func (this *VirtualService) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for VirtualService +func (this *VirtualService) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for Destination +func (this *Destination) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for Destination +func (this *Destination) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for HTTPRoute +func (this *HTTPRoute) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for HTTPRoute +func (this *HTTPRoute) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for Delegate +func (this *Delegate) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for Delegate +func (this *Delegate) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for Headers +func (this *Headers) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for Headers +func (this *Headers) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for Headers_HeaderOperations +func (this *Headers_HeaderOperations) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for Headers_HeaderOperations +func (this *Headers_HeaderOperations) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for TLSRoute +func (this *TLSRoute) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for TLSRoute +func (this *TLSRoute) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for TCPRoute +func (this *TCPRoute) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for TCPRoute +func (this *TCPRoute) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for HTTPMatchRequest +func (this *HTTPMatchRequest) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for HTTPMatchRequest +func (this *HTTPMatchRequest) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for HTTPRouteDestination +func (this *HTTPRouteDestination) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for HTTPRouteDestination +func (this *HTTPRouteDestination) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for RouteDestination +func (this *RouteDestination) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for RouteDestination +func (this *RouteDestination) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for L4MatchAttributes +func (this *L4MatchAttributes) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for L4MatchAttributes +func (this *L4MatchAttributes) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for TLSMatchAttributes +func (this *TLSMatchAttributes) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for TLSMatchAttributes +func (this *TLSMatchAttributes) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for HTTPRedirect +func (this *HTTPRedirect) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for HTTPRedirect +func (this *HTTPRedirect) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for HTTPRewrite +func (this *HTTPRewrite) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for HTTPRewrite +func (this *HTTPRewrite) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for StringMatch +func (this *StringMatch) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for StringMatch +func (this *StringMatch) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for HTTPRetry +func (this *HTTPRetry) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for HTTPRetry +func (this *HTTPRetry) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for CorsPolicy +func (this *CorsPolicy) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for CorsPolicy +func (this *CorsPolicy) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for HTTPFaultInjection +func (this *HTTPFaultInjection) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for HTTPFaultInjection +func (this *HTTPFaultInjection) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for HTTPFaultInjection_Delay +func (this *HTTPFaultInjection_Delay) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for HTTPFaultInjection_Delay +func (this *HTTPFaultInjection_Delay) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for HTTPFaultInjection_Abort +func (this *HTTPFaultInjection_Abort) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for HTTPFaultInjection_Abort +func (this *HTTPFaultInjection_Abort) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for PortSelector +func (this *PortSelector) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for PortSelector +func (this *PortSelector) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for Percent +func (this *Percent) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for Percent +func (this *Percent) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +var ( + VirtualServiceMarshaler = &github_com_gogo_protobuf_jsonpb.Marshaler{} + VirtualServiceUnmarshaler = &github_com_gogo_protobuf_jsonpb.Unmarshaler{} +) diff --git a/vendor/istio.io/api/networking/v1alpha3/workload_entry.gen.json b/vendor/istio.io/api/networking/v1alpha3/workload_entry.gen.json new file mode 100644 index 0000000000..571f1e9af4 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/workload_entry.gen.json @@ -0,0 +1,56 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Configuration affecting VMs onboarded into the mesh.", + "version": "v1alpha3" + }, + "components": { + "schemas": { + "istio.networking.v1alpha3.WorkloadEntry": { + "description": "WorkloadEntry enables specifying the properties of a single non-Kubernetes workload such a VM or a bare metal services that can be referred to by service entries.", + "type": "object", + "properties": { + "labels": { + "description": "One or more labels associated with the endpoint.", + "type": "object", + "additionalProperties": { + "type": "string", + "format": "string" + } + }, + "ports": { + "description": "Set of ports associated with the endpoint. The ports must be associated with a port name that was declared as part of the service. Do not use for `unix://` addresses.", + "type": "object", + "additionalProperties": { + "type": "integer" + } + }, + "weight": { + "description": "The load balancing weight associated with the endpoint. Endpoints with higher weights will receive proportionally higher traffic.", + "type": "integer" + }, + "address": { + "description": "Address associated with the network endpoint without the port. Domain names can be used if and only if the resolution is set to DNS, and must be fully-qualified without wildcards. Use the form unix:///absolute/path/to/socket for Unix domain socket endpoints.", + "type": "string", + "format": "string" + }, + "network": { + "description": "Network enables Istio to group endpoints resident in the same L3 domain/network. All endpoints in the same network are assumed to be directly reachable from one another. When endpoints in different networks cannot reach each other directly, an Istio Gateway can be used to establish connectivity (usually using the `AUTO_PASSTHROUGH` mode in a Gateway Server). This is an advanced configuration used typically for spanning an Istio mesh over multiple clusters.", + "type": "string", + "format": "string" + }, + "locality": { + "description": "The locality associated with the endpoint. A locality corresponds to a failure domain (e.g., country/region/zone). Arbitrary failure domain hierarchies can be represented by separating each encapsulating failure domain by /. For example, the locality of an an endpoint in US, in US-East-1 region, within availability zone az-1, in data center rack r11 can be represented as us/us-east-1/az-1/r11. Istio will configure the sidecar to route to endpoints within the same locality as the sidecar. If none of the endpoints in the locality are available, endpoints parent locality (but within the same network ID) will be chosen. For example, if there are two endpoints in same network (networkID \"n1\"), say e1 with locality us/us-east-1/az-1/r11 and e2 with locality us/us-east-1/az-2/r12, a sidecar from us/us-east-1/az-1/r11 locality will prefer e1 from the same locality over e2 from a different locality. Endpoint e2 could be the IP associated with a gateway (that bridges networks n1 and n2), or the IP associated with a standard service endpoint.", + "type": "string", + "format": "string" + }, + "serviceAccount": { + "description": "The service account associated with the workload if a sidecar is present in the workload. The service account must be present in the same namespace as the configuration ( WorkloadEntry or a ServiceEntry)", + "type": "string", + "format": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/vendor/istio.io/api/networking/v1alpha3/workload_entry.pb.go b/vendor/istio.io/api/networking/v1alpha3/workload_entry.pb.go new file mode 100644 index 0000000000..5bb36a7501 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/workload_entry.pb.go @@ -0,0 +1,1137 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/workload_entry.proto + +// `WorkloadEntry` enables operators to describe the properties of a +// single non-Kubernetes workload such as a VM or a bare metal server +// as it is onboarded into the mesh. A `WorkloadEntry` must be +// accompanied by an Istio `ServiceEntry` that selects the workload +// through the appropriate labels and provides the service definition +// for a `MESH_INTERNAL` service (hostnames, port properties, etc.). A +// `ServiceEntry` object can select multiple workload entries as well +// as Kubernetes pods based on the label selector specified in the +// service entry. +// +// When a workload connects to `istiod`, the status field in the +// custom resource will be updated to indicate the health of the +// workload along with other details, similar to how Kubernetes +// updates the status of a pod. +// +// The following example declares a workload entry representing a +// VM for the `details.bookinfo.com` service. This VM has +// sidecar installed and bootstrapped using the `details-legacy` +// service account. The sidecar receives HTTP traffic on port 80 +// (wrapped in istio mutual TLS) and forwards it to the application on +// the localhost on the same port. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: WorkloadEntry +// metadata: +// name: details-svc +// spec: +// # use of the service account indicates that the workload has a +// # sidecar proxy bootstrapped with this service account. Pods with +// # sidecars will automatically communicate with the workload using +// # istio mutual TLS. +// serviceAccount: details-legacy +// address: 2.2.2.2 +// labels: +// app: details-legacy +// instance-id: vm1 +// # ports if not specified will be the same as service ports +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: WorkloadEntry +// metadata: +// name: details-svc +// spec: +// # use of the service account indicates that the workload has a +// # sidecar proxy bootstrapped with this service account. Pods with +// # sidecars will automatically communicate with the workload using +// # istio mutual TLS. +// serviceAccount: details-legacy +// address: 2.2.2.2 +// labels: +// app: details-legacy +// instance-id: vm1 +// # ports if not specified will be the same as service ports +// ``` +// {{}} +// {{}} +// +// and the associated service entry +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// workloadSelector: +// labels: +// app: details-legacy +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// workloadSelector: +// labels: +// app: details-legacy +// ``` +// {{}} +// {{}} +// +// +// The following example declares the same VM workload using +// its fully qualified DNS name. The service entry's resolution +// mode should be changed to DNS to indicate that the client-side +// sidecars should dynamically resolve the DNS name at runtime before +// forwarding the request. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: WorkloadEntry +// metadata: +// name: details-svc +// spec: +// # use of the service account indicates that the workload has a +// # sidecar proxy bootstrapped with this service account. Pods with +// # sidecars will automatically communicate with the workload using +// # istio mutual TLS. +// serviceAccount: details-legacy +// address: vm1.vpc01.corp.net +// labels: +// app: details-legacy +// instance-id: vm1 +// # ports if not specified will be the same as service ports +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: WorkloadEntry +// metadata: +// name: details-svc +// spec: +// # use of the service account indicates that the workload has a +// # sidecar proxy bootstrapped with this service account. Pods with +// # sidecars will automatically communicate with the workload using +// # istio mutual TLS. +// serviceAccount: details-legacy +// address: vm1.vpc01.corp.net +// labels: +// app: details-legacy +// instance-id: vm1 +// # ports if not specified will be the same as service ports +// ``` +// {{}} +// {{}} +// +// and the associated service entry +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// workloadSelector: +// labels: +// app: details-legacy +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// workloadSelector: +// labels: +// app: details-legacy +// ``` +// {{}} +// {{}} +// + +package v1alpha3 + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + io "io" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// WorkloadEntry enables specifying the properties of a single non-Kubernetes workload such a VM or a bare metal services that can be referred to by service entries. +// +// +// +// +type WorkloadEntry struct { + // Address associated with the network endpoint without the + // port. Domain names can be used if and only if the resolution is set + // to DNS, and must be fully-qualified without wildcards. Use the form + // unix:///absolute/path/to/socket for Unix domain socket endpoints. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // Set of ports associated with the endpoint. The ports must be + // associated with a port name that was declared as part of the + // service. Do not use for `unix://` addresses. + Ports map[string]uint32 `protobuf:"bytes,2,rep,name=ports,proto3" json:"ports,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` + // One or more labels associated with the endpoint. + Labels map[string]string `protobuf:"bytes,3,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + // Network enables Istio to group endpoints resident in the same L3 + // domain/network. All endpoints in the same network are assumed to be + // directly reachable from one another. When endpoints in different + // networks cannot reach each other directly, an Istio Gateway can be + // used to establish connectivity (usually using the + // `AUTO_PASSTHROUGH` mode in a Gateway Server). This is + // an advanced configuration used typically for spanning an Istio mesh + // over multiple clusters. + Network string `protobuf:"bytes,4,opt,name=network,proto3" json:"network,omitempty"` + // The locality associated with the endpoint. A locality corresponds + // to a failure domain (e.g., country/region/zone). Arbitrary failure + // domain hierarchies can be represented by separating each + // encapsulating failure domain by /. For example, the locality of an + // an endpoint in US, in US-East-1 region, within availability zone + // az-1, in data center rack r11 can be represented as + // us/us-east-1/az-1/r11. Istio will configure the sidecar to route to + // endpoints within the same locality as the sidecar. If none of the + // endpoints in the locality are available, endpoints parent locality + // (but within the same network ID) will be chosen. For example, if + // there are two endpoints in same network (networkID "n1"), say e1 + // with locality us/us-east-1/az-1/r11 and e2 with locality + // us/us-east-1/az-2/r12, a sidecar from us/us-east-1/az-1/r11 locality + // will prefer e1 from the same locality over e2 from a different + // locality. Endpoint e2 could be the IP associated with a gateway + // (that bridges networks n1 and n2), or the IP associated with a + // standard service endpoint. + Locality string `protobuf:"bytes,5,opt,name=locality,proto3" json:"locality,omitempty"` + // The load balancing weight associated with the endpoint. Endpoints + // with higher weights will receive proportionally higher traffic. + Weight uint32 `protobuf:"varint,6,opt,name=weight,proto3" json:"weight,omitempty"` + // The service account associated with the workload if a sidecar + // is present in the workload. The service account must be present + // in the same namespace as the configuration ( WorkloadEntry or a + // ServiceEntry) + ServiceAccount string `protobuf:"bytes,7,opt,name=service_account,json=serviceAccount,proto3" json:"service_account,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WorkloadEntry) Reset() { *m = WorkloadEntry{} } +func (m *WorkloadEntry) String() string { return proto.CompactTextString(m) } +func (*WorkloadEntry) ProtoMessage() {} +func (*WorkloadEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_6d7791a8c20f14f2, []int{0} +} +func (m *WorkloadEntry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *WorkloadEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_WorkloadEntry.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *WorkloadEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_WorkloadEntry.Merge(m, src) +} +func (m *WorkloadEntry) XXX_Size() int { + return m.Size() +} +func (m *WorkloadEntry) XXX_DiscardUnknown() { + xxx_messageInfo_WorkloadEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_WorkloadEntry proto.InternalMessageInfo + +func (m *WorkloadEntry) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *WorkloadEntry) GetPorts() map[string]uint32 { + if m != nil { + return m.Ports + } + return nil +} + +func (m *WorkloadEntry) GetLabels() map[string]string { + if m != nil { + return m.Labels + } + return nil +} + +func (m *WorkloadEntry) GetNetwork() string { + if m != nil { + return m.Network + } + return "" +} + +func (m *WorkloadEntry) GetLocality() string { + if m != nil { + return m.Locality + } + return "" +} + +func (m *WorkloadEntry) GetWeight() uint32 { + if m != nil { + return m.Weight + } + return 0 +} + +func (m *WorkloadEntry) GetServiceAccount() string { + if m != nil { + return m.ServiceAccount + } + return "" +} + +func init() { + proto.RegisterType((*WorkloadEntry)(nil), "istio.networking.v1alpha3.WorkloadEntry") + proto.RegisterMapType((map[string]string)(nil), "istio.networking.v1alpha3.WorkloadEntry.LabelsEntry") + proto.RegisterMapType((map[string]uint32)(nil), "istio.networking.v1alpha3.WorkloadEntry.PortsEntry") +} + +func init() { + proto.RegisterFile("networking/v1alpha3/workload_entry.proto", fileDescriptor_6d7791a8c20f14f2) +} + +var fileDescriptor_6d7791a8c20f14f2 = []byte{ + // 350 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x4a, 0xeb, 0x40, + 0x14, 0x86, 0x49, 0x72, 0x9b, 0xde, 0x9e, 0xd2, 0x7b, 0x2f, 0xc3, 0x45, 0xc6, 0x80, 0x35, 0xb8, + 0x31, 0xab, 0x04, 0xad, 0x8b, 0xea, 0xae, 0x05, 0x17, 0x42, 0x17, 0x92, 0x8d, 0xe0, 0xa6, 0x4c, + 0x93, 0x31, 0x1d, 0x3a, 0x64, 0xc2, 0x64, 0x9a, 0xd2, 0xe7, 0xf2, 0x25, 0x5c, 0xfa, 0x08, 0xa5, + 0x4f, 0x22, 0x99, 0x49, 0x6d, 0x05, 0x45, 0x77, 0xe7, 0xff, 0x73, 0xfe, 0x2f, 0x39, 0xe7, 0x04, + 0x82, 0x9c, 0xaa, 0x95, 0x90, 0x0b, 0x96, 0x67, 0x51, 0x75, 0x41, 0x78, 0x31, 0x27, 0x83, 0xa8, + 0x36, 0xb8, 0x20, 0xe9, 0x94, 0xe6, 0x4a, 0xae, 0xc3, 0x42, 0x0a, 0x25, 0xd0, 0x31, 0x2b, 0x15, + 0x13, 0xe1, 0xbe, 0x3f, 0xdc, 0xf5, 0x7b, 0xa7, 0x99, 0x10, 0x19, 0xa7, 0x11, 0x29, 0x58, 0xf4, + 0xc4, 0x28, 0x4f, 0xa7, 0x33, 0x3a, 0x27, 0x15, 0x13, 0xd2, 0x64, 0xcf, 0x9e, 0x1d, 0xe8, 0x3d, + 0x34, 0xd0, 0xdb, 0x9a, 0x89, 0x4e, 0xa0, 0x4d, 0xd2, 0x54, 0xd2, 0xb2, 0xc4, 0x96, 0x6f, 0x05, + 0x9d, 0xb1, 0xb3, 0x19, 0xd9, 0xf1, 0xce, 0x43, 0x77, 0xd0, 0x2a, 0x84, 0x54, 0x25, 0xb6, 0x7d, + 0x27, 0xe8, 0x5e, 0x0e, 0xc2, 0x2f, 0x5f, 0x1e, 0x7e, 0xe0, 0x86, 0xf7, 0x75, 0x4a, 0x97, 0xb1, + 0x21, 0xa0, 0x09, 0xb8, 0x9c, 0xcc, 0x28, 0x2f, 0xb1, 0xa3, 0x59, 0x57, 0x3f, 0x66, 0x4d, 0x74, + 0xcc, 0xc0, 0x1a, 0x06, 0xc2, 0xd0, 0x6e, 0x82, 0xf8, 0x57, 0xfd, 0xdd, 0xf1, 0x4e, 0x22, 0x0f, + 0x7e, 0x73, 0x91, 0x10, 0xce, 0xd4, 0x1a, 0xb7, 0xf4, 0xa3, 0x77, 0x8d, 0x8e, 0xc0, 0x5d, 0x51, + 0x96, 0xcd, 0x15, 0x76, 0x7d, 0x2b, 0xe8, 0xc5, 0x8d, 0x42, 0xe7, 0xf0, 0xb7, 0xa4, 0xb2, 0x62, + 0x09, 0x9d, 0x92, 0x24, 0x11, 0xcb, 0x5c, 0xe1, 0xb6, 0x8e, 0xfe, 0x69, 0xec, 0x91, 0x71, 0xbd, + 0x21, 0xc0, 0x7e, 0x32, 0xf4, 0x0f, 0x9c, 0x05, 0x5d, 0x9b, 0xc5, 0xc5, 0x75, 0x89, 0xfe, 0x43, + 0xab, 0x22, 0x7c, 0x49, 0xb1, 0xad, 0xf9, 0x46, 0xdc, 0xd8, 0x43, 0xcb, 0xbb, 0x86, 0xee, 0xc1, + 0x1c, 0xdf, 0x45, 0x3b, 0x07, 0xd1, 0x71, 0xf8, 0xb2, 0xed, 0x5b, 0xaf, 0xdb, 0xbe, 0xb5, 0xd9, + 0xf6, 0xad, 0x47, 0xdf, 0xac, 0x8d, 0x09, 0x7d, 0xe6, 0x4f, 0x7e, 0x9b, 0x99, 0xab, 0x8f, 0x3d, + 0x78, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xf6, 0xe6, 0x87, 0xc0, 0x54, 0x02, 0x00, 0x00, +} + +func (m *WorkloadEntry) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *WorkloadEntry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WorkloadEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.ServiceAccount) > 0 { + i -= len(m.ServiceAccount) + copy(dAtA[i:], m.ServiceAccount) + i = encodeVarintWorkloadEntry(dAtA, i, uint64(len(m.ServiceAccount))) + i-- + dAtA[i] = 0x3a + } + if m.Weight != 0 { + i = encodeVarintWorkloadEntry(dAtA, i, uint64(m.Weight)) + i-- + dAtA[i] = 0x30 + } + if len(m.Locality) > 0 { + i -= len(m.Locality) + copy(dAtA[i:], m.Locality) + i = encodeVarintWorkloadEntry(dAtA, i, uint64(len(m.Locality))) + i-- + dAtA[i] = 0x2a + } + if len(m.Network) > 0 { + i -= len(m.Network) + copy(dAtA[i:], m.Network) + i = encodeVarintWorkloadEntry(dAtA, i, uint64(len(m.Network))) + i-- + dAtA[i] = 0x22 + } + if len(m.Labels) > 0 { + for k := range m.Labels { + v := m.Labels[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintWorkloadEntry(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintWorkloadEntry(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintWorkloadEntry(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Ports) > 0 { + for k := range m.Ports { + v := m.Ports[k] + baseI := i + i = encodeVarintWorkloadEntry(dAtA, i, uint64(v)) + i-- + dAtA[i] = 0x10 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintWorkloadEntry(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintWorkloadEntry(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintWorkloadEntry(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintWorkloadEntry(dAtA []byte, offset int, v uint64) int { + offset -= sovWorkloadEntry(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *WorkloadEntry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovWorkloadEntry(uint64(l)) + } + if len(m.Ports) > 0 { + for k, v := range m.Ports { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovWorkloadEntry(uint64(len(k))) + 1 + sovWorkloadEntry(uint64(v)) + n += mapEntrySize + 1 + sovWorkloadEntry(uint64(mapEntrySize)) + } + } + if len(m.Labels) > 0 { + for k, v := range m.Labels { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovWorkloadEntry(uint64(len(k))) + 1 + len(v) + sovWorkloadEntry(uint64(len(v))) + n += mapEntrySize + 1 + sovWorkloadEntry(uint64(mapEntrySize)) + } + } + l = len(m.Network) + if l > 0 { + n += 1 + l + sovWorkloadEntry(uint64(l)) + } + l = len(m.Locality) + if l > 0 { + n += 1 + l + sovWorkloadEntry(uint64(l)) + } + if m.Weight != 0 { + n += 1 + sovWorkloadEntry(uint64(m.Weight)) + } + l = len(m.ServiceAccount) + if l > 0 { + n += 1 + l + sovWorkloadEntry(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func sovWorkloadEntry(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozWorkloadEntry(x uint64) (n int) { + return sovWorkloadEntry(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *WorkloadEntry) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWorkloadEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: WorkloadEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: WorkloadEntry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWorkloadEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthWorkloadEntry + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthWorkloadEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ports", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWorkloadEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthWorkloadEntry + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthWorkloadEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Ports == nil { + m.Ports = make(map[string]uint32) + } + var mapkey string + var mapvalue uint32 + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWorkloadEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWorkloadEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthWorkloadEntry + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthWorkloadEntry + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWorkloadEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + mapvalue |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + } else { + iNdEx = entryPreIndex + skippy, err := skipWorkloadEntry(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthWorkloadEntry + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Ports[mapkey] = mapvalue + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Labels", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWorkloadEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthWorkloadEntry + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthWorkloadEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Labels == nil { + m.Labels = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWorkloadEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWorkloadEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthWorkloadEntry + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthWorkloadEntry + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWorkloadEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthWorkloadEntry + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthWorkloadEntry + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipWorkloadEntry(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthWorkloadEntry + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Labels[mapkey] = mapvalue + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Network", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWorkloadEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthWorkloadEntry + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthWorkloadEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Network = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Locality", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWorkloadEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthWorkloadEntry + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthWorkloadEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Locality = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Weight", wireType) + } + m.Weight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWorkloadEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Weight |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ServiceAccount", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowWorkloadEntry + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthWorkloadEntry + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthWorkloadEntry + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ServiceAccount = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipWorkloadEntry(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthWorkloadEntry + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthWorkloadEntry + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...) + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipWorkloadEntry(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowWorkloadEntry + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowWorkloadEntry + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowWorkloadEntry + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthWorkloadEntry + } + iNdEx += length + if iNdEx < 0 { + return 0, ErrInvalidLengthWorkloadEntry + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowWorkloadEntry + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipWorkloadEntry(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + if iNdEx < 0 { + return 0, ErrInvalidLengthWorkloadEntry + } + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthWorkloadEntry = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowWorkloadEntry = fmt.Errorf("proto: integer overflow") +) diff --git a/vendor/istio.io/api/networking/v1alpha3/workload_entry.pb.html b/vendor/istio.io/api/networking/v1alpha3/workload_entry.pb.html new file mode 100644 index 0000000000..2f49ab5a82 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/workload_entry.pb.html @@ -0,0 +1,348 @@ +--- +title: Workload Entry +description: Configuration affecting VMs onboarded into the mesh. +location: https://istio.io/docs/reference/config/networking/workload-entry.html +layout: protoc-gen-docs +generator: protoc-gen-docs +schema: istio.networking.v1alpha3.WorkloadEntry +aliases: [/docs/reference/config/networking/v1alpha3/workload-entry] +number_of_entries: 1 +--- +

WorkloadEntry enables operators to describe the properties of a +single non-Kubernetes workload such as a VM or a bare metal server +as it is onboarded into the mesh. A WorkloadEntry must be +accompanied by an Istio ServiceEntry that selects the workload +through the appropriate labels and provides the service definition +for a MESH_INTERNAL service (hostnames, port properties, etc.). A +ServiceEntry object can select multiple workload entries as well +as Kubernetes pods based on the label selector specified in the +service entry.

+ +

When a workload connects to istiod, the status field in the +custom resource will be updated to indicate the health of the +workload along with other details, similar to how Kubernetes +updates the status of a pod.

+ +

The following example declares a workload entry representing a +VM for the details.bookinfo.com service. This VM has +sidecar installed and bootstrapped using the details-legacy +service account. The sidecar receives HTTP traffic on port 80 +(wrapped in istio mutual TLS) and forwards it to the application on +the localhost on the same port.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: WorkloadEntry
+metadata:
+  name: details-svc
+spec:
+  # use of the service account indicates that the workload has a
+  # sidecar proxy bootstrapped with this service account. Pods with
+  # sidecars will automatically communicate with the workload using
+  # istio mutual TLS.
+  serviceAccount: details-legacy
+  address: 2.2.2.2
+  labels:
+    app: details-legacy
+    instance-id: vm1
+  # ports if not specified will be the same as service ports
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: WorkloadEntry
+metadata:
+  name: details-svc
+spec:
+  # use of the service account indicates that the workload has a
+  # sidecar proxy bootstrapped with this service account. Pods with
+  # sidecars will automatically communicate with the workload using
+  # istio mutual TLS.
+  serviceAccount: details-legacy
+  address: 2.2.2.2
+  labels:
+    app: details-legacy
+    instance-id: vm1
+  # ports if not specified will be the same as service ports
+
+ +

{{}} +{{}}

+ +

and the associated service entry

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: ServiceEntry
+metadata:
+  name: details-svc
+spec:
+  hosts:
+  - details.bookinfo.com
+  location: MESH_INTERNAL
+  ports:
+  - number: 80
+    name: http
+    protocol: HTTP
+  resolution: STATIC
+  workloadSelector:
+    labels:
+      app: details-legacy
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: ServiceEntry
+metadata:
+  name: details-svc
+spec:
+  hosts:
+  - details.bookinfo.com
+  location: MESH_INTERNAL
+  ports:
+  - number: 80
+    name: http
+    protocol: HTTP
+  resolution: STATIC
+  workloadSelector:
+    labels:
+      app: details-legacy
+
+ +

{{}} +{{}}

+ +

The following example declares the same VM workload using +its fully qualified DNS name. The service entry’s resolution +mode should be changed to DNS to indicate that the client-side +sidecars should dynamically resolve the DNS name at runtime before +forwarding the request.

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: WorkloadEntry
+metadata:
+  name: details-svc
+spec:
+  # use of the service account indicates that the workload has a
+  # sidecar proxy bootstrapped with this service account. Pods with
+  # sidecars will automatically communicate with the workload using
+  # istio mutual TLS.
+  serviceAccount: details-legacy
+  address: vm1.vpc01.corp.net
+  labels:
+    app: details-legacy
+    instance-id: vm1
+  # ports if not specified will be the same as service ports
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: WorkloadEntry
+metadata:
+  name: details-svc
+spec:
+  # use of the service account indicates that the workload has a
+  # sidecar proxy bootstrapped with this service account. Pods with
+  # sidecars will automatically communicate with the workload using
+  # istio mutual TLS.
+  serviceAccount: details-legacy
+  address: vm1.vpc01.corp.net
+  labels:
+    app: details-legacy
+    instance-id: vm1
+  # ports if not specified will be the same as service ports
+
+ +

{{}} +{{}}

+ +

and the associated service entry

+ +

{{}} +{{}}

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: ServiceEntry
+metadata:
+  name: details-svc
+spec:
+  hosts:
+  - details.bookinfo.com
+  location: MESH_INTERNAL
+  ports:
+  - number: 80
+    name: http
+    protocol: HTTP
+  resolution: DNS
+  workloadSelector:
+    labels:
+      app: details-legacy
+
+ +

{{}}

+ +

{{}}

+ +
apiVersion: networking.istio.io/v1beta1
+kind: ServiceEntry
+metadata:
+  name: details-svc
+spec:
+  hosts:
+  - details.bookinfo.com
+  location: MESH_INTERNAL
+  ports:
+  - number: 80
+    name: http
+    protocol: HTTP
+  resolution: DNS
+  workloadSelector:
+    labels:
+      app: details-legacy
+
+ +

{{}} +{{}}

+ +

WorkloadEntry

+
+

WorkloadEntry enables specifying the properties of a single non-Kubernetes workload such a VM or a bare metal services that can be referred to by service entries.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
addressstring +

Address associated with the network endpoint without the +port. Domain names can be used if and only if the resolution is set +to DNS, and must be fully-qualified without wildcards. Use the form +unix:///absolute/path/to/socket for Unix domain socket endpoints.

+ +
+Yes +
portsmap<string, uint32> +

Set of ports associated with the endpoint. The ports must be +associated with a port name that was declared as part of the +service. Do not use for unix:// addresses.

+ +
+No +
labelsmap<string, string> +

One or more labels associated with the endpoint.

+ +
+No +
networkstring +

Network enables Istio to group endpoints resident in the same L3 +domain/network. All endpoints in the same network are assumed to be +directly reachable from one another. When endpoints in different +networks cannot reach each other directly, an Istio Gateway can be +used to establish connectivity (usually using the +AUTO_PASSTHROUGH mode in a Gateway Server). This is +an advanced configuration used typically for spanning an Istio mesh +over multiple clusters.

+ +
+No +
localitystring +

The locality associated with the endpoint. A locality corresponds +to a failure domain (e.g., country/region/zone). Arbitrary failure +domain hierarchies can be represented by separating each +encapsulating failure domain by /. For example, the locality of an +an endpoint in US, in US-East-1 region, within availability zone +az-1, in data center rack r11 can be represented as +us/us-east-1/az-1/r11. Istio will configure the sidecar to route to +endpoints within the same locality as the sidecar. If none of the +endpoints in the locality are available, endpoints parent locality +(but within the same network ID) will be chosen. For example, if +there are two endpoints in same network (networkID “n1”), say e1 +with locality us/us-east-1/az-1/r11 and e2 with locality +us/us-east-1/az-2/r12, a sidecar from us/us-east-1/az-1/r11 locality +will prefer e1 from the same locality over e2 from a different +locality. Endpoint e2 could be the IP associated with a gateway +(that bridges networks n1 and n2), or the IP associated with a +standard service endpoint.

+ +
+No +
weightuint32 +

The load balancing weight associated with the endpoint. Endpoints +with higher weights will receive proportionally higher traffic.

+ +
+No +
serviceAccountstring +

The service account associated with the workload if a sidecar +is present in the workload. The service account must be present +in the same namespace as the configuration ( WorkloadEntry or a +ServiceEntry)

+ +
+No +
+
diff --git a/vendor/istio.io/api/networking/v1alpha3/workload_entry.proto b/vendor/istio.io/api/networking/v1alpha3/workload_entry.proto new file mode 100644 index 0000000000..27aa05268f --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/workload_entry.proto @@ -0,0 +1,313 @@ +// Copyright 2020 Istio Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +import "google/api/field_behavior.proto"; + +// $schema: istio.networking.v1alpha3.WorkloadEntry +// $title: Workload Entry +// $description: Configuration affecting VMs onboarded into the mesh. +// $location: https://istio.io/docs/reference/config/networking/workload-entry.html +// $aliases: [/docs/reference/config/networking/v1alpha3/workload-entry] + +// `WorkloadEntry` enables operators to describe the properties of a +// single non-Kubernetes workload such as a VM or a bare metal server +// as it is onboarded into the mesh. A `WorkloadEntry` must be +// accompanied by an Istio `ServiceEntry` that selects the workload +// through the appropriate labels and provides the service definition +// for a `MESH_INTERNAL` service (hostnames, port properties, etc.). A +// `ServiceEntry` object can select multiple workload entries as well +// as Kubernetes pods based on the label selector specified in the +// service entry. +// +// When a workload connects to `istiod`, the status field in the +// custom resource will be updated to indicate the health of the +// workload along with other details, similar to how Kubernetes +// updates the status of a pod. +// +// The following example declares a workload entry representing a +// VM for the `details.bookinfo.com` service. This VM has +// sidecar installed and bootstrapped using the `details-legacy` +// service account. The sidecar receives HTTP traffic on port 80 +// (wrapped in istio mutual TLS) and forwards it to the application on +// the localhost on the same port. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: WorkloadEntry +// metadata: +// name: details-svc +// spec: +// # use of the service account indicates that the workload has a +// # sidecar proxy bootstrapped with this service account. Pods with +// # sidecars will automatically communicate with the workload using +// # istio mutual TLS. +// serviceAccount: details-legacy +// address: 2.2.2.2 +// labels: +// app: details-legacy +// instance-id: vm1 +// # ports if not specified will be the same as service ports +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: WorkloadEntry +// metadata: +// name: details-svc +// spec: +// # use of the service account indicates that the workload has a +// # sidecar proxy bootstrapped with this service account. Pods with +// # sidecars will automatically communicate with the workload using +// # istio mutual TLS. +// serviceAccount: details-legacy +// address: 2.2.2.2 +// labels: +// app: details-legacy +// instance-id: vm1 +// # ports if not specified will be the same as service ports +// ``` +// {{}} +// {{}} +// +// and the associated service entry +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// workloadSelector: +// labels: +// app: details-legacy +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// workloadSelector: +// labels: +// app: details-legacy +// ``` +// {{}} +// {{}} +// +// +// The following example declares the same VM workload using +// its fully qualified DNS name. The service entry's resolution +// mode should be changed to DNS to indicate that the client-side +// sidecars should dynamically resolve the DNS name at runtime before +// forwarding the request. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: WorkloadEntry +// metadata: +// name: details-svc +// spec: +// # use of the service account indicates that the workload has a +// # sidecar proxy bootstrapped with this service account. Pods with +// # sidecars will automatically communicate with the workload using +// # istio mutual TLS. +// serviceAccount: details-legacy +// address: vm1.vpc01.corp.net +// labels: +// app: details-legacy +// instance-id: vm1 +// # ports if not specified will be the same as service ports +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: WorkloadEntry +// metadata: +// name: details-svc +// spec: +// # use of the service account indicates that the workload has a +// # sidecar proxy bootstrapped with this service account. Pods with +// # sidecars will automatically communicate with the workload using +// # istio mutual TLS. +// serviceAccount: details-legacy +// address: vm1.vpc01.corp.net +// labels: +// app: details-legacy +// instance-id: vm1 +// # ports if not specified will be the same as service ports +// ``` +// {{}} +// {{}} +// +// and the associated service entry +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// workloadSelector: +// labels: +// app: details-legacy +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// workloadSelector: +// labels: +// app: details-legacy +// ``` +// {{}} +// {{}} +// +package istio.networking.v1alpha3; + +option go_package = "istio.io/api/networking/v1alpha3"; + +// WorkloadEntry enables specifying the properties of a single non-Kubernetes workload such a VM or a bare metal services that can be referred to by service entries. +// +// +// +// +message WorkloadEntry { + // Address associated with the network endpoint without the + // port. Domain names can be used if and only if the resolution is set + // to DNS, and must be fully-qualified without wildcards. Use the form + // unix:///absolute/path/to/socket for Unix domain socket endpoints. + string address = 1 [(google.api.field_behavior) = REQUIRED]; + + // Set of ports associated with the endpoint. The ports must be + // associated with a port name that was declared as part of the + // service. Do not use for `unix://` addresses. + map ports = 2; + + // One or more labels associated with the endpoint. + map labels = 3; + + // Network enables Istio to group endpoints resident in the same L3 + // domain/network. All endpoints in the same network are assumed to be + // directly reachable from one another. When endpoints in different + // networks cannot reach each other directly, an Istio Gateway can be + // used to establish connectivity (usually using the + // `AUTO_PASSTHROUGH` mode in a Gateway Server). This is + // an advanced configuration used typically for spanning an Istio mesh + // over multiple clusters. + string network = 4; + + // The locality associated with the endpoint. A locality corresponds + // to a failure domain (e.g., country/region/zone). Arbitrary failure + // domain hierarchies can be represented by separating each + // encapsulating failure domain by /. For example, the locality of an + // an endpoint in US, in US-East-1 region, within availability zone + // az-1, in data center rack r11 can be represented as + // us/us-east-1/az-1/r11. Istio will configure the sidecar to route to + // endpoints within the same locality as the sidecar. If none of the + // endpoints in the locality are available, endpoints parent locality + // (but within the same network ID) will be chosen. For example, if + // there are two endpoints in same network (networkID "n1"), say e1 + // with locality us/us-east-1/az-1/r11 and e2 with locality + // us/us-east-1/az-2/r12, a sidecar from us/us-east-1/az-1/r11 locality + // will prefer e1 from the same locality over e2 from a different + // locality. Endpoint e2 could be the IP associated with a gateway + // (that bridges networks n1 and n2), or the IP associated with a + // standard service endpoint. + string locality = 5; + + // The load balancing weight associated with the endpoint. Endpoints + // with higher weights will receive proportionally higher traffic. + uint32 weight = 6; + + // The service account associated with the workload if a sidecar + // is present in the workload. The service account must be present + // in the same namespace as the configuration ( WorkloadEntry or a + // ServiceEntry) + string service_account = 7; +}; + diff --git a/vendor/istio.io/api/networking/v1alpha3/workload_entry_deepcopy.gen.go b/vendor/istio.io/api/networking/v1alpha3/workload_entry_deepcopy.gen.go new file mode 100644 index 0000000000..c99a4ebb94 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/workload_entry_deepcopy.gen.go @@ -0,0 +1,238 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/workload_entry.proto + +// `WorkloadEntry` enables operators to describe the properties of a +// single non-Kubernetes workload such as a VM or a bare metal server +// as it is onboarded into the mesh. A `WorkloadEntry` must be +// accompanied by an Istio `ServiceEntry` that selects the workload +// through the appropriate labels and provides the service definition +// for a `MESH_INTERNAL` service (hostnames, port properties, etc.). A +// `ServiceEntry` object can select multiple workload entries as well +// as Kubernetes pods based on the label selector specified in the +// service entry. +// +// When a workload connects to `istiod`, the status field in the +// custom resource will be updated to indicate the health of the +// workload along with other details, similar to how Kubernetes +// updates the status of a pod. +// +// The following example declares a workload entry representing a +// VM for the `details.bookinfo.com` service. This VM has +// sidecar installed and bootstrapped using the `details-legacy` +// service account. The sidecar receives HTTP traffic on port 80 +// (wrapped in istio mutual TLS) and forwards it to the application on +// the localhost on the same port. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: WorkloadEntry +// metadata: +// name: details-svc +// spec: +// # use of the service account indicates that the workload has a +// # sidecar proxy bootstrapped with this service account. Pods with +// # sidecars will automatically communicate with the workload using +// # istio mutual TLS. +// serviceAccount: details-legacy +// address: 2.2.2.2 +// labels: +// app: details-legacy +// instance-id: vm1 +// # ports if not specified will be the same as service ports +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: WorkloadEntry +// metadata: +// name: details-svc +// spec: +// # use of the service account indicates that the workload has a +// # sidecar proxy bootstrapped with this service account. Pods with +// # sidecars will automatically communicate with the workload using +// # istio mutual TLS. +// serviceAccount: details-legacy +// address: 2.2.2.2 +// labels: +// app: details-legacy +// instance-id: vm1 +// # ports if not specified will be the same as service ports +// ``` +// {{}} +// {{}} +// +// and the associated service entry +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// workloadSelector: +// labels: +// app: details-legacy +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// workloadSelector: +// labels: +// app: details-legacy +// ``` +// {{}} +// {{}} +// +// +// The following example declares the same VM workload using +// its fully qualified DNS name. The service entry's resolution +// mode should be changed to DNS to indicate that the client-side +// sidecars should dynamically resolve the DNS name at runtime before +// forwarding the request. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: WorkloadEntry +// metadata: +// name: details-svc +// spec: +// # use of the service account indicates that the workload has a +// # sidecar proxy bootstrapped with this service account. Pods with +// # sidecars will automatically communicate with the workload using +// # istio mutual TLS. +// serviceAccount: details-legacy +// address: vm1.vpc01.corp.net +// labels: +// app: details-legacy +// instance-id: vm1 +// # ports if not specified will be the same as service ports +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: WorkloadEntry +// metadata: +// name: details-svc +// spec: +// # use of the service account indicates that the workload has a +// # sidecar proxy bootstrapped with this service account. Pods with +// # sidecars will automatically communicate with the workload using +// # istio mutual TLS. +// serviceAccount: details-legacy +// address: vm1.vpc01.corp.net +// labels: +// app: details-legacy +// instance-id: vm1 +// # ports if not specified will be the same as service ports +// ``` +// {{}} +// {{}} +// +// and the associated service entry +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// workloadSelector: +// labels: +// app: details-legacy +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// workloadSelector: +// labels: +// app: details-legacy +// ``` +// {{}} +// {{}} +// + +package v1alpha3 + +import ( + fmt "fmt" + proto "github.com/gogo/protobuf/proto" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// DeepCopyInto supports using WorkloadEntry within kubernetes types, where deepcopy-gen is used. +func (in *WorkloadEntry) DeepCopyInto(out *WorkloadEntry) { + p := proto.Clone(in).(*WorkloadEntry) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadEntry. Required by controller-gen. +func (in *WorkloadEntry) DeepCopy() *WorkloadEntry { + if in == nil { + return nil + } + out := new(WorkloadEntry) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/istio.io/api/networking/v1alpha3/workload_entry_json.gen.go b/vendor/istio.io/api/networking/v1alpha3/workload_entry_json.gen.go new file mode 100644 index 0000000000..ab62849f04 --- /dev/null +++ b/vendor/istio.io/api/networking/v1alpha3/workload_entry_json.gen.go @@ -0,0 +1,240 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: networking/v1alpha3/workload_entry.proto + +// `WorkloadEntry` enables operators to describe the properties of a +// single non-Kubernetes workload such as a VM or a bare metal server +// as it is onboarded into the mesh. A `WorkloadEntry` must be +// accompanied by an Istio `ServiceEntry` that selects the workload +// through the appropriate labels and provides the service definition +// for a `MESH_INTERNAL` service (hostnames, port properties, etc.). A +// `ServiceEntry` object can select multiple workload entries as well +// as Kubernetes pods based on the label selector specified in the +// service entry. +// +// When a workload connects to `istiod`, the status field in the +// custom resource will be updated to indicate the health of the +// workload along with other details, similar to how Kubernetes +// updates the status of a pod. +// +// The following example declares a workload entry representing a +// VM for the `details.bookinfo.com` service. This VM has +// sidecar installed and bootstrapped using the `details-legacy` +// service account. The sidecar receives HTTP traffic on port 80 +// (wrapped in istio mutual TLS) and forwards it to the application on +// the localhost on the same port. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: WorkloadEntry +// metadata: +// name: details-svc +// spec: +// # use of the service account indicates that the workload has a +// # sidecar proxy bootstrapped with this service account. Pods with +// # sidecars will automatically communicate with the workload using +// # istio mutual TLS. +// serviceAccount: details-legacy +// address: 2.2.2.2 +// labels: +// app: details-legacy +// instance-id: vm1 +// # ports if not specified will be the same as service ports +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: WorkloadEntry +// metadata: +// name: details-svc +// spec: +// # use of the service account indicates that the workload has a +// # sidecar proxy bootstrapped with this service account. Pods with +// # sidecars will automatically communicate with the workload using +// # istio mutual TLS. +// serviceAccount: details-legacy +// address: 2.2.2.2 +// labels: +// app: details-legacy +// instance-id: vm1 +// # ports if not specified will be the same as service ports +// ``` +// {{}} +// {{}} +// +// and the associated service entry +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// workloadSelector: +// labels: +// app: details-legacy +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: STATIC +// workloadSelector: +// labels: +// app: details-legacy +// ``` +// {{}} +// {{}} +// +// +// The following example declares the same VM workload using +// its fully qualified DNS name. The service entry's resolution +// mode should be changed to DNS to indicate that the client-side +// sidecars should dynamically resolve the DNS name at runtime before +// forwarding the request. +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: WorkloadEntry +// metadata: +// name: details-svc +// spec: +// # use of the service account indicates that the workload has a +// # sidecar proxy bootstrapped with this service account. Pods with +// # sidecars will automatically communicate with the workload using +// # istio mutual TLS. +// serviceAccount: details-legacy +// address: vm1.vpc01.corp.net +// labels: +// app: details-legacy +// instance-id: vm1 +// # ports if not specified will be the same as service ports +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: WorkloadEntry +// metadata: +// name: details-svc +// spec: +// # use of the service account indicates that the workload has a +// # sidecar proxy bootstrapped with this service account. Pods with +// # sidecars will automatically communicate with the workload using +// # istio mutual TLS. +// serviceAccount: details-legacy +// address: vm1.vpc01.corp.net +// labels: +// app: details-legacy +// instance-id: vm1 +// # ports if not specified will be the same as service ports +// ``` +// {{}} +// {{}} +// +// and the associated service entry +// +// {{}} +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// workloadSelector: +// labels: +// app: details-legacy +// ``` +// {{}} +// +// {{}} +// ```yaml +// apiVersion: networking.istio.io/v1beta1 +// kind: ServiceEntry +// metadata: +// name: details-svc +// spec: +// hosts: +// - details.bookinfo.com +// location: MESH_INTERNAL +// ports: +// - number: 80 +// name: http +// protocol: HTTP +// resolution: DNS +// workloadSelector: +// labels: +// app: details-legacy +// ``` +// {{}} +// {{}} +// + +package v1alpha3 + +import ( + bytes "bytes" + fmt "fmt" + github_com_gogo_protobuf_jsonpb "github.com/gogo/protobuf/jsonpb" + proto "github.com/gogo/protobuf/proto" + _ "istio.io/gogo-genproto/googleapis/google/api" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// MarshalJSON is a custom marshaler for WorkloadEntry +func (this *WorkloadEntry) MarshalJSON() ([]byte, error) { + str, err := WorkloadEntryMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for WorkloadEntry +func (this *WorkloadEntry) UnmarshalJSON(b []byte) error { + return WorkloadEntryUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +var ( + WorkloadEntryMarshaler = &github_com_gogo_protobuf_jsonpb.Marshaler{} + WorkloadEntryUnmarshaler = &github_com_gogo_protobuf_jsonpb.Unmarshaler{} +) diff --git a/vendor/istio.io/client-go/pkg/apis/networking/v1beta1/doc.go b/vendor/istio.io/client-go/pkg/apis/networking/v1alpha3/doc.go similarity index 97% rename from vendor/istio.io/client-go/pkg/apis/networking/v1beta1/doc.go rename to vendor/istio.io/client-go/pkg/apis/networking/v1alpha3/doc.go index 59bebffb23..a347b27ff9 100644 --- a/vendor/istio.io/client-go/pkg/apis/networking/v1beta1/doc.go +++ b/vendor/istio.io/client-go/pkg/apis/networking/v1alpha3/doc.go @@ -18,4 +18,4 @@ // +k8s:openapi-gen=true // +k8s:deepcopy-gen=package // +groupName=networking.istio.io -package v1beta1 +package v1alpha3 diff --git a/vendor/istio.io/client-go/pkg/apis/networking/v1beta1/register.gen.go b/vendor/istio.io/client-go/pkg/apis/networking/v1alpha3/register.gen.go similarity index 95% rename from vendor/istio.io/client-go/pkg/apis/networking/v1beta1/register.gen.go rename to vendor/istio.io/client-go/pkg/apis/networking/v1alpha3/register.gen.go index 153ef305e6..5d51e562e5 100644 --- a/vendor/istio.io/client-go/pkg/apis/networking/v1beta1/register.gen.go +++ b/vendor/istio.io/client-go/pkg/apis/networking/v1alpha3/register.gen.go @@ -14,7 +14,7 @@ // Code generated by kubetype-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -24,7 +24,7 @@ import ( var ( // Package-wide variables from generator "register". - SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"} + SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1alpha3"} SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) localSchemeBuilder = &SchemeBuilder AddToScheme = localSchemeBuilder.AddToScheme @@ -43,6 +43,8 @@ func addKnownTypes(scheme *runtime.Scheme) error { scheme.AddKnownTypes(SchemeGroupVersion, &DestinationRule{}, &DestinationRuleList{}, + &EnvoyFilter{}, + &EnvoyFilterList{}, &Gateway{}, &GatewayList{}, &ServiceEntry{}, diff --git a/vendor/istio.io/client-go/pkg/apis/networking/v1beta1/types.gen.go b/vendor/istio.io/client-go/pkg/apis/networking/v1alpha3/types.gen.go similarity index 81% rename from vendor/istio.io/client-go/pkg/apis/networking/v1beta1/types.gen.go rename to vendor/istio.io/client-go/pkg/apis/networking/v1alpha3/types.gen.go index f14a927693..6cc45c9dfd 100644 --- a/vendor/istio.io/client-go/pkg/apis/networking/v1beta1/types.gen.go +++ b/vendor/istio.io/client-go/pkg/apis/networking/v1alpha3/types.gen.go @@ -14,10 +14,10 @@ // Code generated by kubetype-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( - networkingv1beta1 "istio.io/api/networking/v1beta1" + networkingv1alpha3 "istio.io/api/networking/v1alpha3" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -29,7 +29,8 @@ import ( // // @@ -56,7 +57,7 @@ type DestinationRule struct { // Spec defines the implementation of this definition. // +optional - Spec networkingv1beta1.DestinationRule `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + Spec networkingv1alpha3.DestinationRule `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -72,12 +73,56 @@ type DestinationRuleList struct { // // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +// EnvoyFilter provides a mechanism to customize the Envoy configuration +// generated by Istio Pilot. +// +// +// +// +type EnvoyFilter struct { + v1.TypeMeta `json:",inline"` + // +optional + v1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + + // Spec defines the implementation of this definition. + // +optional + Spec networkingv1alpha3.EnvoyFilter `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` +} + +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + +// EnvoyFilterList is a collection of EnvoyFilters. +type EnvoyFilterList struct { + v1.TypeMeta `json:",inline"` + // +optional + v1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` + Items []EnvoyFilter `json:"items" protobuf:"bytes,2,rep,name=items"` +} + +// +// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object + // Gateway describes a load balancer operating at the edge of the mesh // receiving incoming or outgoing HTTP/TCP connections. // // @@ -99,7 +144,7 @@ type Gateway struct { // Spec defines the implementation of this definition. // +optional - Spec networkingv1beta1.Gateway `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + Spec networkingv1alpha3.Gateway `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -120,7 +165,8 @@ type GatewayList struct { // // @@ -151,7 +197,7 @@ type ServiceEntry struct { // Spec defines the implementation of this definition. // +optional - Spec networkingv1beta1.ServiceEntry `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + Spec networkingv1alpha3.ServiceEntry `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -173,7 +219,8 @@ type ServiceEntryList struct { // // @@ -195,7 +242,7 @@ type Sidecar struct { // Spec defines the implementation of this definition. // +optional - Spec networkingv1beta1.Sidecar `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + Spec networkingv1alpha3.Sidecar `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -215,7 +262,8 @@ type SidecarList struct { // // @@ -244,7 +292,7 @@ type VirtualService struct { // Spec defines the implementation of this definition. // +optional - Spec networkingv1beta1.VirtualService `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + Spec networkingv1alpha3.VirtualService `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object @@ -264,7 +312,8 @@ type VirtualServiceList struct { // // @@ -291,7 +340,7 @@ type WorkloadEntry struct { // Spec defines the implementation of this definition. // +optional - Spec networkingv1beta1.WorkloadEntry `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` + Spec networkingv1alpha3.WorkloadEntry `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/vendor/istio.io/client-go/pkg/apis/networking/v1beta1/zz_generated.deepcopy.gen.go b/vendor/istio.io/client-go/pkg/apis/networking/v1alpha3/zz_generated.deepcopy.gen.go similarity index 86% rename from vendor/istio.io/client-go/pkg/apis/networking/v1beta1/zz_generated.deepcopy.gen.go rename to vendor/istio.io/client-go/pkg/apis/networking/v1alpha3/zz_generated.deepcopy.gen.go index 3784273936..022e23d140 100644 --- a/vendor/istio.io/client-go/pkg/apis/networking/v1beta1/zz_generated.deepcopy.gen.go +++ b/vendor/istio.io/client-go/pkg/apis/networking/v1alpha3/zz_generated.deepcopy.gen.go @@ -16,7 +16,7 @@ // Code generated by deepcopy-gen. DO NOT EDIT. -package v1beta1 +package v1alpha3 import ( runtime "k8s.io/apimachinery/pkg/runtime" @@ -82,6 +82,66 @@ func (in *DestinationRuleList) DeepCopyObject() runtime.Object { return nil } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EnvoyFilter) DeepCopyInto(out *EnvoyFilter) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) + in.Spec.DeepCopyInto(&out.Spec) + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyFilter. +func (in *EnvoyFilter) DeepCopy() *EnvoyFilter { + if in == nil { + return nil + } + out := new(EnvoyFilter) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EnvoyFilter) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *EnvoyFilterList) DeepCopyInto(out *EnvoyFilterList) { + *out = *in + out.TypeMeta = in.TypeMeta + in.ListMeta.DeepCopyInto(&out.ListMeta) + if in.Items != nil { + in, out := &in.Items, &out.Items + *out = make([]EnvoyFilter, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EnvoyFilterList. +func (in *EnvoyFilterList) DeepCopy() *EnvoyFilterList { + if in == nil { + return nil + } + out := new(EnvoyFilterList) + in.DeepCopyInto(out) + return out +} + +// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. +func (in *EnvoyFilterList) DeepCopyObject() runtime.Object { + if c := in.DeepCopy(); c != nil { + return c + } + return nil +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Gateway) DeepCopyInto(out *Gateway) { *out = *in diff --git a/vendor/modules.txt b/vendor/modules.txt index 0637666014..315ff454db 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -450,10 +450,11 @@ gopkg.in/yaml.v2 # istio.io/api v0.0.0-20200615162408-9b5293c30ef5 ## explicit istio.io/api/label +istio.io/api/networking/v1alpha3 istio.io/api/networking/v1beta1 # istio.io/client-go v0.0.0-20200615164228-d77b0b53b6a0 ## explicit -istio.io/client-go/pkg/apis/networking/v1beta1 +istio.io/client-go/pkg/apis/networking/v1alpha3 # istio.io/gogo-genproto v0.0.0-20191029161641-f7d19ec0141d ## explicit istio.io/gogo-genproto/googleapis/google/api