From 1229924efe2c4a5368bb9a2dc4b163d107bde931 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Thu, 21 Jan 2021 18:09:50 -0800 Subject: [PATCH 1/3] local rate limit Signed-off-by: Kuat Yessenov --- networking/v1alpha3/virtual_service.pb.go | 9786 ++++++++++------- networking/v1alpha3/virtual_service.pb.html | 315 +- networking/v1alpha3/virtual_service.proto | 82 +- .../v1alpha3/virtual_service_deepcopy.gen.go | 147 + .../v1alpha3/virtual_service_json.gen.go | 77 + networking/v1beta1/virtual_service.pb.go | 9786 ++++++++++------- networking/v1beta1/virtual_service.proto | 83 +- .../v1beta1/virtual_service_deepcopy.gen.go | 147 + .../v1beta1/virtual_service_json.gen.go | 77 + .../v1alpha3/virtual_service_pb2.py | 483 +- .../networking/v1beta1/virtual_service_pb2.py | 483 +- 11 files changed, 13563 insertions(+), 7903 deletions(-) diff --git a/networking/v1alpha3/virtual_service.pb.go b/networking/v1alpha3/virtual_service.pb.go index 6c9a445c25d..cb546d80b65 100644 --- a/networking/v1alpha3/virtual_service.pb.go +++ b/networking/v1alpha3/virtual_service.pb.go @@ -748,10 +748,12 @@ type HTTPRoute struct { // 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:"-"` + Headers *Headers `protobuf:"bytes,16,opt,name=headers,proto3" json:"headers,omitempty"` + // Rate limits + RateLimit *RateLimit `protobuf:"bytes,21,opt,name=rate_limit,json=rateLimit,proto3" json:"rate_limit,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *HTTPRoute) Reset() { *m = HTTPRoute{} } @@ -886,89 +888,37 @@ func (m *HTTPRoute) GetHeaders() *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 *HTTPRoute) GetRateLimit() *RateLimit { + if m != nil { + return m.RateLimit + } + return nil } -func (m *Delegate) Reset() { *m = Delegate{} } -func (m *Delegate) String() string { return proto.CompactTextString(m) } -func (*Delegate) ProtoMessage() {} -func (*Delegate) Descriptor() ([]byte, []int) { +// RateLimit configuration. +type RateLimit struct { + // Specifies the rate limit descriptors to produce for the route. + Descriptors []*RateLimitDescriptor `protobuf:"bytes,1,rep,name=descriptors,proto3" json:"descriptors,omitempty"` + // Types that are valid to be assigned to RateLimitSpecifier: + // *RateLimit_Local_ + RateLimitSpecifier isRateLimit_RateLimitSpecifier `protobuf_oneof:"rate_limit_specifier"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RateLimit) Reset() { *m = RateLimit{} } +func (m *RateLimit) String() string { return proto.CompactTextString(m) } +func (*RateLimit) ProtoMessage() {} +func (*RateLimit) Descriptor() ([]byte, []int) { return fileDescriptor_e85a9a4fa9c17a22, []int{3} } -func (m *Delegate) XXX_Unmarshal(b []byte) error { +func (m *RateLimit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Delegate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RateLimit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Delegate.Marshal(b, m, deterministic) + return xxx_messageInfo_RateLimit.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -978,125 +928,83 @@ func (m *Delegate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Delegate) XXX_Merge(src proto.Message) { - xxx_messageInfo_Delegate.Merge(m, src) +func (m *RateLimit) XXX_Merge(src proto.Message) { + xxx_messageInfo_RateLimit.Merge(m, src) } -func (m *Delegate) XXX_Size() int { +func (m *RateLimit) XXX_Size() int { return m.Size() } -func (m *Delegate) XXX_DiscardUnknown() { - xxx_messageInfo_Delegate.DiscardUnknown(m) +func (m *RateLimit) XXX_DiscardUnknown() { + xxx_messageInfo_RateLimit.DiscardUnknown(m) } -var xxx_messageInfo_Delegate proto.InternalMessageInfo +var xxx_messageInfo_RateLimit proto.InternalMessageInfo -func (m *Delegate) GetName() string { +type isRateLimit_RateLimitSpecifier interface { + isRateLimit_RateLimitSpecifier() + MarshalTo([]byte) (int, error) + Size() int +} + +type RateLimit_Local_ struct { + Local *RateLimit_Local `protobuf:"bytes,2,opt,name=local,proto3,oneof" json:"local,omitempty"` +} + +func (*RateLimit_Local_) isRateLimit_RateLimitSpecifier() {} + +func (m *RateLimit) GetRateLimitSpecifier() isRateLimit_RateLimitSpecifier { if m != nil { - return m.Name + return m.RateLimitSpecifier } - return "" + return nil } -func (m *Delegate) GetNamespace() string { +func (m *RateLimit) GetDescriptors() []*RateLimitDescriptor { if m != nil { - return m.Namespace + return m.Descriptors } - return "" + return nil } -// 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 removes 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 -// ``` -// {{}} -// {{}} -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 *RateLimit) GetLocal() *RateLimit_Local { + if x, ok := m.GetRateLimitSpecifier().(*RateLimit_Local_); ok { + return x.Local + } + return nil } -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} +// XXX_OneofWrappers is for the internal use of the proto package. +func (*RateLimit) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*RateLimit_Local_)(nil), + } } -func (m *Headers) XXX_Unmarshal(b []byte) error { + +// Token bucket algorithm configuration. Each request consumes a single token. +type RateLimit_TokenBucket struct { + // Maximum amount of tokens in a bucket. + MaxTokens uint32 `protobuf:"varint,1,opt,name=max_tokens,json=maxTokens,proto3" json:"max_tokens,omitempty"` + // The amount of tokens added per fill. + TokensPerFill uint32 `protobuf:"varint,2,opt,name=tokens_per_fill,json=tokensPerFill,proto3" json:"tokens_per_fill,omitempty"` + // The interval that tokens are added to the bucket. + FillInterval *types.Duration `protobuf:"bytes,3,opt,name=fill_interval,json=fillInterval,proto3" json:"fill_interval,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RateLimit_TokenBucket) Reset() { *m = RateLimit_TokenBucket{} } +func (m *RateLimit_TokenBucket) String() string { return proto.CompactTextString(m) } +func (*RateLimit_TokenBucket) ProtoMessage() {} +func (*RateLimit_TokenBucket) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{3, 0} +} +func (m *RateLimit_TokenBucket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Headers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RateLimit_TokenBucket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Headers.Marshal(b, m, deterministic) + return xxx_messageInfo_RateLimit_TokenBucket.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1106,58 +1014,62 @@ func (m *Headers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Headers) XXX_Merge(src proto.Message) { - xxx_messageInfo_Headers.Merge(m, src) +func (m *RateLimit_TokenBucket) XXX_Merge(src proto.Message) { + xxx_messageInfo_RateLimit_TokenBucket.Merge(m, src) } -func (m *Headers) XXX_Size() int { +func (m *RateLimit_TokenBucket) XXX_Size() int { return m.Size() } -func (m *Headers) XXX_DiscardUnknown() { - xxx_messageInfo_Headers.DiscardUnknown(m) +func (m *RateLimit_TokenBucket) XXX_DiscardUnknown() { + xxx_messageInfo_RateLimit_TokenBucket.DiscardUnknown(m) } -var xxx_messageInfo_Headers proto.InternalMessageInfo +var xxx_messageInfo_RateLimit_TokenBucket proto.InternalMessageInfo -func (m *Headers) GetRequest() *Headers_HeaderOperations { +func (m *RateLimit_TokenBucket) GetMaxTokens() uint32 { if m != nil { - return m.Request + return m.MaxTokens } - return nil + return 0 } -func (m *Headers) GetResponse() *Headers_HeaderOperations { +func (m *RateLimit_TokenBucket) GetTokensPerFill() uint32 { if m != nil { - return m.Response + return m.TokensPerFill + } + return 0 +} + +func (m *RateLimit_TokenBucket) GetFillInterval() *types.Duration { + if m != nil { + return m.FillInterval } 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:"-"` +// Local rate limit descriptor configuration. +type RateLimit_LocalDescriptor struct { + // Descriptor entry match. + Entries []*RateLimit_LocalDescriptor_Entry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` + // Specifies the token bucket for matching descriptors. + TokenBucket *RateLimit_TokenBucket `protobuf:"bytes,2,opt,name=token_bucket,json=tokenBucket,proto3" json:"token_bucket,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 *RateLimit_LocalDescriptor) Reset() { *m = RateLimit_LocalDescriptor{} } +func (m *RateLimit_LocalDescriptor) String() string { return proto.CompactTextString(m) } +func (*RateLimit_LocalDescriptor) ProtoMessage() {} +func (*RateLimit_LocalDescriptor) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{3, 1} } -func (m *Headers_HeaderOperations) XXX_Unmarshal(b []byte) error { +func (m *RateLimit_LocalDescriptor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Headers_HeaderOperations) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RateLimit_LocalDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Headers_HeaderOperations.Marshal(b, m, deterministic) + return xxx_messageInfo_RateLimit_LocalDescriptor.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1167,128 +1079,117 @@ func (m *Headers_HeaderOperations) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *Headers_HeaderOperations) XXX_Merge(src proto.Message) { - xxx_messageInfo_Headers_HeaderOperations.Merge(m, src) +func (m *RateLimit_LocalDescriptor) XXX_Merge(src proto.Message) { + xxx_messageInfo_RateLimit_LocalDescriptor.Merge(m, src) } -func (m *Headers_HeaderOperations) XXX_Size() int { +func (m *RateLimit_LocalDescriptor) XXX_Size() int { return m.Size() } -func (m *Headers_HeaderOperations) XXX_DiscardUnknown() { - xxx_messageInfo_Headers_HeaderOperations.DiscardUnknown(m) +func (m *RateLimit_LocalDescriptor) XXX_DiscardUnknown() { + xxx_messageInfo_RateLimit_LocalDescriptor.DiscardUnknown(m) } -var xxx_messageInfo_Headers_HeaderOperations proto.InternalMessageInfo +var xxx_messageInfo_RateLimit_LocalDescriptor proto.InternalMessageInfo -func (m *Headers_HeaderOperations) GetSet() map[string]string { +func (m *RateLimit_LocalDescriptor) GetEntries() []*RateLimit_LocalDescriptor_Entry { if m != nil { - return m.Set + return m.Entries } return nil } -func (m *Headers_HeaderOperations) GetAdd() map[string]string { +func (m *RateLimit_LocalDescriptor) GetTokenBucket() *RateLimit_TokenBucket { if m != nil { - return m.Add + return m.TokenBucket } return nil } -func (m *Headers_HeaderOperations) GetRemove() []string { - if m != nil { - return m.Remove - } - return nil +// Descriptor entry match. +type RateLimit_LocalDescriptor_Entry struct { + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -// 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 *RateLimit_LocalDescriptor_Entry) Reset() { *m = RateLimit_LocalDescriptor_Entry{} } +func (m *RateLimit_LocalDescriptor_Entry) String() string { return proto.CompactTextString(m) } +func (*RateLimit_LocalDescriptor_Entry) ProtoMessage() {} +func (*RateLimit_LocalDescriptor_Entry) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{3, 1, 0} +} +func (m *RateLimit_LocalDescriptor_Entry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RateLimit_LocalDescriptor_Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RateLimit_LocalDescriptor_Entry.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 *RateLimit_LocalDescriptor_Entry) XXX_Merge(src proto.Message) { + xxx_messageInfo_RateLimit_LocalDescriptor_Entry.Merge(m, src) +} +func (m *RateLimit_LocalDescriptor_Entry) XXX_Size() int { + return m.Size() +} +func (m *RateLimit_LocalDescriptor_Entry) XXX_DiscardUnknown() { + xxx_messageInfo_RateLimit_LocalDescriptor_Entry.DiscardUnknown(m) } -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} +var xxx_messageInfo_RateLimit_LocalDescriptor_Entry proto.InternalMessageInfo + +func (m *RateLimit_LocalDescriptor_Entry) GetKey() string { + if m != nil { + return m.Key + } + return "" } -func (m *TLSRoute) XXX_Unmarshal(b []byte) error { + +func (m *RateLimit_LocalDescriptor_Entry) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +// Local rate limit enforcement. +type RateLimit_Local struct { + // The token bucket configuration to use for rate limiting requests that + // are processed by this filter. Each request processed by the filter + // consumes a single token. If the token is available, the request will be + // allowed. If no tokens are available, the request will receive 429. + TokenBucket *RateLimit_TokenBucket `protobuf:"bytes,1,opt,name=token_bucket,json=tokenBucket,proto3" json:"token_bucket,omitempty"` + // The rate limit descriptor list to use in the local rate limit to + // override on. The rate limit descriptor is selected by the first full + // match from the request descriptors. The descriptors token bucket fill + // interval must be a multiple of the global fill interval. + Descriptors []*RateLimit_LocalDescriptor `protobuf:"bytes,2,rep,name=descriptors,proto3" json:"descriptors,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RateLimit_Local) Reset() { *m = RateLimit_Local{} } +func (m *RateLimit_Local) String() string { return proto.CompactTextString(m) } +func (*RateLimit_Local) ProtoMessage() {} +func (*RateLimit_Local) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{3, 2} +} +func (m *RateLimit_Local) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TLSRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RateLimit_Local) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TLSRoute.Marshal(b, m, deterministic) + return xxx_messageInfo_RateLimit_Local.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1298,102 +1199,55 @@ func (m *TLSRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *TLSRoute) XXX_Merge(src proto.Message) { - xxx_messageInfo_TLSRoute.Merge(m, src) +func (m *RateLimit_Local) XXX_Merge(src proto.Message) { + xxx_messageInfo_RateLimit_Local.Merge(m, src) } -func (m *TLSRoute) XXX_Size() int { +func (m *RateLimit_Local) XXX_Size() int { return m.Size() } -func (m *TLSRoute) XXX_DiscardUnknown() { - xxx_messageInfo_TLSRoute.DiscardUnknown(m) +func (m *RateLimit_Local) XXX_DiscardUnknown() { + xxx_messageInfo_RateLimit_Local.DiscardUnknown(m) } -var xxx_messageInfo_TLSRoute proto.InternalMessageInfo +var xxx_messageInfo_RateLimit_Local proto.InternalMessageInfo -func (m *TLSRoute) GetMatch() []*TLSMatchAttributes { +func (m *RateLimit_Local) GetTokenBucket() *RateLimit_TokenBucket { if m != nil { - return m.Match + return m.TokenBucket } return nil } -func (m *TLSRoute) GetRoute() []*RouteDestination { +func (m *RateLimit_Local) GetDescriptors() []*RateLimit_LocalDescriptor { if m != nil { - return m.Route + return m.Descriptors } 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:"-"` +// Rate limit descriptor specifies the descriptors consisting of multiple actions. +type RateLimitDescriptor struct { + // Rate limit entries specify an ordered list of string values composing the descriptor. + // The order of the entries matters, as they are processed sequentially. If an entry fails + // to be computed, no descriptor is generated. + Entries []*RateLimitDescriptor_Entry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,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 *RateLimitDescriptor) Reset() { *m = RateLimitDescriptor{} } +func (m *RateLimitDescriptor) String() string { return proto.CompactTextString(m) } +func (*RateLimitDescriptor) ProtoMessage() {} +func (*RateLimitDescriptor) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{4} } -func (m *TCPRoute) XXX_Unmarshal(b []byte) error { +func (m *RateLimitDescriptor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TCPRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RateLimitDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TCPRoute.Marshal(b, m, deterministic) + return xxx_messageInfo_RateLimitDescriptor.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1403,204 +1257,216 @@ func (m *TCPRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *TCPRoute) XXX_Merge(src proto.Message) { - xxx_messageInfo_TCPRoute.Merge(m, src) +func (m *RateLimitDescriptor) XXX_Merge(src proto.Message) { + xxx_messageInfo_RateLimitDescriptor.Merge(m, src) } -func (m *TCPRoute) XXX_Size() int { +func (m *RateLimitDescriptor) XXX_Size() int { return m.Size() } -func (m *TCPRoute) XXX_DiscardUnknown() { - xxx_messageInfo_TCPRoute.DiscardUnknown(m) +func (m *RateLimitDescriptor) XXX_DiscardUnknown() { + xxx_messageInfo_RateLimitDescriptor.DiscardUnknown(m) } -var xxx_messageInfo_TCPRoute proto.InternalMessageInfo +var xxx_messageInfo_RateLimitDescriptor proto.InternalMessageInfo -func (m *TCPRoute) GetMatch() []*L4MatchAttributes { +func (m *RateLimitDescriptor) GetEntries() []*RateLimitDescriptor_Entry { if m != nil { - return m.Match + return m.Entries } return nil } -func (m *TCPRoute) GetRoute() []*RouteDestination { +// Descriptor entry. +type RateLimitDescriptor_Entry struct { + // The key to use in the descriptor entry. + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // If set to true, skip the entry when the evaluation fails or when the header is missing. + // By default, the entire descriptor is not produced. + SkipIfError bool `protobuf:"varint,2,opt,name=skip_if_error,json=skipIfError,proto3" json:"skip_if_error,omitempty"` + // Types that are valid to be assigned to EntrySpecifier: + // *RateLimitDescriptor_Entry_RequestHeader + // *RateLimitDescriptor_Entry_Expression + EntrySpecifier isRateLimitDescriptor_Entry_EntrySpecifier `protobuf_oneof:"entry_specifier"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RateLimitDescriptor_Entry) Reset() { *m = RateLimitDescriptor_Entry{} } +func (m *RateLimitDescriptor_Entry) String() string { return proto.CompactTextString(m) } +func (*RateLimitDescriptor_Entry) ProtoMessage() {} +func (*RateLimitDescriptor_Entry) Descriptor() ([]byte, []int) { + return fileDescriptor_e85a9a4fa9c17a22, []int{4, 0} +} +func (m *RateLimitDescriptor_Entry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RateLimitDescriptor_Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RateLimitDescriptor_Entry.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 *RateLimitDescriptor_Entry) XXX_Merge(src proto.Message) { + xxx_messageInfo_RateLimitDescriptor_Entry.Merge(m, src) +} +func (m *RateLimitDescriptor_Entry) XXX_Size() int { + return m.Size() +} +func (m *RateLimitDescriptor_Entry) XXX_DiscardUnknown() { + xxx_messageInfo_RateLimitDescriptor_Entry.DiscardUnknown(m) +} + +var xxx_messageInfo_RateLimitDescriptor_Entry proto.InternalMessageInfo + +type isRateLimitDescriptor_Entry_EntrySpecifier interface { + isRateLimitDescriptor_Entry_EntrySpecifier() + MarshalTo([]byte) (int, error) + Size() int +} + +type RateLimitDescriptor_Entry_RequestHeader struct { + RequestHeader string `protobuf:"bytes,3,opt,name=request_header,json=requestHeader,proto3,oneof" json:"request_header,omitempty"` +} +type RateLimitDescriptor_Entry_Expression struct { + Expression string `protobuf:"bytes,4,opt,name=expression,proto3,oneof" json:"expression,omitempty"` +} + +func (*RateLimitDescriptor_Entry_RequestHeader) isRateLimitDescriptor_Entry_EntrySpecifier() {} +func (*RateLimitDescriptor_Entry_Expression) isRateLimitDescriptor_Entry_EntrySpecifier() {} + +func (m *RateLimitDescriptor_Entry) GetEntrySpecifier() isRateLimitDescriptor_Entry_EntrySpecifier { if m != nil { - return m.Route + return m.EntrySpecifier } 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`. +func (m *RateLimitDescriptor_Entry) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *RateLimitDescriptor_Entry) GetSkipIfError() bool { + if m != nil { + return m.SkipIfError + } + return false +} + +func (m *RateLimitDescriptor_Entry) GetRequestHeader() string { + if x, ok := m.GetEntrySpecifier().(*RateLimitDescriptor_Entry_RequestHeader); ok { + return x.RequestHeader + } + return "" +} + +func (m *RateLimitDescriptor_Entry) GetExpression() string { + if x, ok := m.GetEntrySpecifier().(*RateLimitDescriptor_Entry_Expression); ok { + return x.Expression + } + return "" +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*RateLimitDescriptor_Entry) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*RateLimitDescriptor_Entry_RequestHeader)(nil), + (*RateLimitDescriptor_Entry_Expression)(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: ratings-route +// name: bookinfo // spec: // hosts: -// - ratings.prod.svc.cluster.local +// - "bookinfo.com" +// gateways: +// - mygateway // http: // - match: -// - headers: -// end-user: -// exact: jason -// uri: -// prefix: "/ratings/v2/" -// ignoreUriCase: true -// route: -// - destination: -// host: ratings.prod.svc.cluster.local +// - uri: +// prefix: "/productpage" +// delegate: +// name: productpage +// namespace: nsA +// - match: +// - uri: +// prefix: "/reviews" +// delegate: +// name: reviews +// namespace: nsB // ``` -// {{}} // -// {{}} // ```yaml -// apiVersion: networking.istio.io/v1beta1 +// apiVersion: networking.istio.io/v1alpha3 // kind: VirtualService // metadata: -// name: ratings-route +// name: productpage +// namespace: nsA // spec: -// hosts: -// - ratings.prod.svc.cluster.local // http: // - match: -// - headers: -// end-user: -// exact: jason -// uri: -// prefix: "/ratings/v2/" -// ignoreUriCase: true +// - uri: +// prefix: "/productpage/v1/" // route: // - destination: -// host: ratings.prod.svc.cluster.local +// host: productpage-v1.nsA.svc.cluster.local +// - route: +// - destination: +// host: productpage.nsA.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"` +// ```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 *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 *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{5} } -func (m *HTTPMatchRequest) XXX_Unmarshal(b []byte) error { +func (m *Delegate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *HTTPMatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Delegate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_HTTPMatchRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_Delegate.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1610,115 +1476,39 @@ func (m *HTTPMatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *HTTPMatchRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_HTTPMatchRequest.Merge(m, src) +func (m *Delegate) XXX_Merge(src proto.Message) { + xxx_messageInfo_Delegate.Merge(m, src) } -func (m *HTTPMatchRequest) XXX_Size() int { +func (m *Delegate) XXX_Size() int { return m.Size() } -func (m *HTTPMatchRequest) XXX_DiscardUnknown() { - xxx_messageInfo_HTTPMatchRequest.DiscardUnknown(m) +func (m *Delegate) XXX_DiscardUnknown() { + xxx_messageInfo_Delegate.DiscardUnknown(m) } -var xxx_messageInfo_HTTPMatchRequest proto.InternalMessageInfo +var xxx_messageInfo_Delegate proto.InternalMessageInfo -func (m *HTTPMatchRequest) GetName() string { +func (m *Delegate) 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 { +func (m *Delegate) GetNamespace() string { if m != nil { - return m.Gateways + return m.Namespace } - return nil + return "" } -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". +// 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 removes the `foo` response header, but only from responses +// coming from the `v1` subset (version) of the `reviews` service. // // {{}} // {{}} @@ -1731,7 +1521,11 @@ func (m *HTTPMatchRequest) GetSourceNamespace() string { // hosts: // - reviews.prod.svc.cluster.local // http: -// - route: +// - headers: +// request: +// set: +// test: true +// route: // - destination: // host: reviews.prod.svc.cluster.local // subset: v2 @@ -1739,6 +1533,10 @@ func (m *HTTPMatchRequest) GetSourceNamespace() string { // - destination: // host: reviews.prod.svc.cluster.local // subset: v1 +// headers: +// response: +// remove: +// - foo // weight: 75 // ``` // {{}} @@ -1753,7 +1551,11 @@ func (m *HTTPMatchRequest) GetSourceNamespace() string { // hosts: // - reviews.prod.svc.cluster.local // http: -// - route: +// - headers: +// request: +// set: +// test: true +// route: // - destination: // host: reviews.prod.svc.cluster.local // subset: v2 @@ -1761,125 +1563,38 @@ func (m *HTTPMatchRequest) GetSourceNamespace() string { // - destination: // host: reviews.prod.svc.cluster.local // subset: v1 +// headers: +// response: +// remove: +// - foo // 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:"-"` +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 *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 *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{6} } -func (m *HTTPRouteDestination) XXX_Unmarshal(b []byte) error { +func (m *Headers) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *HTTPRouteDestination) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Headers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_HTTPRouteDestination.Marshal(b, m, deterministic) + return xxx_messageInfo_Headers.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1889,65 +1604,58 @@ func (m *HTTPRouteDestination) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *HTTPRouteDestination) XXX_Merge(src proto.Message) { - xxx_messageInfo_HTTPRouteDestination.Merge(m, src) +func (m *Headers) XXX_Merge(src proto.Message) { + xxx_messageInfo_Headers.Merge(m, src) } -func (m *HTTPRouteDestination) XXX_Size() int { +func (m *Headers) XXX_Size() int { return m.Size() } -func (m *HTTPRouteDestination) XXX_DiscardUnknown() { - xxx_messageInfo_HTTPRouteDestination.DiscardUnknown(m) +func (m *Headers) XXX_DiscardUnknown() { + xxx_messageInfo_Headers.DiscardUnknown(m) } -var xxx_messageInfo_HTTPRouteDestination proto.InternalMessageInfo +var xxx_messageInfo_Headers proto.InternalMessageInfo -func (m *HTTPRouteDestination) GetDestination() *Destination { +func (m *Headers) GetRequest() *Headers_HeaderOperations { if m != nil { - return m.Destination + return m.Request } return nil } -func (m *HTTPRouteDestination) GetWeight() int32 { - if m != nil { - return m.Weight - } - return 0 -} - -func (m *HTTPRouteDestination) GetHeaders() *Headers { +func (m *Headers) GetResponse() *Headers_HeaderOperations { if m != nil { - return m.Headers + return m.Response } 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"` +// 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 *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 *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{6, 0} } -func (m *RouteDestination) XXX_Unmarshal(b []byte) error { +func (m *Headers_HeaderOperations) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RouteDestination) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Headers_HeaderOperations) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RouteDestination.Marshal(b, m, deterministic) + return xxx_messageInfo_Headers_HeaderOperations.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1957,184 +1665,128 @@ func (m *RouteDestination) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *RouteDestination) XXX_Merge(src proto.Message) { - xxx_messageInfo_RouteDestination.Merge(m, src) +func (m *Headers_HeaderOperations) XXX_Merge(src proto.Message) { + xxx_messageInfo_Headers_HeaderOperations.Merge(m, src) } -func (m *RouteDestination) XXX_Size() int { +func (m *Headers_HeaderOperations) XXX_Size() int { return m.Size() } -func (m *RouteDestination) XXX_DiscardUnknown() { - xxx_messageInfo_RouteDestination.DiscardUnknown(m) +func (m *Headers_HeaderOperations) XXX_DiscardUnknown() { + xxx_messageInfo_Headers_HeaderOperations.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 +var xxx_messageInfo_Headers_HeaderOperations proto.InternalMessageInfo -func (m *L4MatchAttributes) GetDestinationSubnets() []string { +func (m *Headers_HeaderOperations) GetSet() map[string]string { if m != nil { - return m.DestinationSubnets + return m.Set } 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 { +func (m *Headers_HeaderOperations) GetAdd() map[string]string { if m != nil { - return m.SourceLabels + return m.Add } return nil } -func (m *L4MatchAttributes) GetGateways() []string { +func (m *Headers_HeaderOperations) GetRemove() []string { if m != nil { - return m.Gateways + return m.Remove } 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:"-"` +// 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 *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 *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{7} } -func (m *TLSMatchAttributes) XXX_Unmarshal(b []byte) error { +func (m *TLSRoute) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TLSMatchAttributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TLSRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TLSMatchAttributes.Marshal(b, m, deterministic) + return xxx_messageInfo_TLSRoute.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2144,65 +1796,35 @@ func (m *TLSMatchAttributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *TLSMatchAttributes) XXX_Merge(src proto.Message) { - xxx_messageInfo_TLSMatchAttributes.Merge(m, src) +func (m *TLSRoute) XXX_Merge(src proto.Message) { + xxx_messageInfo_TLSRoute.Merge(m, src) } -func (m *TLSMatchAttributes) XXX_Size() int { +func (m *TLSRoute) XXX_Size() int { return m.Size() } -func (m *TLSMatchAttributes) XXX_DiscardUnknown() { - xxx_messageInfo_TLSMatchAttributes.DiscardUnknown(m) +func (m *TLSRoute) XXX_DiscardUnknown() { + xxx_messageInfo_TLSRoute.DiscardUnknown(m) } -var xxx_messageInfo_TLSMatchAttributes proto.InternalMessageInfo +var xxx_messageInfo_TLSRoute proto.InternalMessageInfo -func (m *TLSMatchAttributes) GetSniHosts() []string { +func (m *TLSRoute) GetMatch() []*TLSMatchAttributes { if m != nil { - return m.SniHosts + return m.Match } return nil } -func (m *TLSMatchAttributes) GetDestinationSubnets() []string { +func (m *TLSRoute) GetRoute() []*RouteDestination { if m != nil { - return m.DestinationSubnets + return m.Route } 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. +// 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. // // {{}} // {{}} @@ -2210,18 +1832,18 @@ func (m *TLSMatchAttributes) GetSourceNamespace() string { // apiVersion: networking.istio.io/v1alpha3 // kind: VirtualService // metadata: -// name: ratings-route +// name: bookinfo-mongo // spec: // hosts: -// - ratings.prod.svc.cluster.local -// http: +// - mongo.prod.svc.cluster.local +// tcp: // - match: -// - uri: -// exact: /v1/getProductRatings -// redirect: -// uri: /v1/bookRatings -// authority: newratings.default.svc.cluster.local -// ... +// - port: 27017 +// route: +// - destination: +// host: mongo.backup.svc.cluster.local +// port: +// number: 5555 // ``` // {{}} // @@ -2230,50 +1852,46 @@ func (m *TLSMatchAttributes) GetSourceNamespace() string { // apiVersion: networking.istio.io/v1beta1 // kind: VirtualService // metadata: -// name: ratings-route +// name: bookinfo-mongo // spec: // hosts: -// - ratings.prod.svc.cluster.local -// http: +// - mongo.prod.svc.cluster.local +// tcp: // - match: -// - uri: -// exact: /v1/getProductRatings -// redirect: -// uri: /v1/bookRatings -// authority: newratings.default.svc.cluster.local -// ... +// - port: 27017 +// route: +// - destination: +// host: mongo.backup.svc.cluster.local +// port: +// number: 5555 // ``` // {{}} // {{}} -// -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:"-"` +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 *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 *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{8} } -func (m *HTTPRedirect) XXX_Unmarshal(b []byte) error { +func (m *TCPRoute) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *HTTPRedirect) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TCPRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_HTTPRedirect.Marshal(b, m, deterministic) + return xxx_messageInfo_TCPRoute.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2283,44 +1901,37 @@ func (m *HTTPRedirect) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *HTTPRedirect) XXX_Merge(src proto.Message) { - xxx_messageInfo_HTTPRedirect.Merge(m, src) +func (m *TCPRoute) XXX_Merge(src proto.Message) { + xxx_messageInfo_TCPRoute.Merge(m, src) } -func (m *HTTPRedirect) XXX_Size() int { +func (m *TCPRoute) XXX_Size() int { return m.Size() } -func (m *HTTPRedirect) XXX_DiscardUnknown() { - xxx_messageInfo_HTTPRedirect.DiscardUnknown(m) +func (m *TCPRoute) XXX_DiscardUnknown() { + xxx_messageInfo_TCPRoute.DiscardUnknown(m) } -var xxx_messageInfo_HTTPRedirect proto.InternalMessageInfo - -func (m *HTTPRedirect) GetUri() string { - if m != nil { - return m.Uri - } - return "" -} +var xxx_messageInfo_TCPRoute proto.InternalMessageInfo -func (m *HTTPRedirect) GetAuthority() string { +func (m *TCPRoute) GetMatch() []*L4MatchAttributes { if m != nil { - return m.Authority + return m.Match } - return "" + return nil } -func (m *HTTPRedirect) GetRedirectCode() uint32 { +func (m *TCPRoute) GetRoute() []*RouteDestination { if m != nil { - return m.RedirectCode + return m.Route } - return 0 + return nil } -// 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. +// 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`. // // {{}} // {{}} @@ -2334,14 +1945,15 @@ func (m *HTTPRedirect) GetRedirectCode() uint32 { // - ratings.prod.svc.cluster.local // http: // - match: -// - uri: -// prefix: /ratings -// rewrite: -// uri: /v1/bookRatings +// - headers: +// end-user: +// exact: jason +// uri: +// prefix: "/ratings/v2/" +// ignoreUriCase: true // route: // - destination: // host: ratings.prod.svc.cluster.local -// subset: v1 // ``` // {{}} // @@ -2356,102 +1968,137 @@ func (m *HTTPRedirect) GetRedirectCode() uint32 { // - ratings.prod.svc.cluster.local // http: // - match: -// - uri: -// prefix: /ratings -// rewrite: -// uri: /v1/bookRatings +// - headers: +// end-user: +// exact: jason +// uri: +// prefix: "/ratings/v2/" +// ignoreUriCase: true // 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 { +// 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{9} +} +func (m *HTTPMatchRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *StringMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *HTTPMatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_StringMatch.Marshal(b, m, deterministic) + return xxx_messageInfo_HTTPMatchRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2461,78 +2108,115 @@ func (m *StringMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *StringMatch) XXX_Merge(src proto.Message) { - xxx_messageInfo_StringMatch.Merge(m, src) +func (m *HTTPMatchRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_HTTPMatchRequest.Merge(m, src) } -func (m *StringMatch) XXX_Size() int { +func (m *HTTPMatchRequest) XXX_Size() int { return m.Size() } -func (m *StringMatch) XXX_DiscardUnknown() { - xxx_messageInfo_StringMatch.DiscardUnknown(m) +func (m *HTTPMatchRequest) XXX_DiscardUnknown() { + xxx_messageInfo_HTTPMatchRequest.DiscardUnknown(m) } -var xxx_messageInfo_StringMatch proto.InternalMessageInfo +var xxx_messageInfo_HTTPMatchRequest proto.InternalMessageInfo -type isStringMatch_MatchType interface { - isStringMatch_MatchType() - MarshalTo([]byte) (int, error) - Size() int +func (m *HTTPMatchRequest) GetName() string { + if m != nil { + return m.Name + } + return "" } -type StringMatch_Exact struct { - Exact string `protobuf:"bytes,1,opt,name=exact,proto3,oneof" json:"exact,omitempty"` +func (m *HTTPMatchRequest) GetUri() *StringMatch { + if m != nil { + return m.Uri + } + return nil } -type StringMatch_Prefix struct { - Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3,oneof" json:"prefix,omitempty"` + +func (m *HTTPMatchRequest) GetScheme() *StringMatch { + if m != nil { + return m.Scheme + } + return nil } -type StringMatch_Regex struct { - Regex string `protobuf:"bytes,3,opt,name=regex,proto3,oneof" json:"regex,omitempty"` + +func (m *HTTPMatchRequest) GetMethod() *StringMatch { + if m != nil { + return m.Method + } + return nil } -func (*StringMatch_Exact) isStringMatch_MatchType() {} -func (*StringMatch_Prefix) isStringMatch_MatchType() {} -func (*StringMatch_Regex) isStringMatch_MatchType() {} +func (m *HTTPMatchRequest) GetAuthority() *StringMatch { + if m != nil { + return m.Authority + } + return nil +} -func (m *StringMatch) GetMatchType() isStringMatch_MatchType { +func (m *HTTPMatchRequest) GetHeaders() map[string]*StringMatch { if m != nil { - return m.MatchType + return m.Headers } return nil } -func (m *StringMatch) GetExact() string { - if x, ok := m.GetMatchType().(*StringMatch_Exact); ok { - return x.Exact +func (m *HTTPMatchRequest) GetPort() uint32 { + if m != nil { + return m.Port } - return "" + return 0 } -func (m *StringMatch) GetPrefix() string { - if x, ok := m.GetMatchType().(*StringMatch_Prefix); ok { - return x.Prefix +func (m *HTTPMatchRequest) GetSourceLabels() map[string]string { + if m != nil { + return m.SourceLabels } - return "" + return nil } -func (m *StringMatch) GetRegex() string { - if x, ok := m.GetMatchType().(*StringMatch_Regex); ok { - return x.Regex +func (m *HTTPMatchRequest) GetGateways() []string { + if m != nil { + return m.Gateways } - return "" + return nil } -// 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), +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 } -// 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. +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". // // {{}} // {{}} @@ -2540,19 +2224,20 @@ func (*StringMatch) XXX_OneofWrappers() []interface{} { // apiVersion: networking.istio.io/v1alpha3 // kind: VirtualService // metadata: -// name: ratings-route +// name: reviews-route // spec: // hosts: -// - ratings.prod.svc.cluster.local +// - reviews.prod.svc.cluster.local // http: // - route: // - destination: -// host: ratings.prod.svc.cluster.local +// host: reviews.prod.svc.cluster.local +// subset: v2 +// weight: 25 +// - destination: +// host: reviews.prod.svc.cluster.local // subset: v1 -// retries: -// attempts: 3 -// perTryTimeout: 2s -// retryOn: gateway-error,connect-failure,refused-stream +// weight: 75 // ``` // {{}} // @@ -2561,116 +2246,67 @@ func (*StringMatch) XXX_OneofWrappers() []interface{} { // apiVersion: networking.istio.io/v1beta1 // kind: VirtualService // metadata: -// name: ratings-route +// name: reviews-route // spec: // hosts: -// - ratings.prod.svc.cluster.local +// - reviews.prod.svc.cluster.local // http: // - route: // - destination: -// host: ratings.prod.svc.cluster.local +// host: reviews.prod.svc.cluster.local +// subset: v2 +// weight: 25 +// - destination: +// host: reviews.prod.svc.cluster.local // subset: v1 -// retries: -// attempts: 3 -// perTryTimeout: 2s -// retryOn: gateway-error,connect-failure,refused-stream +// weight: 75 // ``` // {{}} // {{}} // -type HTTPRetry struct { - // Number of retries to be allowed for a given request. The interval - // between retries will be determined automatically (25ms+). When request - // `timeout` of the [HTTP route](https://istio.io/docs/reference/config/networking/virtual-service/#HTTPRoute) - // or `per_try_timeout` is configured, the actual number of retries attempted also depends on - // the specified request `timeout` and `per_try_timeout` values. - 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. - // Default is same value as request - // `timeout` of the [HTTP route](https://istio.io/docs/reference/config/networking/virtual-service/#HTTPRoute), - // which means no timeout. - 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. +// 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 // // {{}} // {{}} @@ -2678,25 +2314,18 @@ func (m *HTTPRetry) GetRetryRemoteLocalities() *types.BoolValue { // apiVersion: networking.istio.io/v1alpha3 // kind: VirtualService // metadata: -// name: ratings-route +// name: reviews-route-two-domains // spec: // hosts: -// - ratings.prod.svc.cluster.local +// - reviews.com // 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" +// host: dev.reviews.com +// weight: 25 +// - destination: +// host: reviews.com +// weight: 75 // ``` // {{}} // @@ -2705,72 +2334,50 @@ func (m *HTTPRetry) GetRetryRemoteLocalities() *types.BoolValue { // apiVersion: networking.istio.io/v1beta1 // kind: VirtualService // metadata: -// name: ratings-route +// name: reviews-route-two-domains // spec: // hosts: -// - ratings.prod.svc.cluster.local +// - reviews.com // 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" +// host: dev.reviews.com +// weight: 25 +// - destination: +// host: reviews.com +// weight: 75 // ``` // {{}} // {{}} // -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 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:"-"` +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 *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 *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{10} } -func (m *CorsPolicy) XXX_Unmarshal(b []byte) error { +func (m *HTTPRouteDestination) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *CorsPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *HTTPRouteDestination) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_CorsPolicy.Marshal(b, m, deterministic) + return xxx_messageInfo_HTTPRouteDestination.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2780,100 +2387,65 @@ func (m *CorsPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *CorsPolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_CorsPolicy.Merge(m, src) +func (m *HTTPRouteDestination) XXX_Merge(src proto.Message) { + xxx_messageInfo_HTTPRouteDestination.Merge(m, src) } -func (m *CorsPolicy) XXX_Size() int { +func (m *HTTPRouteDestination) 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 *HTTPRouteDestination) XXX_DiscardUnknown() { + xxx_messageInfo_HTTPRouteDestination.DiscardUnknown(m) } -func (m *CorsPolicy) GetAllowHeaders() []string { - if m != nil { - return m.AllowHeaders - } - return nil -} +var xxx_messageInfo_HTTPRouteDestination proto.InternalMessageInfo -func (m *CorsPolicy) GetExposeHeaders() []string { +func (m *HTTPRouteDestination) GetDestination() *Destination { if m != nil { - return m.ExposeHeaders + return m.Destination } return nil } -func (m *CorsPolicy) GetMaxAge() *types.Duration { +func (m *HTTPRouteDestination) GetWeight() int32 { if m != nil { - return m.MaxAge + return m.Weight } - return nil + return 0 } -func (m *CorsPolicy) GetAllowCredentials() *types.BoolValue { +func (m *HTTPRouteDestination) GetHeaders() *Headers { if m != nil { - return m.AllowCredentials + return m.Headers } 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:"-"` +// 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 *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 *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{11} } -func (m *HTTPFaultInjection) XXX_Unmarshal(b []byte) error { +func (m *RouteDestination) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *HTTPFaultInjection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RouteDestination) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_HTTPFaultInjection.Marshal(b, m, deterministic) + return xxx_messageInfo_RouteDestination.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2883,120 +2455,76 @@ func (m *HTTPFaultInjection) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *HTTPFaultInjection) XXX_Merge(src proto.Message) { - xxx_messageInfo_HTTPFaultInjection.Merge(m, src) +func (m *RouteDestination) XXX_Merge(src proto.Message) { + xxx_messageInfo_RouteDestination.Merge(m, src) } -func (m *HTTPFaultInjection) XXX_Size() int { +func (m *RouteDestination) XXX_Size() int { return m.Size() } -func (m *HTTPFaultInjection) XXX_DiscardUnknown() { - xxx_messageInfo_HTTPFaultInjection.DiscardUnknown(m) +func (m *RouteDestination) XXX_DiscardUnknown() { + xxx_messageInfo_RouteDestination.DiscardUnknown(m) } -var xxx_messageInfo_HTTPFaultInjection proto.InternalMessageInfo +var xxx_messageInfo_RouteDestination proto.InternalMessageInfo -func (m *HTTPFaultInjection) GetDelay() *HTTPFaultInjection_Delay { +func (m *RouteDestination) GetDestination() *Destination { if m != nil { - return m.Delay + return m.Destination } return nil } -func (m *HTTPFaultInjection) GetAbort() *HTTPFaultInjection_Abort { +func (m *RouteDestination) GetWeight() int32 { if m != nil { - return m.Abort + return m.Weight } - return nil + return 0 } -// 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"` +// 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 *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 *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{12} } -func (m *HTTPFaultInjection_Delay) XXX_Unmarshal(b []byte) error { +func (m *L4MatchAttributes) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *HTTPFaultInjection_Delay) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *L4MatchAttributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_HTTPFaultInjection_Delay.Marshal(b, m, deterministic) + return xxx_messageInfo_L4MatchAttributes.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -3006,81 +2534,173 @@ func (m *HTTPFaultInjection_Delay) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *HTTPFaultInjection_Delay) XXX_Merge(src proto.Message) { - xxx_messageInfo_HTTPFaultInjection_Delay.Merge(m, src) +func (m *L4MatchAttributes) XXX_Merge(src proto.Message) { + xxx_messageInfo_L4MatchAttributes.Merge(m, src) } -func (m *HTTPFaultInjection_Delay) XXX_Size() int { +func (m *L4MatchAttributes) XXX_Size() int { return m.Size() } -func (m *HTTPFaultInjection_Delay) XXX_DiscardUnknown() { - xxx_messageInfo_HTTPFaultInjection_Delay.DiscardUnknown(m) +func (m *L4MatchAttributes) XXX_DiscardUnknown() { + xxx_messageInfo_L4MatchAttributes.DiscardUnknown(m) } -var xxx_messageInfo_HTTPFaultInjection_Delay proto.InternalMessageInfo +var xxx_messageInfo_L4MatchAttributes proto.InternalMessageInfo -type isHTTPFaultInjection_Delay_HttpDelayType interface { - isHTTPFaultInjection_Delay_HttpDelayType() - MarshalTo([]byte) (int, error) - Size() int +func (m *L4MatchAttributes) GetDestinationSubnets() []string { + if m != nil { + return m.DestinationSubnets + } + return nil } -type HTTPFaultInjection_Delay_FixedDelay struct { - FixedDelay *types.Duration `protobuf:"bytes,2,opt,name=fixed_delay,json=fixedDelay,proto3,oneof" json:"fixed_delay,omitempty"` -} -type HTTPFaultInjection_Delay_ExponentialDelay struct { - ExponentialDelay *types.Duration `protobuf:"bytes,3,opt,name=exponential_delay,json=exponentialDelay,proto3,oneof" json:"exponential_delay,omitempty"` -} +func (m *L4MatchAttributes) GetPort() uint32 { + if m != nil { + return m.Port + } + return 0 +} -func (*HTTPFaultInjection_Delay_FixedDelay) isHTTPFaultInjection_Delay_HttpDelayType() {} -func (*HTTPFaultInjection_Delay_ExponentialDelay) isHTTPFaultInjection_Delay_HttpDelayType() {} +func (m *L4MatchAttributes) GetSourceSubnet() string { + if m != nil { + return m.SourceSubnet + } + return "" +} -func (m *HTTPFaultInjection_Delay) GetHttpDelayType() isHTTPFaultInjection_Delay_HttpDelayType { +func (m *L4MatchAttributes) GetSourceLabels() map[string]string { if m != nil { - return m.HttpDelayType + return m.SourceLabels } return nil } -// Deprecated: Do not use. -func (m *HTTPFaultInjection_Delay) GetPercent() int32 { +func (m *L4MatchAttributes) GetGateways() []string { if m != nil { - return m.Percent + return m.Gateways } - return 0 + return nil } -func (m *HTTPFaultInjection_Delay) GetFixedDelay() *types.Duration { - if x, ok := m.GetHttpDelayType().(*HTTPFaultInjection_Delay_FixedDelay); ok { - return x.FixedDelay +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{13} +} +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 *HTTPFaultInjection_Delay) GetExponentialDelay() *types.Duration { - if x, ok := m.GetHttpDelayType().(*HTTPFaultInjection_Delay_ExponentialDelay); ok { - return x.ExponentialDelay +func (m *TLSMatchAttributes) GetDestinationSubnets() []string { + if m != nil { + return m.DestinationSubnets } return nil } -func (m *HTTPFaultInjection_Delay) GetPercentage() *Percent { +func (m *TLSMatchAttributes) GetPort() uint32 { if m != nil { - return m.Percentage + return m.Port + } + return 0 +} + +func (m *TLSMatchAttributes) GetSourceLabels() map[string]string { + if m != nil { + return m.SourceLabels } 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), +func (m *TLSMatchAttributes) GetGateways() []string { + if m != nil { + return m.Gateways } + return 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". +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. // // {{}} // {{}} @@ -3093,15 +2713,13 @@ func (*HTTPFaultInjection_Delay) XXX_OneofWrappers() []interface{} { // 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 +// - match: +// - uri: +// exact: /v1/getProductRatings +// redirect: +// uri: /v1/bookRatings +// authority: newratings.default.svc.cluster.local +// ... // ``` // {{}} // @@ -3115,48 +2733,45 @@ func (*HTTPFaultInjection_Delay) XXX_OneofWrappers() []interface{} { // 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 +// - match: +// - uri: +// exact: /v1/getProductRatings +// redirect: +// uri: /v1/bookRatings +// authority: newratings.default.svc.cluster.local +// ... // ``` // {{}} // {{}} // -// 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"` +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 *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 *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{14} } -func (m *HTTPFaultInjection_Abort) XXX_Unmarshal(b []byte) error { +func (m *HTTPRedirect) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *HTTPFaultInjection_Abort) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *HTTPRedirect) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_HTTPFaultInjection_Abort.Marshal(b, m, deterministic) + return xxx_messageInfo_HTTPRedirect.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -3166,104 +2781,115 @@ func (m *HTTPFaultInjection_Abort) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *HTTPFaultInjection_Abort) XXX_Merge(src proto.Message) { - xxx_messageInfo_HTTPFaultInjection_Abort.Merge(m, src) +func (m *HTTPRedirect) XXX_Merge(src proto.Message) { + xxx_messageInfo_HTTPRedirect.Merge(m, src) } -func (m *HTTPFaultInjection_Abort) XXX_Size() int { +func (m *HTTPRedirect) XXX_Size() int { return m.Size() } -func (m *HTTPFaultInjection_Abort) XXX_DiscardUnknown() { - xxx_messageInfo_HTTPFaultInjection_Abort.DiscardUnknown(m) +func (m *HTTPRedirect) XXX_DiscardUnknown() { + xxx_messageInfo_HTTPRedirect.DiscardUnknown(m) } -var xxx_messageInfo_HTTPFaultInjection_Abort proto.InternalMessageInfo - -type isHTTPFaultInjection_Abort_ErrorType interface { - isHTTPFaultInjection_Abort_ErrorType() - MarshalTo([]byte) (int, error) - Size() int -} +var xxx_messageInfo_HTTPRedirect proto.InternalMessageInfo -type HTTPFaultInjection_Abort_HttpStatus struct { - HttpStatus int32 `protobuf:"varint,2,opt,name=http_status,json=httpStatus,proto3,oneof" json:"http_status,omitempty"` -} -type HTTPFaultInjection_Abort_GrpcStatus struct { - GrpcStatus string `protobuf:"bytes,3,opt,name=grpc_status,json=grpcStatus,proto3,oneof" json:"grpc_status,omitempty"` -} -type HTTPFaultInjection_Abort_Http2Error struct { - Http2Error string `protobuf:"bytes,4,opt,name=http2_error,json=http2Error,proto3,oneof" json:"http2_error,omitempty"` +func (m *HTTPRedirect) GetUri() string { + if m != nil { + return m.Uri + } + return "" } -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 { +func (m *HTTPRedirect) GetAuthority() string { if m != nil { - return m.ErrorType + return m.Authority } - return nil + return "" } -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 { +func (m *HTTPRedirect) GetRedirectCode() uint32 { 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), + return m.RedirectCode } + return 0 } -// 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"` +// 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 *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 *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{15} } -func (m *PortSelector) XXX_Unmarshal(b []byte) error { +func (m *HTTPRewrite) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *PortSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *HTTPRewrite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_PortSelector.Marshal(b, m, deterministic) + return xxx_messageInfo_HTTPRewrite.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -3273,45 +2899,57 @@ func (m *PortSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *PortSelector) XXX_Merge(src proto.Message) { - xxx_messageInfo_PortSelector.Merge(m, src) +func (m *HTTPRewrite) XXX_Merge(src proto.Message) { + xxx_messageInfo_HTTPRewrite.Merge(m, src) } -func (m *PortSelector) XXX_Size() int { +func (m *HTTPRewrite) XXX_Size() int { return m.Size() } -func (m *PortSelector) XXX_DiscardUnknown() { - xxx_messageInfo_PortSelector.DiscardUnknown(m) +func (m *HTTPRewrite) XXX_DiscardUnknown() { + xxx_messageInfo_HTTPRewrite.DiscardUnknown(m) } -var xxx_messageInfo_PortSelector proto.InternalMessageInfo +var xxx_messageInfo_HTTPRewrite proto.InternalMessageInfo -func (m *PortSelector) GetNumber() uint32 { +func (m *HTTPRewrite) GetUri() string { if m != nil { - return m.Number + return m.Uri } - return 0 + return "" } -// 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 *HTTPRewrite) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" } -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} +// 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 *Percent) XXX_Unmarshal(b []byte) error { + +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{16} +} +func (m *StringMatch) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Percent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *StringMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Percent.Marshal(b, m, deterministic) + return xxx_messageInfo_StringMatch.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -3321,1032 +2959,1081 @@ func (m *Percent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Percent) XXX_Merge(src proto.Message) { - xxx_messageInfo_Percent.Merge(m, src) +func (m *StringMatch) XXX_Merge(src proto.Message) { + xxx_messageInfo_StringMatch.Merge(m, src) } -func (m *Percent) XXX_Size() int { +func (m *StringMatch) XXX_Size() int { return m.Size() } -func (m *Percent) XXX_DiscardUnknown() { - xxx_messageInfo_Percent.DiscardUnknown(m) +func (m *StringMatch) XXX_DiscardUnknown() { + xxx_messageInfo_StringMatch.DiscardUnknown(m) } -var xxx_messageInfo_Percent proto.InternalMessageInfo +var xxx_messageInfo_StringMatch proto.InternalMessageInfo -func (m *Percent) GetValue() float64 { - if m != nil { - return m.Value - } - return 0 +type isStringMatch_MatchType interface { + isStringMatch_MatchType() + MarshalTo([]byte) (int, error) + Size() int } -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") +type StringMatch_Exact struct { + Exact string `protobuf:"bytes,1,opt,name=exact,proto3,oneof" json:"exact,omitempty"` } - -func init() { - proto.RegisterFile("networking/v1alpha3/virtual_service.proto", fileDescriptor_e85a9a4fa9c17a22) +type StringMatch_Prefix struct { + Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3,oneof" json:"prefix,omitempty"` } - -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, +type StringMatch_Regex struct { + Regex string `protobuf:"bytes,3,opt,name=regex,proto3,oneof" json:"regex,omitempty"` } -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 +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 dAtA[:n], nil + return nil } -func (m *VirtualService) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *StringMatch) GetExact() string { + if x, ok := m.GetMatchType().(*StringMatch_Exact); ok { + return x.Exact + } + return "" } -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 - } +func (m *StringMatch) GetPrefix() string { + if x, ok := m.GetMatchType().(*StringMatch_Prefix); ok { + return x.Prefix } - 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 "" +} + +func (m *StringMatch) GetRegex() string { + if x, ok := m.GetMatchType().(*StringMatch_Regex); ok { + return x.Regex } - return len(dAtA) - i, nil + return "" } -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 +// 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), } - return dAtA[:n], nil } -func (m *Destination) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// 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 to be allowed for a given request. The interval + // between retries will be determined automatically (25ms+). When request + // `timeout` of the [HTTP route](https://istio.io/docs/reference/config/networking/virtual-service/#HTTPRoute) + // or `per_try_timeout` is configured, the actual number of retries attempted also depends on + // the specified request `timeout` and `per_try_timeout` values. + 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. + // Default is same value as request + // `timeout` of the [HTTP route](https://istio.io/docs/reference/config/networking/virtual-service/#HTTPRoute), + // which means no timeout. + 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 *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)) +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{17} +} +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 } - 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 b[:n], nil } - return len(dAtA) - i, 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) } -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 +var xxx_messageInfo_HTTPRetry proto.InternalMessageInfo + +func (m *HTTPRetry) GetAttempts() int32 { + if m != nil { + return m.Attempts } - return dAtA[:n], nil + return 0 } -func (m *HTTPRoute) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *HTTPRetry) GetPerTryTimeout() *types.Duration { + if m != nil { + return m.PerTryTimeout + } + return nil } -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 +func (m *HTTPRetry) GetRetryOn() string { + if m != nil { + return m.RetryOn } - 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 + return "" +} + +func (m *HTTPRetry) GetRetryRemoteLocalities() *types.BoolValue { + if m != nil { + return m.RetryRemoteLocalities } - 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)) + 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 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{18} +} +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 } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 + return b[:n], nil } - 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 +} +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 } - 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 + return nil +} + +func (m *CorsPolicy) GetAllowOrigins() []*StringMatch { + if m != nil { + return m.AllowOrigins } - 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 + return nil +} + +func (m *CorsPolicy) GetAllowMethods() []string { + if m != nil { + return m.AllowMethods } - 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 + return nil +} + +func (m *CorsPolicy) GetAllowHeaders() []string { + if m != nil { + return m.AllowHeaders } - 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 + return 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 +func (m *CorsPolicy) GetExposeHeaders() []string { + if m != nil { + return m.ExposeHeaders } - return dAtA[:n], nil -} - -func (m *Delegate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return nil } -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 +func (m *CorsPolicy) GetMaxAge() *types.Duration { + if m != nil { + return m.MaxAge } - return len(dAtA) - i, nil + return 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 +func (m *CorsPolicy) GetAllowCredentials() *types.BoolValue { + if m != nil { + return m.AllowCredentials } - return dAtA[:n], nil + return nil } -func (m *Headers) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// 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 *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)) +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{19} +} +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 } - i-- - dAtA[i] = 0xa + return b[:n], nil } - return len(dAtA) - i, 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) } -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 +var xxx_messageInfo_HTTPFaultInjection proto.InternalMessageInfo + +func (m *HTTPFaultInjection) GetDelay() *HTTPFaultInjection_Delay { + if m != nil { + return m.Delay } - return dAtA[:n], nil + return nil } -func (m *Headers_HeaderOperations) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *HTTPFaultInjection) GetAbort() *HTTPFaultInjection_Abort { + if m != nil { + return m.Abort + } + return nil } -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 +// 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{19, 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 } - return len(dAtA) - i, 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) } -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 +var xxx_messageInfo_HTTPFaultInjection_Delay proto.InternalMessageInfo + +type isHTTPFaultInjection_Delay_HttpDelayType interface { + isHTTPFaultInjection_Delay_HttpDelayType() + MarshalTo([]byte) (int, error) + Size() int } -func (m *TLSRoute) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type HTTPFaultInjection_Delay_FixedDelay struct { + FixedDelay *types.Duration `protobuf:"bytes,2,opt,name=fixed_delay,json=fixedDelay,proto3,oneof" json:"fixed_delay,omitempty"` +} +type HTTPFaultInjection_Delay_ExponentialDelay struct { + ExponentialDelay *types.Duration `protobuf:"bytes,3,opt,name=exponential_delay,json=exponentialDelay,proto3,oneof" json:"exponential_delay,omitempty"` } -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) +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 } - 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 - } + return nil +} + +// Deprecated: Do not use. +func (m *HTTPFaultInjection_Delay) GetPercent() int32 { + if m != nil { + return m.Percent } - 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 0 +} + +func (m *HTTPFaultInjection_Delay) GetFixedDelay() *types.Duration { + if x, ok := m.GetHttpDelayType().(*HTTPFaultInjection_Delay_FixedDelay); ok { + return x.FixedDelay } - return len(dAtA) - i, nil + return 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 +func (m *HTTPFaultInjection_Delay) GetExponentialDelay() *types.Duration { + if x, ok := m.GetHttpDelayType().(*HTTPFaultInjection_Delay_ExponentialDelay); ok { + return x.ExponentialDelay } - return dAtA[:n], nil + return nil } -func (m *TCPRoute) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *HTTPFaultInjection_Delay) GetPercentage() *Percent { + if m != nil { + return m.Percentage + } + return nil } -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) +// 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), } - 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 +} + +// 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{19, 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 } - 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 - } +} +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" json:"http_status,omitempty"` +} +type HTTPFaultInjection_Abort_GrpcStatus struct { + GrpcStatus string `protobuf:"bytes,3,opt,name=grpc_status,json=grpcStatus,proto3,oneof" json:"grpc_status,omitempty"` +} +type HTTPFaultInjection_Abort_Http2Error struct { + Http2Error string `protobuf:"bytes,4,opt,name=http2_error,json=http2Error,proto3,oneof" json:"http2_error,omitempty"` +} + +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 len(dAtA) - i, nil + return 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 +func (m *HTTPFaultInjection_Abort) GetHttpStatus() int32 { + if x, ok := m.GetErrorType().(*HTTPFaultInjection_Abort_HttpStatus); ok { + return x.HttpStatus } - return dAtA[:n], nil + return 0 } -func (m *HTTPMatchRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *HTTPFaultInjection_Abort) GetGrpcStatus() string { + if x, ok := m.GetErrorType().(*HTTPFaultInjection_Abort_GrpcStatus); ok { + return x.GrpcStatus + } + return "" } -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) +func (m *HTTPFaultInjection_Abort) GetHttp2Error() string { + if x, ok := m.GetErrorType().(*HTTPFaultInjection_Abort_Http2Error); ok { + return x.Http2Error } - 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 + return "" +} + +func (m *HTTPFaultInjection_Abort) GetPercentage() *Percent { + if m != nil { + return m.Percentage } - 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 + 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{20} +} +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 } - 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 +} +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 } - 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)) + 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{21} +} +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 } - i-- - dAtA[i] = 0x12 + return b[:n], nil } - 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 +} +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 len(dAtA) - i, nil + return 0 } -func (m *HTTPRouteDestination) Marshal() (dAtA []byte, err error) { +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((*RateLimit)(nil), "istio.networking.v1alpha3.RateLimit") + proto.RegisterType((*RateLimit_TokenBucket)(nil), "istio.networking.v1alpha3.RateLimit.TokenBucket") + proto.RegisterType((*RateLimit_LocalDescriptor)(nil), "istio.networking.v1alpha3.RateLimit.LocalDescriptor") + proto.RegisterType((*RateLimit_LocalDescriptor_Entry)(nil), "istio.networking.v1alpha3.RateLimit.LocalDescriptor.Entry") + proto.RegisterType((*RateLimit_Local)(nil), "istio.networking.v1alpha3.RateLimit.Local") + proto.RegisterType((*RateLimitDescriptor)(nil), "istio.networking.v1alpha3.RateLimitDescriptor") + proto.RegisterType((*RateLimitDescriptor_Entry)(nil), "istio.networking.v1alpha3.RateLimitDescriptor.Entry") + 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{ + // 2324 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0xcd, 0x73, 0x1b, 0x4b, + 0x11, 0xb7, 0x3e, 0x56, 0x1f, 0x2d, 0xc9, 0x96, 0x27, 0x79, 0xc9, 0x46, 0x84, 0xc4, 0x28, 0x24, + 0x2f, 0x0f, 0x78, 0x32, 0x38, 0x81, 0x4a, 0x3d, 0xf2, 0x12, 0x2c, 0x3b, 0x79, 0x8a, 0x71, 0x12, + 0x33, 0xf6, 0x0b, 0x55, 0x5c, 0xb6, 0x56, 0xab, 0xb1, 0x34, 0x64, 0xb5, 0xbb, 0x99, 0x1d, 0xd9, + 0x52, 0x71, 0xe4, 0x40, 0x71, 0xa2, 0xa8, 0xa2, 0x8a, 0x03, 0x47, 0xf8, 0x13, 0x38, 0xf1, 0x17, + 0x70, 0xe4, 0xc4, 0x91, 0x7a, 0xe4, 0xc0, 0x81, 0x2a, 0xb8, 0x72, 0xa3, 0xa8, 0xf9, 0xd8, 0xd5, + 0x4a, 0x76, 0xf4, 0x11, 0x12, 0x38, 0x69, 0xa7, 0xa7, 0x7f, 0x3d, 0x3d, 0xdd, 0x3d, 0x3d, 0x3d, + 0x2d, 0xf8, 0xc8, 0x23, 0xfc, 0xd4, 0x67, 0x2f, 0xa9, 0xd7, 0xdd, 0x3c, 0xf9, 0x96, 0xed, 0x06, + 0x3d, 0xfb, 0xce, 0xe6, 0x09, 0x65, 0x7c, 0x60, 0xbb, 0x56, 0x48, 0xd8, 0x09, 0x75, 0x48, 0x23, + 0x60, 0x3e, 0xf7, 0xd1, 0x15, 0x1a, 0x72, 0xea, 0x37, 0xc6, 0x80, 0x46, 0x04, 0xa8, 0x5d, 0xef, + 0xfa, 0x7e, 0xd7, 0x25, 0x9b, 0x76, 0x40, 0x37, 0x8f, 0x29, 0x71, 0x3b, 0x56, 0x9b, 0xf4, 0xec, + 0x13, 0xea, 0x33, 0x85, 0xad, 0x5d, 0xd3, 0x0c, 0x72, 0xd4, 0x1e, 0x1c, 0x6f, 0x76, 0x06, 0xcc, + 0xe6, 0xd4, 0xf7, 0xde, 0x34, 0x7f, 0xca, 0xec, 0x20, 0x20, 0x2c, 0x54, 0xf3, 0xf5, 0x9f, 0xa5, + 0x61, 0xf5, 0x85, 0xd2, 0xea, 0x50, 0x29, 0x85, 0x2e, 0x82, 0xd1, 0xf3, 0x43, 0x1e, 0x9a, 0xa9, + 0x8d, 0xcc, 0xed, 0x22, 0x56, 0x03, 0x54, 0x83, 0x42, 0xd7, 0xe6, 0xe4, 0xd4, 0x1e, 0x85, 0x66, + 0x5a, 0x4e, 0xc4, 0x63, 0x74, 0x0f, 0xb2, 0x3d, 0xce, 0x03, 0x33, 0xb3, 0x91, 0xb9, 0x5d, 0xda, + 0xfa, 0x6a, 0xe3, 0x8d, 0xfb, 0x69, 0xb4, 0x8e, 0x8e, 0x0e, 0xb0, 0x3f, 0xe0, 0x04, 0x4b, 0x04, + 0xfa, 0x36, 0x64, 0xb8, 0x1b, 0x9a, 0x86, 0x04, 0xde, 0x98, 0x01, 0x3c, 0xda, 0x3f, 0x54, 0x38, + 0xc1, 0x2f, 0x61, 0x4e, 0x60, 0x66, 0xe7, 0xc3, 0x76, 0x0e, 0x22, 0x98, 0x13, 0xa0, 0x2f, 0x41, + 0x91, 0x0c, 0x03, 0x9f, 0x71, 0x8b, 0xfb, 0x66, 0x4e, 0x6d, 0x42, 0x11, 0x8e, 0xfc, 0xfa, 0x4f, + 0xa0, 0xb4, 0x4b, 0x42, 0x4e, 0x3d, 0x69, 0x3e, 0x74, 0x19, 0xb2, 0x62, 0xe3, 0x66, 0x6a, 0x23, + 0x75, 0xbb, 0xd8, 0xcc, 0x7c, 0xb1, 0x9d, 0xc6, 0x92, 0x80, 0x2e, 0x41, 0x2e, 0x1c, 0xb4, 0x43, + 0xc2, 0xcd, 0xb4, 0x98, 0xc2, 0x7a, 0x84, 0xbe, 0x0b, 0x59, 0x21, 0xc9, 0xcc, 0x6c, 0xa4, 0x6e, + 0x97, 0xb6, 0x3e, 0x9c, 0xa1, 0xd4, 0x81, 0xcf, 0xf8, 0x21, 0x71, 0x89, 0xc3, 0x7d, 0x86, 0x25, + 0xa8, 0xfe, 0xd7, 0x02, 0x14, 0x63, 0xdb, 0x20, 0x04, 0x59, 0xcf, 0xee, 0x13, 0x73, 0x5d, 0x2e, + 0x20, 0xbf, 0xd1, 0x36, 0x18, 0x7d, 0x9b, 0x3b, 0x3d, 0xe9, 0x95, 0xd2, 0xd6, 0xd7, 0xe7, 0x18, + 0xf9, 0xa9, 0xe0, 0xc5, 0xe4, 0xd5, 0x80, 0x84, 0x1c, 0x2b, 0x24, 0x7a, 0x04, 0x06, 0x13, 0xf2, + 0xa5, 0xff, 0x4a, 0x5b, 0x9b, 0x8b, 0xf8, 0x29, 0x61, 0x12, 0xac, 0xd0, 0x68, 0x07, 0x0a, 0x8c, + 0x74, 0x28, 0x23, 0xce, 0x22, 0x9b, 0x95, 0x92, 0x34, 0x3b, 0x8e, 0x81, 0xe8, 0x21, 0x14, 0x3a, + 0xc4, 0x25, 0x22, 0x84, 0xcc, 0x8b, 0x52, 0xc8, 0x2c, 0x37, 0xee, 0x6a, 0x56, 0x1c, 0x83, 0xd0, + 0xf7, 0x20, 0xcf, 0xc8, 0x29, 0xa3, 0x9c, 0x98, 0x59, 0x89, 0xbf, 0x35, 0x57, 0x09, 0xc9, 0x8d, + 0x23, 0x18, 0xba, 0x03, 0x79, 0x4e, 0xfb, 0xc4, 0x1f, 0x70, 0x33, 0x27, 0x25, 0x5c, 0x69, 0xa8, + 0xc3, 0xd2, 0x88, 0x0e, 0x4b, 0x63, 0x57, 0x1f, 0x26, 0x1c, 0x71, 0xa2, 0x07, 0x62, 0x59, 0xce, + 0x28, 0x09, 0xcd, 0xbc, 0x04, 0xcd, 0x8d, 0x76, 0xc2, 0xd9, 0x08, 0x47, 0x20, 0xb4, 0x03, 0xc6, + 0xb1, 0x3d, 0x70, 0xb9, 0x59, 0x90, 0xe8, 0x8f, 0xe7, 0xa0, 0x1f, 0x0b, 0xde, 0x27, 0xde, 0x8f, + 0x89, 0xa3, 0x3c, 0x20, 0xb1, 0xe8, 0x01, 0xe4, 0xfa, 0x94, 0x31, 0x9f, 0x99, 0xc5, 0xb9, 0x5b, + 0x4f, 0x3a, 0x50, 0xa3, 0xd0, 0x67, 0xb0, 0xaa, 0xbe, 0xac, 0x80, 0x30, 0x87, 0x78, 0xdc, 0x44, + 0x52, 0xce, 0xd5, 0x33, 0x06, 0xf8, 0xfc, 0x89, 0xc7, 0xef, 0x6c, 0xbd, 0xb0, 0xdd, 0x01, 0x69, + 0xa6, 0xcd, 0x14, 0xae, 0x28, 0xdc, 0x81, 0x82, 0xa1, 0xe7, 0xb0, 0x3e, 0x29, 0xc8, 0xee, 0x12, + 0xf3, 0x82, 0x94, 0x55, 0x9f, 0x75, 0x00, 0x14, 0x33, 0xae, 0x4e, 0x48, 0xb3, 0xbb, 0x04, 0x3d, + 0x86, 0x92, 0xe3, 0xb3, 0xd0, 0x0a, 0x7c, 0x97, 0x3a, 0x23, 0x13, 0xa4, 0xa8, 0x9b, 0x33, 0x44, + 0xed, 0xf8, 0x2c, 0x3c, 0x90, 0xcc, 0x18, 0x9c, 0xf8, 0x1b, 0xdd, 0x87, 0x7c, 0x8f, 0xd8, 0x1d, + 0xc2, 0x42, 0xb3, 0x3a, 0x57, 0x9d, 0x96, 0xe2, 0xc4, 0x11, 0x04, 0xed, 0x00, 0x30, 0x9b, 0x13, + 0xcb, 0xa5, 0x7d, 0xca, 0xcd, 0x0f, 0xe6, 0xfa, 0x19, 0xdb, 0x9c, 0xec, 0x0b, 0x5e, 0x5c, 0x64, + 0xd1, 0xe7, 0x5e, 0xb6, 0x60, 0x54, 0x73, 0x7b, 0xd9, 0x42, 0xa9, 0x5a, 0xc5, 0xeb, 0xa7, 0xa4, + 0x1d, 0xfa, 0xce, 0x4b, 0xc2, 0xad, 0x41, 0xd0, 0x65, 0x76, 0x87, 0xe0, 0x55, 0x91, 0x86, 0xbd, + 0x8e, 0xa5, 0xd7, 0xc4, 0x97, 0x19, 0xe9, 0xfb, 0x27, 0xc4, 0x62, 0x24, 0x0c, 0x7c, 0x2f, 0x24, + 0xe3, 0x09, 0xcd, 0x78, 0x66, 0xe2, 0x52, 0x8c, 0x90, 0xa7, 0x7c, 0x4c, 0x8f, 0x01, 0x13, 0xf4, + 0xfa, 0xbf, 0x0c, 0x28, 0xc6, 0x9a, 0xa2, 0x03, 0x28, 0x75, 0x48, 0xe8, 0x30, 0x1a, 0x70, 0x9f, + 0x85, 0x3a, 0xab, 0x34, 0x16, 0xd9, 0xe4, 0x6e, 0x0c, 0xc3, 0x49, 0x11, 0xa8, 0x09, 0x86, 0xeb, + 0x3b, 0xb6, 0x2b, 0xf3, 0x62, 0x69, 0xeb, 0x6b, 0x8b, 0xc8, 0x6a, 0xec, 0x0b, 0x44, 0x6b, 0x05, + 0x2b, 0x68, 0xed, 0x57, 0x29, 0x28, 0x1d, 0xf9, 0x2f, 0x89, 0xd7, 0x1c, 0x08, 0x6b, 0xa1, 0x2f, + 0x03, 0xf4, 0xed, 0xa1, 0xc5, 0x05, 0x29, 0x94, 0xb9, 0xb8, 0x82, 0x8b, 0x7d, 0x7b, 0x28, 0x79, + 0x42, 0x74, 0x0b, 0xd6, 0xd4, 0x94, 0x88, 0x3f, 0xeb, 0x98, 0xba, 0x6a, 0xf1, 0x0a, 0xae, 0x28, + 0xf2, 0x01, 0x61, 0x8f, 0xa9, 0xeb, 0xa2, 0x07, 0x50, 0x11, 0x93, 0x16, 0xf5, 0x38, 0x61, 0x27, + 0xb6, 0xab, 0xf3, 0xd6, 0x8c, 0x03, 0x5f, 0x16, 0xfc, 0x4f, 0x34, 0x7b, 0xed, 0x1f, 0x29, 0x58, + 0x93, 0x9a, 0x8e, 0xf7, 0x8e, 0x8e, 0x20, 0x4f, 0x3c, 0x95, 0x09, 0x94, 0xf1, 0x3e, 0x59, 0x7c, + 0xc3, 0x63, 0x31, 0x8d, 0x47, 0x9e, 0xcc, 0x0f, 0x5a, 0x14, 0x3a, 0x84, 0xb2, 0x54, 0xdd, 0x6a, + 0x4b, 0x03, 0x68, 0x5b, 0x7e, 0x73, 0x21, 0xd1, 0x09, 0xc3, 0xe1, 0x12, 0x1f, 0x0f, 0x6a, 0x9b, + 0x60, 0xc8, 0x65, 0x50, 0x15, 0x32, 0x2f, 0xc9, 0x48, 0xdd, 0x69, 0x58, 0x7c, 0x8a, 0xcb, 0xfe, + 0x44, 0x9c, 0x6e, 0x7d, 0x99, 0xa9, 0x41, 0xed, 0xf7, 0x29, 0x30, 0xa4, 0xa2, 0x67, 0xf4, 0x49, + 0xbd, 0x03, 0x7d, 0xd0, 0x8b, 0xc9, 0xd8, 0x53, 0xd7, 0xd1, 0xdd, 0xb7, 0x31, 0xdf, 0x44, 0x04, + 0x36, 0x2f, 0xc1, 0xc5, 0xf1, 0xb9, 0xb5, 0xc2, 0x80, 0x38, 0xf4, 0x98, 0x12, 0x56, 0xff, 0x69, + 0x1a, 0x2e, 0x9c, 0x13, 0xbe, 0xe8, 0xd9, 0xb4, 0x0b, 0xef, 0x2e, 0x17, 0xff, 0x53, 0xce, 0xab, + 0xfd, 0x26, 0xf5, 0x66, 0x43, 0xd7, 0xa1, 0x12, 0xbe, 0xa4, 0x81, 0x45, 0x8f, 0x2d, 0x22, 0x53, + 0xb7, 0x30, 0x78, 0x01, 0x97, 0x04, 0xf1, 0xc9, 0xf1, 0x23, 0x99, 0x97, 0x3f, 0x84, 0xd5, 0xc9, + 0x43, 0x2b, 0xe3, 0xb4, 0xd8, 0x5a, 0xc1, 0x15, 0x4d, 0x57, 0xa9, 0x0a, 0x6d, 0x00, 0x90, 0x61, + 0xc0, 0x48, 0x18, 0x52, 0xdf, 0x93, 0xf7, 0x9f, 0x60, 0x4a, 0xd0, 0x9a, 0xeb, 0xb0, 0x26, 0xb4, + 0x1a, 0x25, 0xac, 0x70, 0x1f, 0x0a, 0xd1, 0x3d, 0x1a, 0x57, 0x18, 0xa9, 0x44, 0x85, 0x71, 0x15, + 0x8a, 0xe2, 0x37, 0x0c, 0x6c, 0x27, 0x0a, 0x87, 0x31, 0xa1, 0xfe, 0xb7, 0x0c, 0xe4, 0x75, 0xa2, + 0x44, 0x4f, 0xc5, 0x25, 0x28, 0xf5, 0xd1, 0xf1, 0x70, 0x67, 0x7e, 0x76, 0xd5, 0xbf, 0xcf, 0x03, + 0xa2, 0x4e, 0x58, 0x88, 0x23, 0x19, 0xe8, 0xb9, 0x28, 0x28, 0x54, 0x72, 0xd3, 0xf1, 0xfe, 0x56, + 0xf2, 0x62, 0x21, 0xb5, 0x3f, 0xa4, 0xa1, 0x3a, 0x3d, 0x8d, 0x9e, 0x41, 0x26, 0x94, 0x01, 0x2c, + 0x1c, 0x7d, 0xff, 0x2d, 0x16, 0x68, 0x1c, 0x12, 0xae, 0x1c, 0x2e, 0x04, 0x09, 0x79, 0x76, 0xa7, + 0xa3, 0x83, 0xf7, 0xad, 0xe4, 0x6d, 0x77, 0x3a, 0x5a, 0x9e, 0xdd, 0xe9, 0x88, 0xba, 0x52, 0x25, + 0x74, 0x59, 0x46, 0x17, 0xb1, 0x1e, 0xd5, 0xbe, 0x03, 0x85, 0x68, 0xe1, 0x45, 0xcf, 0xef, 0x27, + 0xe9, 0x7b, 0x29, 0x81, 0x8b, 0x16, 0x58, 0x06, 0x57, 0xff, 0x75, 0x0a, 0x0a, 0x51, 0xb5, 0x8d, + 0x5a, 0x93, 0x55, 0xe7, 0xc7, 0xb3, 0x2b, 0x74, 0x59, 0x74, 0x6e, 0x73, 0xce, 0x68, 0x7b, 0xc0, + 0x49, 0xa8, 0xaa, 0x66, 0x5d, 0x7c, 0x6e, 0x4f, 0x16, 0x9f, 0xb3, 0xea, 0xd7, 0x37, 0x14, 0x9e, + 0xf5, 0x5f, 0x0a, 0xcd, 0x74, 0x41, 0x2f, 0x6e, 0x9b, 0xa4, 0x66, 0xdf, 0x98, 0x21, 0x6f, 0xff, + 0xee, 0x94, 0x62, 0xef, 0x50, 0xa7, 0xdf, 0x15, 0xa1, 0x3a, 0x5d, 0x6f, 0xc7, 0xa7, 0xab, 0x94, + 0x38, 0x5d, 0xf7, 0x20, 0x33, 0x60, 0x54, 0x9f, 0x97, 0x59, 0x05, 0xdb, 0x21, 0x67, 0xd4, 0xeb, + 0x2a, 0x79, 0x02, 0x22, 0xaa, 0xbd, 0xd0, 0xe9, 0x91, 0x7e, 0x74, 0x38, 0x16, 0x05, 0x6b, 0x94, + 0xac, 0x16, 0x09, 0xef, 0xf9, 0x1d, 0x7d, 0xeb, 0x2d, 0x8c, 0x57, 0x28, 0xb4, 0x0b, 0x45, 0x7b, + 0xc0, 0x7b, 0x3e, 0xa3, 0x7c, 0xb4, 0x40, 0xad, 0x9d, 0x14, 0x31, 0x06, 0x22, 0x3c, 0xae, 0xc8, + 0xd4, 0x6b, 0xef, 0xde, 0x12, 0x2f, 0x98, 0xe8, 0x0c, 0xe9, 0x7c, 0x1b, 0xd5, 0x69, 0x48, 0x3f, + 0xb9, 0x72, 0xf2, 0xce, 0x97, 0xdf, 0xa8, 0x0d, 0x95, 0xd0, 0x1f, 0x30, 0x87, 0x58, 0xae, 0xdd, + 0x26, 0xae, 0x28, 0xd3, 0xc5, 0x6a, 0x9f, 0x2e, 0xb3, 0xda, 0xa1, 0x14, 0xb0, 0x2f, 0xf1, 0x6a, + 0xc9, 0x72, 0x98, 0x20, 0x4d, 0xbc, 0x85, 0x0b, 0x53, 0x6f, 0x61, 0x0b, 0xca, 0xaf, 0x06, 0x84, + 0x8d, 0xac, 0xc0, 0x66, 0x76, 0x3f, 0x34, 0x8b, 0xf3, 0xf3, 0xc3, 0xf4, 0xf2, 0x3f, 0x10, 0xf8, + 0x03, 0x09, 0x57, 0xab, 0x97, 0x5e, 0x8d, 0x29, 0xa2, 0xe6, 0xa1, 0x5d, 0xcf, 0x67, 0xc4, 0x1a, + 0x30, 0x6a, 0x39, 0x76, 0x48, 0x64, 0x99, 0x5c, 0xc0, 0x15, 0x45, 0xfe, 0x9c, 0xd1, 0x1d, 0x3b, + 0x24, 0xa8, 0x07, 0x6b, 0xa7, 0x94, 0xf7, 0xfc, 0x41, 0x5c, 0x01, 0x9a, 0x65, 0xa9, 0xcb, 0xc3, + 0x65, 0x74, 0xf9, 0xa1, 0x12, 0x31, 0x61, 0xff, 0xd5, 0xd3, 0x09, 0x22, 0xfa, 0x08, 0xaa, 0xda, + 0xe4, 0xe3, 0xfb, 0xa3, 0x22, 0x43, 0x7f, 0x4d, 0xd1, 0x9f, 0x45, 0xe4, 0x5a, 0x1b, 0xca, 0x49, + 0x51, 0xe7, 0x24, 0xa6, 0xfb, 0xc9, 0xc4, 0xb4, 0x78, 0xa4, 0x25, 0x12, 0xdf, 0x43, 0x58, 0x3f, + 0xe3, 0xc0, 0xa5, 0x32, 0xe7, 0x31, 0x54, 0xa7, 0x5d, 0xf0, 0x5e, 0x14, 0xa5, 0x70, 0xe1, 0x1c, + 0xf3, 0xbe, 0x8f, 0xa5, 0xea, 0xbf, 0x4d, 0xc3, 0xc5, 0xf3, 0xde, 0xf4, 0xe8, 0xa9, 0x2c, 0xc5, + 0xa2, 0xe1, 0x02, 0xe9, 0x29, 0x01, 0x56, 0xf9, 0x3d, 0x89, 0x17, 0x97, 0xd8, 0x29, 0xa1, 0xdd, + 0x9e, 0x2a, 0x5c, 0x0d, 0xac, 0x47, 0xc9, 0xf7, 0x58, 0x7e, 0xe9, 0xf7, 0xd8, 0x5e, 0xb6, 0x90, + 0xa9, 0xe6, 0xff, 0x07, 0x2f, 0xa4, 0x11, 0x54, 0xff, 0x4f, 0x06, 0xaa, 0xff, 0x3d, 0x0d, 0xeb, + 0x67, 0xee, 0x29, 0xb4, 0x09, 0x17, 0x12, 0x60, 0x2b, 0x1c, 0xb4, 0x3d, 0x12, 0x37, 0xe6, 0x50, + 0x62, 0xea, 0x50, 0xcd, 0xc4, 0x19, 0x31, 0x9d, 0xc8, 0x88, 0x37, 0xe2, 0x8c, 0xa8, 0xf0, 0xaa, + 0xa8, 0x8c, 0x52, 0x9a, 0x42, 0x22, 0x67, 0x3a, 0x6d, 0xaa, 0xde, 0xda, 0x83, 0x65, 0xae, 0xd5, + 0xa5, 0xf2, 0xa6, 0x31, 0x95, 0x37, 0xcf, 0x4b, 0x22, 0xb9, 0xf3, 0x93, 0xc8, 0x7f, 0x7b, 0xc0, + 0xeb, 0xff, 0x4e, 0x03, 0x3a, 0x5b, 0xae, 0xa0, 0x0d, 0x28, 0x86, 0x1e, 0xb5, 0x12, 0xcd, 0x4f, + 0xe5, 0xc0, 0x42, 0xe8, 0xd1, 0x96, 0x6c, 0x82, 0xbe, 0xc1, 0x1f, 0xe9, 0xb9, 0xfe, 0xc8, 0x24, + 0xfc, 0xd1, 0x99, 0x36, 0xb5, 0x31, 0x37, 0x2d, 0x9f, 0x55, 0x76, 0x29, 0x5b, 0xe7, 0x16, 0xb0, + 0x75, 0xfe, 0xfd, 0xd8, 0x7a, 0x2f, 0x5b, 0xc8, 0x56, 0x0d, 0x3c, 0x19, 0x81, 0x75, 0x07, 0xca, + 0xc9, 0xbe, 0xa0, 0x10, 0x18, 0x15, 0x47, 0x45, 0x55, 0xf4, 0x5c, 0x4d, 0x16, 0x1d, 0xfa, 0x31, + 0x32, 0x2e, 0x26, 0x6e, 0x40, 0x25, 0xea, 0x24, 0x5a, 0x8e, 0xdf, 0x21, 0xda, 0xbe, 0xe5, 0x88, + 0xb8, 0xe3, 0x77, 0x48, 0xfd, 0x53, 0x28, 0x25, 0xfa, 0x7e, 0xcb, 0xae, 0x51, 0x27, 0x50, 0x4a, + 0x24, 0x53, 0x74, 0x09, 0x0c, 0x32, 0xb4, 0x1d, 0xdd, 0x10, 0x6e, 0xad, 0x60, 0x35, 0x44, 0x26, + 0xe4, 0x02, 0x46, 0x8e, 0xe9, 0x50, 0x49, 0x68, 0xad, 0x60, 0x3d, 0x16, 0x08, 0x46, 0xba, 0x64, + 0x18, 0x3f, 0xe2, 0xd4, 0xb0, 0x59, 0x06, 0x90, 0xe5, 0xa7, 0xc5, 0x47, 0x01, 0xa9, 0xff, 0x25, + 0xa5, 0x3b, 0xbf, 0x44, 0x58, 0xf6, 0x3a, 0x14, 0x6c, 0xce, 0x49, 0x3f, 0xe0, 0xaa, 0xdb, 0x61, + 0xe8, 0x08, 0x8c, 0x88, 0x68, 0x1b, 0xd6, 0x02, 0xc2, 0x2c, 0xf1, 0xb2, 0x8b, 0x9a, 0x97, 0xe9, + 0x79, 0xbd, 0x8c, 0x4a, 0x40, 0xd8, 0x11, 0x1b, 0x1d, 0xe9, 0x16, 0xe6, 0x15, 0xf1, 0xdc, 0x12, + 0x02, 0x7c, 0x4f, 0xa7, 0x02, 0xd9, 0x9d, 0x1c, 0x3d, 0xf7, 0x10, 0x86, 0xcb, 0x6a, 0x4a, 0x24, + 0x4e, 0xf1, 0x90, 0x16, 0xaf, 0x6d, 0xca, 0xc5, 0x03, 0x59, 0x15, 0x7e, 0xb5, 0x33, 0xab, 0x34, + 0x7d, 0xdf, 0x95, 0xfd, 0x41, 0xfc, 0x81, 0x84, 0x62, 0x89, 0xdc, 0x8f, 0x81, 0xf5, 0x7f, 0xa6, + 0x01, 0xc6, 0x5d, 0x3a, 0x74, 0x13, 0xca, 0xb6, 0xeb, 0xfa, 0xa7, 0x96, 0xcf, 0x68, 0x97, 0x7a, + 0xfa, 0x9c, 0xa5, 0xcd, 0x14, 0x2e, 0x49, 0xfa, 0x73, 0x49, 0x46, 0xdf, 0x87, 0x4a, 0x92, 0x2d, + 0x2a, 0xe3, 0x16, 0xbd, 0xfa, 0xca, 0x09, 0x59, 0xa1, 0x08, 0x17, 0x25, 0x4c, 0x55, 0xb4, 0xd1, + 0x81, 0x55, 0x4c, 0x4f, 0x15, 0x6d, 0xcc, 0x14, 0x5d, 0x54, 0x99, 0x04, 0x53, 0x54, 0xea, 0xdc, + 0x84, 0x55, 0x32, 0x0c, 0xfc, 0xf1, 0x1d, 0x23, 0xf3, 0x64, 0x11, 0x57, 0x14, 0x35, 0x62, 0xdb, + 0x82, 0x7c, 0xdf, 0x1e, 0x5a, 0x76, 0x97, 0x98, 0xc6, 0x3c, 0xef, 0xe4, 0xfa, 0xf6, 0x70, 0xbb, + 0x4b, 0xd0, 0x67, 0xb0, 0xae, 0xd6, 0x77, 0x18, 0xe9, 0x10, 0x8f, 0x53, 0xdb, 0x0d, 0x75, 0x63, + 0x7a, 0x96, 0xd5, 0xab, 0x12, 0xb4, 0x33, 0xc6, 0xd4, 0x7f, 0x61, 0x00, 0x3a, 0xdb, 0x3b, 0x46, + 0x4f, 0xc0, 0xe8, 0x10, 0xd7, 0x1e, 0x2d, 0xf2, 0x64, 0x3f, 0x83, 0x6e, 0xec, 0x0a, 0x28, 0x56, + 0x12, 0x84, 0x28, 0xbb, 0x1d, 0x5d, 0x33, 0x4b, 0x8b, 0xda, 0x16, 0x50, 0xac, 0x24, 0xd4, 0x7e, + 0x9e, 0x06, 0x43, 0xca, 0x46, 0x57, 0x21, 0x1f, 0x75, 0xa3, 0x55, 0xe4, 0x8b, 0x98, 0x88, 0x48, + 0x68, 0x1b, 0x4a, 0xc7, 0x74, 0x48, 0x3a, 0x96, 0xda, 0xc3, 0xbc, 0x98, 0x97, 0xc7, 0xa6, 0xb5, + 0x82, 0x41, 0x82, 0xd4, 0x02, 0x2d, 0x58, 0x17, 0x5e, 0xf2, 0x94, 0x9d, 0xb4, 0xa0, 0x79, 0x8d, + 0xc0, 0xd6, 0x0a, 0xae, 0x26, 0x50, 0x4a, 0x52, 0x13, 0x20, 0xd1, 0xef, 0x36, 0x16, 0xee, 0x77, + 0x27, 0x50, 0xcd, 0x75, 0x58, 0xeb, 0x71, 0x1e, 0x28, 0x35, 0x64, 0x2a, 0xa8, 0xfd, 0x39, 0x05, + 0x86, 0x34, 0x0e, 0xba, 0x05, 0x25, 0x39, 0x19, 0x72, 0x9b, 0x0f, 0x42, 0x55, 0x2a, 0xc4, 0x5b, + 0x12, 0x33, 0x87, 0x72, 0x02, 0x7d, 0x05, 0x4a, 0x5d, 0x16, 0x38, 0x11, 0x5f, 0x94, 0x68, 0x40, + 0x10, 0xc7, 0x2c, 0x02, 0xb0, 0xa5, 0xbb, 0x4e, 0x71, 0xaf, 0x48, 0x12, 0x55, 0xdb, 0xe9, 0x5d, + 0x6c, 0xa7, 0x0c, 0x20, 0x17, 0x90, 0x3b, 0xd9, 0xcb, 0x16, 0x52, 0xd5, 0x74, 0xec, 0xbc, 0xfa, + 0x16, 0x94, 0x93, 0xff, 0x79, 0x89, 0x22, 0xc8, 0x1b, 0xf4, 0xdb, 0x84, 0xe9, 0x8e, 0xae, 0x1e, + 0xed, 0x65, 0x0b, 0xe9, 0x6a, 0x46, 0xbd, 0x97, 0xeb, 0xd7, 0x21, 0x1f, 0xfd, 0xcb, 0x10, 0x5f, + 0x2e, 0x82, 0x3b, 0xa5, 0x2f, 0x97, 0x66, 0xe3, 0x8f, 0xaf, 0xaf, 0xa5, 0xfe, 0xf4, 0xfa, 0x5a, + 0xea, 0x8b, 0xd7, 0xd7, 0x52, 0x3f, 0xda, 0x50, 0xea, 0x52, 0x5f, 0xfe, 0x55, 0x7a, 0xce, 0x7f, + 0xaf, 0xed, 0x9c, 0xf4, 0xed, 0x9d, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x03, 0xc1, 0x4a, + 0x99, 0x1d, 0x00, 0x00, +} + +func (m *VirtualService) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4356,12 +4043,12 @@ func (m *HTTPRouteDestination) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *HTTPRouteDestination) MarshalTo(dAtA []byte) (int, error) { +func (m *VirtualService) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HTTPRouteDestination) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *VirtualService) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -4370,39 +4057,79 @@ func (m *HTTPRouteDestination) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 + 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 -= size - i = encodeVarintVirtualService(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a } - i-- - dAtA[i] = 0x3a } - if m.Weight != 0 { - i = encodeVarintVirtualService(dAtA, i, uint64(m.Weight)) - i-- - dAtA[i] = 0x10 + 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 m.Destination != nil { - { - size, err := m.Destination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + 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 -= 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 } - i-- - dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *RouteDestination) Marshal() (dAtA []byte, err error) { +func (m *Destination) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4412,12 +4139,12 @@ func (m *RouteDestination) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RouteDestination) MarshalTo(dAtA []byte) (int, error) { +func (m *Destination) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RouteDestination) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Destination) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -4426,14 +4153,9 @@ func (m *RouteDestination) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 { + if m.Port != nil { { - size, err := m.Destination.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Port.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -4441,12 +4163,26 @@ func (m *RouteDestination) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 *L4MatchAttributes) Marshal() (dAtA []byte, err error) { +func (m *HTTPRoute) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4456,12 +4192,12 @@ func (m *L4MatchAttributes) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *L4MatchAttributes) MarshalTo(dAtA []byte) (int, error) { +func (m *HTTPRoute) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *L4MatchAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *HTTPRoute) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -4470,143 +4206,193 @@ func (m *L4MatchAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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))) + if m.RateLimit != nil { + { + size, err := m.RateLimit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x32 + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa } - 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 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 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 m.MirrorPercentage != nil { + { + size, err := m.MirrorPercentage.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } - } - 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)) + dAtA[i] = 0x1 i-- - dAtA[i] = 0x10 + dAtA[i] = 0x9a } - 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 + 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 } - 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.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 len(m.SourceNamespace) > 0 { - i -= len(m.SourceNamespace) - copy(dAtA[i:], m.SourceNamespace) - i = encodeVarintVirtualService(dAtA, i, uint64(len(m.SourceNamespace))) + 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 + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 } - 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 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 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.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.Port != 0 { - i = encodeVarintVirtualService(dAtA, i, uint64(m.Port)) + 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] = 0x18 + dAtA[i] = 0x42 } - 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]))) + 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.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]))) + 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 } @@ -4614,7 +4400,7 @@ func (m *TLSMatchAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *HTTPRedirect) Marshal() (dAtA []byte, err error) { +func (m *RateLimit) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4624,12 +4410,12 @@ func (m *HTTPRedirect) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *HTTPRedirect) MarshalTo(dAtA []byte) (int, error) { +func (m *RateLimit) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HTTPRedirect) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RateLimit) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -4638,29 +4424,54 @@ func (m *HTTPRedirect) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 m.RateLimitSpecifier != nil { + { + size := m.RateLimitSpecifier.Size() + i -= size + if _, err := m.RateLimitSpecifier.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - 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.Descriptors) > 0 { + for iNdEx := len(m.Descriptors) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Descriptors[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - if len(m.Uri) > 0 { - i -= len(m.Uri) - copy(dAtA[i:], m.Uri) - i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Uri))) + return len(dAtA) - i, nil +} + +func (m *RateLimit_Local_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RateLimit_Local_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Local != nil { + { + size, err := m.Local.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 } return len(dAtA) - i, nil } - -func (m *HTTPRewrite) Marshal() (dAtA []byte, err error) { +func (m *RateLimit_TokenBucket) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4670,12 +4481,12 @@ func (m *HTTPRewrite) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *HTTPRewrite) MarshalTo(dAtA []byte) (int, error) { +func (m *RateLimit_TokenBucket) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HTTPRewrite) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RateLimit_TokenBucket) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -4684,24 +4495,32 @@ func (m *HTTPRewrite) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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))) + if m.FillInterval != nil { + { + size, err := m.FillInterval.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } - if len(m.Uri) > 0 { - i -= len(m.Uri) - copy(dAtA[i:], m.Uri) - i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Uri))) + if m.TokensPerFill != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.TokensPerFill)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x10 + } + if m.MaxTokens != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.MaxTokens)) + i-- + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *StringMatch) Marshal() (dAtA []byte, err error) { +func (m *RateLimit_LocalDescriptor) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4711,12 +4530,12 @@ func (m *StringMatch) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *StringMatch) MarshalTo(dAtA []byte) (int, error) { +func (m *RateLimit_LocalDescriptor) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *StringMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RateLimit_LocalDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -4725,61 +4544,77 @@ func (m *StringMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if m.MatchType != nil { + if m.TokenBucket != nil { { - size := m.MatchType.Size() - i -= size - if _, err := m.MatchType.MarshalTo(dAtA[i:]); err != nil { + size, err := m.TokenBucket.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Entries) > 0 { + for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Entries[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 *StringMatch_Exact) MarshalTo(dAtA []byte) (int, error) { +func (m *RateLimit_LocalDescriptor_Entry) Marshal() (dAtA []byte, err error) { size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil } -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) { +func (m *RateLimit_LocalDescriptor_Entry) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *StringMatch_Prefix) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RateLimit_LocalDescriptor_Entry) 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) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[: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 + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *HTTPRetry) Marshal() (dAtA []byte, err error) { + +func (m *RateLimit_Local) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4789,12 +4624,12 @@ func (m *HTTPRetry) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *HTTPRetry) MarshalTo(dAtA []byte) (int, error) { +func (m *RateLimit_Local) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HTTPRetry) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RateLimit_Local) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -4803,28 +4638,23 @@ func (m *HTTPRetry) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 + if len(m.Descriptors) > 0 { + for iNdEx := len(m.Descriptors) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Descriptors[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintVirtualService(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 } - 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 { + if m.TokenBucket != nil { { - size, err := m.PerTryTimeout.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.TokenBucket.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -4832,17 +4662,12 @@ func (m *HTTPRetry) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *CorsPolicy) Marshal() (dAtA []byte, err error) { +func (m *RateLimitDescriptor) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4852,12 +4677,12 @@ func (m *CorsPolicy) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *CorsPolicy) MarshalTo(dAtA []byte) (int, error) { +func (m *RateLimitDescriptor) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *CorsPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RateLimitDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -4866,10 +4691,10 @@ func (m *CorsPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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-- { + if len(m.Entries) > 0 { + for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.AllowOrigins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -4877,73 +4702,13 @@ func (m *CorsPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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) { +func (m *RateLimitDescriptor_Entry) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4953,12 +4718,12 @@ func (m *HTTPFaultInjection) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *HTTPFaultInjection) MarshalTo(dAtA []byte) (int, error) { +func (m *RateLimitDescriptor_Entry) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HTTPFaultInjection) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RateLimitDescriptor_Entry) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -4967,34 +4732,64 @@ func (m *HTTPFaultInjection) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if m.Abort != nil { + if m.EntrySpecifier != nil { { - size, err := m.Abort.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { + size := m.EntrySpecifier.Size() + i -= size + if _, err := m.EntrySpecifier.MarshalTo(dAtA[i:]); 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)) + if m.SkipIfError { + i-- + if m.SkipIfError { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } i-- + dAtA[i] = 0x10 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Key))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *HTTPFaultInjection_Delay) Marshal() (dAtA []byte, err error) { +func (m *RateLimitDescriptor_Entry_RequestHeader) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RateLimitDescriptor_Entry_RequestHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.RequestHeader) + copy(dAtA[i:], m.RequestHeader) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.RequestHeader))) + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil +} +func (m *RateLimitDescriptor_Entry_Expression) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RateLimitDescriptor_Entry_Expression) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Expression) + copy(dAtA[i:], m.Expression) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Expression))) + i-- + dAtA[i] = 0x22 + 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]) @@ -5004,12 +4799,12 @@ func (m *HTTPFaultInjection_Delay) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *HTTPFaultInjection_Delay) MarshalTo(dAtA []byte) (int, error) { +func (m *Delegate) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HTTPFaultInjection_Delay) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Delegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -5018,45 +4813,50 @@ func (m *HTTPFaultInjection_Delay) MarshalToSizedBuffer(dAtA []byte) (int, error 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)) - } + 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] = 0x2a - } - if m.HttpDelayType != nil { - { - size := m.HttpDelayType.Size() - i -= size - if _, err := m.HttpDelayType.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } + dAtA[i] = 0x12 } - if m.Percent != 0 { - i = encodeVarintVirtualService(dAtA, i, uint64(m.Percent)) + 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] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *HTTPFaultInjection_Delay_FixedDelay) MarshalTo(dAtA []byte) (int, error) { +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 *HTTPFaultInjection_Delay_FixedDelay) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Headers) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.FixedDelay != nil { + _ = 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.FixedDelay.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Response.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -5066,18 +4866,9 @@ func (m *HTTPFaultInjection_Delay_FixedDelay) MarshalToSizedBuffer(dAtA []byte) i-- dAtA[i] = 0x12 } - return len(dAtA) - i, nil -} -func (m *HTTPFaultInjection_Delay_ExponentialDelay) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HTTPFaultInjection_Delay_ExponentialDelay) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ExponentialDelay != nil { + if m.Request != nil { { - size, err := m.ExponentialDelay.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Request.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -5085,11 +4876,12 @@ func (m *HTTPFaultInjection_Delay_ExponentialDelay) MarshalToSizedBuffer(dAtA [] i = encodeVarintVirtualService(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *HTTPFaultInjection_Abort) Marshal() (dAtA []byte, err error) { + +func (m *Headers_HeaderOperations) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5099,12 +4891,12 @@ func (m *HTTPFaultInjection_Abort) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *HTTPFaultInjection_Abort) MarshalTo(dAtA []byte) (int, error) { +func (m *Headers_HeaderOperations) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HTTPFaultInjection_Abort) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Headers_HeaderOperations) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -5113,71 +4905,112 @@ func (m *HTTPFaultInjection_Abort) MarshalToSizedBuffer(dAtA []byte) (int, error 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)) + 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 } - 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 - } + 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 *HTTPFaultInjection_Abort_HttpStatus) MarshalTo(dAtA []byte) (int, error) { +func (m *TLSRoute) Marshal() (dAtA []byte, err error) { size := m.Size() - return m.MarshalToSizedBuffer(dAtA[: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_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) { +func (m *TLSRoute) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HTTPFaultInjection_Abort_GrpcStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TLSRoute) 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 + _ = 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 *HTTPFaultInjection_Abort_Http2Error) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[: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) { +func (m *TCPRoute) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5187,12 +5020,12 @@ func (m *PortSelector) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PortSelector) MarshalTo(dAtA []byte) (int, error) { +func (m *TCPRoute) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PortSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TCPRoute) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -5201,15 +5034,38 @@ func (m *PortSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 + 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 *Percent) Marshal() (dAtA []byte, err error) { +func (m *HTTPMatchRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5219,12 +5075,12 @@ func (m *Percent) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Percent) MarshalTo(dAtA []byte) (int, error) { +func (m *HTTPMatchRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Percent) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *HTTPMatchRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -5233,760 +5089,1140 @@ func (m *Percent) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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)))) + 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] = 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 + dAtA[i] = 0x6a } - 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.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.Gateways) > 0 { - for _, s := range m.Gateways { - l = len(s) - n += 1 + l + sovVirtualService(uint64(l)) - } + 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 len(m.Http) > 0 { - for _, e := range m.Http { - l = e.Size() - n += 1 + l + sovVirtualService(uint64(l)) + if m.IgnoreUriCase { + i-- + if m.IgnoreUriCase { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } + i-- + dAtA[i] = 0x50 } - if len(m.Tcp) > 0 { - for _, e := range m.Tcp { - l = e.Size() - n += 1 + l + sovVirtualService(uint64(l)) + 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.Tls) > 0 { - for _, e := range m.Tls { - l = e.Size() - n += 1 + l + sovVirtualService(uint64(l)) + 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.ExportTo) > 0 { - for _, s := range m.ExportTo { - l = len(s) - n += 1 + l + sovVirtualService(uint64(l)) + 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.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if m.Port != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x30 } - return n -} - -func (m *Destination) Size() (n int) { - if m == nil { - return 0 + 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 + } } - var l int - _ = l - l = len(m.Host) - if l > 0 { - n += 1 + l + sovVirtualService(uint64(l)) + 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 } - l = len(m.Subset) - if l > 0 { - n += 1 + l + sovVirtualService(uint64(l)) + 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.Port != nil { - l = m.Port.Size() - n += 1 + l + sovVirtualService(uint64(l)) + 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.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + 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 n + return len(dAtA) - i, nil } -func (m *HTTPRoute) Size() (n int) { - if m == nil { - return 0 +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 len(m.Match) > 0 { - for _, e := range m.Match { - l = e.Size() - n += 1 + l + sovVirtualService(uint64(l)) - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Route) > 0 { - for _, e := range m.Route { - l = e.Size() - n += 1 + l + sovVirtualService(uint64(l)) + 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.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.Weight != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Weight)) + i-- + dAtA[i] = 0x10 } - if m.Timeout != nil { - l = m.Timeout.Size() - n += 1 + l + sovVirtualService(uint64(l)) + 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 } - if m.Retries != nil { - l = m.Retries.Size() - n += 1 + l + sovVirtualService(uint64(l)) + 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 } - if m.Fault != nil { - l = m.Fault.Size() - n += 1 + l + sovVirtualService(uint64(l)) + 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.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.Weight != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Weight)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + 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 n + return len(dAtA) - i, nil } -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) +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 n + return dAtA[:n], nil } -func (m *Headers) Size() (n int) { - if m == nil { - return 0 - } +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.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) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return n -} - -func (m *Headers_HeaderOperations) Size() (n int) { - if m == nil { - return 0 + 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 } - 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.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.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.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.Remove) > 0 { - for _, s := range m.Remove { - l = len(s) - n += 1 + l + sovVirtualService(uint64(l)) - } + 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.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if m.Port != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x10 } - return n + 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 *TLSRoute) Size() (n int) { - if m == nil { - return 0 +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 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) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return n -} - -func (m *TCPRoute) Size() (n int) { - if m == nil { - return 0 + 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 } - 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.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.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 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 { - 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)) - } + i = encodeVarintVirtualService(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x18 } - 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 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 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)) + 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 } } - 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 + return len(dAtA) - i, nil } -func (m *HTTPRouteDestination) Size() (n int) { - if m == nil { - return 0 +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.Destination != nil { - l = m.Destination.Size() - n += 1 + l + sovVirtualService(uint64(l)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.Weight != 0 { - n += 1 + sovVirtualService(uint64(m.Weight)) + if m.RedirectCode != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.RedirectCode)) + i-- + dAtA[i] = 0x18 } - if m.Headers != nil { - l = m.Headers.Size() - n += 1 + l + sovVirtualService(uint64(l)) + 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 m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + 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 n + return len(dAtA) - i, nil } -func (m *RouteDestination) Size() (n int) { - if m == nil { - return 0 +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.Destination != nil { - l = m.Destination.Size() - n += 1 + l + sovVirtualService(uint64(l)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.Weight != 0 { - n += 1 + sovVirtualService(uint64(m.Weight)) + 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 m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + 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 n + return len(dAtA) - i, nil } -func (m *L4MatchAttributes) Size() (n int) { - if m == nil { - return 0 +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 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 m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Gateways) > 0 { - for _, s := range m.Gateways { - l = len(s) - n += 1 + l + sovVirtualService(uint64(l)) + if m.MatchType != nil { + { + size := m.MatchType.Size() + i -= size + if _, err := m.MatchType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } } - 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 + return len(dAtA) - i, nil } -func (m *TLSMatchAttributes) Size() (n int) { - if m == nil { - return 0 +func (m *StringMatch_Exact) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[: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) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[: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) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[: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 len(m.SniHosts) > 0 { - for _, s := range m.SniHosts { - l = len(s) - n += 1 + l + sovVirtualService(uint64(l)) - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.DestinationSubnets) > 0 { - for _, s := range m.DestinationSubnets { - l = len(s) - n += 1 + l + sovVirtualService(uint64(l)) + 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 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.RetryOn) > 0 { + i -= len(m.RetryOn) + copy(dAtA[i:], m.RetryOn) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.RetryOn))) + i-- + dAtA[i] = 0x1a } - if len(m.Gateways) > 0 { - for _, s := range m.Gateways { - l = len(s) - n += 1 + l + sovVirtualService(uint64(l)) + 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 } - l = len(m.SourceNamespace) - if l > 0 { - n += 1 + l + sovVirtualService(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if m.Attempts != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Attempts)) + i-- + dAtA[i] = 0x8 } - return n + return len(dAtA) - i, nil } -func (m *HTTPRedirect) Size() (n int) { - if m == nil { - return 0 +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 - l = len(m.Uri) - if l > 0 { - n += 1 + l + sovVirtualService(uint64(l)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovVirtualService(uint64(l)) + 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.RedirectCode != 0 { - n += 1 + sovVirtualService(uint64(m.RedirectCode)) + 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.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + 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 } - return n -} - -func (m *HTTPRewrite) Size() (n int) { - if m == nil { - return 0 + 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 + } } - var l int - _ = l - l = len(m.Uri) - if l > 0 { - n += 1 + l + sovVirtualService(uint64(l)) + 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 + } } - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovVirtualService(uint64(l)) + 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 m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + 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 n + return len(dAtA) - i, nil } -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) +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 n + return dAtA[:n], nil } -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 *HTTPFaultInjection) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HTTPRetry) Size() (n int) { - if m == nil { - return 0 - } + +func (m *HTTPFaultInjection) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i 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.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.RetryRemoteLocalities != nil { - l = m.RetryRemoteLocalities.Size() - n += 1 + l + sovVirtualService(uint64(l)) + 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.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + 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 n + return len(dAtA) - i, nil } -func (m *CorsPolicy) Size() (n int) { - if m == nil { - return 0 +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 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 m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.AllowHeaders) > 0 { - for _, s := range m.AllowHeaders { - l = len(s) - n += 1 + l + sovVirtualService(uint64(l)) + 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 len(m.ExposeHeaders) > 0 { - for _, s := range m.ExposeHeaders { - l = len(s) - n += 1 + l + sovVirtualService(uint64(l)) + if m.HttpDelayType != nil { + { + size := m.HttpDelayType.Size() + i -= size + if _, err := m.HttpDelayType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } } - 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 m.Percent != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Percent)) + i-- + dAtA[i] = 0x8 } - if len(m.AllowOrigins) > 0 { - for _, e := range m.AllowOrigins { - l = e.Size() - n += 1 + l + sovVirtualService(uint64(l)) + return len(dAtA) - i, nil +} + +func (m *HTTPFaultInjection_Delay_FixedDelay) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[: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 } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n + return len(dAtA) - i, nil +} +func (m *HTTPFaultInjection_Delay_ExponentialDelay) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -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)) +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 } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + 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 n + return dAtA[:n], nil } -func (m *HTTPFaultInjection_Delay) Size() (n int) { - if m == nil { - return 0 - } +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.Percent != 0 { - n += 1 + sovVirtualService(uint64(m.Percent)) - } - if m.HttpDelayType != nil { - n += m.HttpDelayType.Size() + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Percentage != nil { - l = m.Percentage.Size() - n += 1 + l + sovVirtualService(uint64(l)) + { + 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.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if m.ErrorType != nil { + { + size := m.ErrorType.Size() + i -= size + if _, err := m.ErrorType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - return n + return len(dAtA) - i, nil } -func (m *HTTPFaultInjection_Delay_FixedDelay) Size() (n int) { - if m == nil { - return 0 +func (m *HTTPFaultInjection_Abort_HttpStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[: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) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[: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) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[: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.FixedDelay != nil { - l = m.FixedDelay.Size() - n += 1 + l + sovVirtualService(uint64(l)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return n + if m.Number != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Number)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } -func (m *HTTPFaultInjection_Delay_ExponentialDelay) Size() (n int) { - if m == nil { - return 0 + +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.ExponentialDelay != nil { - l = m.ExponentialDelay.Size() - n += 1 + l + sovVirtualService(uint64(l)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return n + 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 (m *HTTPFaultInjection_Abort) Size() (n int) { + +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 m.ErrorType != nil { - n += m.ErrorType.Size() + if len(m.Hosts) > 0 { + for _, s := range m.Hosts { + l = len(s) + n += 1 + l + sovVirtualService(uint64(l)) + } } - if m.Percentage != nil { - l = m.Percentage.Size() - 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) @@ -5994,72 +6230,1348 @@ func (m *HTTPFaultInjection_Abort) Size() (n int) { return n } -func (m *HTTPFaultInjection_Abort_HttpStatus) Size() (n int) { +func (m *Destination) 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 + l = len(m.Host) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) } - 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 + 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) } - var l int - _ = l - l = len(m.Http2Error) - n += 1 + l + sovVirtualService(uint64(l)) return n } -func (m *PortSelector) Size() (n int) { + +func (m *HTTPRoute) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Number != 0 { - n += 1 + sovVirtualService(uint64(m.Number)) + if len(m.Match) > 0 { + for _, e := range m.Match { + l = e.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + 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.RateLimit != nil { + l = m.RateLimit.Size() + n += 2 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RateLimit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Descriptors) > 0 { + for _, e := range m.Descriptors { + l = e.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if m.RateLimitSpecifier != nil { + n += m.RateLimitSpecifier.Size() + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RateLimit_Local_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Local != nil { + l = m.Local.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + return n +} +func (m *RateLimit_TokenBucket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MaxTokens != 0 { + n += 1 + sovVirtualService(uint64(m.MaxTokens)) + } + if m.TokensPerFill != 0 { + n += 1 + sovVirtualService(uint64(m.TokensPerFill)) + } + if m.FillInterval != nil { + l = m.FillInterval.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RateLimit_LocalDescriptor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Entries) > 0 { + for _, e := range m.Entries { + l = e.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if m.TokenBucket != nil { + l = m.TokenBucket.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RateLimit_LocalDescriptor_Entry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RateLimit_Local) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TokenBucket != nil { + l = m.TokenBucket.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if len(m.Descriptors) > 0 { + for _, e := range m.Descriptors { + l = e.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RateLimitDescriptor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Entries) > 0 { + for _, e := range m.Entries { + l = e.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RateLimitDescriptor_Entry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.SkipIfError { + n += 2 + } + if m.EntrySpecifier != nil { + n += m.EntrySpecifier.Size() + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RateLimitDescriptor_Entry_RequestHeader) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RequestHeader) + n += 1 + l + sovVirtualService(uint64(l)) + return n +} +func (m *RateLimitDescriptor_Entry_Expression) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Expression) + n += 1 + l + sovVirtualService(uint64(l)) + 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) || (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) || (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 + } } - 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) + if iNdEx > l { + return io.ErrUnexpectedEOF } - 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)))) + return nil } -func (m *VirtualService) Unmarshal(dAtA []byte) error { +func (m *HTTPRoute) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6069,30 +7581,170 @@ func (m *VirtualService) Unmarshal(dAtA []byte) error { if shift >= 64 { return ErrIntOverflowVirtualService } - if iNdEx >= l { + 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 } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if m.Rewrite == nil { + m.Rewrite = &HTTPRewrite{} } - } - 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 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 Hosts", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVirtualService @@ -6102,27 +7754,211 @@ func (m *VirtualService) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthVirtualService } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthVirtualService } if postIndex > l { return io.ErrUnexpectedEOF } - m.Hosts = append(m.Hosts, string(dAtA[iNdEx:postIndex])) + if m.Timeout == nil { + m.Timeout = &types.Duration{} + } + if err := m.Timeout.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 2: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Gateways", wireType) + 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 { @@ -6150,11 +7986,11 @@ func (m *VirtualService) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Gateways = append(m.Gateways, string(dAtA[iNdEx:postIndex])) + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 18: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Http", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MirrorPercent", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6181,14 +8017,16 @@ func (m *VirtualService) Unmarshal(dAtA []byte) error { 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 { + if m.MirrorPercent == nil { + m.MirrorPercent = &types.UInt32Value{} + } + if err := m.MirrorPercent.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: + case 19: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tcp", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MirrorPercentage", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6215,14 +8053,16 @@ func (m *VirtualService) Unmarshal(dAtA []byte) error { 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 { + if m.MirrorPercentage == nil { + m.MirrorPercentage = &Percent{} + } + if err := m.MirrorPercentage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: + case 20: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tls", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Delegate", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6249,16 +8089,18 @@ func (m *VirtualService) Unmarshal(dAtA []byte) error { 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 { + if m.Delegate == nil { + m.Delegate = &Delegate{} + } + if err := m.Delegate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 6: + case 21: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExportTo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RateLimit", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVirtualService @@ -6268,23 +8110,27 @@ func (m *VirtualService) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthVirtualService } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthVirtualService } if postIndex > l { return io.ErrUnexpectedEOF } - m.ExportTo = append(m.ExportTo, string(dAtA[iNdEx:postIndex])) + if m.RateLimit == nil { + m.RateLimit = &RateLimit{} + } + if err := m.RateLimit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -6308,7 +8154,7 @@ func (m *VirtualService) Unmarshal(dAtA []byte) error { } return nil } -func (m *Destination) Unmarshal(dAtA []byte) error { +func (m *RateLimit) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6331,17 +8177,17 @@ func (m *Destination) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Destination: wiretype end group for non-group") + return fmt.Errorf("proto: RateLimit: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Destination: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RateLimit: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Descriptors", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVirtualService @@ -6351,59 +8197,29 @@ func (m *Destination) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthVirtualService } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen 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.Descriptors = append(m.Descriptors, &RateLimitDescriptor{}) + if err := m.Descriptors[len(m.Descriptors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Subset = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Local", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6430,12 +8246,11 @@ func (m *Destination) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Port == nil { - m.Port = &PortSelector{} - } - if err := m.Port.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &RateLimit_Local{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.RateLimitSpecifier = &RateLimit_Local_{v} iNdEx = postIndex default: iNdEx = preIndex @@ -6459,7 +8274,7 @@ func (m *Destination) Unmarshal(dAtA []byte) error { } return nil } -func (m *HTTPRoute) Unmarshal(dAtA []byte) error { +func (m *RateLimit_TokenBucket) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6482,17 +8297,17 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: HTTPRoute: wiretype end group for non-group") + return fmt.Errorf("proto: TokenBucket: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: HTTPRoute: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TokenBucket: 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) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxTokens", wireType) } - var msglen int + m.MaxTokens = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVirtualService @@ -6502,31 +8317,16 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.MaxTokens |= uint32(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) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TokensPerFill", wireType) } - var msglen int + m.TokensPerFill = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVirtualService @@ -6536,29 +8336,14 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.TokensPerFill |= uint32(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) + return fmt.Errorf("proto: wrong wireType = %d for field FillInterval", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6585,16 +8370,67 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Redirect == nil { - m.Redirect = &HTTPRedirect{} + if m.FillInterval == nil { + m.FillInterval = &types.Duration{} } - if err := m.Redirect.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.FillInterval.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (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 *RateLimit_LocalDescriptor) 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: LocalDescriptor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LocalDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rewrite", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6621,16 +8457,14 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Rewrite == nil { - m.Rewrite = &HTTPRewrite{} - } - if err := m.Rewrite.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Entries = append(m.Entries, &RateLimit_LocalDescriptor_Entry{}) + if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 6: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenBucket", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6657,18 +8491,69 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Timeout == nil { - m.Timeout = &types.Duration{} + if m.TokenBucket == nil { + m.TokenBucket = &RateLimit_TokenBucket{} } - if err := m.Timeout.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.TokenBucket.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 7: + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (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 *RateLimit_LocalDescriptor_Entry) 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: Entry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Entry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Retries", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVirtualService @@ -6678,33 +8563,29 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthVirtualService } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen 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 - } + m.Key = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fault", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVirtualService @@ -6714,31 +8595,78 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthVirtualService } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen 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 { + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { return err } - iNdEx = postIndex - case 9: + if (skippy < 0) || (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 *RateLimit_Local) 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: Local: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Local: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Mirror", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenBucket", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6765,16 +8693,16 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Mirror == nil { - m.Mirror = &Destination{} + if m.TokenBucket == nil { + m.TokenBucket = &RateLimit_TokenBucket{} } - if err := m.Mirror.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.TokenBucket.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 10: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CorsPolicy", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Descriptors", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6801,16 +8729,65 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.CorsPolicy == nil { - m.CorsPolicy = &CorsPolicy{} - } - if err := m.CorsPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Descriptors = append(m.Descriptors, &RateLimit_LocalDescriptor{}) + if err := m.Descriptors[len(m.Descriptors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 16: + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (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 *RateLimitDescriptor) 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: RateLimitDescriptor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RateLimitDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6837,16 +8814,65 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Headers == nil { - m.Headers = &Headers{} - } - if err := m.Headers.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Entries = append(m.Entries, &RateLimitDescriptor_Entry{}) + if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 17: + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (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 *RateLimitDescriptor_Entry) 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: Entry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Entry: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6874,13 +8900,13 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Key = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 18: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MirrorPercent", wireType) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SkipIfError", wireType) } - var msglen int + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVirtualService @@ -6890,33 +8916,17 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + v |= 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: + m.SkipIfError = bool(v != 0) + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MirrorPercentage", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RequestHeader", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVirtualService @@ -6926,33 +8936,29 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthVirtualService } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen 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 - } + m.EntrySpecifier = &RateLimitDescriptor_Entry_RequestHeader{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex - case 20: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Delegate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Expression", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVirtualService @@ -6962,27 +8968,23 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthVirtualService } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen 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 - } + m.EntrySpecifier = &RateLimitDescriptor_Entry_Expression{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex default: iNdEx = preIndex diff --git a/networking/v1alpha3/virtual_service.pb.html b/networking/v1alpha3/virtual_service.pb.html index d4b4467a980..fa001801c38 100644 --- a/networking/v1alpha3/virtual_service.pb.html +++ b/networking/v1alpha3/virtual_service.pb.html @@ -6,7 +6,7 @@ generator: protoc-gen-docs schema: istio.networking.v1alpha3.VirtualService aliases: [/docs/reference/config/networking/v1alpha3/virtual-service] -number_of_entries: 24 +number_of_entries: 31 ---

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

@@ -807,6 +807,17 @@

HTTPRoute

Header manipulation rules

+ + +No + + + +rateLimit +RateLimit + +

Rate limits

+ No @@ -820,6 +831,75 @@

HTTPRoute

Use of integer mirror_percent value is deprecated. Use the double mirror_percentage field instead

+ + +No + + + + + +

RateLimit

+
+

RateLimit configuration.

+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
descriptorsRateLimitDescriptor[] +

Specifies the rate limit descriptors to produce for the route.

+ +
+No +
localLocal (oneof) +

Local rate limit configuration.

+ +
+No +
+
+

RateLimitDescriptor

+
+

Rate limit descriptor specifies the descriptors consisting of multiple actions.

+ + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
entriesEntry[] +

Rate limit entries specify an ordered list of string values composing the descriptor. +The order of the entries matters, as they are processed sequentially. If an entry fails +to be computed, no descriptor is generated.

+
No @@ -2561,6 +2641,239 @@

Percent

value double + +No +
+
+

RateLimit.TokenBucket

+
+

Token bucket algorithm configuration. Each request consumes a single token.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
maxTokensuint32 +

Maximum amount of tokens in a bucket.

+ +
+No +
tokensPerFilluint32 +

The amount of tokens added per fill.

+ +
+No +
fillIntervalDuration +

The interval that tokens are added to the bucket.

+ +
+No +
+
+

RateLimit.LocalDescriptor

+
+

Local rate limit descriptor configuration.

+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
entriesEntry[] +

Descriptor entry match.

+ +
+No +
tokenBucketTokenBucket +

Specifies the token bucket for matching descriptors.

+ +
+No +
+
+

RateLimit.Local

+
+

Local rate limit enforcement.

+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
tokenBucketTokenBucket +

The token bucket configuration to use for rate limiting requests that +are processed by this filter. Each request processed by the filter +consumes a single token. If the token is available, the request will be +allowed. If no tokens are available, the request will receive 429.

+ +
+No +
descriptorsLocalDescriptor[] +

The rate limit descriptor list to use in the local rate limit to +override on. The rate limit descriptor is selected by the first full +match from the request descriptors. The descriptors token bucket fill +interval must be a multiple of the global fill interval.

+ +
+No +
+
+

RateLimit.LocalDescriptor.Entry

+
+

Descriptor entry match.

+ + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
keystring + +No +
valuestring + +No +
+
+

RateLimitDescriptor.Entry

+
+

Descriptor entry.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeDescriptionRequired
keystring +

The key to use in the descriptor entry.

+ +
+No +
skipIfErrorbool +

If set to true, skip the entry when the evaluation fails or when the header is missing. +By default, the entire descriptor is not produced.

+ +
+No +
requestHeaderstring (oneof) +

The header name to be queried from the request headers. The header’s +value is used to populate the value of the descriptor entry for the +descriptor_key.

+ +
+No +
expressionstring (oneof) +

CEL expression to populate the entry value.

+
No diff --git a/networking/v1alpha3/virtual_service.proto b/networking/v1alpha3/virtual_service.proto index 2ff9f2dde7f..bcf3307602c 100644 --- a/networking/v1alpha3/virtual_service.proto +++ b/networking/v1alpha3/virtual_service.proto @@ -643,10 +643,90 @@ message HTTPRoute { // Header manipulation rules Headers headers = 16; + // Rate limits + RateLimit rate_limit = 21; + // $hide_from_docs - // Next available field number: 21 + // Next available field number: 22 +} + +// RateLimit configuration. +message RateLimit { + // Specifies the rate limit descriptors to produce for the route. + repeated RateLimitDescriptor descriptors = 1; + + // Token bucket algorithm configuration. Each request consumes a single token. + message TokenBucket { + // Maximum amount of tokens in a bucket. + uint32 max_tokens = 1; + // The amount of tokens added per fill. + uint32 tokens_per_fill = 2; + // The interval that tokens are added to the bucket. + google.protobuf.Duration fill_interval = 3; + } + + // Local rate limit descriptor configuration. + message LocalDescriptor { + // Descriptor entry match. + message Entry { + string key = 1; + string value = 2; + } + // Descriptor entry match. + repeated Entry entries = 1; + + // Specifies the token bucket for matching descriptors. + TokenBucket token_bucket = 2; + } + + // Local rate limit enforcement. + message Local { + // The token bucket configuration to use for rate limiting requests that + // are processed by this filter. Each request processed by the filter + // consumes a single token. If the token is available, the request will be + // allowed. If no tokens are available, the request will receive 429. + TokenBucket token_bucket = 1; + + // The rate limit descriptor list to use in the local rate limit to + // override on. The rate limit descriptor is selected by the first full + // match from the request descriptors. The descriptors token bucket fill + // interval must be a multiple of the global fill interval. + repeated LocalDescriptor descriptors = 2; + } + + oneof rate_limit_specifier { + // Local rate limit configuration. + Local local = 2; + } } +// Rate limit descriptor specifies the descriptors consisting of multiple actions. +message RateLimitDescriptor { + // Descriptor entry. + message Entry { + // The key to use in the descriptor entry. + string key = 1; + + // If set to true, skip the entry when the evaluation fails or when the header is missing. + // By default, the entire descriptor is not produced. + bool skip_if_error = 2; + + oneof entry_specifier { + // The header name to be queried from the request headers. The header’s + // value is used to populate the value of the descriptor entry for the + // descriptor_key. + string request_header = 3; + + // CEL expression to populate the entry value. + string expression = 4; + } + } + + // Rate limit entries specify an ordered list of string values composing the descriptor. + // The order of the entries matters, as they are processed sequentially. If an entry fails + // to be computed, no descriptor is generated. + repeated Entry entries = 1; +} // Describes the delegate VirtualService. // The following routing rules forward the traffic to `/productpage` by a delegate VirtualService named `productpage`, diff --git a/networking/v1alpha3/virtual_service_deepcopy.gen.go b/networking/v1alpha3/virtual_service_deepcopy.gen.go index dfca279b6f7..a96f17e6bd3 100644 --- a/networking/v1alpha3/virtual_service_deepcopy.gen.go +++ b/networking/v1alpha3/virtual_service_deepcopy.gen.go @@ -227,6 +227,153 @@ func (in *HTTPRoute) DeepCopyInterface() interface{} { return in.DeepCopy() } +// DeepCopyInto supports using RateLimit within kubernetes types, where deepcopy-gen is used. +func (in *RateLimit) DeepCopyInto(out *RateLimit) { + p := proto.Clone(in).(*RateLimit) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit. Required by controller-gen. +func (in *RateLimit) DeepCopy() *RateLimit { + if in == nil { + return nil + } + out := new(RateLimit) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit. Required by controller-gen. +func (in *RateLimit) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + +// DeepCopyInto supports using RateLimit_TokenBucket within kubernetes types, where deepcopy-gen is used. +func (in *RateLimit_TokenBucket) DeepCopyInto(out *RateLimit_TokenBucket) { + p := proto.Clone(in).(*RateLimit_TokenBucket) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit_TokenBucket. Required by controller-gen. +func (in *RateLimit_TokenBucket) DeepCopy() *RateLimit_TokenBucket { + if in == nil { + return nil + } + out := new(RateLimit_TokenBucket) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit_TokenBucket. Required by controller-gen. +func (in *RateLimit_TokenBucket) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + +// DeepCopyInto supports using RateLimit_LocalDescriptor within kubernetes types, where deepcopy-gen is used. +func (in *RateLimit_LocalDescriptor) DeepCopyInto(out *RateLimit_LocalDescriptor) { + p := proto.Clone(in).(*RateLimit_LocalDescriptor) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit_LocalDescriptor. Required by controller-gen. +func (in *RateLimit_LocalDescriptor) DeepCopy() *RateLimit_LocalDescriptor { + if in == nil { + return nil + } + out := new(RateLimit_LocalDescriptor) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit_LocalDescriptor. Required by controller-gen. +func (in *RateLimit_LocalDescriptor) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + +// DeepCopyInto supports using RateLimit_LocalDescriptor_Entry within kubernetes types, where deepcopy-gen is used. +func (in *RateLimit_LocalDescriptor_Entry) DeepCopyInto(out *RateLimit_LocalDescriptor_Entry) { + p := proto.Clone(in).(*RateLimit_LocalDescriptor_Entry) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit_LocalDescriptor_Entry. Required by controller-gen. +func (in *RateLimit_LocalDescriptor_Entry) DeepCopy() *RateLimit_LocalDescriptor_Entry { + if in == nil { + return nil + } + out := new(RateLimit_LocalDescriptor_Entry) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit_LocalDescriptor_Entry. Required by controller-gen. +func (in *RateLimit_LocalDescriptor_Entry) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + +// DeepCopyInto supports using RateLimit_Local within kubernetes types, where deepcopy-gen is used. +func (in *RateLimit_Local) DeepCopyInto(out *RateLimit_Local) { + p := proto.Clone(in).(*RateLimit_Local) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit_Local. Required by controller-gen. +func (in *RateLimit_Local) DeepCopy() *RateLimit_Local { + if in == nil { + return nil + } + out := new(RateLimit_Local) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit_Local. Required by controller-gen. +func (in *RateLimit_Local) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + +// DeepCopyInto supports using RateLimitDescriptor within kubernetes types, where deepcopy-gen is used. +func (in *RateLimitDescriptor) DeepCopyInto(out *RateLimitDescriptor) { + p := proto.Clone(in).(*RateLimitDescriptor) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitDescriptor. Required by controller-gen. +func (in *RateLimitDescriptor) DeepCopy() *RateLimitDescriptor { + if in == nil { + return nil + } + out := new(RateLimitDescriptor) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitDescriptor. Required by controller-gen. +func (in *RateLimitDescriptor) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + +// DeepCopyInto supports using RateLimitDescriptor_Entry within kubernetes types, where deepcopy-gen is used. +func (in *RateLimitDescriptor_Entry) DeepCopyInto(out *RateLimitDescriptor_Entry) { + p := proto.Clone(in).(*RateLimitDescriptor_Entry) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitDescriptor_Entry. Required by controller-gen. +func (in *RateLimitDescriptor_Entry) DeepCopy() *RateLimitDescriptor_Entry { + if in == nil { + return nil + } + out := new(RateLimitDescriptor_Entry) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitDescriptor_Entry. Required by controller-gen. +func (in *RateLimitDescriptor_Entry) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + // DeepCopyInto supports using Delegate within kubernetes types, where deepcopy-gen is used. func (in *Delegate) DeepCopyInto(out *Delegate) { p := proto.Clone(in).(*Delegate) diff --git a/networking/v1alpha3/virtual_service_json.gen.go b/networking/v1alpha3/virtual_service_json.gen.go index 474f22a8e20..28eba56c2a0 100644 --- a/networking/v1alpha3/virtual_service_json.gen.go +++ b/networking/v1alpha3/virtual_service_json.gen.go @@ -199,6 +199,83 @@ func (this *HTTPRoute) UnmarshalJSON(b []byte) error { return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) } +// MarshalJSON is a custom marshaler for RateLimit +func (this *RateLimit) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for RateLimit +func (this *RateLimit) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for RateLimit_TokenBucket +func (this *RateLimit_TokenBucket) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for RateLimit_TokenBucket +func (this *RateLimit_TokenBucket) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for RateLimit_LocalDescriptor +func (this *RateLimit_LocalDescriptor) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for RateLimit_LocalDescriptor +func (this *RateLimit_LocalDescriptor) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for RateLimit_LocalDescriptor_Entry +func (this *RateLimit_LocalDescriptor_Entry) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for RateLimit_LocalDescriptor_Entry +func (this *RateLimit_LocalDescriptor_Entry) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for RateLimit_Local +func (this *RateLimit_Local) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for RateLimit_Local +func (this *RateLimit_Local) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for RateLimitDescriptor +func (this *RateLimitDescriptor) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for RateLimitDescriptor +func (this *RateLimitDescriptor) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for RateLimitDescriptor_Entry +func (this *RateLimitDescriptor_Entry) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for RateLimitDescriptor_Entry +func (this *RateLimitDescriptor_Entry) 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) diff --git a/networking/v1beta1/virtual_service.pb.go b/networking/v1beta1/virtual_service.pb.go index 7308b08b1c8..1185af515e0 100644 --- a/networking/v1beta1/virtual_service.pb.go +++ b/networking/v1beta1/virtual_service.pb.go @@ -744,10 +744,12 @@ type HTTPRoute struct { // 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:"-"` + Headers *Headers `protobuf:"bytes,16,opt,name=headers,proto3" json:"headers,omitempty"` + // Rate limits + RateLimit *RateLimit `protobuf:"bytes,21,opt,name=rate_limit,json=rateLimit,proto3" json:"rate_limit,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } func (m *HTTPRoute) Reset() { *m = HTTPRoute{} } @@ -882,89 +884,37 @@ func (m *HTTPRoute) GetHeaders() *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 *HTTPRoute) GetRateLimit() *RateLimit { + if m != nil { + return m.RateLimit + } + return nil } -func (m *Delegate) Reset() { *m = Delegate{} } -func (m *Delegate) String() string { return proto.CompactTextString(m) } -func (*Delegate) ProtoMessage() {} -func (*Delegate) Descriptor() ([]byte, []int) { +// RateLimit configuration. +type RateLimit struct { + // Specifies the rate limit descriptors to produce for the route. + Descriptors []*RateLimitDescriptor `protobuf:"bytes,1,rep,name=descriptors,proto3" json:"descriptors,omitempty"` + // Types that are valid to be assigned to RateLimitSpecifier: + // *RateLimit_Local_ + RateLimitSpecifier isRateLimit_RateLimitSpecifier `protobuf_oneof:"rate_limit_specifier"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RateLimit) Reset() { *m = RateLimit{} } +func (m *RateLimit) String() string { return proto.CompactTextString(m) } +func (*RateLimit) ProtoMessage() {} +func (*RateLimit) Descriptor() ([]byte, []int) { return fileDescriptor_8c56a442a0838fd7, []int{3} } -func (m *Delegate) XXX_Unmarshal(b []byte) error { +func (m *RateLimit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Delegate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RateLimit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Delegate.Marshal(b, m, deterministic) + return xxx_messageInfo_RateLimit.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -974,125 +924,83 @@ func (m *Delegate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Delegate) XXX_Merge(src proto.Message) { - xxx_messageInfo_Delegate.Merge(m, src) +func (m *RateLimit) XXX_Merge(src proto.Message) { + xxx_messageInfo_RateLimit.Merge(m, src) } -func (m *Delegate) XXX_Size() int { +func (m *RateLimit) XXX_Size() int { return m.Size() } -func (m *Delegate) XXX_DiscardUnknown() { - xxx_messageInfo_Delegate.DiscardUnknown(m) +func (m *RateLimit) XXX_DiscardUnknown() { + xxx_messageInfo_RateLimit.DiscardUnknown(m) } -var xxx_messageInfo_Delegate proto.InternalMessageInfo +var xxx_messageInfo_RateLimit proto.InternalMessageInfo -func (m *Delegate) GetName() string { +type isRateLimit_RateLimitSpecifier interface { + isRateLimit_RateLimitSpecifier() + MarshalTo([]byte) (int, error) + Size() int +} + +type RateLimit_Local_ struct { + Local *RateLimit_Local `protobuf:"bytes,2,opt,name=local,proto3,oneof" json:"local,omitempty"` +} + +func (*RateLimit_Local_) isRateLimit_RateLimitSpecifier() {} + +func (m *RateLimit) GetRateLimitSpecifier() isRateLimit_RateLimitSpecifier { if m != nil { - return m.Name + return m.RateLimitSpecifier } - return "" + return nil } -func (m *Delegate) GetNamespace() string { +func (m *RateLimit) GetDescriptors() []*RateLimitDescriptor { if m != nil { - return m.Namespace + return m.Descriptors } - return "" + return nil } -// 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 removes 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 -// ``` -// {{}} -// {{}} -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 *RateLimit) GetLocal() *RateLimit_Local { + if x, ok := m.GetRateLimitSpecifier().(*RateLimit_Local_); ok { + return x.Local + } + return nil } -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_8c56a442a0838fd7, []int{4} +// XXX_OneofWrappers is for the internal use of the proto package. +func (*RateLimit) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*RateLimit_Local_)(nil), + } } -func (m *Headers) XXX_Unmarshal(b []byte) error { + +// Token bucket algorithm configuration. Each request consumes a single token. +type RateLimit_TokenBucket struct { + // Maximum amount of tokens in a bucket. + MaxTokens uint32 `protobuf:"varint,1,opt,name=max_tokens,json=maxTokens,proto3" json:"max_tokens,omitempty"` + // The amount of tokens added per fill. + TokensPerFill uint32 `protobuf:"varint,2,opt,name=tokens_per_fill,json=tokensPerFill,proto3" json:"tokens_per_fill,omitempty"` + // The interval that tokens are added to the bucket. + FillInterval *types.Duration `protobuf:"bytes,3,opt,name=fill_interval,json=fillInterval,proto3" json:"fill_interval,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RateLimit_TokenBucket) Reset() { *m = RateLimit_TokenBucket{} } +func (m *RateLimit_TokenBucket) String() string { return proto.CompactTextString(m) } +func (*RateLimit_TokenBucket) ProtoMessage() {} +func (*RateLimit_TokenBucket) Descriptor() ([]byte, []int) { + return fileDescriptor_8c56a442a0838fd7, []int{3, 0} +} +func (m *RateLimit_TokenBucket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Headers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RateLimit_TokenBucket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Headers.Marshal(b, m, deterministic) + return xxx_messageInfo_RateLimit_TokenBucket.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1102,58 +1010,62 @@ func (m *Headers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Headers) XXX_Merge(src proto.Message) { - xxx_messageInfo_Headers.Merge(m, src) +func (m *RateLimit_TokenBucket) XXX_Merge(src proto.Message) { + xxx_messageInfo_RateLimit_TokenBucket.Merge(m, src) } -func (m *Headers) XXX_Size() int { +func (m *RateLimit_TokenBucket) XXX_Size() int { return m.Size() } -func (m *Headers) XXX_DiscardUnknown() { - xxx_messageInfo_Headers.DiscardUnknown(m) +func (m *RateLimit_TokenBucket) XXX_DiscardUnknown() { + xxx_messageInfo_RateLimit_TokenBucket.DiscardUnknown(m) } -var xxx_messageInfo_Headers proto.InternalMessageInfo +var xxx_messageInfo_RateLimit_TokenBucket proto.InternalMessageInfo -func (m *Headers) GetRequest() *Headers_HeaderOperations { +func (m *RateLimit_TokenBucket) GetMaxTokens() uint32 { if m != nil { - return m.Request + return m.MaxTokens } - return nil + return 0 } -func (m *Headers) GetResponse() *Headers_HeaderOperations { +func (m *RateLimit_TokenBucket) GetTokensPerFill() uint32 { if m != nil { - return m.Response + return m.TokensPerFill + } + return 0 +} + +func (m *RateLimit_TokenBucket) GetFillInterval() *types.Duration { + if m != nil { + return m.FillInterval } 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:"-"` +// Local rate limit descriptor configuration. +type RateLimit_LocalDescriptor struct { + // Descriptor entry match. + Entries []*RateLimit_LocalDescriptor_Entry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` + // Specifies the token bucket for matching descriptors. + TokenBucket *RateLimit_TokenBucket `protobuf:"bytes,2,opt,name=token_bucket,json=tokenBucket,proto3" json:"token_bucket,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_8c56a442a0838fd7, []int{4, 0} +func (m *RateLimit_LocalDescriptor) Reset() { *m = RateLimit_LocalDescriptor{} } +func (m *RateLimit_LocalDescriptor) String() string { return proto.CompactTextString(m) } +func (*RateLimit_LocalDescriptor) ProtoMessage() {} +func (*RateLimit_LocalDescriptor) Descriptor() ([]byte, []int) { + return fileDescriptor_8c56a442a0838fd7, []int{3, 1} } -func (m *Headers_HeaderOperations) XXX_Unmarshal(b []byte) error { +func (m *RateLimit_LocalDescriptor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Headers_HeaderOperations) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RateLimit_LocalDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Headers_HeaderOperations.Marshal(b, m, deterministic) + return xxx_messageInfo_RateLimit_LocalDescriptor.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1163,128 +1075,117 @@ func (m *Headers_HeaderOperations) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *Headers_HeaderOperations) XXX_Merge(src proto.Message) { - xxx_messageInfo_Headers_HeaderOperations.Merge(m, src) +func (m *RateLimit_LocalDescriptor) XXX_Merge(src proto.Message) { + xxx_messageInfo_RateLimit_LocalDescriptor.Merge(m, src) } -func (m *Headers_HeaderOperations) XXX_Size() int { +func (m *RateLimit_LocalDescriptor) XXX_Size() int { return m.Size() } -func (m *Headers_HeaderOperations) XXX_DiscardUnknown() { - xxx_messageInfo_Headers_HeaderOperations.DiscardUnknown(m) +func (m *RateLimit_LocalDescriptor) XXX_DiscardUnknown() { + xxx_messageInfo_RateLimit_LocalDescriptor.DiscardUnknown(m) } -var xxx_messageInfo_Headers_HeaderOperations proto.InternalMessageInfo +var xxx_messageInfo_RateLimit_LocalDescriptor proto.InternalMessageInfo -func (m *Headers_HeaderOperations) GetSet() map[string]string { +func (m *RateLimit_LocalDescriptor) GetEntries() []*RateLimit_LocalDescriptor_Entry { if m != nil { - return m.Set + return m.Entries } return nil } -func (m *Headers_HeaderOperations) GetAdd() map[string]string { +func (m *RateLimit_LocalDescriptor) GetTokenBucket() *RateLimit_TokenBucket { if m != nil { - return m.Add + return m.TokenBucket } return nil } -func (m *Headers_HeaderOperations) GetRemove() []string { - if m != nil { - return m.Remove - } - return nil +// Descriptor entry match. +type RateLimit_LocalDescriptor_Entry struct { + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -// 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 *RateLimit_LocalDescriptor_Entry) Reset() { *m = RateLimit_LocalDescriptor_Entry{} } +func (m *RateLimit_LocalDescriptor_Entry) String() string { return proto.CompactTextString(m) } +func (*RateLimit_LocalDescriptor_Entry) ProtoMessage() {} +func (*RateLimit_LocalDescriptor_Entry) Descriptor() ([]byte, []int) { + return fileDescriptor_8c56a442a0838fd7, []int{3, 1, 0} +} +func (m *RateLimit_LocalDescriptor_Entry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RateLimit_LocalDescriptor_Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RateLimit_LocalDescriptor_Entry.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 *RateLimit_LocalDescriptor_Entry) XXX_Merge(src proto.Message) { + xxx_messageInfo_RateLimit_LocalDescriptor_Entry.Merge(m, src) +} +func (m *RateLimit_LocalDescriptor_Entry) XXX_Size() int { + return m.Size() +} +func (m *RateLimit_LocalDescriptor_Entry) XXX_DiscardUnknown() { + xxx_messageInfo_RateLimit_LocalDescriptor_Entry.DiscardUnknown(m) } -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_8c56a442a0838fd7, []int{5} +var xxx_messageInfo_RateLimit_LocalDescriptor_Entry proto.InternalMessageInfo + +func (m *RateLimit_LocalDescriptor_Entry) GetKey() string { + if m != nil { + return m.Key + } + return "" } -func (m *TLSRoute) XXX_Unmarshal(b []byte) error { + +func (m *RateLimit_LocalDescriptor_Entry) GetValue() string { + if m != nil { + return m.Value + } + return "" +} + +// Local rate limit enforcement. +type RateLimit_Local struct { + // The token bucket configuration to use for rate limiting requests that + // are processed by this filter. Each request processed by the filter + // consumes a single token. If the token is available, the request will be + // allowed. If no tokens are available, the request will receive 429. + TokenBucket *RateLimit_TokenBucket `protobuf:"bytes,1,opt,name=token_bucket,json=tokenBucket,proto3" json:"token_bucket,omitempty"` + // The rate limit descriptor list to use in the local rate limit to + // override on. The rate limit descriptor is selected by the first full + // match from the request descriptors. The descriptors token bucket fill + // interval must be a multiple of the global fill interval. + Descriptors []*RateLimit_LocalDescriptor `protobuf:"bytes,2,rep,name=descriptors,proto3" json:"descriptors,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RateLimit_Local) Reset() { *m = RateLimit_Local{} } +func (m *RateLimit_Local) String() string { return proto.CompactTextString(m) } +func (*RateLimit_Local) ProtoMessage() {} +func (*RateLimit_Local) Descriptor() ([]byte, []int) { + return fileDescriptor_8c56a442a0838fd7, []int{3, 2} +} +func (m *RateLimit_Local) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TLSRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RateLimit_Local) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TLSRoute.Marshal(b, m, deterministic) + return xxx_messageInfo_RateLimit_Local.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1294,102 +1195,55 @@ func (m *TLSRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *TLSRoute) XXX_Merge(src proto.Message) { - xxx_messageInfo_TLSRoute.Merge(m, src) +func (m *RateLimit_Local) XXX_Merge(src proto.Message) { + xxx_messageInfo_RateLimit_Local.Merge(m, src) } -func (m *TLSRoute) XXX_Size() int { +func (m *RateLimit_Local) XXX_Size() int { return m.Size() } -func (m *TLSRoute) XXX_DiscardUnknown() { - xxx_messageInfo_TLSRoute.DiscardUnknown(m) +func (m *RateLimit_Local) XXX_DiscardUnknown() { + xxx_messageInfo_RateLimit_Local.DiscardUnknown(m) } -var xxx_messageInfo_TLSRoute proto.InternalMessageInfo +var xxx_messageInfo_RateLimit_Local proto.InternalMessageInfo -func (m *TLSRoute) GetMatch() []*TLSMatchAttributes { +func (m *RateLimit_Local) GetTokenBucket() *RateLimit_TokenBucket { if m != nil { - return m.Match + return m.TokenBucket } return nil } -func (m *TLSRoute) GetRoute() []*RouteDestination { +func (m *RateLimit_Local) GetDescriptors() []*RateLimit_LocalDescriptor { if m != nil { - return m.Route + return m.Descriptors } 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:"-"` +// Rate limit descriptor specifies the descriptors consisting of multiple actions. +type RateLimitDescriptor struct { + // Rate limit entries specify an ordered list of string values composing the descriptor. + // The order of the entries matters, as they are processed sequentially. If an entry fails + // to be computed, no descriptor is generated. + Entries []*RateLimitDescriptor_Entry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,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_8c56a442a0838fd7, []int{6} +func (m *RateLimitDescriptor) Reset() { *m = RateLimitDescriptor{} } +func (m *RateLimitDescriptor) String() string { return proto.CompactTextString(m) } +func (*RateLimitDescriptor) ProtoMessage() {} +func (*RateLimitDescriptor) Descriptor() ([]byte, []int) { + return fileDescriptor_8c56a442a0838fd7, []int{4} } -func (m *TCPRoute) XXX_Unmarshal(b []byte) error { +func (m *RateLimitDescriptor) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TCPRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RateLimitDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TCPRoute.Marshal(b, m, deterministic) + return xxx_messageInfo_RateLimitDescriptor.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1399,204 +1253,216 @@ func (m *TCPRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *TCPRoute) XXX_Merge(src proto.Message) { - xxx_messageInfo_TCPRoute.Merge(m, src) +func (m *RateLimitDescriptor) XXX_Merge(src proto.Message) { + xxx_messageInfo_RateLimitDescriptor.Merge(m, src) } -func (m *TCPRoute) XXX_Size() int { +func (m *RateLimitDescriptor) XXX_Size() int { return m.Size() } -func (m *TCPRoute) XXX_DiscardUnknown() { - xxx_messageInfo_TCPRoute.DiscardUnknown(m) +func (m *RateLimitDescriptor) XXX_DiscardUnknown() { + xxx_messageInfo_RateLimitDescriptor.DiscardUnknown(m) } -var xxx_messageInfo_TCPRoute proto.InternalMessageInfo +var xxx_messageInfo_RateLimitDescriptor proto.InternalMessageInfo -func (m *TCPRoute) GetMatch() []*L4MatchAttributes { +func (m *RateLimitDescriptor) GetEntries() []*RateLimitDescriptor_Entry { if m != nil { - return m.Match + return m.Entries } return nil } -func (m *TCPRoute) GetRoute() []*RouteDestination { +// Descriptor entry. +type RateLimitDescriptor_Entry struct { + // The key to use in the descriptor entry. + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + // If set to true, skip the entry when the evaluation fails or when the header is missing. + // By default, the entire descriptor is not produced. + SkipIfError bool `protobuf:"varint,2,opt,name=skip_if_error,json=skipIfError,proto3" json:"skip_if_error,omitempty"` + // Types that are valid to be assigned to EntrySpecifier: + // *RateLimitDescriptor_Entry_RequestHeader + // *RateLimitDescriptor_Entry_Expression + EntrySpecifier isRateLimitDescriptor_Entry_EntrySpecifier `protobuf_oneof:"entry_specifier"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *RateLimitDescriptor_Entry) Reset() { *m = RateLimitDescriptor_Entry{} } +func (m *RateLimitDescriptor_Entry) String() string { return proto.CompactTextString(m) } +func (*RateLimitDescriptor_Entry) ProtoMessage() {} +func (*RateLimitDescriptor_Entry) Descriptor() ([]byte, []int) { + return fileDescriptor_8c56a442a0838fd7, []int{4, 0} +} +func (m *RateLimitDescriptor_Entry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RateLimitDescriptor_Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RateLimitDescriptor_Entry.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 *RateLimitDescriptor_Entry) XXX_Merge(src proto.Message) { + xxx_messageInfo_RateLimitDescriptor_Entry.Merge(m, src) +} +func (m *RateLimitDescriptor_Entry) XXX_Size() int { + return m.Size() +} +func (m *RateLimitDescriptor_Entry) XXX_DiscardUnknown() { + xxx_messageInfo_RateLimitDescriptor_Entry.DiscardUnknown(m) +} + +var xxx_messageInfo_RateLimitDescriptor_Entry proto.InternalMessageInfo + +type isRateLimitDescriptor_Entry_EntrySpecifier interface { + isRateLimitDescriptor_Entry_EntrySpecifier() + MarshalTo([]byte) (int, error) + Size() int +} + +type RateLimitDescriptor_Entry_RequestHeader struct { + RequestHeader string `protobuf:"bytes,3,opt,name=request_header,json=requestHeader,proto3,oneof" json:"request_header,omitempty"` +} +type RateLimitDescriptor_Entry_Expression struct { + Expression string `protobuf:"bytes,4,opt,name=expression,proto3,oneof" json:"expression,omitempty"` +} + +func (*RateLimitDescriptor_Entry_RequestHeader) isRateLimitDescriptor_Entry_EntrySpecifier() {} +func (*RateLimitDescriptor_Entry_Expression) isRateLimitDescriptor_Entry_EntrySpecifier() {} + +func (m *RateLimitDescriptor_Entry) GetEntrySpecifier() isRateLimitDescriptor_Entry_EntrySpecifier { if m != nil { - return m.Route + return m.EntrySpecifier } 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`. +func (m *RateLimitDescriptor_Entry) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *RateLimitDescriptor_Entry) GetSkipIfError() bool { + if m != nil { + return m.SkipIfError + } + return false +} + +func (m *RateLimitDescriptor_Entry) GetRequestHeader() string { + if x, ok := m.GetEntrySpecifier().(*RateLimitDescriptor_Entry_RequestHeader); ok { + return x.RequestHeader + } + return "" +} + +func (m *RateLimitDescriptor_Entry) GetExpression() string { + if x, ok := m.GetEntrySpecifier().(*RateLimitDescriptor_Entry_Expression); ok { + return x.Expression + } + return "" +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*RateLimitDescriptor_Entry) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*RateLimitDescriptor_Entry_RequestHeader)(nil), + (*RateLimitDescriptor_Entry_Expression)(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: ratings-route +// name: bookinfo // spec: // hosts: -// - ratings.prod.svc.cluster.local +// - "bookinfo.com" +// gateways: +// - mygateway // http: // - match: -// - headers: -// end-user: -// exact: jason -// uri: -// prefix: "/ratings/v2/" -// ignoreUriCase: true -// route: -// - destination: -// host: ratings.prod.svc.cluster.local +// - uri: +// prefix: "/productpage" +// delegate: +// name: productpage +// namespace: nsA +// - match: +// - uri: +// prefix: "/reviews" +// delegate: +// name: reviews +// namespace: nsB // ``` -// {{}} // -// {{}} // ```yaml -// apiVersion: networking.istio.io/v1beta1 +// apiVersion: networking.istio.io/v1alpha3 // kind: VirtualService // metadata: -// name: ratings-route +// name: productpage +// namespace: nsA // spec: -// hosts: -// - ratings.prod.svc.cluster.local // http: // - match: -// - headers: -// end-user: -// exact: jason -// uri: -// prefix: "/ratings/v2/" -// ignoreUriCase: true +// - uri: +// prefix: "/productpage/v1/" // route: // - destination: -// host: ratings.prod.svc.cluster.local +// host: productpage-v1.nsA.svc.cluster.local +// - route: +// - destination: +// host: productpage.nsA.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"` +// ```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 *HTTPMatchRequest) Reset() { *m = HTTPMatchRequest{} } -func (m *HTTPMatchRequest) String() string { return proto.CompactTextString(m) } -func (*HTTPMatchRequest) ProtoMessage() {} -func (*HTTPMatchRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8c56a442a0838fd7, []int{7} +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_8c56a442a0838fd7, []int{5} } -func (m *HTTPMatchRequest) XXX_Unmarshal(b []byte) error { +func (m *Delegate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *HTTPMatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Delegate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_HTTPMatchRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_Delegate.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1606,115 +1472,39 @@ func (m *HTTPMatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *HTTPMatchRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_HTTPMatchRequest.Merge(m, src) +func (m *Delegate) XXX_Merge(src proto.Message) { + xxx_messageInfo_Delegate.Merge(m, src) } -func (m *HTTPMatchRequest) XXX_Size() int { +func (m *Delegate) XXX_Size() int { return m.Size() } -func (m *HTTPMatchRequest) XXX_DiscardUnknown() { - xxx_messageInfo_HTTPMatchRequest.DiscardUnknown(m) +func (m *Delegate) XXX_DiscardUnknown() { + xxx_messageInfo_Delegate.DiscardUnknown(m) } -var xxx_messageInfo_HTTPMatchRequest proto.InternalMessageInfo +var xxx_messageInfo_Delegate proto.InternalMessageInfo -func (m *HTTPMatchRequest) GetName() string { +func (m *Delegate) 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 { +func (m *Delegate) GetNamespace() string { if m != nil { - return m.Gateways + return m.Namespace } - return nil + return "" } -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". +// 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 removes the `foo` response header, but only from responses +// coming from the `v1` subset (version) of the `reviews` service. // // {{}} // {{}} @@ -1727,7 +1517,11 @@ func (m *HTTPMatchRequest) GetSourceNamespace() string { // hosts: // - reviews.prod.svc.cluster.local // http: -// - route: +// - headers: +// request: +// set: +// test: true +// route: // - destination: // host: reviews.prod.svc.cluster.local // subset: v2 @@ -1735,6 +1529,10 @@ func (m *HTTPMatchRequest) GetSourceNamespace() string { // - destination: // host: reviews.prod.svc.cluster.local // subset: v1 +// headers: +// response: +// remove: +// - foo // weight: 75 // ``` // {{}} @@ -1749,7 +1547,11 @@ func (m *HTTPMatchRequest) GetSourceNamespace() string { // hosts: // - reviews.prod.svc.cluster.local // http: -// - route: +// - headers: +// request: +// set: +// test: true +// route: // - destination: // host: reviews.prod.svc.cluster.local // subset: v2 @@ -1757,125 +1559,38 @@ func (m *HTTPMatchRequest) GetSourceNamespace() string { // - destination: // host: reviews.prod.svc.cluster.local // subset: v1 +// headers: +// response: +// remove: +// - foo // 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:"-"` +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 *HTTPRouteDestination) Reset() { *m = HTTPRouteDestination{} } -func (m *HTTPRouteDestination) String() string { return proto.CompactTextString(m) } -func (*HTTPRouteDestination) ProtoMessage() {} -func (*HTTPRouteDestination) Descriptor() ([]byte, []int) { - return fileDescriptor_8c56a442a0838fd7, []int{8} +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_8c56a442a0838fd7, []int{6} } -func (m *HTTPRouteDestination) XXX_Unmarshal(b []byte) error { +func (m *Headers) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *HTTPRouteDestination) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Headers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_HTTPRouteDestination.Marshal(b, m, deterministic) + return xxx_messageInfo_Headers.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1885,65 +1600,58 @@ func (m *HTTPRouteDestination) XXX_Marshal(b []byte, deterministic bool) ([]byte return b[:n], nil } } -func (m *HTTPRouteDestination) XXX_Merge(src proto.Message) { - xxx_messageInfo_HTTPRouteDestination.Merge(m, src) +func (m *Headers) XXX_Merge(src proto.Message) { + xxx_messageInfo_Headers.Merge(m, src) } -func (m *HTTPRouteDestination) XXX_Size() int { +func (m *Headers) XXX_Size() int { return m.Size() } -func (m *HTTPRouteDestination) XXX_DiscardUnknown() { - xxx_messageInfo_HTTPRouteDestination.DiscardUnknown(m) +func (m *Headers) XXX_DiscardUnknown() { + xxx_messageInfo_Headers.DiscardUnknown(m) } -var xxx_messageInfo_HTTPRouteDestination proto.InternalMessageInfo +var xxx_messageInfo_Headers proto.InternalMessageInfo -func (m *HTTPRouteDestination) GetDestination() *Destination { +func (m *Headers) GetRequest() *Headers_HeaderOperations { if m != nil { - return m.Destination + return m.Request } return nil } -func (m *HTTPRouteDestination) GetWeight() int32 { - if m != nil { - return m.Weight - } - return 0 -} - -func (m *HTTPRouteDestination) GetHeaders() *Headers { +func (m *Headers) GetResponse() *Headers_HeaderOperations { if m != nil { - return m.Headers + return m.Response } 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"` +// 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 *RouteDestination) Reset() { *m = RouteDestination{} } -func (m *RouteDestination) String() string { return proto.CompactTextString(m) } -func (*RouteDestination) ProtoMessage() {} -func (*RouteDestination) Descriptor() ([]byte, []int) { - return fileDescriptor_8c56a442a0838fd7, []int{9} +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_8c56a442a0838fd7, []int{6, 0} } -func (m *RouteDestination) XXX_Unmarshal(b []byte) error { +func (m *Headers_HeaderOperations) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *RouteDestination) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *Headers_HeaderOperations) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_RouteDestination.Marshal(b, m, deterministic) + return xxx_messageInfo_Headers_HeaderOperations.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -1953,184 +1661,128 @@ func (m *RouteDestination) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return b[:n], nil } } -func (m *RouteDestination) XXX_Merge(src proto.Message) { - xxx_messageInfo_RouteDestination.Merge(m, src) +func (m *Headers_HeaderOperations) XXX_Merge(src proto.Message) { + xxx_messageInfo_Headers_HeaderOperations.Merge(m, src) } -func (m *RouteDestination) XXX_Size() int { +func (m *Headers_HeaderOperations) XXX_Size() int { return m.Size() } -func (m *RouteDestination) XXX_DiscardUnknown() { - xxx_messageInfo_RouteDestination.DiscardUnknown(m) +func (m *Headers_HeaderOperations) XXX_DiscardUnknown() { + xxx_messageInfo_Headers_HeaderOperations.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_8c56a442a0838fd7, []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 +var xxx_messageInfo_Headers_HeaderOperations proto.InternalMessageInfo -func (m *L4MatchAttributes) GetDestinationSubnets() []string { +func (m *Headers_HeaderOperations) GetSet() map[string]string { if m != nil { - return m.DestinationSubnets + return m.Set } 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 { +func (m *Headers_HeaderOperations) GetAdd() map[string]string { if m != nil { - return m.SourceLabels + return m.Add } return nil } -func (m *L4MatchAttributes) GetGateways() []string { +func (m *Headers_HeaderOperations) GetRemove() []string { if m != nil { - return m.Gateways + return m.Remove } 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:"-"` +// 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 *TLSMatchAttributes) Reset() { *m = TLSMatchAttributes{} } -func (m *TLSMatchAttributes) String() string { return proto.CompactTextString(m) } -func (*TLSMatchAttributes) ProtoMessage() {} -func (*TLSMatchAttributes) Descriptor() ([]byte, []int) { - return fileDescriptor_8c56a442a0838fd7, []int{11} +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_8c56a442a0838fd7, []int{7} } -func (m *TLSMatchAttributes) XXX_Unmarshal(b []byte) error { +func (m *TLSRoute) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *TLSMatchAttributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TLSRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_TLSMatchAttributes.Marshal(b, m, deterministic) + return xxx_messageInfo_TLSRoute.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2140,65 +1792,35 @@ func (m *TLSMatchAttributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *TLSMatchAttributes) XXX_Merge(src proto.Message) { - xxx_messageInfo_TLSMatchAttributes.Merge(m, src) +func (m *TLSRoute) XXX_Merge(src proto.Message) { + xxx_messageInfo_TLSRoute.Merge(m, src) } -func (m *TLSMatchAttributes) XXX_Size() int { +func (m *TLSRoute) XXX_Size() int { return m.Size() } -func (m *TLSMatchAttributes) XXX_DiscardUnknown() { - xxx_messageInfo_TLSMatchAttributes.DiscardUnknown(m) +func (m *TLSRoute) XXX_DiscardUnknown() { + xxx_messageInfo_TLSRoute.DiscardUnknown(m) } -var xxx_messageInfo_TLSMatchAttributes proto.InternalMessageInfo +var xxx_messageInfo_TLSRoute proto.InternalMessageInfo -func (m *TLSMatchAttributes) GetSniHosts() []string { +func (m *TLSRoute) GetMatch() []*TLSMatchAttributes { if m != nil { - return m.SniHosts + return m.Match } return nil } -func (m *TLSMatchAttributes) GetDestinationSubnets() []string { +func (m *TLSRoute) GetRoute() []*RouteDestination { if m != nil { - return m.DestinationSubnets + return m.Route } 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. +// 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. // // {{}} // {{}} @@ -2206,18 +1828,18 @@ func (m *TLSMatchAttributes) GetSourceNamespace() string { // apiVersion: networking.istio.io/v1alpha3 // kind: VirtualService // metadata: -// name: ratings-route +// name: bookinfo-mongo // spec: // hosts: -// - ratings.prod.svc.cluster.local -// http: +// - mongo.prod.svc.cluster.local +// tcp: // - match: -// - uri: -// exact: /v1/getProductRatings -// redirect: -// uri: /v1/bookRatings -// authority: newratings.default.svc.cluster.local -// ... +// - port: 27017 +// route: +// - destination: +// host: mongo.backup.svc.cluster.local +// port: +// number: 5555 // ``` // {{}} // @@ -2226,50 +1848,46 @@ func (m *TLSMatchAttributes) GetSourceNamespace() string { // apiVersion: networking.istio.io/v1beta1 // kind: VirtualService // metadata: -// name: ratings-route +// name: bookinfo-mongo // spec: // hosts: -// - ratings.prod.svc.cluster.local -// http: +// - mongo.prod.svc.cluster.local +// tcp: // - match: -// - uri: -// exact: /v1/getProductRatings -// redirect: -// uri: /v1/bookRatings -// authority: newratings.default.svc.cluster.local -// ... +// - port: 27017 +// route: +// - destination: +// host: mongo.backup.svc.cluster.local +// port: +// number: 5555 // ``` // {{}} // {{}} -// -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:"-"` +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 *HTTPRedirect) Reset() { *m = HTTPRedirect{} } -func (m *HTTPRedirect) String() string { return proto.CompactTextString(m) } -func (*HTTPRedirect) ProtoMessage() {} -func (*HTTPRedirect) Descriptor() ([]byte, []int) { - return fileDescriptor_8c56a442a0838fd7, []int{12} +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_8c56a442a0838fd7, []int{8} } -func (m *HTTPRedirect) XXX_Unmarshal(b []byte) error { +func (m *TCPRoute) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *HTTPRedirect) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *TCPRoute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_HTTPRedirect.Marshal(b, m, deterministic) + return xxx_messageInfo_TCPRoute.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2279,44 +1897,37 @@ func (m *HTTPRedirect) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *HTTPRedirect) XXX_Merge(src proto.Message) { - xxx_messageInfo_HTTPRedirect.Merge(m, src) +func (m *TCPRoute) XXX_Merge(src proto.Message) { + xxx_messageInfo_TCPRoute.Merge(m, src) } -func (m *HTTPRedirect) XXX_Size() int { +func (m *TCPRoute) XXX_Size() int { return m.Size() } -func (m *HTTPRedirect) XXX_DiscardUnknown() { - xxx_messageInfo_HTTPRedirect.DiscardUnknown(m) +func (m *TCPRoute) XXX_DiscardUnknown() { + xxx_messageInfo_TCPRoute.DiscardUnknown(m) } -var xxx_messageInfo_HTTPRedirect proto.InternalMessageInfo - -func (m *HTTPRedirect) GetUri() string { - if m != nil { - return m.Uri - } - return "" -} +var xxx_messageInfo_TCPRoute proto.InternalMessageInfo -func (m *HTTPRedirect) GetAuthority() string { +func (m *TCPRoute) GetMatch() []*L4MatchAttributes { if m != nil { - return m.Authority + return m.Match } - return "" + return nil } -func (m *HTTPRedirect) GetRedirectCode() uint32 { +func (m *TCPRoute) GetRoute() []*RouteDestination { if m != nil { - return m.RedirectCode + return m.Route } - return 0 + return nil } -// 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. +// 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`. // // {{}} // {{}} @@ -2330,14 +1941,15 @@ func (m *HTTPRedirect) GetRedirectCode() uint32 { // - ratings.prod.svc.cluster.local // http: // - match: -// - uri: -// prefix: /ratings -// rewrite: -// uri: /v1/bookRatings +// - headers: +// end-user: +// exact: jason +// uri: +// prefix: "/ratings/v2/" +// ignoreUriCase: true // route: // - destination: // host: ratings.prod.svc.cluster.local -// subset: v1 // ``` // {{}} // @@ -2352,102 +1964,137 @@ func (m *HTTPRedirect) GetRedirectCode() uint32 { // - ratings.prod.svc.cluster.local // http: // - match: -// - uri: -// prefix: /ratings -// rewrite: -// uri: /v1/bookRatings +// - headers: +// end-user: +// exact: jason +// uri: +// prefix: "/ratings/v2/" +// ignoreUriCase: true // 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_8c56a442a0838fd7, []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_8c56a442a0838fd7, []int{14} -} -func (m *StringMatch) XXX_Unmarshal(b []byte) error { +// 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_8c56a442a0838fd7, []int{9} +} +func (m *HTTPMatchRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *StringMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *HTTPMatchRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_StringMatch.Marshal(b, m, deterministic) + return xxx_messageInfo_HTTPMatchRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2457,78 +2104,115 @@ func (m *StringMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *StringMatch) XXX_Merge(src proto.Message) { - xxx_messageInfo_StringMatch.Merge(m, src) +func (m *HTTPMatchRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_HTTPMatchRequest.Merge(m, src) } -func (m *StringMatch) XXX_Size() int { +func (m *HTTPMatchRequest) XXX_Size() int { return m.Size() } -func (m *StringMatch) XXX_DiscardUnknown() { - xxx_messageInfo_StringMatch.DiscardUnknown(m) +func (m *HTTPMatchRequest) XXX_DiscardUnknown() { + xxx_messageInfo_HTTPMatchRequest.DiscardUnknown(m) } -var xxx_messageInfo_StringMatch proto.InternalMessageInfo +var xxx_messageInfo_HTTPMatchRequest proto.InternalMessageInfo -type isStringMatch_MatchType interface { - isStringMatch_MatchType() - MarshalTo([]byte) (int, error) - Size() int +func (m *HTTPMatchRequest) GetName() string { + if m != nil { + return m.Name + } + return "" } -type StringMatch_Exact struct { - Exact string `protobuf:"bytes,1,opt,name=exact,proto3,oneof" json:"exact,omitempty"` +func (m *HTTPMatchRequest) GetUri() *StringMatch { + if m != nil { + return m.Uri + } + return nil } -type StringMatch_Prefix struct { - Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3,oneof" json:"prefix,omitempty"` + +func (m *HTTPMatchRequest) GetScheme() *StringMatch { + if m != nil { + return m.Scheme + } + return nil } -type StringMatch_Regex struct { - Regex string `protobuf:"bytes,3,opt,name=regex,proto3,oneof" json:"regex,omitempty"` + +func (m *HTTPMatchRequest) GetMethod() *StringMatch { + if m != nil { + return m.Method + } + return nil } -func (*StringMatch_Exact) isStringMatch_MatchType() {} -func (*StringMatch_Prefix) isStringMatch_MatchType() {} -func (*StringMatch_Regex) isStringMatch_MatchType() {} +func (m *HTTPMatchRequest) GetAuthority() *StringMatch { + if m != nil { + return m.Authority + } + return nil +} -func (m *StringMatch) GetMatchType() isStringMatch_MatchType { +func (m *HTTPMatchRequest) GetHeaders() map[string]*StringMatch { if m != nil { - return m.MatchType + return m.Headers } return nil } -func (m *StringMatch) GetExact() string { - if x, ok := m.GetMatchType().(*StringMatch_Exact); ok { - return x.Exact +func (m *HTTPMatchRequest) GetPort() uint32 { + if m != nil { + return m.Port } - return "" + return 0 } -func (m *StringMatch) GetPrefix() string { - if x, ok := m.GetMatchType().(*StringMatch_Prefix); ok { - return x.Prefix +func (m *HTTPMatchRequest) GetSourceLabels() map[string]string { + if m != nil { + return m.SourceLabels } - return "" + return nil } -func (m *StringMatch) GetRegex() string { - if x, ok := m.GetMatchType().(*StringMatch_Regex); ok { - return x.Regex +func (m *HTTPMatchRequest) GetGateways() []string { + if m != nil { + return m.Gateways } - return "" + return nil } -// 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), +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 } -// 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. +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". // // {{}} // {{}} @@ -2536,19 +2220,20 @@ func (*StringMatch) XXX_OneofWrappers() []interface{} { // apiVersion: networking.istio.io/v1alpha3 // kind: VirtualService // metadata: -// name: ratings-route +// name: reviews-route // spec: // hosts: -// - ratings.prod.svc.cluster.local +// - reviews.prod.svc.cluster.local // http: // - route: // - destination: -// host: ratings.prod.svc.cluster.local +// host: reviews.prod.svc.cluster.local +// subset: v2 +// weight: 25 +// - destination: +// host: reviews.prod.svc.cluster.local // subset: v1 -// retries: -// attempts: 3 -// perTryTimeout: 2s -// retryOn: gateway-error,connect-failure,refused-stream +// weight: 75 // ``` // {{}} // @@ -2557,116 +2242,67 @@ func (*StringMatch) XXX_OneofWrappers() []interface{} { // apiVersion: networking.istio.io/v1beta1 // kind: VirtualService // metadata: -// name: ratings-route +// name: reviews-route // spec: // hosts: -// - ratings.prod.svc.cluster.local +// - reviews.prod.svc.cluster.local // http: // - route: // - destination: -// host: ratings.prod.svc.cluster.local +// host: reviews.prod.svc.cluster.local +// subset: v2 +// weight: 25 +// - destination: +// host: reviews.prod.svc.cluster.local // subset: v1 -// retries: -// attempts: 3 -// perTryTimeout: 2s -// retryOn: gateway-error,connect-failure,refused-stream +// weight: 75 // ``` // {{}} // {{}} // -type HTTPRetry struct { - // Number of retries to be allowed for a given request. The interval - // between retries will be determined automatically (25ms+). When request - // `timeout` of the [HTTP route](https://istio.io/docs/reference/config/networking/virtual-service/#HTTPRoute) - // or `per_try_timeout` is configured, the actual number of retries attempted also depends on - // the specified request `timeout` and `per_try_timeout` values. - 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. - // Default is same value as request - // `timeout` of the [HTTP route](https://istio.io/docs/reference/config/networking/virtual-service/#HTTPRoute), - // which means no timeout. - 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_8c56a442a0838fd7, []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. +// 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 // // {{}} // {{}} @@ -2674,25 +2310,18 @@ func (m *HTTPRetry) GetRetryRemoteLocalities() *types.BoolValue { // apiVersion: networking.istio.io/v1alpha3 // kind: VirtualService // metadata: -// name: ratings-route +// name: reviews-route-two-domains // spec: // hosts: -// - ratings.prod.svc.cluster.local +// - reviews.com // 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" +// host: dev.reviews.com +// weight: 25 +// - destination: +// host: reviews.com +// weight: 75 // ``` // {{}} // @@ -2701,72 +2330,50 @@ func (m *HTTPRetry) GetRetryRemoteLocalities() *types.BoolValue { // apiVersion: networking.istio.io/v1beta1 // kind: VirtualService // metadata: -// name: ratings-route +// name: reviews-route-two-domains // spec: // hosts: -// - ratings.prod.svc.cluster.local +// - reviews.com // 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" +// host: dev.reviews.com +// weight: 25 +// - destination: +// host: reviews.com +// weight: 75 // ``` // {{}} // {{}} // -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 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:"-"` +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 *CorsPolicy) Reset() { *m = CorsPolicy{} } -func (m *CorsPolicy) String() string { return proto.CompactTextString(m) } -func (*CorsPolicy) ProtoMessage() {} -func (*CorsPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_8c56a442a0838fd7, []int{16} +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_8c56a442a0838fd7, []int{10} } -func (m *CorsPolicy) XXX_Unmarshal(b []byte) error { +func (m *HTTPRouteDestination) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *CorsPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *HTTPRouteDestination) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_CorsPolicy.Marshal(b, m, deterministic) + return xxx_messageInfo_HTTPRouteDestination.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2776,100 +2383,65 @@ func (m *CorsPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *CorsPolicy) XXX_Merge(src proto.Message) { - xxx_messageInfo_CorsPolicy.Merge(m, src) +func (m *HTTPRouteDestination) XXX_Merge(src proto.Message) { + xxx_messageInfo_HTTPRouteDestination.Merge(m, src) } -func (m *CorsPolicy) XXX_Size() int { +func (m *HTTPRouteDestination) 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 *HTTPRouteDestination) XXX_DiscardUnknown() { + xxx_messageInfo_HTTPRouteDestination.DiscardUnknown(m) } -func (m *CorsPolicy) GetAllowHeaders() []string { - if m != nil { - return m.AllowHeaders - } - return nil -} +var xxx_messageInfo_HTTPRouteDestination proto.InternalMessageInfo -func (m *CorsPolicy) GetExposeHeaders() []string { +func (m *HTTPRouteDestination) GetDestination() *Destination { if m != nil { - return m.ExposeHeaders + return m.Destination } return nil } -func (m *CorsPolicy) GetMaxAge() *types.Duration { +func (m *HTTPRouteDestination) GetWeight() int32 { if m != nil { - return m.MaxAge + return m.Weight } - return nil + return 0 } -func (m *CorsPolicy) GetAllowCredentials() *types.BoolValue { +func (m *HTTPRouteDestination) GetHeaders() *Headers { if m != nil { - return m.AllowCredentials + return m.Headers } 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:"-"` +// 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 *HTTPFaultInjection) Reset() { *m = HTTPFaultInjection{} } -func (m *HTTPFaultInjection) String() string { return proto.CompactTextString(m) } -func (*HTTPFaultInjection) ProtoMessage() {} -func (*HTTPFaultInjection) Descriptor() ([]byte, []int) { - return fileDescriptor_8c56a442a0838fd7, []int{17} +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_8c56a442a0838fd7, []int{11} } -func (m *HTTPFaultInjection) XXX_Unmarshal(b []byte) error { +func (m *RouteDestination) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *HTTPFaultInjection) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *RouteDestination) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_HTTPFaultInjection.Marshal(b, m, deterministic) + return xxx_messageInfo_RouteDestination.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2879,120 +2451,76 @@ func (m *HTTPFaultInjection) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *HTTPFaultInjection) XXX_Merge(src proto.Message) { - xxx_messageInfo_HTTPFaultInjection.Merge(m, src) +func (m *RouteDestination) XXX_Merge(src proto.Message) { + xxx_messageInfo_RouteDestination.Merge(m, src) } -func (m *HTTPFaultInjection) XXX_Size() int { +func (m *RouteDestination) XXX_Size() int { return m.Size() } -func (m *HTTPFaultInjection) XXX_DiscardUnknown() { - xxx_messageInfo_HTTPFaultInjection.DiscardUnknown(m) +func (m *RouteDestination) XXX_DiscardUnknown() { + xxx_messageInfo_RouteDestination.DiscardUnknown(m) } -var xxx_messageInfo_HTTPFaultInjection proto.InternalMessageInfo +var xxx_messageInfo_RouteDestination proto.InternalMessageInfo -func (m *HTTPFaultInjection) GetDelay() *HTTPFaultInjection_Delay { +func (m *RouteDestination) GetDestination() *Destination { if m != nil { - return m.Delay + return m.Destination } return nil } -func (m *HTTPFaultInjection) GetAbort() *HTTPFaultInjection_Abort { +func (m *RouteDestination) GetWeight() int32 { if m != nil { - return m.Abort + return m.Weight } - return nil + return 0 } -// 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"` +// 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 *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_8c56a442a0838fd7, []int{17, 0} +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_8c56a442a0838fd7, []int{12} } -func (m *HTTPFaultInjection_Delay) XXX_Unmarshal(b []byte) error { +func (m *L4MatchAttributes) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *HTTPFaultInjection_Delay) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *L4MatchAttributes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_HTTPFaultInjection_Delay.Marshal(b, m, deterministic) + return xxx_messageInfo_L4MatchAttributes.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -3002,81 +2530,173 @@ func (m *HTTPFaultInjection_Delay) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *HTTPFaultInjection_Delay) XXX_Merge(src proto.Message) { - xxx_messageInfo_HTTPFaultInjection_Delay.Merge(m, src) +func (m *L4MatchAttributes) XXX_Merge(src proto.Message) { + xxx_messageInfo_L4MatchAttributes.Merge(m, src) } -func (m *HTTPFaultInjection_Delay) XXX_Size() int { +func (m *L4MatchAttributes) XXX_Size() int { return m.Size() } -func (m *HTTPFaultInjection_Delay) XXX_DiscardUnknown() { - xxx_messageInfo_HTTPFaultInjection_Delay.DiscardUnknown(m) +func (m *L4MatchAttributes) XXX_DiscardUnknown() { + xxx_messageInfo_L4MatchAttributes.DiscardUnknown(m) } -var xxx_messageInfo_HTTPFaultInjection_Delay proto.InternalMessageInfo +var xxx_messageInfo_L4MatchAttributes proto.InternalMessageInfo -type isHTTPFaultInjection_Delay_HttpDelayType interface { - isHTTPFaultInjection_Delay_HttpDelayType() - MarshalTo([]byte) (int, error) - Size() int +func (m *L4MatchAttributes) GetDestinationSubnets() []string { + if m != nil { + return m.DestinationSubnets + } + return nil } -type HTTPFaultInjection_Delay_FixedDelay struct { - FixedDelay *types.Duration `protobuf:"bytes,2,opt,name=fixed_delay,json=fixedDelay,proto3,oneof" json:"fixed_delay,omitempty"` -} -type HTTPFaultInjection_Delay_ExponentialDelay struct { - ExponentialDelay *types.Duration `protobuf:"bytes,3,opt,name=exponential_delay,json=exponentialDelay,proto3,oneof" json:"exponential_delay,omitempty"` -} +func (m *L4MatchAttributes) GetPort() uint32 { + if m != nil { + return m.Port + } + return 0 +} -func (*HTTPFaultInjection_Delay_FixedDelay) isHTTPFaultInjection_Delay_HttpDelayType() {} -func (*HTTPFaultInjection_Delay_ExponentialDelay) isHTTPFaultInjection_Delay_HttpDelayType() {} +func (m *L4MatchAttributes) GetSourceSubnet() string { + if m != nil { + return m.SourceSubnet + } + return "" +} -func (m *HTTPFaultInjection_Delay) GetHttpDelayType() isHTTPFaultInjection_Delay_HttpDelayType { +func (m *L4MatchAttributes) GetSourceLabels() map[string]string { if m != nil { - return m.HttpDelayType + return m.SourceLabels } return nil } -// Deprecated: Do not use. -func (m *HTTPFaultInjection_Delay) GetPercent() int32 { +func (m *L4MatchAttributes) GetGateways() []string { if m != nil { - return m.Percent + return m.Gateways } - return 0 + return nil } -func (m *HTTPFaultInjection_Delay) GetFixedDelay() *types.Duration { - if x, ok := m.GetHttpDelayType().(*HTTPFaultInjection_Delay_FixedDelay); ok { - return x.FixedDelay +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_8c56a442a0838fd7, []int{13} +} +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 *HTTPFaultInjection_Delay) GetExponentialDelay() *types.Duration { - if x, ok := m.GetHttpDelayType().(*HTTPFaultInjection_Delay_ExponentialDelay); ok { - return x.ExponentialDelay +func (m *TLSMatchAttributes) GetDestinationSubnets() []string { + if m != nil { + return m.DestinationSubnets } return nil } -func (m *HTTPFaultInjection_Delay) GetPercentage() *Percent { +func (m *TLSMatchAttributes) GetPort() uint32 { if m != nil { - return m.Percentage + return m.Port + } + return 0 +} + +func (m *TLSMatchAttributes) GetSourceLabels() map[string]string { + if m != nil { + return m.SourceLabels } 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), +func (m *TLSMatchAttributes) GetGateways() []string { + if m != nil { + return m.Gateways } + return 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". +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. // // {{}} // {{}} @@ -3089,15 +2709,13 @@ func (*HTTPFaultInjection_Delay) XXX_OneofWrappers() []interface{} { // 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 +// - match: +// - uri: +// exact: /v1/getProductRatings +// redirect: +// uri: /v1/bookRatings +// authority: newratings.default.svc.cluster.local +// ... // ``` // {{}} // @@ -3111,48 +2729,45 @@ func (*HTTPFaultInjection_Delay) XXX_OneofWrappers() []interface{} { // 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 +// - match: +// - uri: +// exact: /v1/getProductRatings +// redirect: +// uri: /v1/bookRatings +// authority: newratings.default.svc.cluster.local +// ... // ``` // {{}} // {{}} // -// 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"` +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 *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_8c56a442a0838fd7, []int{17, 1} +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_8c56a442a0838fd7, []int{14} } -func (m *HTTPFaultInjection_Abort) XXX_Unmarshal(b []byte) error { +func (m *HTTPRedirect) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *HTTPFaultInjection_Abort) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *HTTPRedirect) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_HTTPFaultInjection_Abort.Marshal(b, m, deterministic) + return xxx_messageInfo_HTTPRedirect.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -3162,104 +2777,115 @@ func (m *HTTPFaultInjection_Abort) XXX_Marshal(b []byte, deterministic bool) ([] return b[:n], nil } } -func (m *HTTPFaultInjection_Abort) XXX_Merge(src proto.Message) { - xxx_messageInfo_HTTPFaultInjection_Abort.Merge(m, src) +func (m *HTTPRedirect) XXX_Merge(src proto.Message) { + xxx_messageInfo_HTTPRedirect.Merge(m, src) } -func (m *HTTPFaultInjection_Abort) XXX_Size() int { +func (m *HTTPRedirect) XXX_Size() int { return m.Size() } -func (m *HTTPFaultInjection_Abort) XXX_DiscardUnknown() { - xxx_messageInfo_HTTPFaultInjection_Abort.DiscardUnknown(m) +func (m *HTTPRedirect) XXX_DiscardUnknown() { + xxx_messageInfo_HTTPRedirect.DiscardUnknown(m) } -var xxx_messageInfo_HTTPFaultInjection_Abort proto.InternalMessageInfo - -type isHTTPFaultInjection_Abort_ErrorType interface { - isHTTPFaultInjection_Abort_ErrorType() - MarshalTo([]byte) (int, error) - Size() int -} +var xxx_messageInfo_HTTPRedirect proto.InternalMessageInfo -type HTTPFaultInjection_Abort_HttpStatus struct { - HttpStatus int32 `protobuf:"varint,2,opt,name=http_status,json=httpStatus,proto3,oneof" json:"http_status,omitempty"` -} -type HTTPFaultInjection_Abort_GrpcStatus struct { - GrpcStatus string `protobuf:"bytes,3,opt,name=grpc_status,json=grpcStatus,proto3,oneof" json:"grpc_status,omitempty"` -} -type HTTPFaultInjection_Abort_Http2Error struct { - Http2Error string `protobuf:"bytes,4,opt,name=http2_error,json=http2Error,proto3,oneof" json:"http2_error,omitempty"` +func (m *HTTPRedirect) GetUri() string { + if m != nil { + return m.Uri + } + return "" } -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 { +func (m *HTTPRedirect) GetAuthority() string { if m != nil { - return m.ErrorType + return m.Authority } - return nil + return "" } -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 { +func (m *HTTPRedirect) GetRedirectCode() uint32 { 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), + return m.RedirectCode } + return 0 } -// 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"` +// 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 *PortSelector) Reset() { *m = PortSelector{} } -func (m *PortSelector) String() string { return proto.CompactTextString(m) } -func (*PortSelector) ProtoMessage() {} -func (*PortSelector) Descriptor() ([]byte, []int) { - return fileDescriptor_8c56a442a0838fd7, []int{18} +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_8c56a442a0838fd7, []int{15} } -func (m *PortSelector) XXX_Unmarshal(b []byte) error { +func (m *HTTPRewrite) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *PortSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *HTTPRewrite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_PortSelector.Marshal(b, m, deterministic) + return xxx_messageInfo_HTTPRewrite.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -3269,45 +2895,57 @@ func (m *PortSelector) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *PortSelector) XXX_Merge(src proto.Message) { - xxx_messageInfo_PortSelector.Merge(m, src) +func (m *HTTPRewrite) XXX_Merge(src proto.Message) { + xxx_messageInfo_HTTPRewrite.Merge(m, src) } -func (m *PortSelector) XXX_Size() int { +func (m *HTTPRewrite) XXX_Size() int { return m.Size() } -func (m *PortSelector) XXX_DiscardUnknown() { - xxx_messageInfo_PortSelector.DiscardUnknown(m) +func (m *HTTPRewrite) XXX_DiscardUnknown() { + xxx_messageInfo_HTTPRewrite.DiscardUnknown(m) } -var xxx_messageInfo_PortSelector proto.InternalMessageInfo +var xxx_messageInfo_HTTPRewrite proto.InternalMessageInfo -func (m *PortSelector) GetNumber() uint32 { +func (m *HTTPRewrite) GetUri() string { if m != nil { - return m.Number + return m.Uri } - return 0 + return "" } -// 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 *HTTPRewrite) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" } -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_8c56a442a0838fd7, []int{19} +// 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 *Percent) XXX_Unmarshal(b []byte) error { + +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_8c56a442a0838fd7, []int{16} +} +func (m *StringMatch) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Percent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *StringMatch) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Percent.Marshal(b, m, deterministic) + return xxx_messageInfo_StringMatch.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -3317,1032 +2955,1081 @@ func (m *Percent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Percent) XXX_Merge(src proto.Message) { - xxx_messageInfo_Percent.Merge(m, src) +func (m *StringMatch) XXX_Merge(src proto.Message) { + xxx_messageInfo_StringMatch.Merge(m, src) } -func (m *Percent) XXX_Size() int { +func (m *StringMatch) XXX_Size() int { return m.Size() } -func (m *Percent) XXX_DiscardUnknown() { - xxx_messageInfo_Percent.DiscardUnknown(m) +func (m *StringMatch) XXX_DiscardUnknown() { + xxx_messageInfo_StringMatch.DiscardUnknown(m) } -var xxx_messageInfo_Percent proto.InternalMessageInfo +var xxx_messageInfo_StringMatch proto.InternalMessageInfo -func (m *Percent) GetValue() float64 { - if m != nil { - return m.Value - } - return 0 +type isStringMatch_MatchType interface { + isStringMatch_MatchType() + MarshalTo([]byte) (int, error) + Size() int } -func init() { - proto.RegisterType((*VirtualService)(nil), "istio.networking.v1beta1.VirtualService") - proto.RegisterType((*Destination)(nil), "istio.networking.v1beta1.Destination") - proto.RegisterType((*HTTPRoute)(nil), "istio.networking.v1beta1.HTTPRoute") - proto.RegisterType((*Delegate)(nil), "istio.networking.v1beta1.Delegate") - proto.RegisterType((*Headers)(nil), "istio.networking.v1beta1.Headers") - proto.RegisterType((*Headers_HeaderOperations)(nil), "istio.networking.v1beta1.Headers.HeaderOperations") - proto.RegisterMapType((map[string]string)(nil), "istio.networking.v1beta1.Headers.HeaderOperations.AddEntry") - proto.RegisterMapType((map[string]string)(nil), "istio.networking.v1beta1.Headers.HeaderOperations.SetEntry") - proto.RegisterType((*TLSRoute)(nil), "istio.networking.v1beta1.TLSRoute") - proto.RegisterType((*TCPRoute)(nil), "istio.networking.v1beta1.TCPRoute") - proto.RegisterType((*HTTPMatchRequest)(nil), "istio.networking.v1beta1.HTTPMatchRequest") - proto.RegisterMapType((map[string]*StringMatch)(nil), "istio.networking.v1beta1.HTTPMatchRequest.HeadersEntry") - proto.RegisterMapType((map[string]*StringMatch)(nil), "istio.networking.v1beta1.HTTPMatchRequest.QueryParamsEntry") - proto.RegisterMapType((map[string]string)(nil), "istio.networking.v1beta1.HTTPMatchRequest.SourceLabelsEntry") - proto.RegisterMapType((map[string]*StringMatch)(nil), "istio.networking.v1beta1.HTTPMatchRequest.WithoutHeadersEntry") - proto.RegisterType((*HTTPRouteDestination)(nil), "istio.networking.v1beta1.HTTPRouteDestination") - proto.RegisterType((*RouteDestination)(nil), "istio.networking.v1beta1.RouteDestination") - proto.RegisterType((*L4MatchAttributes)(nil), "istio.networking.v1beta1.L4MatchAttributes") - proto.RegisterMapType((map[string]string)(nil), "istio.networking.v1beta1.L4MatchAttributes.SourceLabelsEntry") - proto.RegisterType((*TLSMatchAttributes)(nil), "istio.networking.v1beta1.TLSMatchAttributes") - proto.RegisterMapType((map[string]string)(nil), "istio.networking.v1beta1.TLSMatchAttributes.SourceLabelsEntry") - proto.RegisterType((*HTTPRedirect)(nil), "istio.networking.v1beta1.HTTPRedirect") - proto.RegisterType((*HTTPRewrite)(nil), "istio.networking.v1beta1.HTTPRewrite") - proto.RegisterType((*StringMatch)(nil), "istio.networking.v1beta1.StringMatch") - proto.RegisterType((*HTTPRetry)(nil), "istio.networking.v1beta1.HTTPRetry") - proto.RegisterType((*CorsPolicy)(nil), "istio.networking.v1beta1.CorsPolicy") - proto.RegisterType((*HTTPFaultInjection)(nil), "istio.networking.v1beta1.HTTPFaultInjection") - proto.RegisterType((*HTTPFaultInjection_Delay)(nil), "istio.networking.v1beta1.HTTPFaultInjection.Delay") - proto.RegisterType((*HTTPFaultInjection_Abort)(nil), "istio.networking.v1beta1.HTTPFaultInjection.Abort") - proto.RegisterType((*PortSelector)(nil), "istio.networking.v1beta1.PortSelector") - proto.RegisterType((*Percent)(nil), "istio.networking.v1beta1.Percent") +type StringMatch_Exact struct { + Exact string `protobuf:"bytes,1,opt,name=exact,proto3,oneof" json:"exact,omitempty"` } - -func init() { - proto.RegisterFile("networking/v1beta1/virtual_service.proto", fileDescriptor_8c56a442a0838fd7) +type StringMatch_Prefix struct { + Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3,oneof" json:"prefix,omitempty"` } - -var fileDescriptor_8c56a442a0838fd7 = []byte{ - // 1987 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, 0x6b, 0x52, 0x89, 0x57, 0x21, 0x29, - 0x03, 0x8b, 0x5c, 0xab, 0x6c, 0x11, 0x6a, 0xb3, 0xd9, 0x5d, 0xff, 0x09, 0xeb, 0x75, 0x39, 0x89, - 0x77, 0xec, 0x5d, 0xaa, 0x38, 0x30, 0xd5, 0x9a, 0x79, 0x96, 0x86, 0x48, 0xd3, 0x93, 0x9e, 0x1e, - 0xdb, 0xe2, 0xcc, 0x81, 0x2a, 0x0e, 0x14, 0x07, 0x0e, 0x1c, 0xf9, 0x16, 0x7c, 0x04, 0x8e, 0x5c, - 0xb8, 0x52, 0x5b, 0xb9, 0x71, 0xe0, 0x23, 0x50, 0x45, 0xf5, 0x9f, 0x91, 0x46, 0x96, 0x6d, 0x49, - 0x21, 0x61, 0x4f, 0x9a, 0x7e, 0xfd, 0x7e, 0xbf, 0xee, 0x7e, 0xaf, 0xfb, 0xbd, 0xd7, 0x2d, 0x58, - 0x0f, 0x50, 0x9c, 0x32, 0xfe, 0xd2, 0x0f, 0xba, 0x1b, 0x27, 0x1f, 0x76, 0x50, 0xd0, 0x0f, 0x37, - 0x4e, 0x7c, 0x2e, 0x62, 0xda, 0x77, 0x22, 0xe4, 0x27, 0xbe, 0x8b, 0xad, 0x90, 0x33, 0xc1, 0x88, - 0xe5, 0x47, 0xc2, 0x67, 0xad, 0xb1, 0x7e, 0xcb, 0xe8, 0xaf, 0xde, 0xed, 0x32, 0xd6, 0xed, 0xe3, - 0x06, 0x0d, 0xfd, 0x8d, 0x63, 0x1f, 0xfb, 0x9e, 0xd3, 0xc1, 0x1e, 0x3d, 0xf1, 0x19, 0xd7, 0xd0, - 0xd5, 0x3b, 0x46, 0x41, 0xb5, 0x3a, 0xf1, 0xf1, 0x86, 0x17, 0x73, 0x2a, 0x7c, 0x16, 0x5c, 0xd6, - 0x7f, 0xca, 0x69, 0x18, 0x22, 0x8f, 0x74, 0x7f, 0xf3, 0xb7, 0x59, 0x58, 0xfa, 0x46, 0x4f, 0xea, - 0x50, 0xcf, 0x89, 0xdc, 0x80, 0x42, 0x8f, 0x45, 0x22, 0xb2, 0x32, 0x6b, 0xb9, 0xf5, 0x8a, 0xad, - 0x1b, 0x64, 0x15, 0xca, 0x5d, 0x2a, 0xf0, 0x94, 0x0e, 0x23, 0x2b, 0xab, 0x3a, 0x46, 0x6d, 0xf2, - 0x08, 0xf2, 0x3d, 0x21, 0x42, 0x2b, 0xb7, 0x96, 0x5b, 0xaf, 0xb6, 0xef, 0xb5, 0x2e, 0x5b, 0x4e, - 0x6b, 0xf7, 0xe8, 0xe8, 0xc0, 0x66, 0xb1, 0x40, 0x5b, 0x01, 0xc8, 0x47, 0x90, 0x13, 0xfd, 0xc8, - 0x2a, 0x28, 0x5c, 0xf3, 0x72, 0xdc, 0xd1, 0xfe, 0xa1, 0x86, 0x49, 0x75, 0x85, 0x72, 0x43, 0x2b, - 0x3f, 0x13, 0xb5, 0x7d, 0x90, 0xa0, 0xdc, 0x90, 0x7c, 0x1f, 0x2a, 0x78, 0x16, 0x32, 0x2e, 0x1c, - 0xc1, 0xac, 0xa2, 0x5e, 0x81, 0x16, 0x1c, 0xb1, 0xe6, 0x6f, 0xa0, 0xba, 0x83, 0x91, 0xf0, 0x03, - 0x65, 0x3b, 0x72, 0x0b, 0xf2, 0x72, 0xd5, 0x56, 0x66, 0x2d, 0xb3, 0x5e, 0xd9, 0xca, 0x7d, 0xbb, - 0x99, 0xb5, 0x95, 0x80, 0xdc, 0x84, 0x62, 0x14, 0x77, 0x22, 0x14, 0x56, 0x56, 0x76, 0xd9, 0xa6, - 0x45, 0x3e, 0x86, 0xbc, 0x64, 0xb2, 0x72, 0x6b, 0x99, 0xf5, 0x6a, 0xfb, 0xc1, 0xe5, 0x73, 0x3a, - 0x60, 0x5c, 0x1c, 0x62, 0x1f, 0x5d, 0xc1, 0xb8, 0xad, 0x30, 0xcd, 0x3f, 0x96, 0xa1, 0x32, 0x32, - 0x0c, 0x21, 0x90, 0x0f, 0xe8, 0x00, 0xad, 0x15, 0xc5, 0xaf, 0xbe, 0xc9, 0xe7, 0x50, 0x18, 0x50, - 0xe1, 0xf6, 0x94, 0x47, 0xaa, 0xed, 0x1f, 0x5d, 0x6d, 0xe0, 0x67, 0x52, 0xd5, 0xc6, 0x57, 0x31, - 0x46, 0xc2, 0xd6, 0x40, 0xb2, 0x03, 0x05, 0x2e, 0xe9, 0x95, 0xeb, 0xaa, 0xed, 0xd6, 0x1c, 0x2e, - 0x4a, 0xd9, 0xc3, 0xd6, 0x60, 0xb2, 0x05, 0x65, 0x8e, 0x9e, 0xcf, 0xd1, 0x9d, 0x63, 0xa5, 0x8a, - 0xc8, 0x68, 0xdb, 0x23, 0x1c, 0xf9, 0x14, 0xca, 0x1e, 0xf6, 0x51, 0xee, 0x1d, 0xeb, 0x86, 0xe2, - 0xb8, 0xc2, 0x83, 0x3b, 0x46, 0xd3, 0x1e, 0x61, 0xc8, 0x67, 0x50, 0xe2, 0x78, 0xca, 0x7d, 0x81, - 0x56, 0x5e, 0xc1, 0xef, 0xcf, 0x9a, 0x82, 0x52, 0xb6, 0x13, 0x14, 0x79, 0x08, 0x25, 0xe1, 0x0f, - 0x90, 0xc5, 0xc2, 0x2a, 0x2a, 0x82, 0xf7, 0x5a, 0xfa, 0x8c, 0xb4, 0x92, 0x33, 0xd2, 0xda, 0x31, - 0x67, 0xc8, 0x4e, 0x34, 0xc9, 0x13, 0x39, 0xaa, 0xe0, 0x3e, 0x46, 0x56, 0x49, 0x81, 0x66, 0x6d, - 0x72, 0x14, 0x7c, 0x68, 0x27, 0x18, 0xb2, 0x05, 0x85, 0x63, 0x1a, 0xf7, 0x85, 0x55, 0x56, 0xe0, - 0x0f, 0xae, 0x06, 0xff, 0x5c, 0xaa, 0x7e, 0x19, 0xfc, 0x1a, 0x5d, 0x6d, 0x7c, 0x05, 0x25, 0x4f, - 0xa0, 0x38, 0xf0, 0x39, 0x67, 0xdc, 0xaa, 0xcc, 0x5a, 0x77, 0xda, 0x75, 0x06, 0x44, 0xbe, 0x80, - 0x25, 0xfd, 0xe5, 0x84, 0xc8, 0x5d, 0x0c, 0x84, 0x45, 0x14, 0xcd, 0xed, 0xa9, 0xd5, 0x7f, 0xfd, - 0x65, 0x20, 0x1e, 0xb6, 0xbf, 0xa1, 0xfd, 0x18, 0xb7, 0xb2, 0x56, 0xc6, 0xae, 0x6b, 0xdc, 0x81, - 0x86, 0x91, 0xe7, 0xb0, 0x32, 0x49, 0x44, 0xbb, 0x68, 0x5d, 0x57, 0x5c, 0xef, 0x5f, 0xb1, 0xef, - 0xb5, 0xae, 0xdd, 0x98, 0x20, 0xa3, 0x5d, 0x24, 0x4f, 0xa1, 0xea, 0x32, 0x1e, 0x39, 0x21, 0xeb, - 0xfb, 0xee, 0xd0, 0x02, 0xc5, 0xf4, 0x83, 0xcb, 0x99, 0xb6, 0x19, 0x8f, 0x0e, 0x94, 0xae, 0x0d, - 0xee, 0xe8, 0x9b, 0x3c, 0x86, 0x52, 0x0f, 0xa9, 0x87, 0x3c, 0xb2, 0x1a, 0xb3, 0x26, 0xb3, 0xab, - 0x15, 0xed, 0x04, 0xb1, 0x97, 0x2f, 0x17, 0x1a, 0xc5, 0xbd, 0x7c, 0xb9, 0xda, 0x68, 0xd8, 0x2b, - 0xa7, 0xd8, 0x89, 0x98, 0xfb, 0x12, 0x85, 0x13, 0x87, 0x5d, 0x4e, 0x3d, 0xb4, 0x97, 0x64, 0xc8, - 0x0c, 0x3c, 0xc7, 0xa8, 0xdb, 0xb7, 0x38, 0x0e, 0xd8, 0x09, 0x3a, 0x1c, 0xa3, 0x90, 0x05, 0x11, - 0x8e, 0x3b, 0x8c, 0xe2, 0x54, 0xc7, 0xcd, 0x11, 0x42, 0x1d, 0xcb, 0xb1, 0x7c, 0x04, 0x98, 0x90, - 0x37, 0x3f, 0x81, 0x72, 0xb2, 0xf7, 0x47, 0x11, 0x21, 0x93, 0x8a, 0x08, 0xb7, 0xa1, 0x22, 0x7f, - 0xa3, 0x90, 0xba, 0x68, 0x42, 0xd1, 0x58, 0xd0, 0x7c, 0x9d, 0x83, 0x92, 0x59, 0x23, 0xd9, 0x97, - 0x3b, 0x57, 0x91, 0x2b, 0x82, 0x6a, 0xbb, 0x3d, 0xd3, 0x2e, 0xe6, 0xf7, 0x45, 0x88, 0xfa, 0x18, - 0x44, 0x76, 0x42, 0x41, 0x9e, 0xcb, 0x08, 0xa0, 0xd7, 0xa6, 0x86, 0x7d, 0x33, 0xba, 0x11, 0xc7, - 0xea, 0x5f, 0xb3, 0xd0, 0x38, 0xdf, 0x4d, 0x9e, 0x41, 0x4e, 0x46, 0x58, 0x1d, 0xec, 0x1e, 0x2f, - 0xce, 0xdf, 0x3a, 0x44, 0xf1, 0x34, 0x90, 0x07, 0x50, 0xf2, 0x48, 0x3a, 0xea, 0x79, 0x26, 0xf2, - 0xbd, 0x09, 0xdd, 0xa6, 0xe7, 0x19, 0x3a, 0xea, 0x79, 0x32, 0x05, 0x68, 0x67, 0xaa, 0x74, 0x57, - 0xb1, 0x4d, 0x6b, 0xf5, 0xa7, 0x50, 0x4e, 0xc6, 0x25, 0x0d, 0xc8, 0xbd, 0xc4, 0xa1, 0xf1, 0x98, - 0xfc, 0x94, 0x49, 0xf5, 0x44, 0x9e, 0x28, 0xe3, 0x2c, 0xdd, 0xf8, 0x38, 0xfb, 0xb3, 0x8c, 0xc4, - 0x25, 0x03, 0x2c, 0x82, 0x6b, 0xfe, 0x29, 0x03, 0xe5, 0x24, 0x2f, 0x92, 0x2f, 0x26, 0x33, 0xc4, - 0x07, 0x57, 0xa6, 0x52, 0x95, 0x20, 0x36, 0x85, 0xe0, 0x7e, 0x27, 0x16, 0x18, 0xe9, 0xfc, 0x66, - 0x12, 0xc5, 0xe7, 0x93, 0x89, 0xe2, 0x8a, 0x54, 0x73, 0x49, 0x92, 0x68, 0xfe, 0x41, 0xce, 0xcb, - 0x64, 0x5e, 0xb2, 0x39, 0x39, 0xaf, 0x1f, 0x5f, 0x4e, 0xb7, 0xff, 0xd1, 0xb9, 0x69, 0xbd, 0xbd, - 0x19, 0xfd, 0xb9, 0x02, 0x8d, 0xf3, 0x89, 0x71, 0x74, 0xaa, 0xaa, 0xa9, 0x53, 0xf5, 0x08, 0x72, - 0x31, 0xf7, 0xcd, 0x39, 0xb9, 0x22, 0xbe, 0x1e, 0x0a, 0xee, 0x07, 0x5d, 0x4d, 0x27, 0x11, 0x32, - 0x36, 0x47, 0x6e, 0x0f, 0x07, 0xc9, 0xa1, 0x98, 0x13, 0x6b, 0x40, 0x2a, 0xb4, 0xa3, 0xe8, 0x31, - 0xcf, 0x64, 0xd5, 0x79, 0xe1, 0x1a, 0x44, 0xb6, 0xa1, 0x42, 0x63, 0xd1, 0x63, 0xdc, 0x17, 0xc3, - 0xd9, 0x49, 0x31, 0xcd, 0x30, 0xc6, 0x91, 0xaf, 0xc6, 0xf1, 0x53, 0x97, 0x63, 0x8f, 0xe6, 0xaf, - 0x32, 0x92, 0xa3, 0xa3, 0x4f, 0x49, 0xc2, 0x23, 0x4d, 0xac, 0x8a, 0x22, 0x99, 0x66, 0xeb, 0xba, - 0xd8, 0x21, 0x14, 0xea, 0x11, 0x8b, 0xb9, 0x8b, 0x4e, 0x9f, 0x76, 0xb0, 0x2f, 0xd3, 0xa9, 0x1c, - 0xec, 0x93, 0x05, 0x06, 0x3b, 0x54, 0xf8, 0x7d, 0x05, 0xd7, 0x23, 0xd6, 0xa2, 0x94, 0x68, 0xa2, - 0x52, 0x2d, 0x9f, 0xab, 0x54, 0x7f, 0x05, 0xb5, 0x57, 0x31, 0xf2, 0xa1, 0x13, 0x52, 0x4e, 0x07, - 0x91, 0x55, 0x99, 0x19, 0x14, 0xce, 0x8f, 0xfe, 0x95, 0x84, 0x1f, 0x28, 0xb4, 0x1e, 0xbc, 0xfa, - 0x6a, 0x2c, 0x21, 0x0f, 0x60, 0xd9, 0xef, 0x06, 0x8c, 0xa3, 0x13, 0x73, 0xdf, 0x71, 0x69, 0x84, - 0x2a, 0xa1, 0x95, 0xed, 0xba, 0x16, 0x7f, 0xcd, 0xfd, 0x6d, 0x1a, 0x21, 0xe9, 0xc2, 0xf2, 0xa9, - 0x2f, 0x7a, 0x2c, 0x1e, 0x85, 0x7c, 0xab, 0xa6, 0xa6, 0xf2, 0xe9, 0x02, 0x53, 0xf9, 0x85, 0x66, - 0x98, 0x30, 0xfe, 0xd2, 0xe9, 0x84, 0x90, 0xfc, 0x10, 0x1a, 0xc6, 0xde, 0xe3, 0x7c, 0x51, 0x57, - 0x5b, 0x7e, 0x59, 0xcb, 0x9f, 0x27, 0xe2, 0x55, 0x0a, 0xb5, 0x34, 0xd5, 0x05, 0xc1, 0xe8, 0x71, - 0x3a, 0x18, 0xcd, 0xbd, 0xc9, 0x52, 0xb1, 0xee, 0x33, 0x58, 0x99, 0xf2, 0xde, 0x42, 0xc1, 0x12, - 0xa1, 0x71, 0xde, 0x01, 0xef, 0x62, 0x9e, 0x3d, 0xb8, 0x7e, 0x81, 0x71, 0xdf, 0xc1, 0x48, 0xcd, - 0xbf, 0x64, 0xe1, 0xc6, 0x45, 0x25, 0x37, 0xd9, 0x87, 0xaa, 0x37, 0x6e, 0xce, 0x8e, 0x49, 0x29, - 0xac, 0x0e, 0xe8, 0x69, 0xb8, 0x4c, 0x5a, 0xa7, 0xe8, 0x77, 0x7b, 0xfa, 0xde, 0x52, 0xb0, 0x4d, - 0x2b, 0x5d, 0x35, 0x95, 0xde, 0xa0, 0x6a, 0xca, 0x35, 0x4a, 0xff, 0x87, 0x62, 0xe8, 0x0c, 0x1a, - 0xdf, 0x8d, 0x79, 0x9a, 0xff, 0xca, 0xc2, 0xca, 0x54, 0x62, 0x22, 0x1b, 0x70, 0x3d, 0x05, 0x76, - 0xa2, 0xb8, 0x13, 0xe0, 0xe8, 0xba, 0x4c, 0x52, 0x5d, 0x87, 0xba, 0x67, 0x14, 0x08, 0xb3, 0xa9, - 0x40, 0x78, 0x6f, 0x14, 0x08, 0x35, 0x5e, 0x85, 0xfe, 0x4a, 0x12, 0xca, 0x34, 0x92, 0x74, 0xce, - 0x47, 0x4b, 0x7d, 0xe7, 0x7d, 0xb2, 0x40, 0x1a, 0x5d, 0x28, 0x5c, 0x16, 0xce, 0x85, 0xcb, 0x8b, - 0xa2, 0x47, 0xf1, 0xe2, 0xe8, 0xf1, 0xbf, 0x1e, 0xed, 0xe6, 0x7f, 0xb2, 0x40, 0xa6, 0x8b, 0x13, - 0xb2, 0x06, 0x95, 0x28, 0xf0, 0x9d, 0xd4, 0x8b, 0x84, 0xf6, 0x5f, 0x39, 0x0a, 0xfc, 0x5d, 0xf5, - 0x32, 0x71, 0x89, 0x3b, 0xb2, 0x33, 0xdd, 0x91, 0x4b, 0xb9, 0xc3, 0x3d, 0x6f, 0xe9, 0xc2, 0xac, - 0x70, 0x3c, 0x3d, 0xd7, 0x85, 0x4c, 0x5d, 0x9c, 0xc3, 0xd4, 0xa5, 0x77, 0x63, 0xea, 0xbd, 0x7c, - 0x39, 0xdf, 0x28, 0xd8, 0x93, 0xfb, 0xaf, 0xe9, 0x42, 0x2d, 0x7d, 0x65, 0x97, 0x84, 0x49, 0x31, - 0x54, 0xd1, 0x55, 0xce, 0xed, 0x74, 0x9d, 0x61, 0x2e, 0x1d, 0xe3, 0x02, 0xe2, 0x1e, 0xd4, 0x93, - 0x4b, 0xbe, 0xe3, 0x32, 0x0f, 0x8d, 0x79, 0x6b, 0x89, 0x70, 0x9b, 0x79, 0xd8, 0x7c, 0x02, 0xd5, - 0xd4, 0xa5, 0x7c, 0xd1, 0x31, 0x9a, 0x08, 0xd5, 0x54, 0x1c, 0x25, 0x37, 0xa1, 0x80, 0x67, 0xd4, - 0x35, 0xef, 0x34, 0xbb, 0xd7, 0x6c, 0xdd, 0x24, 0x16, 0x14, 0x43, 0x8e, 0xc7, 0xfe, 0x99, 0x66, - 0xd8, 0xbd, 0x66, 0x9b, 0xb6, 0x44, 0x70, 0xec, 0xe2, 0x99, 0x3e, 0x6d, 0x12, 0xa1, 0x9a, 0x5b, - 0x35, 0x00, 0x55, 0x6d, 0x3a, 0x62, 0x18, 0x62, 0xf3, 0x9f, 0x19, 0xf3, 0x22, 0x23, 0x6f, 0xf1, - 0xe4, 0x2e, 0x94, 0xa9, 0x10, 0x38, 0x08, 0xd5, 0x06, 0xcc, 0xac, 0x17, 0xcc, 0x06, 0x4c, 0x84, - 0x64, 0x13, 0x96, 0x43, 0xe4, 0x8e, 0xe0, 0x43, 0x27, 0x79, 0x59, 0xc8, 0xce, 0x7a, 0x59, 0xa8, - 0x87, 0xc8, 0x8f, 0xf8, 0xf0, 0xc8, 0xbc, 0x2f, 0xbc, 0x27, 0xef, 0x55, 0x92, 0x80, 0x05, 0x26, - 0x10, 0xa8, 0xb7, 0x83, 0xe1, 0x8b, 0x80, 0xd8, 0x70, 0x4b, 0x77, 0xc9, 0xa8, 0x29, 0xd0, 0xe9, - 0x33, 0x97, 0xf6, 0x7d, 0xe1, 0x63, 0x64, 0x6a, 0xbd, 0xd5, 0xa9, 0x51, 0xb6, 0x18, 0xeb, 0xab, - 0xfb, 0xbb, 0xfd, 0x3d, 0x05, 0xb5, 0x15, 0x72, 0x7f, 0x04, 0x6c, 0xfe, 0x3b, 0x0b, 0x30, 0xbe, - 0x47, 0x93, 0xfb, 0x50, 0xa3, 0xfd, 0x3e, 0x3b, 0x75, 0x18, 0xf7, 0xbb, 0x7e, 0x60, 0x8e, 0x99, - 0xbc, 0xfb, 0x57, 0x95, 0xfc, 0x85, 0x12, 0x93, 0x3d, 0xa8, 0xa7, 0xd5, 0x92, 0xda, 0x6d, 0xce, - 0xa4, 0x57, 0x4b, 0x51, 0x45, 0x72, 0xb7, 0x68, 0x2e, 0x5d, 0xc3, 0x26, 0xc7, 0x55, 0x2b, 0x3d, - 0xd3, 0xb2, 0xb1, 0x52, 0x92, 0xa3, 0x72, 0x29, 0xa5, 0xa4, 0xc2, 0xb9, 0x0f, 0x4b, 0x78, 0x16, - 0xb2, 0x71, 0x7e, 0x51, 0x41, 0xb2, 0x62, 0xd7, 0xb5, 0x34, 0x51, 0x6b, 0x43, 0x69, 0x40, 0xcf, - 0x1c, 0xda, 0x45, 0xab, 0x30, 0xcb, 0x39, 0xc5, 0x01, 0x3d, 0xdb, 0xec, 0xca, 0x5b, 0xd5, 0x8a, - 0x1e, 0xdf, 0xe5, 0xe8, 0x61, 0x20, 0x7c, 0xda, 0x8f, 0xcc, 0xa3, 0xd1, 0x55, 0x46, 0x6f, 0x28, - 0xd0, 0xf6, 0x18, 0xd3, 0xfc, 0x7d, 0x01, 0xc8, 0xf4, 0xcb, 0x0e, 0xd9, 0x85, 0x82, 0x87, 0x7d, - 0x3a, 0x9c, 0xe3, 0x66, 0x3e, 0x05, 0x6e, 0xed, 0x48, 0xa4, 0xad, 0x09, 0x24, 0x13, 0xed, 0x24, - 0x29, 0x66, 0x51, 0xa6, 0x4d, 0x89, 0xb4, 0x35, 0xc1, 0xea, 0xef, 0xb2, 0x50, 0x50, 0xd4, 0xe4, - 0x36, 0x94, 0x92, 0xa7, 0x22, 0xbd, 0xed, 0xe5, 0x86, 0x48, 0x44, 0x64, 0x13, 0xaa, 0xc7, 0xfe, - 0x19, 0x7a, 0x8e, 0x5e, 0xc1, 0xac, 0x0d, 0xaf, 0xce, 0xcc, 0xee, 0x35, 0x1b, 0x14, 0x68, 0xc7, - 0x4c, 0x7a, 0x45, 0xfa, 0x28, 0xd0, 0x56, 0x32, 0x44, 0xb9, 0x19, 0x44, 0xbb, 0xd7, 0xec, 0x46, - 0x0a, 0xa5, 0x99, 0x36, 0x01, 0x52, 0x8f, 0x51, 0x85, 0x79, 0x1f, 0xa3, 0x52, 0xa0, 0xad, 0x15, - 0x58, 0xee, 0x09, 0x11, 0xea, 0x59, 0xa8, 0x30, 0xb0, 0xfa, 0x8f, 0x0c, 0x14, 0x94, 0x6d, 0xc8, - 0x03, 0xa8, 0xaa, 0xce, 0x48, 0x50, 0x11, 0x47, 0xba, 0x48, 0x18, 0xad, 0x48, 0xf6, 0x1c, 0xaa, - 0x0e, 0xf2, 0x3e, 0x54, 0xbb, 0x3c, 0x74, 0x13, 0xbd, 0x24, 0xc8, 0x80, 0x14, 0x8e, 0x55, 0x24, - 0xa0, 0xed, 0xa0, 0x7a, 0xcb, 0xcb, 0x27, 0x2a, 0x4a, 0xf8, 0x54, 0x3d, 0xd5, 0xbd, 0x85, 0xd5, - 0xd4, 0x00, 0x14, 0xbf, 0x5a, 0xc8, 0x5e, 0xbe, 0x9c, 0x69, 0x64, 0x47, 0xae, 0x6b, 0xb6, 0xa1, - 0x96, 0x7e, 0x86, 0x96, 0xd5, 0x4f, 0x10, 0x0f, 0x3a, 0xc8, 0x95, 0x9f, 0xeb, 0xb6, 0x69, 0xed, - 0xe5, 0xcb, 0xd9, 0x46, 0x4e, 0x5f, 0x8d, 0x9b, 0x77, 0xa1, 0x94, 0x3c, 0x00, 0x8e, 0xf2, 0x8a, - 0xd4, 0xce, 0x98, 0xbc, 0xb2, 0xf5, 0x93, 0xbf, 0xbd, 0xbe, 0x93, 0xf9, 0xfb, 0xeb, 0x3b, 0x99, - 0x6f, 0x5f, 0xdf, 0xc9, 0xfc, 0xf2, 0xae, 0x9e, 0xad, 0xcf, 0xd4, 0x3f, 0x17, 0xd3, 0x7f, 0x84, - 0x74, 0x8a, 0xca, 0xb1, 0x0f, 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x15, 0xd7, 0x7f, 0x89, 0x25, - 0x19, 0x00, 0x00, +type StringMatch_Regex struct { + Regex string `protobuf:"bytes,3,opt,name=regex,proto3,oneof" json:"regex,omitempty"` } -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 +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 dAtA[:n], nil + return nil } -func (m *VirtualService) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *StringMatch) GetExact() string { + if x, ok := m.GetMatchType().(*StringMatch_Exact); ok { + return x.Exact + } + return "" } -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 - } +func (m *StringMatch) GetPrefix() string { + if x, ok := m.GetMatchType().(*StringMatch_Prefix); ok { + return x.Prefix } - 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 "" +} + +func (m *StringMatch) GetRegex() string { + if x, ok := m.GetMatchType().(*StringMatch_Regex); ok { + return x.Regex } - return len(dAtA) - i, nil + return "" } -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 +// 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), } - return dAtA[:n], nil } -func (m *Destination) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// 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 to be allowed for a given request. The interval + // between retries will be determined automatically (25ms+). When request + // `timeout` of the [HTTP route](https://istio.io/docs/reference/config/networking/virtual-service/#HTTPRoute) + // or `per_try_timeout` is configured, the actual number of retries attempted also depends on + // the specified request `timeout` and `per_try_timeout` values. + 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. + // Default is same value as request + // `timeout` of the [HTTP route](https://istio.io/docs/reference/config/networking/virtual-service/#HTTPRoute), + // which means no timeout. + 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 *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)) +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_8c56a442a0838fd7, []int{17} +} +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 } - 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 b[:n], nil } - return len(dAtA) - i, 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) } -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 +var xxx_messageInfo_HTTPRetry proto.InternalMessageInfo + +func (m *HTTPRetry) GetAttempts() int32 { + if m != nil { + return m.Attempts } - return dAtA[:n], nil + return 0 } -func (m *HTTPRoute) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *HTTPRetry) GetPerTryTimeout() *types.Duration { + if m != nil { + return m.PerTryTimeout + } + return nil } -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 +func (m *HTTPRetry) GetRetryOn() string { + if m != nil { + return m.RetryOn } - 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 + return "" +} + +func (m *HTTPRetry) GetRetryRemoteLocalities() *types.BoolValue { + if m != nil { + return m.RetryRemoteLocalities } - 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)) + 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 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_8c56a442a0838fd7, []int{18} +} +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 } - i-- - dAtA[i] = 0x1 - i-- - dAtA[i] = 0x92 + return b[:n], nil } - 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 +} +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 } - 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 + return nil +} + +func (m *CorsPolicy) GetAllowOrigins() []*StringMatch { + if m != nil { + return m.AllowOrigins } - 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 + return nil +} + +func (m *CorsPolicy) GetAllowMethods() []string { + if m != nil { + return m.AllowMethods } - 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 + return nil +} + +func (m *CorsPolicy) GetAllowHeaders() []string { + if m != nil { + return m.AllowHeaders } - 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 + return 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 +func (m *CorsPolicy) GetExposeHeaders() []string { + if m != nil { + return m.ExposeHeaders } - return dAtA[:n], nil -} - -func (m *Delegate) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + return nil } -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 +func (m *CorsPolicy) GetMaxAge() *types.Duration { + if m != nil { + return m.MaxAge } - return len(dAtA) - i, nil + return 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 +func (m *CorsPolicy) GetAllowCredentials() *types.BoolValue { + if m != nil { + return m.AllowCredentials } - return dAtA[:n], nil + return nil } -func (m *Headers) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +// 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 *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)) +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_8c56a442a0838fd7, []int{19} +} +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 } - i-- - dAtA[i] = 0xa + return b[:n], nil } - return len(dAtA) - i, 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) } -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 +var xxx_messageInfo_HTTPFaultInjection proto.InternalMessageInfo + +func (m *HTTPFaultInjection) GetDelay() *HTTPFaultInjection_Delay { + if m != nil { + return m.Delay } - return dAtA[:n], nil + return nil } -func (m *Headers_HeaderOperations) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *HTTPFaultInjection) GetAbort() *HTTPFaultInjection_Abort { + if m != nil { + return m.Abort + } + return nil } -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 +// 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_8c56a442a0838fd7, []int{19, 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 } - return len(dAtA) - i, 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) } -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 +var xxx_messageInfo_HTTPFaultInjection_Delay proto.InternalMessageInfo + +type isHTTPFaultInjection_Delay_HttpDelayType interface { + isHTTPFaultInjection_Delay_HttpDelayType() + MarshalTo([]byte) (int, error) + Size() int } -func (m *TLSRoute) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +type HTTPFaultInjection_Delay_FixedDelay struct { + FixedDelay *types.Duration `protobuf:"bytes,2,opt,name=fixed_delay,json=fixedDelay,proto3,oneof" json:"fixed_delay,omitempty"` +} +type HTTPFaultInjection_Delay_ExponentialDelay struct { + ExponentialDelay *types.Duration `protobuf:"bytes,3,opt,name=exponential_delay,json=exponentialDelay,proto3,oneof" json:"exponential_delay,omitempty"` } -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) +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 } - 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 - } + return nil +} + +// Deprecated: Do not use. +func (m *HTTPFaultInjection_Delay) GetPercent() int32 { + if m != nil { + return m.Percent } - 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 0 +} + +func (m *HTTPFaultInjection_Delay) GetFixedDelay() *types.Duration { + if x, ok := m.GetHttpDelayType().(*HTTPFaultInjection_Delay_FixedDelay); ok { + return x.FixedDelay } - return len(dAtA) - i, nil + return 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 +func (m *HTTPFaultInjection_Delay) GetExponentialDelay() *types.Duration { + if x, ok := m.GetHttpDelayType().(*HTTPFaultInjection_Delay_ExponentialDelay); ok { + return x.ExponentialDelay } - return dAtA[:n], nil + return nil } -func (m *TCPRoute) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *HTTPFaultInjection_Delay) GetPercentage() *Percent { + if m != nil { + return m.Percentage + } + return nil } -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) +// 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), } - 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 +} + +// 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_8c56a442a0838fd7, []int{19, 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 } - 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 - } +} +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" json:"http_status,omitempty"` +} +type HTTPFaultInjection_Abort_GrpcStatus struct { + GrpcStatus string `protobuf:"bytes,3,opt,name=grpc_status,json=grpcStatus,proto3,oneof" json:"grpc_status,omitempty"` +} +type HTTPFaultInjection_Abort_Http2Error struct { + Http2Error string `protobuf:"bytes,4,opt,name=http2_error,json=http2Error,proto3,oneof" json:"http2_error,omitempty"` +} + +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 len(dAtA) - i, nil + return 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 +func (m *HTTPFaultInjection_Abort) GetHttpStatus() int32 { + if x, ok := m.GetErrorType().(*HTTPFaultInjection_Abort_HttpStatus); ok { + return x.HttpStatus } - return dAtA[:n], nil + return 0 } -func (m *HTTPMatchRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *HTTPFaultInjection_Abort) GetGrpcStatus() string { + if x, ok := m.GetErrorType().(*HTTPFaultInjection_Abort_GrpcStatus); ok { + return x.GrpcStatus + } + return "" } -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) +func (m *HTTPFaultInjection_Abort) GetHttp2Error() string { + if x, ok := m.GetErrorType().(*HTTPFaultInjection_Abort_Http2Error); ok { + return x.Http2Error } - 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 + return "" +} + +func (m *HTTPFaultInjection_Abort) GetPercentage() *Percent { + if m != nil { + return m.Percentage } - 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 + 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_8c56a442a0838fd7, []int{20} +} +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 } - 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 +} +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 } - 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)) + 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_8c56a442a0838fd7, []int{21} +} +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 } - i-- - dAtA[i] = 0x12 + return b[:n], nil } - 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 +} +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 len(dAtA) - i, nil + return 0 } -func (m *HTTPRouteDestination) Marshal() (dAtA []byte, err error) { +func init() { + proto.RegisterType((*VirtualService)(nil), "istio.networking.v1beta1.VirtualService") + proto.RegisterType((*Destination)(nil), "istio.networking.v1beta1.Destination") + proto.RegisterType((*HTTPRoute)(nil), "istio.networking.v1beta1.HTTPRoute") + proto.RegisterType((*RateLimit)(nil), "istio.networking.v1beta1.RateLimit") + proto.RegisterType((*RateLimit_TokenBucket)(nil), "istio.networking.v1beta1.RateLimit.TokenBucket") + proto.RegisterType((*RateLimit_LocalDescriptor)(nil), "istio.networking.v1beta1.RateLimit.LocalDescriptor") + proto.RegisterType((*RateLimit_LocalDescriptor_Entry)(nil), "istio.networking.v1beta1.RateLimit.LocalDescriptor.Entry") + proto.RegisterType((*RateLimit_Local)(nil), "istio.networking.v1beta1.RateLimit.Local") + proto.RegisterType((*RateLimitDescriptor)(nil), "istio.networking.v1beta1.RateLimitDescriptor") + proto.RegisterType((*RateLimitDescriptor_Entry)(nil), "istio.networking.v1beta1.RateLimitDescriptor.Entry") + proto.RegisterType((*Delegate)(nil), "istio.networking.v1beta1.Delegate") + proto.RegisterType((*Headers)(nil), "istio.networking.v1beta1.Headers") + proto.RegisterType((*Headers_HeaderOperations)(nil), "istio.networking.v1beta1.Headers.HeaderOperations") + proto.RegisterMapType((map[string]string)(nil), "istio.networking.v1beta1.Headers.HeaderOperations.AddEntry") + proto.RegisterMapType((map[string]string)(nil), "istio.networking.v1beta1.Headers.HeaderOperations.SetEntry") + proto.RegisterType((*TLSRoute)(nil), "istio.networking.v1beta1.TLSRoute") + proto.RegisterType((*TCPRoute)(nil), "istio.networking.v1beta1.TCPRoute") + proto.RegisterType((*HTTPMatchRequest)(nil), "istio.networking.v1beta1.HTTPMatchRequest") + proto.RegisterMapType((map[string]*StringMatch)(nil), "istio.networking.v1beta1.HTTPMatchRequest.HeadersEntry") + proto.RegisterMapType((map[string]*StringMatch)(nil), "istio.networking.v1beta1.HTTPMatchRequest.QueryParamsEntry") + proto.RegisterMapType((map[string]string)(nil), "istio.networking.v1beta1.HTTPMatchRequest.SourceLabelsEntry") + proto.RegisterMapType((map[string]*StringMatch)(nil), "istio.networking.v1beta1.HTTPMatchRequest.WithoutHeadersEntry") + proto.RegisterType((*HTTPRouteDestination)(nil), "istio.networking.v1beta1.HTTPRouteDestination") + proto.RegisterType((*RouteDestination)(nil), "istio.networking.v1beta1.RouteDestination") + proto.RegisterType((*L4MatchAttributes)(nil), "istio.networking.v1beta1.L4MatchAttributes") + proto.RegisterMapType((map[string]string)(nil), "istio.networking.v1beta1.L4MatchAttributes.SourceLabelsEntry") + proto.RegisterType((*TLSMatchAttributes)(nil), "istio.networking.v1beta1.TLSMatchAttributes") + proto.RegisterMapType((map[string]string)(nil), "istio.networking.v1beta1.TLSMatchAttributes.SourceLabelsEntry") + proto.RegisterType((*HTTPRedirect)(nil), "istio.networking.v1beta1.HTTPRedirect") + proto.RegisterType((*HTTPRewrite)(nil), "istio.networking.v1beta1.HTTPRewrite") + proto.RegisterType((*StringMatch)(nil), "istio.networking.v1beta1.StringMatch") + proto.RegisterType((*HTTPRetry)(nil), "istio.networking.v1beta1.HTTPRetry") + proto.RegisterType((*CorsPolicy)(nil), "istio.networking.v1beta1.CorsPolicy") + proto.RegisterType((*HTTPFaultInjection)(nil), "istio.networking.v1beta1.HTTPFaultInjection") + proto.RegisterType((*HTTPFaultInjection_Delay)(nil), "istio.networking.v1beta1.HTTPFaultInjection.Delay") + proto.RegisterType((*HTTPFaultInjection_Abort)(nil), "istio.networking.v1beta1.HTTPFaultInjection.Abort") + proto.RegisterType((*PortSelector)(nil), "istio.networking.v1beta1.PortSelector") + proto.RegisterType((*Percent)(nil), "istio.networking.v1beta1.Percent") +} + +func init() { + proto.RegisterFile("networking/v1beta1/virtual_service.proto", fileDescriptor_8c56a442a0838fd7) +} + +var fileDescriptor_8c56a442a0838fd7 = []byte{ + // 2325 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0x4d, 0x73, 0x1b, 0xc7, + 0xd1, 0x26, 0xbe, 0x08, 0xa0, 0x01, 0x90, 0xe0, 0x48, 0x96, 0xd6, 0x78, 0xf5, 0x4a, 0x34, 0x14, + 0x29, 0x72, 0x62, 0x83, 0x65, 0xca, 0x15, 0x25, 0x96, 0x25, 0x9b, 0x20, 0x65, 0x53, 0x2c, 0x4a, + 0xa2, 0x87, 0x94, 0x53, 0x95, 0x43, 0xb6, 0x16, 0x8b, 0x26, 0x30, 0xd1, 0x62, 0x77, 0x35, 0x3b, + 0x20, 0xc1, 0x1c, 0x53, 0x39, 0xa4, 0x2a, 0x87, 0x5c, 0x92, 0x43, 0x2a, 0xa7, 0xfc, 0x85, 0x9c, + 0xf2, 0x13, 0x72, 0xcc, 0xc5, 0xd7, 0x94, 0x4b, 0xb7, 0x54, 0x2a, 0x87, 0xfc, 0x80, 0x54, 0xa5, + 0xe6, 0x63, 0x81, 0x05, 0x41, 0x12, 0x80, 0x6c, 0x25, 0x27, 0xec, 0xf4, 0xf4, 0xf3, 0x4c, 0x4f, + 0xcf, 0x4c, 0x4f, 0x4f, 0x03, 0xee, 0xf8, 0x28, 0x8e, 0x03, 0xfe, 0x82, 0xf9, 0x9d, 0xb5, 0xa3, + 0x0f, 0x5a, 0x28, 0x9c, 0x0f, 0xd6, 0x8e, 0x18, 0x17, 0x7d, 0xc7, 0xb3, 0x23, 0xe4, 0x47, 0xcc, + 0xc5, 0x46, 0xc8, 0x03, 0x11, 0x10, 0x8b, 0x45, 0x82, 0x05, 0x8d, 0x91, 0x7e, 0xc3, 0xe8, 0xd7, + 0x6e, 0x74, 0x82, 0xa0, 0xe3, 0xe1, 0x9a, 0x13, 0xb2, 0xb5, 0x43, 0x86, 0x5e, 0xdb, 0x6e, 0x61, + 0xd7, 0x39, 0x62, 0x01, 0xd7, 0xd0, 0xda, 0x75, 0xa3, 0xa0, 0x5a, 0xad, 0xfe, 0xe1, 0x5a, 0xbb, + 0xcf, 0x1d, 0xc1, 0x02, 0xff, 0xbc, 0xfe, 0x63, 0xee, 0x84, 0x21, 0xf2, 0x48, 0xf7, 0xd7, 0x7f, + 0x99, 0x86, 0xa5, 0x2f, 0xb5, 0x51, 0xfb, 0xda, 0x26, 0x72, 0x19, 0x72, 0xdd, 0x20, 0x12, 0x91, + 0x95, 0x5a, 0xcd, 0xdc, 0x29, 0x52, 0xdd, 0x20, 0x35, 0x28, 0x74, 0x1c, 0x81, 0xc7, 0xce, 0x49, + 0x64, 0xa5, 0x55, 0xc7, 0xb0, 0x4d, 0xee, 0x41, 0xb6, 0x2b, 0x44, 0x68, 0x65, 0x56, 0x33, 0x77, + 0x4a, 0xeb, 0x37, 0x1b, 0xe7, 0x4d, 0xa7, 0xb1, 0x7d, 0x70, 0xb0, 0x47, 0x83, 0xbe, 0x40, 0xaa, + 0x00, 0xe4, 0x43, 0xc8, 0x08, 0x2f, 0xb2, 0x72, 0x0a, 0x57, 0x3f, 0x1f, 0x77, 0xb0, 0xbb, 0xaf, + 0x61, 0x52, 0x5d, 0xa1, 0xdc, 0xd0, 0xca, 0x4e, 0x45, 0x6d, 0xee, 0xc5, 0x28, 0x37, 0x24, 0xff, + 0x07, 0x45, 0x1c, 0x84, 0x01, 0x17, 0xb6, 0x08, 0xac, 0x45, 0x3d, 0x03, 0x2d, 0x38, 0x08, 0xea, + 0x3f, 0x87, 0xd2, 0x16, 0x46, 0x82, 0xf9, 0xca, 0x77, 0xe4, 0x2a, 0x64, 0xe5, 0xac, 0xad, 0xd4, + 0x6a, 0xea, 0x4e, 0xb1, 0x99, 0xf9, 0x7a, 0x23, 0x4d, 0x95, 0x80, 0x5c, 0x81, 0xc5, 0xa8, 0xdf, + 0x8a, 0x50, 0x58, 0x69, 0xd9, 0x45, 0x4d, 0x8b, 0x7c, 0x04, 0x59, 0xc9, 0x64, 0x65, 0x56, 0x53, + 0x77, 0x4a, 0xeb, 0xb7, 0xcf, 0xb7, 0x69, 0x2f, 0xe0, 0x62, 0x1f, 0x3d, 0x74, 0x45, 0xc0, 0xa9, + 0xc2, 0xd4, 0xbf, 0x2a, 0x40, 0x71, 0xe8, 0x18, 0x42, 0x20, 0xeb, 0x3b, 0x3d, 0xb4, 0x56, 0x14, + 0xbf, 0xfa, 0x26, 0x9f, 0x42, 0xae, 0xe7, 0x08, 0xb7, 0xab, 0x56, 0xa4, 0xb4, 0xfe, 0xbd, 0x8b, + 0x1d, 0xfc, 0x44, 0xaa, 0x52, 0x7c, 0xd9, 0xc7, 0x48, 0x50, 0x0d, 0x24, 0x5b, 0x90, 0xe3, 0x92, + 0x5e, 0x2d, 0x5d, 0x69, 0xbd, 0x31, 0xc3, 0x12, 0x25, 0xfc, 0x41, 0x35, 0x98, 0x34, 0xa1, 0xc0, + 0xb1, 0xcd, 0x38, 0xba, 0x33, 0xcc, 0x54, 0x11, 0x19, 0x6d, 0x3a, 0xc4, 0x91, 0x87, 0x50, 0x68, + 0xa3, 0x87, 0x72, 0xef, 0x58, 0x97, 0x15, 0xc7, 0x05, 0x2b, 0xb8, 0x65, 0x34, 0xe9, 0x10, 0x43, + 0x3e, 0x81, 0x3c, 0xc7, 0x63, 0xce, 0x04, 0x5a, 0x59, 0x05, 0xbf, 0x35, 0xcd, 0x04, 0xa5, 0x4c, + 0x63, 0x14, 0xb9, 0x0b, 0x79, 0xc1, 0x7a, 0x18, 0xf4, 0x85, 0xb5, 0xa8, 0x08, 0xde, 0x6e, 0xe8, + 0x33, 0xd2, 0x88, 0xcf, 0x48, 0x63, 0xcb, 0x9c, 0x21, 0x1a, 0x6b, 0x92, 0x07, 0x72, 0x54, 0xc1, + 0x19, 0x46, 0x56, 0x5e, 0x81, 0xa6, 0x6d, 0x72, 0x14, 0xfc, 0x84, 0xc6, 0x18, 0xd2, 0x84, 0xdc, + 0xa1, 0xd3, 0xf7, 0x84, 0x55, 0x50, 0xe0, 0xf7, 0x2e, 0x06, 0x7f, 0x26, 0x55, 0x1f, 0xfb, 0x3f, + 0x43, 0x57, 0x3b, 0x5f, 0x41, 0xc9, 0x03, 0x58, 0xec, 0x31, 0xce, 0x03, 0x6e, 0x15, 0xa7, 0xcd, + 0x3b, 0xb9, 0x74, 0x06, 0x44, 0x3e, 0x87, 0x25, 0xfd, 0x65, 0x87, 0xc8, 0x5d, 0xf4, 0x85, 0x45, + 0x14, 0xcd, 0xb5, 0x89, 0xd9, 0x3f, 0x7f, 0xec, 0x8b, 0xbb, 0xeb, 0x5f, 0x3a, 0x5e, 0x1f, 0x9b, + 0x69, 0x2b, 0x45, 0x2b, 0x1a, 0xb7, 0xa7, 0x61, 0xe4, 0x29, 0xac, 0x8c, 0x13, 0x39, 0x1d, 0xb4, + 0x2e, 0x29, 0xae, 0x77, 0x2e, 0xd8, 0xf7, 0x5a, 0x97, 0x56, 0xc7, 0xc8, 0x9c, 0x0e, 0x92, 0x47, + 0x50, 0x72, 0x03, 0x1e, 0xd9, 0x61, 0xe0, 0x31, 0xf7, 0xc4, 0x02, 0xc5, 0xf4, 0x9d, 0xf3, 0x99, + 0x36, 0x03, 0x1e, 0xed, 0x29, 0x5d, 0x0a, 0xee, 0xf0, 0x9b, 0xdc, 0x87, 0x7c, 0x17, 0x9d, 0x36, + 0xf2, 0xc8, 0xaa, 0x4e, 0x33, 0x66, 0x5b, 0x2b, 0xd2, 0x18, 0x41, 0x9a, 0x00, 0xdc, 0x11, 0x68, + 0x7b, 0xac, 0xc7, 0x84, 0xf5, 0xd6, 0xb4, 0x15, 0xa6, 0x8e, 0xc0, 0x5d, 0xa9, 0x4a, 0x8b, 0x3c, + 0xfe, 0xdc, 0xc9, 0x16, 0x72, 0xd5, 0xc5, 0x9d, 0x6c, 0xa1, 0x54, 0xad, 0xd2, 0x95, 0x63, 0x6c, + 0x45, 0x81, 0xfb, 0x02, 0x85, 0xdd, 0x0f, 0x3b, 0xdc, 0x69, 0x23, 0x5d, 0x92, 0x61, 0xd7, 0x6f, + 0xdb, 0x66, 0x48, 0x7a, 0x95, 0x63, 0x2f, 0x38, 0x42, 0x9b, 0x63, 0x14, 0x06, 0x7e, 0x84, 0xa3, + 0x0e, 0xa3, 0x38, 0xd1, 0x71, 0x65, 0x88, 0x50, 0x47, 0x7b, 0x24, 0x1f, 0x02, 0xc6, 0xe4, 0xf5, + 0x7f, 0xe5, 0xa0, 0x38, 0xb4, 0x94, 0x3c, 0x83, 0x52, 0x1b, 0x23, 0x97, 0xb3, 0x50, 0x04, 0x3c, + 0x32, 0x91, 0xe4, 0xfd, 0x19, 0xe6, 0xb8, 0x35, 0x44, 0xd1, 0x24, 0x03, 0xd9, 0x80, 0x9c, 0x17, + 0xb8, 0x8e, 0xa7, 0x22, 0x61, 0x69, 0xfd, 0xdd, 0x19, 0xa8, 0x1a, 0xbb, 0x12, 0xb0, 0xbd, 0x40, + 0x35, 0xb2, 0xf6, 0xdb, 0x14, 0x94, 0x0e, 0x82, 0x17, 0xe8, 0x37, 0xfb, 0xd2, 0x57, 0xe4, 0xff, + 0x01, 0x7a, 0xce, 0xc0, 0x16, 0x52, 0x14, 0xa9, 0xe0, 0x5b, 0xa1, 0xc5, 0x9e, 0x33, 0x50, 0x3a, + 0x11, 0xb9, 0x0d, 0xcb, 0xba, 0x4b, 0xee, 0x3c, 0xfb, 0x90, 0x79, 0x7a, 0xec, 0x0a, 0xad, 0x68, + 0xf1, 0x1e, 0xf2, 0xcf, 0x98, 0xe7, 0x91, 0x87, 0x50, 0x91, 0x9d, 0x36, 0xf3, 0x05, 0xf2, 0x23, + 0xc7, 0x33, 0xb1, 0xea, 0x82, 0x73, 0x5e, 0x96, 0xfa, 0x8f, 0x8d, 0x7a, 0xed, 0x1f, 0x29, 0x58, + 0x56, 0x96, 0x8e, 0xa6, 0x4e, 0xf6, 0x21, 0x8f, 0xbe, 0x0e, 0x00, 0xda, 0x75, 0x3f, 0x9a, 0x79, + 0xbe, 0x23, 0x96, 0xc6, 0x23, 0x5f, 0x85, 0x05, 0xc3, 0x44, 0x28, 0x94, 0x95, 0xe5, 0x76, 0x4b, + 0xcd, 0xdf, 0x78, 0x72, 0x6d, 0x16, 0xe6, 0x84, 0xdb, 0x68, 0x49, 0x8c, 0x1a, 0xb5, 0x35, 0xc8, + 0xa9, 0x51, 0x48, 0x15, 0x32, 0x2f, 0xf0, 0x44, 0x5f, 0x61, 0x54, 0x7e, 0xca, 0x8b, 0xfd, 0x48, + 0x9e, 0x6a, 0x73, 0x77, 0xe9, 0x46, 0xed, 0x4f, 0x29, 0xc8, 0x29, 0x3b, 0x27, 0xcc, 0x49, 0x7d, + 0x73, 0x73, 0xc8, 0xf3, 0xf1, 0x6d, 0xa7, 0xaf, 0x9f, 0xbb, 0xaf, 0xe1, 0xbb, 0xb1, 0xcd, 0xd7, + 0xbc, 0x02, 0x97, 0x47, 0x07, 0xd6, 0x8e, 0x42, 0x74, 0xd9, 0x21, 0x43, 0x5e, 0xff, 0x45, 0x1a, + 0x2e, 0x9d, 0xb1, 0x73, 0xc9, 0x93, 0xd3, 0xcb, 0x77, 0x77, 0xae, 0x9d, 0x7f, 0x6a, 0xe1, 0x6a, + 0x7f, 0x48, 0x9d, 0xef, 0xe5, 0x3a, 0x54, 0xa2, 0x17, 0x2c, 0xb4, 0xd9, 0xa1, 0x8d, 0x2a, 0x5c, + 0x4b, 0x6f, 0x17, 0x68, 0x49, 0x0a, 0x1f, 0x1f, 0x3e, 0x52, 0xc1, 0xf8, 0xbb, 0xb0, 0x34, 0x7e, + 0x5a, 0xd5, 0x16, 0x2d, 0x6e, 0x2f, 0xd0, 0x8a, 0x91, 0xeb, 0x10, 0x45, 0x56, 0x01, 0x70, 0x10, + 0x72, 0x8c, 0x22, 0x16, 0xf8, 0xea, 0xc2, 0x93, 0x4a, 0x09, 0x59, 0x73, 0x05, 0x96, 0xa5, 0x55, + 0x27, 0x09, 0x27, 0x7c, 0x0c, 0x85, 0xf8, 0xe2, 0x1c, 0xa6, 0x13, 0xa9, 0x44, 0x3a, 0x71, 0x0d, + 0x8a, 0xf2, 0x37, 0x0a, 0x1d, 0x37, 0xde, 0x0b, 0x23, 0x41, 0xfd, 0x55, 0x06, 0xf2, 0x26, 0x40, + 0x92, 0x5d, 0x79, 0xed, 0x29, 0x7b, 0xcc, 0x66, 0x58, 0x9f, 0x1a, 0x54, 0xcd, 0xef, 0xb3, 0x10, + 0xf5, 0xd9, 0x8a, 0x68, 0x4c, 0x41, 0x9e, 0xca, 0xf4, 0x41, 0x07, 0x35, 0xb3, 0xd5, 0x5f, 0x87, + 0x6e, 0xc8, 0x51, 0xfb, 0x73, 0x1a, 0xaa, 0xa7, 0xbb, 0xc9, 0x13, 0xc8, 0x44, 0x6a, 0xef, 0xca, + 0x55, 0xbe, 0x3f, 0x3f, 0x7f, 0x63, 0x1f, 0x85, 0x5e, 0x6d, 0xc9, 0x23, 0xe9, 0x9c, 0x76, 0xdb, + 0xec, 0xdb, 0xd7, 0xa1, 0xdb, 0x68, 0xb7, 0x0d, 0x9d, 0xd3, 0x6e, 0xcb, 0xfc, 0x51, 0x47, 0x71, + 0x95, 0x2b, 0x17, 0xa9, 0x69, 0xd5, 0x7e, 0x00, 0x85, 0x78, 0xdc, 0x59, 0x0f, 0xee, 0x47, 0xe9, + 0x1f, 0xa6, 0x24, 0x2e, 0x1e, 0x60, 0x1e, 0x5c, 0xfd, 0x77, 0x29, 0x28, 0xc4, 0x49, 0x35, 0xf9, + 0x7c, 0x3c, 0xbd, 0x7c, 0xef, 0xc2, 0x3c, 0x5c, 0x65, 0x97, 0x1b, 0x42, 0x70, 0xd6, 0xea, 0x0b, + 0x8c, 0x74, 0x72, 0x6c, 0xb2, 0xcc, 0x4f, 0xc7, 0xb3, 0xcc, 0x0b, 0xf2, 0xd4, 0x73, 0x32, 0xcc, + 0xfa, 0x6f, 0xa4, 0x5d, 0x26, 0x6d, 0x97, 0x37, 0x4c, 0xd2, 0xae, 0xef, 0x9f, 0x4f, 0xb7, 0xfb, + 0xe1, 0x29, 0xb3, 0xbe, 0x3d, 0x8b, 0x7e, 0x5f, 0x84, 0xea, 0xe9, 0xac, 0x7a, 0x78, 0xaa, 0x4a, + 0x89, 0x53, 0x75, 0x0f, 0x32, 0x7d, 0xce, 0xcc, 0x39, 0xb9, 0x20, 0x39, 0xdb, 0x17, 0x9c, 0xf9, + 0x1d, 0x4d, 0x27, 0x11, 0x32, 0xb1, 0x8b, 0xdc, 0x2e, 0xf6, 0xe2, 0x43, 0x31, 0x23, 0xd6, 0x80, + 0x54, 0x5e, 0x88, 0xa2, 0x1b, 0xb4, 0xcd, 0x35, 0x37, 0x2b, 0x5c, 0x83, 0xc8, 0x26, 0x14, 0x9d, + 0xbe, 0xe8, 0x06, 0x9c, 0x89, 0x93, 0xe9, 0x19, 0x75, 0x92, 0x61, 0x84, 0x23, 0x5f, 0x8c, 0x92, + 0x2f, 0xfd, 0x96, 0xbb, 0x37, 0xfb, 0x13, 0x25, 0x3e, 0x3a, 0x26, 0xc4, 0xc6, 0x29, 0x19, 0x31, + 0x2f, 0xaa, 0x45, 0x75, 0xc3, 0xab, 0x6f, 0xe2, 0x40, 0x25, 0x0a, 0xfa, 0xdc, 0x45, 0xdb, 0x73, + 0x5a, 0xe8, 0xc9, 0x5c, 0x5c, 0x0e, 0xf6, 0xf1, 0x1c, 0x83, 0xed, 0x2b, 0xfc, 0xae, 0x82, 0xeb, + 0x11, 0xcb, 0x51, 0x42, 0x34, 0xf6, 0xcc, 0x2d, 0x9c, 0x7a, 0xe6, 0xfe, 0x14, 0xca, 0x2f, 0xfb, + 0xc8, 0x4f, 0xec, 0xd0, 0xe1, 0x4e, 0x2f, 0xb2, 0x8a, 0x53, 0x83, 0xc2, 0xe9, 0xd1, 0xbf, 0x90, + 0xf0, 0x3d, 0x85, 0xd6, 0x83, 0x97, 0x5e, 0x8e, 0x24, 0x32, 0xbf, 0x61, 0x1d, 0x3f, 0xe0, 0x68, + 0xf7, 0x39, 0xb3, 0x5d, 0x27, 0x42, 0x95, 0x0d, 0x17, 0x68, 0x45, 0x8b, 0x9f, 0x73, 0xb6, 0xe9, + 0x44, 0x48, 0x3a, 0xb0, 0x7c, 0xcc, 0x44, 0x37, 0xe8, 0x0f, 0x73, 0x3d, 0xab, 0xac, 0x4c, 0x79, + 0x38, 0x87, 0x29, 0x3f, 0xd6, 0x0c, 0x63, 0xce, 0x5f, 0x3a, 0x1e, 0x13, 0x92, 0x77, 0xa1, 0x6a, + 0xfc, 0x3d, 0xba, 0x2f, 0x2a, 0x6a, 0xcb, 0x2f, 0x6b, 0xf9, 0xd3, 0x58, 0x5c, 0x73, 0xa0, 0x9c, + 0xa4, 0x3a, 0x23, 0x18, 0xdd, 0x4f, 0x06, 0xa3, 0x99, 0x37, 0x59, 0x22, 0xd6, 0x7d, 0x02, 0x2b, + 0x13, 0xab, 0x37, 0x57, 0xb0, 0x44, 0xa8, 0x9e, 0x5e, 0x80, 0x37, 0x61, 0x67, 0x17, 0x2e, 0x9d, + 0xe1, 0xdc, 0x37, 0x30, 0x52, 0xfd, 0x8f, 0x69, 0xb8, 0x7c, 0xd6, 0x7b, 0x9d, 0xec, 0xaa, 0xac, + 0x2b, 0x6e, 0x4e, 0x8f, 0x49, 0x09, 0xac, 0x0e, 0xe8, 0x49, 0xb8, 0xbc, 0xb4, 0x8e, 0x91, 0x75, + 0xba, 0x3a, 0x41, 0xcd, 0x51, 0xd3, 0x4a, 0x3e, 0xb9, 0xf2, 0xf3, 0x3e, 0xb9, 0x76, 0xb2, 0x85, + 0x4c, 0x35, 0xff, 0x5f, 0x78, 0x05, 0x0d, 0xa0, 0xfa, 0xbf, 0x71, 0x4f, 0xfd, 0xef, 0x69, 0x58, + 0x99, 0xb8, 0x98, 0xc8, 0x1a, 0x5c, 0x4a, 0x80, 0xed, 0xa8, 0xdf, 0xf2, 0x71, 0x58, 0x6b, 0x23, + 0x89, 0xae, 0x7d, 0xdd, 0x33, 0x0c, 0x84, 0xe9, 0x44, 0x20, 0xbc, 0x39, 0x0c, 0x84, 0x1a, 0xaf, + 0xd3, 0xc7, 0x38, 0x94, 0x69, 0x24, 0x69, 0x9d, 0x8e, 0x96, 0xba, 0x60, 0xf6, 0x60, 0x8e, 0x6b, + 0x74, 0xae, 0x70, 0x99, 0x3b, 0x15, 0x2e, 0xcf, 0x8a, 0x1e, 0x8b, 0x67, 0x47, 0x8f, 0x6f, 0x7a, + 0xb4, 0xeb, 0xff, 0x4e, 0x03, 0x99, 0x4c, 0x4e, 0xc8, 0x2a, 0x14, 0x23, 0x9f, 0xd9, 0x89, 0x72, + 0xa6, 0x5e, 0xbf, 0x42, 0xe4, 0xb3, 0x6d, 0x55, 0xd6, 0x3c, 0x67, 0x39, 0xd2, 0x53, 0x97, 0x23, + 0x93, 0x58, 0x0e, 0xf7, 0xb4, 0xa7, 0x73, 0xd3, 0xc2, 0xf1, 0xa4, 0xad, 0x73, 0xb9, 0x7a, 0x71, + 0x06, 0x57, 0xe7, 0xdf, 0x8c, 0xab, 0x77, 0xb2, 0x85, 0x6c, 0x35, 0x47, 0xc7, 0xf7, 0x5f, 0xdd, + 0x85, 0x72, 0xb2, 0xde, 0x27, 0x09, 0xe3, 0x64, 0xa8, 0xa8, 0xb3, 0x9c, 0x6b, 0xc9, 0x3c, 0xc3, + 0x3c, 0x3a, 0x46, 0x09, 0xc4, 0x4d, 0xa8, 0xc4, 0x15, 0x42, 0xdb, 0x0d, 0xda, 0x68, 0xdc, 0x5b, + 0x8e, 0x85, 0x9b, 0x41, 0x1b, 0xeb, 0x0f, 0xa0, 0x94, 0xa8, 0xe8, 0xcd, 0x3b, 0x46, 0x1d, 0xa1, + 0x94, 0x88, 0xa3, 0xe4, 0x0a, 0xe4, 0x70, 0xe0, 0xb8, 0xa6, 0xc8, 0xbb, 0xbd, 0x40, 0x75, 0x93, + 0x58, 0xb0, 0x18, 0x72, 0x3c, 0x64, 0x03, 0xcd, 0xb0, 0xbd, 0x40, 0x4d, 0x5b, 0x22, 0x38, 0x76, + 0x70, 0x30, 0x7c, 0xac, 0xe9, 0x66, 0xb3, 0x0c, 0xa0, 0xb2, 0x4d, 0x5b, 0x9c, 0x84, 0x58, 0xff, + 0x5b, 0xca, 0x94, 0x73, 0x51, 0x7a, 0xf6, 0x06, 0x14, 0x1c, 0x21, 0xb0, 0x17, 0x0a, 0x5d, 0xd0, + 0xc8, 0x99, 0x0d, 0x18, 0x0b, 0xc9, 0x06, 0x2c, 0x87, 0xc8, 0x6d, 0xf9, 0x82, 0x8b, 0xcb, 0x92, + 0xe9, 0x69, 0xe5, 0x8a, 0x4a, 0x88, 0xfc, 0x80, 0x9f, 0x1c, 0x98, 0xe2, 0xe4, 0xdb, 0xf2, 0x5d, + 0x25, 0x09, 0x02, 0xdf, 0x04, 0x02, 0x55, 0x78, 0x3c, 0x79, 0xe6, 0x13, 0x0a, 0x57, 0x75, 0x97, + 0x8c, 0x9a, 0xf2, 0xbd, 0x2c, 0x1f, 0xd5, 0x4c, 0xc8, 0x77, 0xb0, 0xce, 0xf5, 0x6a, 0x13, 0xa3, + 0x34, 0x83, 0xc0, 0x53, 0xc5, 0x3f, 0xfa, 0x96, 0x82, 0x52, 0x85, 0xdc, 0x1d, 0x02, 0xeb, 0xff, + 0x4c, 0x03, 0x8c, 0x8a, 0x70, 0xe4, 0x16, 0x94, 0x1d, 0xcf, 0x0b, 0x8e, 0xed, 0x80, 0xb3, 0x0e, + 0xf3, 0xcd, 0x31, 0x4b, 0x5b, 0x29, 0x5a, 0x52, 0xf2, 0x67, 0x4a, 0x4c, 0x76, 0xa0, 0x92, 0x54, + 0x8b, 0x73, 0xb7, 0x19, 0x2f, 0xbd, 0x72, 0x82, 0x2a, 0x92, 0xbb, 0x45, 0x73, 0xe9, 0x1c, 0x36, + 0x3e, 0xae, 0x5a, 0xe9, 0x89, 0x96, 0x8d, 0x94, 0xe2, 0x3b, 0x2a, 0x93, 0x50, 0x8a, 0x33, 0x9c, + 0x5b, 0xb0, 0x84, 0x83, 0x30, 0x18, 0xdd, 0x2f, 0x2a, 0x48, 0x16, 0x69, 0x45, 0x4b, 0x63, 0xb5, + 0x75, 0xc8, 0xf7, 0x9c, 0x81, 0xed, 0x74, 0xd0, 0xca, 0x4d, 0x5b, 0x9c, 0xc5, 0x9e, 0x33, 0xd8, + 0xe8, 0xc8, 0x57, 0xd5, 0x8a, 0x1e, 0xdf, 0xe5, 0xd8, 0x46, 0x5f, 0x30, 0xc7, 0x8b, 0x4c, 0xc5, + 0xf9, 0x22, 0xa7, 0x57, 0x15, 0x68, 0x73, 0x84, 0xa9, 0xff, 0x3a, 0x07, 0x64, 0xb2, 0x2c, 0x4c, + 0xb6, 0x21, 0xd7, 0x46, 0xcf, 0x39, 0x99, 0xe1, 0x65, 0x3e, 0x01, 0x6e, 0x6c, 0x49, 0x24, 0xd5, + 0x04, 0x92, 0xc9, 0x69, 0xc5, 0x57, 0xcc, 0xbc, 0x4c, 0x1b, 0x12, 0x49, 0x35, 0x41, 0xed, 0x57, + 0x69, 0xc8, 0x29, 0x6a, 0x72, 0x0d, 0xf2, 0x71, 0x9d, 0x59, 0x6f, 0x7b, 0xb9, 0x21, 0x62, 0x11, + 0xd9, 0x80, 0xd2, 0x21, 0x1b, 0x60, 0xdb, 0xd6, 0x33, 0x98, 0xb6, 0xe1, 0xd5, 0x99, 0xd9, 0x5e, + 0xa0, 0xa0, 0x40, 0x5b, 0xc6, 0xe8, 0x15, 0xb9, 0x46, 0xbe, 0xf6, 0x92, 0x21, 0x9a, 0x56, 0xe8, + 0xdb, 0x5e, 0xa0, 0xd5, 0x04, 0x4a, 0x33, 0x6d, 0x00, 0x24, 0x2a, 0xd9, 0xb9, 0x59, 0x2b, 0xd9, + 0x09, 0x50, 0x73, 0x05, 0x96, 0xbb, 0x42, 0x84, 0xda, 0x0a, 0x15, 0x06, 0x6a, 0x5f, 0xa5, 0x20, + 0xa7, 0x7c, 0x43, 0x6e, 0x43, 0x49, 0x75, 0x46, 0xc2, 0x11, 0xfd, 0x48, 0x27, 0x09, 0xc3, 0x19, + 0xc9, 0x9e, 0x7d, 0xd5, 0x41, 0xde, 0x81, 0x52, 0x87, 0x87, 0x6e, 0xac, 0x17, 0x07, 0x19, 0x90, + 0xc2, 0x91, 0x8a, 0x04, 0xac, 0x9b, 0xca, 0xd2, 0xb0, 0x1e, 0xa4, 0x84, 0xba, 0xb4, 0xf4, 0x2d, + 0xcc, 0xa6, 0x0c, 0xa0, 0xf8, 0xd5, 0x44, 0x76, 0xb2, 0x85, 0x54, 0x35, 0x3d, 0x5c, 0xba, 0xfa, + 0x3a, 0x94, 0x93, 0xff, 0x61, 0xc9, 0xec, 0xc7, 0xef, 0xf7, 0x5a, 0xc8, 0x4d, 0xbd, 0xd6, 0xb4, + 0x76, 0xb2, 0x85, 0x74, 0x35, 0xa3, 0x9f, 0xc6, 0xf5, 0x1b, 0x90, 0x8f, 0xff, 0x3d, 0x18, 0xde, + 0x2b, 0x52, 0x3b, 0x65, 0xee, 0x95, 0xe6, 0xfb, 0x7f, 0x79, 0x75, 0x3d, 0xf5, 0xd7, 0x57, 0xd7, + 0x53, 0x5f, 0xbf, 0xba, 0x9e, 0xfa, 0xc9, 0x0d, 0x6d, 0x2d, 0x0b, 0xd4, 0xdf, 0x9e, 0x93, 0xff, + 0xa2, 0xb6, 0x16, 0xd5, 0xc2, 0xde, 0xfd, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x94, 0x81, + 0x12, 0x62, 0x1d, 0x00, 0x00, +} + +func (m *VirtualService) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4352,12 +4039,12 @@ func (m *HTTPRouteDestination) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *HTTPRouteDestination) MarshalTo(dAtA []byte) (int, error) { +func (m *VirtualService) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HTTPRouteDestination) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *VirtualService) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -4366,39 +4053,79 @@ func (m *HTTPRouteDestination) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 + 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 -= size - i = encodeVarintVirtualService(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x2a } - i-- - dAtA[i] = 0x3a } - if m.Weight != 0 { - i = encodeVarintVirtualService(dAtA, i, uint64(m.Weight)) - i-- - dAtA[i] = 0x10 + 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 m.Destination != nil { - { - size, err := m.Destination.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + 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 -= 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 } - i-- - dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *RouteDestination) Marshal() (dAtA []byte, err error) { +func (m *Destination) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4408,12 +4135,12 @@ func (m *RouteDestination) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *RouteDestination) MarshalTo(dAtA []byte) (int, error) { +func (m *Destination) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *RouteDestination) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Destination) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -4422,14 +4149,9 @@ func (m *RouteDestination) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 { + if m.Port != nil { { - size, err := m.Destination.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Port.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -4437,12 +4159,26 @@ func (m *RouteDestination) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 *L4MatchAttributes) Marshal() (dAtA []byte, err error) { +func (m *HTTPRoute) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4452,12 +4188,12 @@ func (m *L4MatchAttributes) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *L4MatchAttributes) MarshalTo(dAtA []byte) (int, error) { +func (m *HTTPRoute) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *L4MatchAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *HTTPRoute) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -4466,143 +4202,193 @@ func (m *L4MatchAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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))) + if m.RateLimit != nil { + { + size, err := m.RateLimit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x32 + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xaa } - 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 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 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 m.MirrorPercentage != nil { + { + size, err := m.MirrorPercentage.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } - } - 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)) + dAtA[i] = 0x1 i-- - dAtA[i] = 0x10 + dAtA[i] = 0x9a } - 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 + 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 } - 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.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 len(m.SourceNamespace) > 0 { - i -= len(m.SourceNamespace) - copy(dAtA[i:], m.SourceNamespace) - i = encodeVarintVirtualService(dAtA, i, uint64(len(m.SourceNamespace))) + 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 + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 } - 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 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 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.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.Port != 0 { - i = encodeVarintVirtualService(dAtA, i, uint64(m.Port)) + 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] = 0x18 + dAtA[i] = 0x42 } - 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]))) + 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.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]))) + 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 } @@ -4610,7 +4396,7 @@ func (m *TLSMatchAttributes) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *HTTPRedirect) Marshal() (dAtA []byte, err error) { +func (m *RateLimit) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4620,12 +4406,12 @@ func (m *HTTPRedirect) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *HTTPRedirect) MarshalTo(dAtA []byte) (int, error) { +func (m *RateLimit) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HTTPRedirect) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RateLimit) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -4634,29 +4420,54 @@ func (m *HTTPRedirect) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 m.RateLimitSpecifier != nil { + { + size := m.RateLimitSpecifier.Size() + i -= size + if _, err := m.RateLimitSpecifier.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - 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.Descriptors) > 0 { + for iNdEx := len(m.Descriptors) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Descriptors[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - if len(m.Uri) > 0 { - i -= len(m.Uri) - copy(dAtA[i:], m.Uri) - i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Uri))) + return len(dAtA) - i, nil +} + +func (m *RateLimit_Local_) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RateLimit_Local_) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + if m.Local != nil { + { + size, err := m.Local.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 } return len(dAtA) - i, nil } - -func (m *HTTPRewrite) Marshal() (dAtA []byte, err error) { +func (m *RateLimit_TokenBucket) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4666,12 +4477,12 @@ func (m *HTTPRewrite) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *HTTPRewrite) MarshalTo(dAtA []byte) (int, error) { +func (m *RateLimit_TokenBucket) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HTTPRewrite) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RateLimit_TokenBucket) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -4680,24 +4491,32 @@ func (m *HTTPRewrite) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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))) + if m.FillInterval != nil { + { + size, err := m.FillInterval.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } - if len(m.Uri) > 0 { - i -= len(m.Uri) - copy(dAtA[i:], m.Uri) - i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Uri))) + if m.TokensPerFill != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.TokensPerFill)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x10 + } + if m.MaxTokens != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.MaxTokens)) + i-- + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *StringMatch) Marshal() (dAtA []byte, err error) { +func (m *RateLimit_LocalDescriptor) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4707,12 +4526,12 @@ func (m *StringMatch) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *StringMatch) MarshalTo(dAtA []byte) (int, error) { +func (m *RateLimit_LocalDescriptor) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *StringMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RateLimit_LocalDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -4721,61 +4540,77 @@ func (m *StringMatch) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if m.MatchType != nil { + if m.TokenBucket != nil { { - size := m.MatchType.Size() - i -= size - if _, err := m.MatchType.MarshalTo(dAtA[i:]); err != nil { + size, err := m.TokenBucket.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { return 0, err } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Entries) > 0 { + for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Entries[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 *StringMatch_Exact) MarshalTo(dAtA []byte) (int, error) { +func (m *RateLimit_LocalDescriptor_Entry) Marshal() (dAtA []byte, err error) { size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil } -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) { +func (m *RateLimit_LocalDescriptor_Entry) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *StringMatch_Prefix) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RateLimit_LocalDescriptor_Entry) 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) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[: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 + _ = i + var l int + _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Value) > 0 { + i -= len(m.Value) + copy(dAtA[i:], m.Value) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Value))) + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *HTTPRetry) Marshal() (dAtA []byte, err error) { + +func (m *RateLimit_Local) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4785,12 +4620,12 @@ func (m *HTTPRetry) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *HTTPRetry) MarshalTo(dAtA []byte) (int, error) { +func (m *RateLimit_Local) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HTTPRetry) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RateLimit_Local) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -4799,28 +4634,23 @@ func (m *HTTPRetry) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 + if len(m.Descriptors) > 0 { + for iNdEx := len(m.Descriptors) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Descriptors[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVirtualService(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintVirtualService(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 } - 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 { + if m.TokenBucket != nil { { - size, err := m.PerTryTimeout.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.TokenBucket.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -4828,17 +4658,12 @@ func (m *HTTPRetry) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *CorsPolicy) Marshal() (dAtA []byte, err error) { +func (m *RateLimitDescriptor) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4848,12 +4673,12 @@ func (m *CorsPolicy) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *CorsPolicy) MarshalTo(dAtA []byte) (int, error) { +func (m *RateLimitDescriptor) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *CorsPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RateLimitDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -4862,10 +4687,10 @@ func (m *CorsPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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-- { + if len(m.Entries) > 0 { + for iNdEx := len(m.Entries) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.AllowOrigins[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Entries[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -4873,73 +4698,13 @@ func (m *CorsPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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) { +func (m *RateLimitDescriptor_Entry) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -4949,12 +4714,12 @@ func (m *HTTPFaultInjection) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *HTTPFaultInjection) MarshalTo(dAtA []byte) (int, error) { +func (m *RateLimitDescriptor_Entry) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HTTPFaultInjection) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *RateLimitDescriptor_Entry) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -4963,34 +4728,64 @@ func (m *HTTPFaultInjection) MarshalToSizedBuffer(dAtA []byte) (int, error) { i -= len(m.XXX_unrecognized) copy(dAtA[i:], m.XXX_unrecognized) } - if m.Abort != nil { + if m.EntrySpecifier != nil { { - size, err := m.Abort.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { + size := m.EntrySpecifier.Size() + i -= size + if _, err := m.EntrySpecifier.MarshalTo(dAtA[i:]); 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)) + if m.SkipIfError { + i-- + if m.SkipIfError { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } i-- + dAtA[i] = 0x10 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Key))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *HTTPFaultInjection_Delay) Marshal() (dAtA []byte, err error) { +func (m *RateLimitDescriptor_Entry_RequestHeader) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RateLimitDescriptor_Entry_RequestHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.RequestHeader) + copy(dAtA[i:], m.RequestHeader) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.RequestHeader))) + i-- + dAtA[i] = 0x1a + return len(dAtA) - i, nil +} +func (m *RateLimitDescriptor_Entry_Expression) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RateLimitDescriptor_Entry_Expression) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + i -= len(m.Expression) + copy(dAtA[i:], m.Expression) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.Expression))) + i-- + dAtA[i] = 0x22 + 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]) @@ -5000,12 +4795,12 @@ func (m *HTTPFaultInjection_Delay) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *HTTPFaultInjection_Delay) MarshalTo(dAtA []byte) (int, error) { +func (m *Delegate) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HTTPFaultInjection_Delay) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Delegate) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -5014,45 +4809,50 @@ func (m *HTTPFaultInjection_Delay) MarshalToSizedBuffer(dAtA []byte) (int, error 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)) - } + 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] = 0x2a - } - if m.HttpDelayType != nil { - { - size := m.HttpDelayType.Size() - i -= size - if _, err := m.HttpDelayType.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } + dAtA[i] = 0x12 } - if m.Percent != 0 { - i = encodeVarintVirtualService(dAtA, i, uint64(m.Percent)) + 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] = 0x8 + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *HTTPFaultInjection_Delay_FixedDelay) MarshalTo(dAtA []byte) (int, error) { +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 *HTTPFaultInjection_Delay_FixedDelay) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Headers) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) - if m.FixedDelay != nil { + _ = 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.FixedDelay.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Response.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -5062,18 +4862,9 @@ func (m *HTTPFaultInjection_Delay_FixedDelay) MarshalToSizedBuffer(dAtA []byte) i-- dAtA[i] = 0x12 } - return len(dAtA) - i, nil -} -func (m *HTTPFaultInjection_Delay_ExponentialDelay) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *HTTPFaultInjection_Delay_ExponentialDelay) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.ExponentialDelay != nil { + if m.Request != nil { { - size, err := m.ExponentialDelay.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.Request.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -5081,11 +4872,12 @@ func (m *HTTPFaultInjection_Delay_ExponentialDelay) MarshalToSizedBuffer(dAtA [] i = encodeVarintVirtualService(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a + dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *HTTPFaultInjection_Abort) Marshal() (dAtA []byte, err error) { + +func (m *Headers_HeaderOperations) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5095,12 +4887,12 @@ func (m *HTTPFaultInjection_Abort) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *HTTPFaultInjection_Abort) MarshalTo(dAtA []byte) (int, error) { +func (m *Headers_HeaderOperations) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HTTPFaultInjection_Abort) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *Headers_HeaderOperations) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -5109,71 +4901,112 @@ func (m *HTTPFaultInjection_Abort) MarshalToSizedBuffer(dAtA []byte) (int, error 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)) + 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 } - 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 - } + 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 *HTTPFaultInjection_Abort_HttpStatus) MarshalTo(dAtA []byte) (int, error) { +func (m *TLSRoute) Marshal() (dAtA []byte, err error) { size := m.Size() - return m.MarshalToSizedBuffer(dAtA[: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_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) { +func (m *TLSRoute) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HTTPFaultInjection_Abort_GrpcStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TLSRoute) 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 + _ = 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 *HTTPFaultInjection_Abort_Http2Error) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[: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) { +func (m *TCPRoute) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5183,12 +5016,12 @@ func (m *PortSelector) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *PortSelector) MarshalTo(dAtA []byte) (int, error) { +func (m *TCPRoute) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *PortSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *TCPRoute) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -5197,15 +5030,38 @@ func (m *PortSelector) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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 + 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 *Percent) Marshal() (dAtA []byte, err error) { +func (m *HTTPMatchRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5215,12 +5071,12 @@ func (m *Percent) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Percent) MarshalTo(dAtA []byte) (int, error) { +func (m *HTTPMatchRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Percent) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *HTTPMatchRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -5229,760 +5085,1140 @@ func (m *Percent) MarshalToSizedBuffer(dAtA []byte) (int, error) { 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)))) + 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] = 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 + dAtA[i] = 0x6a } - 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.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.Gateways) > 0 { - for _, s := range m.Gateways { - l = len(s) - n += 1 + l + sovVirtualService(uint64(l)) - } + 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 len(m.Http) > 0 { - for _, e := range m.Http { - l = e.Size() - n += 1 + l + sovVirtualService(uint64(l)) + if m.IgnoreUriCase { + i-- + if m.IgnoreUriCase { + dAtA[i] = 1 + } else { + dAtA[i] = 0 } + i-- + dAtA[i] = 0x50 } - if len(m.Tcp) > 0 { - for _, e := range m.Tcp { - l = e.Size() - n += 1 + l + sovVirtualService(uint64(l)) + 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.Tls) > 0 { - for _, e := range m.Tls { - l = e.Size() - n += 1 + l + sovVirtualService(uint64(l)) + 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.ExportTo) > 0 { - for _, s := range m.ExportTo { - l = len(s) - n += 1 + l + sovVirtualService(uint64(l)) + 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.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if m.Port != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x30 } - return n -} - -func (m *Destination) Size() (n int) { - if m == nil { - return 0 + 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 + } } - var l int - _ = l - l = len(m.Host) - if l > 0 { - n += 1 + l + sovVirtualService(uint64(l)) + 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 } - l = len(m.Subset) - if l > 0 { - n += 1 + l + sovVirtualService(uint64(l)) + 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.Port != nil { - l = m.Port.Size() - n += 1 + l + sovVirtualService(uint64(l)) + 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.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + 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 n + return len(dAtA) - i, nil } -func (m *HTTPRoute) Size() (n int) { - if m == nil { - return 0 +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 len(m.Match) > 0 { - for _, e := range m.Match { - l = e.Size() - n += 1 + l + sovVirtualService(uint64(l)) - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Route) > 0 { - for _, e := range m.Route { - l = e.Size() - n += 1 + l + sovVirtualService(uint64(l)) + 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.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.Weight != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Weight)) + i-- + dAtA[i] = 0x10 } - if m.Timeout != nil { - l = m.Timeout.Size() - n += 1 + l + sovVirtualService(uint64(l)) + 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 } - if m.Retries != nil { - l = m.Retries.Size() - n += 1 + l + sovVirtualService(uint64(l)) + 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 } - if m.Fault != nil { - l = m.Fault.Size() - n += 1 + l + sovVirtualService(uint64(l)) + 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.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.Weight != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Weight)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + 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 n + return len(dAtA) - i, nil } -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) +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 n + return dAtA[:n], nil } -func (m *Headers) Size() (n int) { - if m == nil { - return 0 - } +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.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) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return n -} - -func (m *Headers_HeaderOperations) Size() (n int) { - if m == nil { - return 0 + 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 } - 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.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.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.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.Remove) > 0 { - for _, s := range m.Remove { - l = len(s) - n += 1 + l + sovVirtualService(uint64(l)) - } + 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.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if m.Port != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x10 } - return n + 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 *TLSRoute) Size() (n int) { - if m == nil { - return 0 +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 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) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return n -} - -func (m *TCPRoute) Size() (n int) { - if m == nil { - return 0 + 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 } - 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.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.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 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 { - 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)) - } + i = encodeVarintVirtualService(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x18 } - 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 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 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)) + 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 } } - 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 + return len(dAtA) - i, nil } -func (m *HTTPRouteDestination) Size() (n int) { - if m == nil { - return 0 +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.Destination != nil { - l = m.Destination.Size() - n += 1 + l + sovVirtualService(uint64(l)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.Weight != 0 { - n += 1 + sovVirtualService(uint64(m.Weight)) + if m.RedirectCode != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.RedirectCode)) + i-- + dAtA[i] = 0x18 } - if m.Headers != nil { - l = m.Headers.Size() - n += 1 + l + sovVirtualService(uint64(l)) + 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 m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + 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 n + return len(dAtA) - i, nil } -func (m *RouteDestination) Size() (n int) { - if m == nil { - return 0 +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.Destination != nil { - l = m.Destination.Size() - n += 1 + l + sovVirtualService(uint64(l)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.Weight != 0 { - n += 1 + sovVirtualService(uint64(m.Weight)) + 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 m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + 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 n + return len(dAtA) - i, nil } -func (m *L4MatchAttributes) Size() (n int) { - if m == nil { - return 0 +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 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 m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Gateways) > 0 { - for _, s := range m.Gateways { - l = len(s) - n += 1 + l + sovVirtualService(uint64(l)) + if m.MatchType != nil { + { + size := m.MatchType.Size() + i -= size + if _, err := m.MatchType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } } - 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 + return len(dAtA) - i, nil } -func (m *TLSMatchAttributes) Size() (n int) { - if m == nil { - return 0 +func (m *StringMatch_Exact) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[: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) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[: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) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[: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 len(m.SniHosts) > 0 { - for _, s := range m.SniHosts { - l = len(s) - n += 1 + l + sovVirtualService(uint64(l)) - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.DestinationSubnets) > 0 { - for _, s := range m.DestinationSubnets { - l = len(s) - n += 1 + l + sovVirtualService(uint64(l)) + 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 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.RetryOn) > 0 { + i -= len(m.RetryOn) + copy(dAtA[i:], m.RetryOn) + i = encodeVarintVirtualService(dAtA, i, uint64(len(m.RetryOn))) + i-- + dAtA[i] = 0x1a } - if len(m.Gateways) > 0 { - for _, s := range m.Gateways { - l = len(s) - n += 1 + l + sovVirtualService(uint64(l)) + 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 } - l = len(m.SourceNamespace) - if l > 0 { - n += 1 + l + sovVirtualService(uint64(l)) - } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if m.Attempts != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Attempts)) + i-- + dAtA[i] = 0x8 } - return n + return len(dAtA) - i, nil } -func (m *HTTPRedirect) Size() (n int) { - if m == nil { - return 0 +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 - l = len(m.Uri) - if l > 0 { - n += 1 + l + sovVirtualService(uint64(l)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovVirtualService(uint64(l)) + 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.RedirectCode != 0 { - n += 1 + sovVirtualService(uint64(m.RedirectCode)) + 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.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + 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 } - return n -} - -func (m *HTTPRewrite) Size() (n int) { - if m == nil { - return 0 + 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 + } } - var l int - _ = l - l = len(m.Uri) - if l > 0 { - n += 1 + l + sovVirtualService(uint64(l)) + 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 + } } - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovVirtualService(uint64(l)) + 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 m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + 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 n + return len(dAtA) - i, nil } -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) +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 n + return dAtA[:n], nil } -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 *HTTPFaultInjection) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *HTTPRetry) Size() (n int) { - if m == nil { - return 0 - } + +func (m *HTTPFaultInjection) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i 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.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.RetryRemoteLocalities != nil { - l = m.RetryRemoteLocalities.Size() - n += 1 + l + sovVirtualService(uint64(l)) + 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.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + 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 n + return len(dAtA) - i, nil } -func (m *CorsPolicy) Size() (n int) { - if m == nil { - return 0 +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 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 m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.AllowHeaders) > 0 { - for _, s := range m.AllowHeaders { - l = len(s) - n += 1 + l + sovVirtualService(uint64(l)) + 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 len(m.ExposeHeaders) > 0 { - for _, s := range m.ExposeHeaders { - l = len(s) - n += 1 + l + sovVirtualService(uint64(l)) + if m.HttpDelayType != nil { + { + size := m.HttpDelayType.Size() + i -= size + if _, err := m.HttpDelayType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } } - 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 m.Percent != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Percent)) + i-- + dAtA[i] = 0x8 } - if len(m.AllowOrigins) > 0 { - for _, e := range m.AllowOrigins { - l = e.Size() - n += 1 + l + sovVirtualService(uint64(l)) + return len(dAtA) - i, nil +} + +func (m *HTTPFaultInjection_Delay_FixedDelay) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[: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 } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) - } - return n + return len(dAtA) - i, nil +} +func (m *HTTPFaultInjection_Delay_ExponentialDelay) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -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)) +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 } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + 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 n + return dAtA[:n], nil } -func (m *HTTPFaultInjection_Delay) Size() (n int) { - if m == nil { - return 0 - } +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.Percent != 0 { - n += 1 + sovVirtualService(uint64(m.Percent)) - } - if m.HttpDelayType != nil { - n += m.HttpDelayType.Size() + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Percentage != nil { - l = m.Percentage.Size() - n += 1 + l + sovVirtualService(uint64(l)) + { + 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.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + if m.ErrorType != nil { + { + size := m.ErrorType.Size() + i -= size + if _, err := m.ErrorType.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - return n + return len(dAtA) - i, nil } -func (m *HTTPFaultInjection_Delay_FixedDelay) Size() (n int) { - if m == nil { - return 0 +func (m *HTTPFaultInjection_Abort_HttpStatus) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[: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) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[: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) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[: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.FixedDelay != nil { - l = m.FixedDelay.Size() - n += 1 + l + sovVirtualService(uint64(l)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return n + if m.Number != 0 { + i = encodeVarintVirtualService(dAtA, i, uint64(m.Number)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } -func (m *HTTPFaultInjection_Delay_ExponentialDelay) Size() (n int) { - if m == nil { - return 0 + +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.ExponentialDelay != nil { - l = m.ExponentialDelay.Size() - n += 1 + l + sovVirtualService(uint64(l)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return n + 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 (m *HTTPFaultInjection_Abort) Size() (n int) { + +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 m.ErrorType != nil { - n += m.ErrorType.Size() + if len(m.Hosts) > 0 { + for _, s := range m.Hosts { + l = len(s) + n += 1 + l + sovVirtualService(uint64(l)) + } } - if m.Percentage != nil { - l = m.Percentage.Size() - 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) @@ -5990,72 +6226,1348 @@ func (m *HTTPFaultInjection_Abort) Size() (n int) { return n } -func (m *HTTPFaultInjection_Abort_HttpStatus) Size() (n int) { +func (m *Destination) 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 + l = len(m.Host) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) } - 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 + 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) } - var l int - _ = l - l = len(m.Http2Error) - n += 1 + l + sovVirtualService(uint64(l)) return n } -func (m *PortSelector) Size() (n int) { + +func (m *HTTPRoute) Size() (n int) { if m == nil { return 0 } var l int _ = l - if m.Number != 0 { - n += 1 + sovVirtualService(uint64(m.Number)) + if len(m.Match) > 0 { + for _, e := range m.Match { + l = e.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } } - if m.XXX_unrecognized != nil { - n += len(m.XXX_unrecognized) + 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.RateLimit != nil { + l = m.RateLimit.Size() + n += 2 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RateLimit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Descriptors) > 0 { + for _, e := range m.Descriptors { + l = e.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if m.RateLimitSpecifier != nil { + n += m.RateLimitSpecifier.Size() + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RateLimit_Local_) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Local != nil { + l = m.Local.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + return n +} +func (m *RateLimit_TokenBucket) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MaxTokens != 0 { + n += 1 + sovVirtualService(uint64(m.MaxTokens)) + } + if m.TokensPerFill != 0 { + n += 1 + sovVirtualService(uint64(m.TokensPerFill)) + } + if m.FillInterval != nil { + l = m.FillInterval.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RateLimit_LocalDescriptor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Entries) > 0 { + for _, e := range m.Entries { + l = e.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if m.TokenBucket != nil { + l = m.TokenBucket.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RateLimit_LocalDescriptor_Entry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) + } + l = len(m.Value) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RateLimit_Local) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TokenBucket != nil { + l = m.TokenBucket.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + if len(m.Descriptors) > 0 { + for _, e := range m.Descriptors { + l = e.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RateLimitDescriptor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Entries) > 0 { + for _, e := range m.Entries { + l = e.Size() + n += 1 + l + sovVirtualService(uint64(l)) + } + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RateLimitDescriptor_Entry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovVirtualService(uint64(l)) + } + if m.SkipIfError { + n += 2 + } + if m.EntrySpecifier != nil { + n += m.EntrySpecifier.Size() + } + if m.XXX_unrecognized != nil { + n += len(m.XXX_unrecognized) + } + return n +} + +func (m *RateLimitDescriptor_Entry_RequestHeader) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RequestHeader) + n += 1 + l + sovVirtualService(uint64(l)) + return n +} +func (m *RateLimitDescriptor_Entry_Expression) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Expression) + n += 1 + l + sovVirtualService(uint64(l)) + 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) || (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) || (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 + } } - 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) + if iNdEx > l { + return io.ErrUnexpectedEOF } - 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)))) + return nil } -func (m *VirtualService) Unmarshal(dAtA []byte) error { +func (m *HTTPRoute) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6065,30 +7577,170 @@ func (m *VirtualService) Unmarshal(dAtA []byte) error { if shift >= 64 { return ErrIntOverflowVirtualService } - if iNdEx >= l { + 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 } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break + if m.Rewrite == nil { + m.Rewrite = &HTTPRewrite{} } - } - 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 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 Hosts", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVirtualService @@ -6098,27 +7750,211 @@ func (m *VirtualService) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthVirtualService } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthVirtualService } if postIndex > l { return io.ErrUnexpectedEOF } - m.Hosts = append(m.Hosts, string(dAtA[iNdEx:postIndex])) + if m.Timeout == nil { + m.Timeout = &types.Duration{} + } + if err := m.Timeout.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex - case 2: + case 7: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Gateways", wireType) + 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 { @@ -6146,11 +7982,11 @@ func (m *VirtualService) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Gateways = append(m.Gateways, string(dAtA[iNdEx:postIndex])) + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 18: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Http", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MirrorPercent", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6177,14 +8013,16 @@ func (m *VirtualService) Unmarshal(dAtA []byte) error { 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 { + if m.MirrorPercent == nil { + m.MirrorPercent = &types.UInt32Value{} + } + if err := m.MirrorPercent.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: + case 19: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tcp", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field MirrorPercentage", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6211,14 +8049,16 @@ func (m *VirtualService) Unmarshal(dAtA []byte) error { 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 { + if m.MirrorPercentage == nil { + m.MirrorPercentage = &Percent{} + } + if err := m.MirrorPercentage.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 5: + case 20: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Tls", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Delegate", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6245,16 +8085,18 @@ func (m *VirtualService) Unmarshal(dAtA []byte) error { 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 { + if m.Delegate == nil { + m.Delegate = &Delegate{} + } + if err := m.Delegate.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 6: + case 21: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ExportTo", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RateLimit", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVirtualService @@ -6264,23 +8106,27 @@ func (m *VirtualService) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthVirtualService } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthVirtualService } if postIndex > l { return io.ErrUnexpectedEOF } - m.ExportTo = append(m.ExportTo, string(dAtA[iNdEx:postIndex])) + if m.RateLimit == nil { + m.RateLimit = &RateLimit{} + } + if err := m.RateLimit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } iNdEx = postIndex default: iNdEx = preIndex @@ -6304,7 +8150,7 @@ func (m *VirtualService) Unmarshal(dAtA []byte) error { } return nil } -func (m *Destination) Unmarshal(dAtA []byte) error { +func (m *RateLimit) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6327,17 +8173,17 @@ func (m *Destination) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Destination: wiretype end group for non-group") + return fmt.Errorf("proto: RateLimit: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Destination: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RateLimit: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Descriptors", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVirtualService @@ -6347,59 +8193,29 @@ func (m *Destination) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthVirtualService } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen 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.Descriptors = append(m.Descriptors, &RateLimitDescriptor{}) + if err := m.Descriptors[len(m.Descriptors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Subset = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Port", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Local", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6426,12 +8242,11 @@ func (m *Destination) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Port == nil { - m.Port = &PortSelector{} - } - if err := m.Port.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + v := &RateLimit_Local{} + if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } + m.RateLimitSpecifier = &RateLimit_Local_{v} iNdEx = postIndex default: iNdEx = preIndex @@ -6455,7 +8270,7 @@ func (m *Destination) Unmarshal(dAtA []byte) error { } return nil } -func (m *HTTPRoute) Unmarshal(dAtA []byte) error { +func (m *RateLimit_TokenBucket) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -6478,17 +8293,17 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: HTTPRoute: wiretype end group for non-group") + return fmt.Errorf("proto: TokenBucket: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: HTTPRoute: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: TokenBucket: 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) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxTokens", wireType) } - var msglen int + m.MaxTokens = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVirtualService @@ -6498,31 +8313,16 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.MaxTokens |= uint32(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) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TokensPerFill", wireType) } - var msglen int + m.TokensPerFill = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVirtualService @@ -6532,29 +8332,14 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + m.TokensPerFill |= uint32(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) + return fmt.Errorf("proto: wrong wireType = %d for field FillInterval", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6581,16 +8366,67 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Redirect == nil { - m.Redirect = &HTTPRedirect{} + if m.FillInterval == nil { + m.FillInterval = &types.Duration{} } - if err := m.Redirect.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.FillInterval.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 4: + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (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 *RateLimit_LocalDescriptor) 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: LocalDescriptor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LocalDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Rewrite", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6617,16 +8453,14 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Rewrite == nil { - m.Rewrite = &HTTPRewrite{} - } - if err := m.Rewrite.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Entries = append(m.Entries, &RateLimit_LocalDescriptor_Entry{}) + if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 6: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Timeout", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenBucket", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6653,18 +8487,69 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Timeout == nil { - m.Timeout = &types.Duration{} + if m.TokenBucket == nil { + m.TokenBucket = &RateLimit_TokenBucket{} } - if err := m.Timeout.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.TokenBucket.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 7: + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (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 *RateLimit_LocalDescriptor_Entry) 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: Entry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Entry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Retries", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVirtualService @@ -6674,33 +8559,29 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthVirtualService } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen 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 - } + m.Key = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Fault", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVirtualService @@ -6710,31 +8591,78 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthVirtualService } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen 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 { + m.Value = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { return err } - iNdEx = postIndex - case 9: + if (skippy < 0) || (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 *RateLimit_Local) 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: Local: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Local: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Mirror", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TokenBucket", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6761,16 +8689,16 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Mirror == nil { - m.Mirror = &Destination{} + if m.TokenBucket == nil { + m.TokenBucket = &RateLimit_TokenBucket{} } - if err := m.Mirror.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.TokenBucket.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 10: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field CorsPolicy", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Descriptors", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6797,16 +8725,65 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.CorsPolicy == nil { - m.CorsPolicy = &CorsPolicy{} - } - if err := m.CorsPolicy.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Descriptors = append(m.Descriptors, &RateLimit_LocalDescriptor{}) + if err := m.Descriptors[len(m.Descriptors)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 16: + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (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 *RateLimitDescriptor) 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: RateLimitDescriptor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RateLimitDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -6833,16 +8810,65 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Headers == nil { - m.Headers = &Headers{} - } - if err := m.Headers.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.Entries = append(m.Entries, &RateLimitDescriptor_Entry{}) + if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex - case 17: + default: + iNdEx = preIndex + skippy, err := skipVirtualService(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (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 *RateLimitDescriptor_Entry) 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: Entry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Entry: 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) + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -6870,13 +8896,13 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Key = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 18: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MirrorPercent", wireType) + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SkipIfError", wireType) } - var msglen int + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVirtualService @@ -6886,33 +8912,17 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + v |= 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: + m.SkipIfError = bool(v != 0) + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MirrorPercentage", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RequestHeader", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVirtualService @@ -6922,33 +8932,29 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthVirtualService } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen 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 - } + m.EntrySpecifier = &RateLimitDescriptor_Entry_RequestHeader{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex - case 20: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Delegate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Expression", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowVirtualService @@ -6958,27 +8964,23 @@ func (m *HTTPRoute) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthVirtualService } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen 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 - } + m.EntrySpecifier = &RateLimitDescriptor_Entry_Expression{string(dAtA[iNdEx:postIndex])} iNdEx = postIndex default: iNdEx = preIndex diff --git a/networking/v1beta1/virtual_service.proto b/networking/v1beta1/virtual_service.proto index c6219d81e1a..b82ffd8e67b 100644 --- a/networking/v1beta1/virtual_service.proto +++ b/networking/v1beta1/virtual_service.proto @@ -640,8 +640,89 @@ message HTTPRoute { // Header manipulation rules Headers headers = 16; + // Rate limits + RateLimit rate_limit = 21; + // $hide_from_docs - // Next available field number: 21 + // Next available field number: 22 +} + +// RateLimit configuration. +message RateLimit { + // Specifies the rate limit descriptors to produce for the route. + repeated RateLimitDescriptor descriptors = 1; + + // Token bucket algorithm configuration. Each request consumes a single token. + message TokenBucket { + // Maximum amount of tokens in a bucket. + uint32 max_tokens = 1; + // The amount of tokens added per fill. + uint32 tokens_per_fill = 2; + // The interval that tokens are added to the bucket. + google.protobuf.Duration fill_interval = 3; + } + + // Local rate limit descriptor configuration. + message LocalDescriptor { + // Descriptor entry match. + message Entry { + string key = 1; + string value = 2; + } + // Descriptor entry match. + repeated Entry entries = 1; + + // Specifies the token bucket for matching descriptors. + TokenBucket token_bucket = 2; + } + + // Local rate limit enforcement. + message Local { + // The token bucket configuration to use for rate limiting requests that + // are processed by this filter. Each request processed by the filter + // consumes a single token. If the token is available, the request will be + // allowed. If no tokens are available, the request will receive 429. + TokenBucket token_bucket = 1; + + // The rate limit descriptor list to use in the local rate limit to + // override on. The rate limit descriptor is selected by the first full + // match from the request descriptors. The descriptors token bucket fill + // interval must be a multiple of the global fill interval. + repeated LocalDescriptor descriptors = 2; + } + + oneof rate_limit_specifier { + // Local rate limit configuration. + Local local = 2; + } +} + +// Rate limit descriptor specifies the descriptors consisting of multiple actions. +message RateLimitDescriptor { + // Descriptor entry. + message Entry { + // The key to use in the descriptor entry. + string key = 1; + + // If set to true, skip the entry when the evaluation fails or when the header is missing. + // By default, the entire descriptor is not produced. + bool skip_if_error = 2; + + oneof entry_specifier { + // The header name to be queried from the request headers. The header’s + // value is used to populate the value of the descriptor entry for the + // descriptor_key. + string request_header = 3; + + // CEL expression to populate the entry value. + string expression = 4; + } + } + + // Rate limit entries specify an ordered list of string values composing the descriptor. + // The order of the entries matters, as they are processed sequentially. If an entry fails + // to be computed, no descriptor is generated. + repeated Entry entries = 1; } // Describes the delegate VirtualService. diff --git a/networking/v1beta1/virtual_service_deepcopy.gen.go b/networking/v1beta1/virtual_service_deepcopy.gen.go index fb2e57deb28..e510da636f5 100644 --- a/networking/v1beta1/virtual_service_deepcopy.gen.go +++ b/networking/v1beta1/virtual_service_deepcopy.gen.go @@ -227,6 +227,153 @@ func (in *HTTPRoute) DeepCopyInterface() interface{} { return in.DeepCopy() } +// DeepCopyInto supports using RateLimit within kubernetes types, where deepcopy-gen is used. +func (in *RateLimit) DeepCopyInto(out *RateLimit) { + p := proto.Clone(in).(*RateLimit) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit. Required by controller-gen. +func (in *RateLimit) DeepCopy() *RateLimit { + if in == nil { + return nil + } + out := new(RateLimit) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit. Required by controller-gen. +func (in *RateLimit) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + +// DeepCopyInto supports using RateLimit_TokenBucket within kubernetes types, where deepcopy-gen is used. +func (in *RateLimit_TokenBucket) DeepCopyInto(out *RateLimit_TokenBucket) { + p := proto.Clone(in).(*RateLimit_TokenBucket) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit_TokenBucket. Required by controller-gen. +func (in *RateLimit_TokenBucket) DeepCopy() *RateLimit_TokenBucket { + if in == nil { + return nil + } + out := new(RateLimit_TokenBucket) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit_TokenBucket. Required by controller-gen. +func (in *RateLimit_TokenBucket) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + +// DeepCopyInto supports using RateLimit_LocalDescriptor within kubernetes types, where deepcopy-gen is used. +func (in *RateLimit_LocalDescriptor) DeepCopyInto(out *RateLimit_LocalDescriptor) { + p := proto.Clone(in).(*RateLimit_LocalDescriptor) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit_LocalDescriptor. Required by controller-gen. +func (in *RateLimit_LocalDescriptor) DeepCopy() *RateLimit_LocalDescriptor { + if in == nil { + return nil + } + out := new(RateLimit_LocalDescriptor) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit_LocalDescriptor. Required by controller-gen. +func (in *RateLimit_LocalDescriptor) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + +// DeepCopyInto supports using RateLimit_LocalDescriptor_Entry within kubernetes types, where deepcopy-gen is used. +func (in *RateLimit_LocalDescriptor_Entry) DeepCopyInto(out *RateLimit_LocalDescriptor_Entry) { + p := proto.Clone(in).(*RateLimit_LocalDescriptor_Entry) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit_LocalDescriptor_Entry. Required by controller-gen. +func (in *RateLimit_LocalDescriptor_Entry) DeepCopy() *RateLimit_LocalDescriptor_Entry { + if in == nil { + return nil + } + out := new(RateLimit_LocalDescriptor_Entry) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit_LocalDescriptor_Entry. Required by controller-gen. +func (in *RateLimit_LocalDescriptor_Entry) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + +// DeepCopyInto supports using RateLimit_Local within kubernetes types, where deepcopy-gen is used. +func (in *RateLimit_Local) DeepCopyInto(out *RateLimit_Local) { + p := proto.Clone(in).(*RateLimit_Local) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit_Local. Required by controller-gen. +func (in *RateLimit_Local) DeepCopy() *RateLimit_Local { + if in == nil { + return nil + } + out := new(RateLimit_Local) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new RateLimit_Local. Required by controller-gen. +func (in *RateLimit_Local) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + +// DeepCopyInto supports using RateLimitDescriptor within kubernetes types, where deepcopy-gen is used. +func (in *RateLimitDescriptor) DeepCopyInto(out *RateLimitDescriptor) { + p := proto.Clone(in).(*RateLimitDescriptor) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitDescriptor. Required by controller-gen. +func (in *RateLimitDescriptor) DeepCopy() *RateLimitDescriptor { + if in == nil { + return nil + } + out := new(RateLimitDescriptor) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitDescriptor. Required by controller-gen. +func (in *RateLimitDescriptor) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + +// DeepCopyInto supports using RateLimitDescriptor_Entry within kubernetes types, where deepcopy-gen is used. +func (in *RateLimitDescriptor_Entry) DeepCopyInto(out *RateLimitDescriptor_Entry) { + p := proto.Clone(in).(*RateLimitDescriptor_Entry) + *out = *p +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitDescriptor_Entry. Required by controller-gen. +func (in *RateLimitDescriptor_Entry) DeepCopy() *RateLimitDescriptor_Entry { + if in == nil { + return nil + } + out := new(RateLimitDescriptor_Entry) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInterface is an autogenerated deepcopy function, copying the receiver, creating a new RateLimitDescriptor_Entry. Required by controller-gen. +func (in *RateLimitDescriptor_Entry) DeepCopyInterface() interface{} { + return in.DeepCopy() +} + // DeepCopyInto supports using Delegate within kubernetes types, where deepcopy-gen is used. func (in *Delegate) DeepCopyInto(out *Delegate) { p := proto.Clone(in).(*Delegate) diff --git a/networking/v1beta1/virtual_service_json.gen.go b/networking/v1beta1/virtual_service_json.gen.go index 03e0fe10c6e..31f6cabc035 100644 --- a/networking/v1beta1/virtual_service_json.gen.go +++ b/networking/v1beta1/virtual_service_json.gen.go @@ -199,6 +199,83 @@ func (this *HTTPRoute) UnmarshalJSON(b []byte) error { return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) } +// MarshalJSON is a custom marshaler for RateLimit +func (this *RateLimit) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for RateLimit +func (this *RateLimit) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for RateLimit_TokenBucket +func (this *RateLimit_TokenBucket) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for RateLimit_TokenBucket +func (this *RateLimit_TokenBucket) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for RateLimit_LocalDescriptor +func (this *RateLimit_LocalDescriptor) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for RateLimit_LocalDescriptor +func (this *RateLimit_LocalDescriptor) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for RateLimit_LocalDescriptor_Entry +func (this *RateLimit_LocalDescriptor_Entry) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for RateLimit_LocalDescriptor_Entry +func (this *RateLimit_LocalDescriptor_Entry) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for RateLimit_Local +func (this *RateLimit_Local) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for RateLimit_Local +func (this *RateLimit_Local) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for RateLimitDescriptor +func (this *RateLimitDescriptor) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for RateLimitDescriptor +func (this *RateLimitDescriptor) UnmarshalJSON(b []byte) error { + return VirtualServiceUnmarshaler.Unmarshal(bytes.NewReader(b), this) +} + +// MarshalJSON is a custom marshaler for RateLimitDescriptor_Entry +func (this *RateLimitDescriptor_Entry) MarshalJSON() ([]byte, error) { + str, err := VirtualServiceMarshaler.MarshalToString(this) + return []byte(str), err +} + +// UnmarshalJSON is a custom unmarshaler for RateLimitDescriptor_Entry +func (this *RateLimitDescriptor_Entry) 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) diff --git a/python/istio_api/networking/v1alpha3/virtual_service_pb2.py b/python/istio_api/networking/v1alpha3/virtual_service_pb2.py index 812886f4f8e..95dd28ff7ae 100644 --- a/python/istio_api/networking/v1alpha3/virtual_service_pb2.py +++ b/python/istio_api/networking/v1alpha3/virtual_service_pb2.py @@ -23,7 +23,7 @@ package='istio.networking.v1alpha3', syntax='proto3', serialized_options=_b('Z istio.io/api/networking/v1alpha3'), - serialized_pb=_b('\n)networking/v1alpha3/virtual_service.proto\x12\x19istio.networking.v1alpha3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xdc\x01\n\x0eVirtualService\x12\r\n\x05hosts\x18\x01 \x03(\t\x12\x10\n\x08gateways\x18\x02 \x03(\t\x12\x32\n\x04http\x18\x03 \x03(\x0b\x32$.istio.networking.v1alpha3.HTTPRoute\x12\x30\n\x03tls\x18\x05 \x03(\x0b\x32#.istio.networking.v1alpha3.TLSRoute\x12\x30\n\x03tcp\x18\x04 \x03(\x0b\x32#.istio.networking.v1alpha3.TCPRoute\x12\x11\n\texport_to\x18\x06 \x03(\t\"g\n\x0b\x44\x65stination\x12\x11\n\x04host\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0e\n\x06subset\x18\x02 \x01(\t\x12\x35\n\x04port\x18\x03 \x01(\x0b\x32\'.istio.networking.v1alpha3.PortSelector\"\x94\x07\n\tHTTPRoute\x12\x0c\n\x04name\x18\x11 \x01(\t\x12:\n\x05match\x18\x01 \x03(\x0b\x32+.istio.networking.v1alpha3.HTTPMatchRequest\x12>\n\x05route\x18\x02 \x03(\x0b\x32/.istio.networking.v1alpha3.HTTPRouteDestination\x12\x39\n\x08redirect\x18\x03 \x01(\x0b\x32\'.istio.networking.v1alpha3.HTTPRedirect\x12\x35\n\x08\x64\x65legate\x18\x14 \x01(\x0b\x32#.istio.networking.v1alpha3.Delegate\x12\x37\n\x07rewrite\x18\x04 \x01(\x0b\x32&.istio.networking.v1alpha3.HTTPRewrite\x12*\n\x07timeout\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x35\n\x07retries\x18\x07 \x01(\x0b\x32$.istio.networking.v1alpha3.HTTPRetry\x12<\n\x05\x66\x61ult\x18\x08 \x01(\x0b\x32-.istio.networking.v1alpha3.HTTPFaultInjection\x12\x36\n\x06mirror\x18\t \x01(\x0b\x32&.istio.networking.v1alpha3.Destination\x12\x38\n\x0emirror_percent\x18\x12 \x01(\x0b\x32\x1c.google.protobuf.UInt32ValueB\x02\x18\x01\x12=\n\x11mirror_percentage\x18\x13 \x01(\x0b\x32\".istio.networking.v1alpha3.Percent\x12:\n\x0b\x63ors_policy\x18\n \x01(\x0b\x32%.istio.networking.v1alpha3.CorsPolicy\x12\x33\n\x07headers\x18\x10 \x01(\x0b\x32\".istio.networking.v1alpha3.HeadersJ\x04\x08\x05\x10\x06J\x04\x08\x0b\x10\x10R\x11websocket_upgradeR\x0e\x61ppend_headersR\x17remove_response_headersR\x17\x61ppend_response_headersR\x16remove_request_headersR\x16\x61ppend_request_headers\"+\n\x08\x44\x65legate\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tnamespace\x18\x02 \x01(\t\"\xa9\x03\n\x07Headers\x12\x44\n\x07request\x18\x01 \x01(\x0b\x32\x33.istio.networking.v1alpha3.Headers.HeaderOperations\x12\x45\n\x08response\x18\x02 \x01(\x0b\x32\x33.istio.networking.v1alpha3.Headers.HeaderOperations\x1a\x90\x02\n\x10HeaderOperations\x12I\n\x03set\x18\x01 \x03(\x0b\x32<.istio.networking.v1alpha3.Headers.HeaderOperations.SetEntry\x12I\n\x03\x61\x64\x64\x18\x02 \x03(\x0b\x32<.istio.networking.v1alpha3.Headers.HeaderOperations.AddEntry\x12\x0e\n\x06remove\x18\x03 \x03(\t\x1a*\n\x08SetEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a*\n\x08\x41\x64\x64\x45ntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x89\x01\n\x08TLSRoute\x12\x41\n\x05match\x18\x01 \x03(\x0b\x32-.istio.networking.v1alpha3.TLSMatchAttributesB\x03\xe0\x41\x02\x12:\n\x05route\x18\x02 \x03(\x0b\x32+.istio.networking.v1alpha3.RouteDestination\"\x83\x01\n\x08TCPRoute\x12;\n\x05match\x18\x01 \x03(\x0b\x32,.istio.networking.v1alpha3.L4MatchAttributes\x12:\n\x05route\x18\x02 \x03(\x0b\x32+.istio.networking.v1alpha3.RouteDestination\"\xea\x07\n\x10HTTPMatchRequest\x12\x0c\n\x04name\x18\x0b \x01(\t\x12\x33\n\x03uri\x18\x01 \x01(\x0b\x32&.istio.networking.v1alpha3.StringMatch\x12\x36\n\x06scheme\x18\x02 \x01(\x0b\x32&.istio.networking.v1alpha3.StringMatch\x12\x36\n\x06method\x18\x03 \x01(\x0b\x32&.istio.networking.v1alpha3.StringMatch\x12\x39\n\tauthority\x18\x04 \x01(\x0b\x32&.istio.networking.v1alpha3.StringMatch\x12I\n\x07headers\x18\x05 \x03(\x0b\x32\x38.istio.networking.v1alpha3.HTTPMatchRequest.HeadersEntry\x12\x0c\n\x04port\x18\x06 \x01(\r\x12T\n\rsource_labels\x18\x07 \x03(\x0b\x32=.istio.networking.v1alpha3.HTTPMatchRequest.SourceLabelsEntry\x12\x10\n\x08gateways\x18\x08 \x03(\t\x12R\n\x0cquery_params\x18\t \x03(\x0b\x32<.istio.networking.v1alpha3.HTTPMatchRequest.QueryParamsEntry\x12\x17\n\x0fignore_uri_case\x18\n \x01(\x08\x12X\n\x0fwithout_headers\x18\x0c \x03(\x0b\x32?.istio.networking.v1alpha3.HTTPMatchRequest.WithoutHeadersEntry\x12\x18\n\x10source_namespace\x18\r \x01(\t\x1aV\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x35\n\x05value\x18\x02 \x01(\x0b\x32&.istio.networking.v1alpha3.StringMatch:\x02\x38\x01\x1a\x33\n\x11SourceLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1aZ\n\x10QueryParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x35\n\x05value\x18\x02 \x01(\x0b\x32&.istio.networking.v1alpha3.StringMatch:\x02\x38\x01\x1a]\n\x13WithoutHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x35\n\x05value\x18\x02 \x01(\x0b\x32&.istio.networking.v1alpha3.StringMatch:\x02\x38\x01\"\x85\x02\n\x14HTTPRouteDestination\x12@\n\x0b\x64\x65stination\x18\x01 \x01(\x0b\x32&.istio.networking.v1alpha3.DestinationB\x03\xe0\x41\x02\x12\x0e\n\x06weight\x18\x02 \x01(\x05\x12\x33\n\x07headers\x18\x07 \x01(\x0b\x32\".istio.networking.v1alpha3.HeadersJ\x04\x08\x03\x10\x07R\x17remove_response_headersR\x17\x61ppend_response_headersR\x16remove_request_headersR\x16\x61ppend_request_headers\"d\n\x10RouteDestination\x12@\n\x0b\x64\x65stination\x18\x01 \x01(\x0b\x32&.istio.networking.v1alpha3.DestinationB\x03\xe0\x41\x02\x12\x0e\n\x06weight\x18\x02 \x01(\x05\"\x8d\x02\n\x11L4MatchAttributes\x12\x1b\n\x13\x64\x65stination_subnets\x18\x01 \x03(\t\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x15\n\rsource_subnet\x18\x03 \x01(\t\x12U\n\rsource_labels\x18\x04 \x03(\x0b\x32>.istio.networking.v1alpha3.L4MatchAttributes.SourceLabelsEntry\x12\x10\n\x08gateways\x18\x05 \x03(\t\x12\x18\n\x10source_namespace\x18\x06 \x01(\t\x1a\x33\n\x11SourceLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xa5\x02\n\x12TLSMatchAttributes\x12\x16\n\tsni_hosts\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12\x1b\n\x13\x64\x65stination_subnets\x18\x02 \x03(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\x12V\n\rsource_labels\x18\x05 \x03(\x0b\x32?.istio.networking.v1alpha3.TLSMatchAttributes.SourceLabelsEntry\x12\x10\n\x08gateways\x18\x06 \x03(\t\x12\x18\n\x10source_namespace\x18\x07 \x01(\t\x1a\x33\n\x11SourceLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01J\x04\x08\x04\x10\x05R\rsource_subnet\"E\n\x0cHTTPRedirect\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x11\n\tauthority\x18\x02 \x01(\t\x12\x15\n\rredirect_code\x18\x03 \x01(\r\"-\n\x0bHTTPRewrite\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x11\n\tauthority\x18\x02 \x01(\t\"O\n\x0bStringMatch\x12\x0f\n\x05\x65xact\x18\x01 \x01(\tH\x00\x12\x10\n\x06prefix\x18\x02 \x01(\tH\x00\x12\x0f\n\x05regex\x18\x03 \x01(\tH\x00\x42\x0c\n\nmatch_type\"\xa5\x01\n\tHTTPRetry\x12\x15\n\x08\x61ttempts\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12\x32\n\x0fper_try_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x10\n\x08retry_on\x18\x03 \x01(\t\x12;\n\x17retry_remote_localities\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\"\x8e\x02\n\nCorsPolicy\x12\x18\n\x0c\x61llow_origin\x18\x01 \x03(\tB\x02\x18\x01\x12=\n\rallow_origins\x18\x07 \x03(\x0b\x32&.istio.networking.v1alpha3.StringMatch\x12\x15\n\rallow_methods\x18\x02 \x03(\t\x12\x15\n\rallow_headers\x18\x03 \x03(\t\x12\x16\n\x0e\x65xpose_headers\x18\x04 \x03(\t\x12*\n\x07max_age\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x35\n\x11\x61llow_credentials\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\"\x9e\x04\n\x12HTTPFaultInjection\x12\x42\n\x05\x64\x65lay\x18\x01 \x01(\x0b\x32\x33.istio.networking.v1alpha3.HTTPFaultInjection.Delay\x12\x42\n\x05\x61\x62ort\x18\x02 \x01(\x0b\x32\x33.istio.networking.v1alpha3.HTTPFaultInjection.Abort\x1a\xd6\x01\n\x05\x44\x65lay\x12\x13\n\x07percent\x18\x01 \x01(\x05\x42\x02\x18\x01\x12\x35\n\x0b\x66ixed_delay\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02H\x00\x12\x36\n\x11\x65xponential_delay\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x12\x36\n\npercentage\x18\x05 \x01(\x0b\x32\".istio.networking.v1alpha3.PercentB\x11\n\x0fhttp_delay_type\x1a\xa6\x01\n\x05\x41\x62ort\x12\x1a\n\x0bhttp_status\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02H\x00\x12\x15\n\x0bgrpc_status\x18\x03 \x01(\tH\x00\x12\x15\n\x0bhttp2_error\x18\x04 \x01(\tH\x00\x12\x36\n\npercentage\x18\x05 \x01(\x0b\x32\".istio.networking.v1alpha3.PercentB\x0c\n\nerror_typeJ\x04\x08\x01\x10\x02R\x07percent\"*\n\x0cPortSelector\x12\x0e\n\x06number\x18\x01 \x01(\rJ\x04\x08\x02\x10\x03R\x04name\"\x18\n\x07Percent\x12\r\n\x05value\x18\x01 \x01(\x01\x42\"Z istio.io/api/networking/v1alpha3b\x06proto3') + serialized_pb=_b('\n)networking/v1alpha3/virtual_service.proto\x12\x19istio.networking.v1alpha3\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xdc\x01\n\x0eVirtualService\x12\r\n\x05hosts\x18\x01 \x03(\t\x12\x10\n\x08gateways\x18\x02 \x03(\t\x12\x32\n\x04http\x18\x03 \x03(\x0b\x32$.istio.networking.v1alpha3.HTTPRoute\x12\x30\n\x03tls\x18\x05 \x03(\x0b\x32#.istio.networking.v1alpha3.TLSRoute\x12\x30\n\x03tcp\x18\x04 \x03(\x0b\x32#.istio.networking.v1alpha3.TCPRoute\x12\x11\n\texport_to\x18\x06 \x03(\t\"g\n\x0b\x44\x65stination\x12\x11\n\x04host\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0e\n\x06subset\x18\x02 \x01(\t\x12\x35\n\x04port\x18\x03 \x01(\x0b\x32\'.istio.networking.v1alpha3.PortSelector\"\xce\x07\n\tHTTPRoute\x12\x0c\n\x04name\x18\x11 \x01(\t\x12:\n\x05match\x18\x01 \x03(\x0b\x32+.istio.networking.v1alpha3.HTTPMatchRequest\x12>\n\x05route\x18\x02 \x03(\x0b\x32/.istio.networking.v1alpha3.HTTPRouteDestination\x12\x39\n\x08redirect\x18\x03 \x01(\x0b\x32\'.istio.networking.v1alpha3.HTTPRedirect\x12\x35\n\x08\x64\x65legate\x18\x14 \x01(\x0b\x32#.istio.networking.v1alpha3.Delegate\x12\x37\n\x07rewrite\x18\x04 \x01(\x0b\x32&.istio.networking.v1alpha3.HTTPRewrite\x12*\n\x07timeout\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x35\n\x07retries\x18\x07 \x01(\x0b\x32$.istio.networking.v1alpha3.HTTPRetry\x12<\n\x05\x66\x61ult\x18\x08 \x01(\x0b\x32-.istio.networking.v1alpha3.HTTPFaultInjection\x12\x36\n\x06mirror\x18\t \x01(\x0b\x32&.istio.networking.v1alpha3.Destination\x12\x38\n\x0emirror_percent\x18\x12 \x01(\x0b\x32\x1c.google.protobuf.UInt32ValueB\x02\x18\x01\x12=\n\x11mirror_percentage\x18\x13 \x01(\x0b\x32\".istio.networking.v1alpha3.Percent\x12:\n\x0b\x63ors_policy\x18\n \x01(\x0b\x32%.istio.networking.v1alpha3.CorsPolicy\x12\x33\n\x07headers\x18\x10 \x01(\x0b\x32\".istio.networking.v1alpha3.Headers\x12\x38\n\nrate_limit\x18\x15 \x01(\x0b\x32$.istio.networking.v1alpha3.RateLimitJ\x04\x08\x05\x10\x06J\x04\x08\x0b\x10\x10R\x11websocket_upgradeR\x0e\x61ppend_headersR\x17remove_response_headersR\x17\x61ppend_response_headersR\x16remove_request_headersR\x16\x61ppend_request_headers\"\xfe\x04\n\tRateLimit\x12\x43\n\x0b\x64\x65scriptors\x18\x01 \x03(\x0b\x32..istio.networking.v1alpha3.RateLimitDescriptor\x12;\n\x05local\x18\x02 \x01(\x0b\x32*.istio.networking.v1alpha3.RateLimit.LocalH\x00\x1al\n\x0bTokenBucket\x12\x12\n\nmax_tokens\x18\x01 \x01(\r\x12\x17\n\x0ftokens_per_fill\x18\x02 \x01(\r\x12\x30\n\rfill_interval\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a\xcb\x01\n\x0fLocalDescriptor\x12K\n\x07\x65ntries\x18\x01 \x03(\x0b\x32:.istio.networking.v1alpha3.RateLimit.LocalDescriptor.Entry\x12\x46\n\x0ctoken_bucket\x18\x02 \x01(\x0b\x32\x30.istio.networking.v1alpha3.RateLimit.TokenBucket\x1a#\n\x05\x45ntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x1a\x9a\x01\n\x05Local\x12\x46\n\x0ctoken_bucket\x18\x01 \x01(\x0b\x32\x30.istio.networking.v1alpha3.RateLimit.TokenBucket\x12I\n\x0b\x64\x65scriptors\x18\x02 \x03(\x0b\x32\x34.istio.networking.v1alpha3.RateLimit.LocalDescriptorB\x16\n\x14rate_limit_specifier\"\xcc\x01\n\x13RateLimitDescriptor\x12\x45\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x34.istio.networking.v1alpha3.RateLimitDescriptor.Entry\x1an\n\x05\x45ntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x15\n\rskip_if_error\x18\x02 \x01(\x08\x12\x18\n\x0erequest_header\x18\x03 \x01(\tH\x00\x12\x14\n\nexpression\x18\x04 \x01(\tH\x00\x42\x11\n\x0f\x65ntry_specifier\"+\n\x08\x44\x65legate\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tnamespace\x18\x02 \x01(\t\"\xa9\x03\n\x07Headers\x12\x44\n\x07request\x18\x01 \x01(\x0b\x32\x33.istio.networking.v1alpha3.Headers.HeaderOperations\x12\x45\n\x08response\x18\x02 \x01(\x0b\x32\x33.istio.networking.v1alpha3.Headers.HeaderOperations\x1a\x90\x02\n\x10HeaderOperations\x12I\n\x03set\x18\x01 \x03(\x0b\x32<.istio.networking.v1alpha3.Headers.HeaderOperations.SetEntry\x12I\n\x03\x61\x64\x64\x18\x02 \x03(\x0b\x32<.istio.networking.v1alpha3.Headers.HeaderOperations.AddEntry\x12\x0e\n\x06remove\x18\x03 \x03(\t\x1a*\n\x08SetEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a*\n\x08\x41\x64\x64\x45ntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x89\x01\n\x08TLSRoute\x12\x41\n\x05match\x18\x01 \x03(\x0b\x32-.istio.networking.v1alpha3.TLSMatchAttributesB\x03\xe0\x41\x02\x12:\n\x05route\x18\x02 \x03(\x0b\x32+.istio.networking.v1alpha3.RouteDestination\"\x83\x01\n\x08TCPRoute\x12;\n\x05match\x18\x01 \x03(\x0b\x32,.istio.networking.v1alpha3.L4MatchAttributes\x12:\n\x05route\x18\x02 \x03(\x0b\x32+.istio.networking.v1alpha3.RouteDestination\"\xea\x07\n\x10HTTPMatchRequest\x12\x0c\n\x04name\x18\x0b \x01(\t\x12\x33\n\x03uri\x18\x01 \x01(\x0b\x32&.istio.networking.v1alpha3.StringMatch\x12\x36\n\x06scheme\x18\x02 \x01(\x0b\x32&.istio.networking.v1alpha3.StringMatch\x12\x36\n\x06method\x18\x03 \x01(\x0b\x32&.istio.networking.v1alpha3.StringMatch\x12\x39\n\tauthority\x18\x04 \x01(\x0b\x32&.istio.networking.v1alpha3.StringMatch\x12I\n\x07headers\x18\x05 \x03(\x0b\x32\x38.istio.networking.v1alpha3.HTTPMatchRequest.HeadersEntry\x12\x0c\n\x04port\x18\x06 \x01(\r\x12T\n\rsource_labels\x18\x07 \x03(\x0b\x32=.istio.networking.v1alpha3.HTTPMatchRequest.SourceLabelsEntry\x12\x10\n\x08gateways\x18\x08 \x03(\t\x12R\n\x0cquery_params\x18\t \x03(\x0b\x32<.istio.networking.v1alpha3.HTTPMatchRequest.QueryParamsEntry\x12\x17\n\x0fignore_uri_case\x18\n \x01(\x08\x12X\n\x0fwithout_headers\x18\x0c \x03(\x0b\x32?.istio.networking.v1alpha3.HTTPMatchRequest.WithoutHeadersEntry\x12\x18\n\x10source_namespace\x18\r \x01(\t\x1aV\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x35\n\x05value\x18\x02 \x01(\x0b\x32&.istio.networking.v1alpha3.StringMatch:\x02\x38\x01\x1a\x33\n\x11SourceLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1aZ\n\x10QueryParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x35\n\x05value\x18\x02 \x01(\x0b\x32&.istio.networking.v1alpha3.StringMatch:\x02\x38\x01\x1a]\n\x13WithoutHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x35\n\x05value\x18\x02 \x01(\x0b\x32&.istio.networking.v1alpha3.StringMatch:\x02\x38\x01\"\x85\x02\n\x14HTTPRouteDestination\x12@\n\x0b\x64\x65stination\x18\x01 \x01(\x0b\x32&.istio.networking.v1alpha3.DestinationB\x03\xe0\x41\x02\x12\x0e\n\x06weight\x18\x02 \x01(\x05\x12\x33\n\x07headers\x18\x07 \x01(\x0b\x32\".istio.networking.v1alpha3.HeadersJ\x04\x08\x03\x10\x07R\x17remove_response_headersR\x17\x61ppend_response_headersR\x16remove_request_headersR\x16\x61ppend_request_headers\"d\n\x10RouteDestination\x12@\n\x0b\x64\x65stination\x18\x01 \x01(\x0b\x32&.istio.networking.v1alpha3.DestinationB\x03\xe0\x41\x02\x12\x0e\n\x06weight\x18\x02 \x01(\x05\"\x8d\x02\n\x11L4MatchAttributes\x12\x1b\n\x13\x64\x65stination_subnets\x18\x01 \x03(\t\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x15\n\rsource_subnet\x18\x03 \x01(\t\x12U\n\rsource_labels\x18\x04 \x03(\x0b\x32>.istio.networking.v1alpha3.L4MatchAttributes.SourceLabelsEntry\x12\x10\n\x08gateways\x18\x05 \x03(\t\x12\x18\n\x10source_namespace\x18\x06 \x01(\t\x1a\x33\n\x11SourceLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xa5\x02\n\x12TLSMatchAttributes\x12\x16\n\tsni_hosts\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12\x1b\n\x13\x64\x65stination_subnets\x18\x02 \x03(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\x12V\n\rsource_labels\x18\x05 \x03(\x0b\x32?.istio.networking.v1alpha3.TLSMatchAttributes.SourceLabelsEntry\x12\x10\n\x08gateways\x18\x06 \x03(\t\x12\x18\n\x10source_namespace\x18\x07 \x01(\t\x1a\x33\n\x11SourceLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01J\x04\x08\x04\x10\x05R\rsource_subnet\"E\n\x0cHTTPRedirect\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x11\n\tauthority\x18\x02 \x01(\t\x12\x15\n\rredirect_code\x18\x03 \x01(\r\"-\n\x0bHTTPRewrite\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x11\n\tauthority\x18\x02 \x01(\t\"O\n\x0bStringMatch\x12\x0f\n\x05\x65xact\x18\x01 \x01(\tH\x00\x12\x10\n\x06prefix\x18\x02 \x01(\tH\x00\x12\x0f\n\x05regex\x18\x03 \x01(\tH\x00\x42\x0c\n\nmatch_type\"\xa5\x01\n\tHTTPRetry\x12\x15\n\x08\x61ttempts\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12\x32\n\x0fper_try_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x10\n\x08retry_on\x18\x03 \x01(\t\x12;\n\x17retry_remote_localities\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\"\x8e\x02\n\nCorsPolicy\x12\x18\n\x0c\x61llow_origin\x18\x01 \x03(\tB\x02\x18\x01\x12=\n\rallow_origins\x18\x07 \x03(\x0b\x32&.istio.networking.v1alpha3.StringMatch\x12\x15\n\rallow_methods\x18\x02 \x03(\t\x12\x15\n\rallow_headers\x18\x03 \x03(\t\x12\x16\n\x0e\x65xpose_headers\x18\x04 \x03(\t\x12*\n\x07max_age\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x35\n\x11\x61llow_credentials\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\"\x9e\x04\n\x12HTTPFaultInjection\x12\x42\n\x05\x64\x65lay\x18\x01 \x01(\x0b\x32\x33.istio.networking.v1alpha3.HTTPFaultInjection.Delay\x12\x42\n\x05\x61\x62ort\x18\x02 \x01(\x0b\x32\x33.istio.networking.v1alpha3.HTTPFaultInjection.Abort\x1a\xd6\x01\n\x05\x44\x65lay\x12\x13\n\x07percent\x18\x01 \x01(\x05\x42\x02\x18\x01\x12\x35\n\x0b\x66ixed_delay\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02H\x00\x12\x36\n\x11\x65xponential_delay\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x12\x36\n\npercentage\x18\x05 \x01(\x0b\x32\".istio.networking.v1alpha3.PercentB\x11\n\x0fhttp_delay_type\x1a\xa6\x01\n\x05\x41\x62ort\x12\x1a\n\x0bhttp_status\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02H\x00\x12\x15\n\x0bgrpc_status\x18\x03 \x01(\tH\x00\x12\x15\n\x0bhttp2_error\x18\x04 \x01(\tH\x00\x12\x36\n\npercentage\x18\x05 \x01(\x0b\x32\".istio.networking.v1alpha3.PercentB\x0c\n\nerror_typeJ\x04\x08\x01\x10\x02R\x07percent\"*\n\x0cPortSelector\x12\x0e\n\x06number\x18\x01 \x01(\rJ\x04\x08\x02\x10\x03R\x04name\"\x18\n\x07Percent\x12\r\n\x05value\x18\x01 \x01(\x01\x42\"Z istio.io/api/networking/v1alpha3b\x06proto3') , dependencies=[google_dot_api_dot_field__behavior__pb2.DESCRIPTOR,google_dot_protobuf_dot_duration__pb2.DESCRIPTOR,google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR,]) @@ -246,6 +246,13 @@ message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='rate_limit', full_name='istio.networking.v1alpha3.HTTPRoute.rate_limit', index=14, + number=21, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -259,7 +266,288 @@ oneofs=[ ], serialized_start=498, - serialized_end=1414, + serialized_end=1472, +) + + +_RATELIMIT_TOKENBUCKET = _descriptor.Descriptor( + name='TokenBucket', + full_name='istio.networking.v1alpha3.RateLimit.TokenBucket', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='max_tokens', full_name='istio.networking.v1alpha3.RateLimit.TokenBucket.max_tokens', index=0, + number=1, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tokens_per_fill', full_name='istio.networking.v1alpha3.RateLimit.TokenBucket.tokens_per_fill', index=1, + number=2, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='fill_interval', full_name='istio.networking.v1alpha3.RateLimit.TokenBucket.fill_interval', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1618, + serialized_end=1726, +) + +_RATELIMIT_LOCALDESCRIPTOR_ENTRY = _descriptor.Descriptor( + name='Entry', + full_name='istio.networking.v1alpha3.RateLimit.LocalDescriptor.Entry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='istio.networking.v1alpha3.RateLimit.LocalDescriptor.Entry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='istio.networking.v1alpha3.RateLimit.LocalDescriptor.Entry.value', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1897, + serialized_end=1932, +) + +_RATELIMIT_LOCALDESCRIPTOR = _descriptor.Descriptor( + name='LocalDescriptor', + full_name='istio.networking.v1alpha3.RateLimit.LocalDescriptor', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='entries', full_name='istio.networking.v1alpha3.RateLimit.LocalDescriptor.entries', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='token_bucket', full_name='istio.networking.v1alpha3.RateLimit.LocalDescriptor.token_bucket', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_RATELIMIT_LOCALDESCRIPTOR_ENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1729, + serialized_end=1932, +) + +_RATELIMIT_LOCAL = _descriptor.Descriptor( + name='Local', + full_name='istio.networking.v1alpha3.RateLimit.Local', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='token_bucket', full_name='istio.networking.v1alpha3.RateLimit.Local.token_bucket', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='descriptors', full_name='istio.networking.v1alpha3.RateLimit.Local.descriptors', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1935, + serialized_end=2089, +) + +_RATELIMIT = _descriptor.Descriptor( + name='RateLimit', + full_name='istio.networking.v1alpha3.RateLimit', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='descriptors', full_name='istio.networking.v1alpha3.RateLimit.descriptors', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='local', full_name='istio.networking.v1alpha3.RateLimit.local', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_RATELIMIT_TOKENBUCKET, _RATELIMIT_LOCALDESCRIPTOR, _RATELIMIT_LOCAL, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='rate_limit_specifier', full_name='istio.networking.v1alpha3.RateLimit.rate_limit_specifier', + index=0, containing_type=None, fields=[]), + ], + serialized_start=1475, + serialized_end=2113, +) + + +_RATELIMITDESCRIPTOR_ENTRY = _descriptor.Descriptor( + name='Entry', + full_name='istio.networking.v1alpha3.RateLimitDescriptor.Entry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='istio.networking.v1alpha3.RateLimitDescriptor.Entry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='skip_if_error', full_name='istio.networking.v1alpha3.RateLimitDescriptor.Entry.skip_if_error', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='request_header', full_name='istio.networking.v1alpha3.RateLimitDescriptor.Entry.request_header', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='expression', full_name='istio.networking.v1alpha3.RateLimitDescriptor.Entry.expression', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='entry_specifier', full_name='istio.networking.v1alpha3.RateLimitDescriptor.Entry.entry_specifier', + index=0, containing_type=None, fields=[]), + ], + serialized_start=2210, + serialized_end=2320, +) + +_RATELIMITDESCRIPTOR = _descriptor.Descriptor( + name='RateLimitDescriptor', + full_name='istio.networking.v1alpha3.RateLimitDescriptor', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='entries', full_name='istio.networking.v1alpha3.RateLimitDescriptor.entries', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_RATELIMITDESCRIPTOR_ENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2116, + serialized_end=2320, ) @@ -296,8 +584,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1416, - serialized_end=1459, + serialized_start=2322, + serialized_end=2365, ) @@ -334,8 +622,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1801, - serialized_end=1843, + serialized_start=2707, + serialized_end=2749, ) _HEADERS_HEADEROPERATIONS_ADDENTRY = _descriptor.Descriptor( @@ -371,8 +659,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1845, - serialized_end=1887, + serialized_start=2751, + serialized_end=2793, ) _HEADERS_HEADEROPERATIONS = _descriptor.Descriptor( @@ -415,8 +703,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1615, - serialized_end=1887, + serialized_start=2521, + serialized_end=2793, ) _HEADERS = _descriptor.Descriptor( @@ -452,8 +740,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1462, - serialized_end=1887, + serialized_start=2368, + serialized_end=2793, ) @@ -490,8 +778,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1890, - serialized_end=2027, + serialized_start=2796, + serialized_end=2933, ) @@ -528,8 +816,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2030, - serialized_end=2161, + serialized_start=2936, + serialized_end=3067, ) @@ -566,8 +854,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2840, - serialized_end=2926, + serialized_start=3746, + serialized_end=3832, ) _HTTPMATCHREQUEST_SOURCELABELSENTRY = _descriptor.Descriptor( @@ -603,8 +891,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2928, - serialized_end=2979, + serialized_start=3834, + serialized_end=3885, ) _HTTPMATCHREQUEST_QUERYPARAMSENTRY = _descriptor.Descriptor( @@ -640,8 +928,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2981, - serialized_end=3071, + serialized_start=3887, + serialized_end=3977, ) _HTTPMATCHREQUEST_WITHOUTHEADERSENTRY = _descriptor.Descriptor( @@ -677,8 +965,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=3073, - serialized_end=3166, + serialized_start=3979, + serialized_end=4072, ) _HTTPMATCHREQUEST = _descriptor.Descriptor( @@ -791,8 +1079,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2164, - serialized_end=3166, + serialized_start=3070, + serialized_end=4072, ) @@ -836,8 +1124,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=3169, - serialized_end=3430, + serialized_start=4075, + serialized_end=4336, ) @@ -874,8 +1162,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=3432, - serialized_end=3532, + serialized_start=4338, + serialized_end=4438, ) @@ -912,8 +1200,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2928, - serialized_end=2979, + serialized_start=3834, + serialized_end=3885, ) _L4MATCHATTRIBUTES = _descriptor.Descriptor( @@ -977,8 +1265,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=3535, - serialized_end=3804, + serialized_start=4441, + serialized_end=4710, ) @@ -1015,8 +1303,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2928, - serialized_end=2979, + serialized_start=3834, + serialized_end=3885, ) _TLSMATCHATTRIBUTES = _descriptor.Descriptor( @@ -1080,8 +1368,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=3807, - serialized_end=4100, + serialized_start=4713, + serialized_end=5006, ) @@ -1125,8 +1413,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=4102, - serialized_end=4171, + serialized_start=5008, + serialized_end=5077, ) @@ -1163,8 +1451,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=4173, - serialized_end=4218, + serialized_start=5079, + serialized_end=5124, ) @@ -1211,8 +1499,8 @@ name='match_type', full_name='istio.networking.v1alpha3.StringMatch.match_type', index=0, containing_type=None, fields=[]), ], - serialized_start=4220, - serialized_end=4299, + serialized_start=5126, + serialized_end=5205, ) @@ -1263,8 +1551,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=4302, - serialized_end=4467, + serialized_start=5208, + serialized_end=5373, ) @@ -1336,8 +1624,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=4470, - serialized_end=4740, + serialized_start=5376, + serialized_end=5646, ) @@ -1391,8 +1679,8 @@ name='http_delay_type', full_name='istio.networking.v1alpha3.HTTPFaultInjection.Delay.http_delay_type', index=0, containing_type=None, fields=[]), ], - serialized_start=4902, - serialized_end=5116, + serialized_start=5808, + serialized_end=6022, ) _HTTPFAULTINJECTION_ABORT = _descriptor.Descriptor( @@ -1445,8 +1733,8 @@ name='error_type', full_name='istio.networking.v1alpha3.HTTPFaultInjection.Abort.error_type', index=0, containing_type=None, fields=[]), ], - serialized_start=5119, - serialized_end=5285, + serialized_start=6025, + serialized_end=6191, ) _HTTPFAULTINJECTION = _descriptor.Descriptor( @@ -1482,8 +1770,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=4743, - serialized_end=5285, + serialized_start=5649, + serialized_end=6191, ) @@ -1513,8 +1801,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=5287, - serialized_end=5329, + serialized_start=6193, + serialized_end=6235, ) @@ -1544,8 +1832,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=5331, - serialized_end=5355, + serialized_start=6237, + serialized_end=6261, ) _VIRTUALSERVICE.fields_by_name['http'].message_type = _HTTPROUTE @@ -1565,6 +1853,29 @@ _HTTPROUTE.fields_by_name['mirror_percentage'].message_type = _PERCENT _HTTPROUTE.fields_by_name['cors_policy'].message_type = _CORSPOLICY _HTTPROUTE.fields_by_name['headers'].message_type = _HEADERS +_HTTPROUTE.fields_by_name['rate_limit'].message_type = _RATELIMIT +_RATELIMIT_TOKENBUCKET.fields_by_name['fill_interval'].message_type = google_dot_protobuf_dot_duration__pb2._DURATION +_RATELIMIT_TOKENBUCKET.containing_type = _RATELIMIT +_RATELIMIT_LOCALDESCRIPTOR_ENTRY.containing_type = _RATELIMIT_LOCALDESCRIPTOR +_RATELIMIT_LOCALDESCRIPTOR.fields_by_name['entries'].message_type = _RATELIMIT_LOCALDESCRIPTOR_ENTRY +_RATELIMIT_LOCALDESCRIPTOR.fields_by_name['token_bucket'].message_type = _RATELIMIT_TOKENBUCKET +_RATELIMIT_LOCALDESCRIPTOR.containing_type = _RATELIMIT +_RATELIMIT_LOCAL.fields_by_name['token_bucket'].message_type = _RATELIMIT_TOKENBUCKET +_RATELIMIT_LOCAL.fields_by_name['descriptors'].message_type = _RATELIMIT_LOCALDESCRIPTOR +_RATELIMIT_LOCAL.containing_type = _RATELIMIT +_RATELIMIT.fields_by_name['descriptors'].message_type = _RATELIMITDESCRIPTOR +_RATELIMIT.fields_by_name['local'].message_type = _RATELIMIT_LOCAL +_RATELIMIT.oneofs_by_name['rate_limit_specifier'].fields.append( + _RATELIMIT.fields_by_name['local']) +_RATELIMIT.fields_by_name['local'].containing_oneof = _RATELIMIT.oneofs_by_name['rate_limit_specifier'] +_RATELIMITDESCRIPTOR_ENTRY.containing_type = _RATELIMITDESCRIPTOR +_RATELIMITDESCRIPTOR_ENTRY.oneofs_by_name['entry_specifier'].fields.append( + _RATELIMITDESCRIPTOR_ENTRY.fields_by_name['request_header']) +_RATELIMITDESCRIPTOR_ENTRY.fields_by_name['request_header'].containing_oneof = _RATELIMITDESCRIPTOR_ENTRY.oneofs_by_name['entry_specifier'] +_RATELIMITDESCRIPTOR_ENTRY.oneofs_by_name['entry_specifier'].fields.append( + _RATELIMITDESCRIPTOR_ENTRY.fields_by_name['expression']) +_RATELIMITDESCRIPTOR_ENTRY.fields_by_name['expression'].containing_oneof = _RATELIMITDESCRIPTOR_ENTRY.oneofs_by_name['entry_specifier'] +_RATELIMITDESCRIPTOR.fields_by_name['entries'].message_type = _RATELIMITDESCRIPTOR_ENTRY _HEADERS_HEADEROPERATIONS_SETENTRY.containing_type = _HEADERS_HEADEROPERATIONS _HEADERS_HEADEROPERATIONS_ADDENTRY.containing_type = _HEADERS_HEADEROPERATIONS _HEADERS_HEADEROPERATIONS.fields_by_name['set'].message_type = _HEADERS_HEADEROPERATIONS_SETENTRY @@ -1638,6 +1949,8 @@ DESCRIPTOR.message_types_by_name['VirtualService'] = _VIRTUALSERVICE DESCRIPTOR.message_types_by_name['Destination'] = _DESTINATION DESCRIPTOR.message_types_by_name['HTTPRoute'] = _HTTPROUTE +DESCRIPTOR.message_types_by_name['RateLimit'] = _RATELIMIT +DESCRIPTOR.message_types_by_name['RateLimitDescriptor'] = _RATELIMITDESCRIPTOR DESCRIPTOR.message_types_by_name['Delegate'] = _DELEGATE DESCRIPTOR.message_types_by_name['Headers'] = _HEADERS DESCRIPTOR.message_types_by_name['TLSRoute'] = _TLSROUTE @@ -1678,6 +1991,60 @@ }) _sym_db.RegisterMessage(HTTPRoute) +RateLimit = _reflection.GeneratedProtocolMessageType('RateLimit', (_message.Message,), { + + 'TokenBucket' : _reflection.GeneratedProtocolMessageType('TokenBucket', (_message.Message,), { + 'DESCRIPTOR' : _RATELIMIT_TOKENBUCKET, + '__module__' : 'networking.v1alpha3.virtual_service_pb2' + # @@protoc_insertion_point(class_scope:istio.networking.v1alpha3.RateLimit.TokenBucket) + }) + , + + 'LocalDescriptor' : _reflection.GeneratedProtocolMessageType('LocalDescriptor', (_message.Message,), { + + 'Entry' : _reflection.GeneratedProtocolMessageType('Entry', (_message.Message,), { + 'DESCRIPTOR' : _RATELIMIT_LOCALDESCRIPTOR_ENTRY, + '__module__' : 'networking.v1alpha3.virtual_service_pb2' + # @@protoc_insertion_point(class_scope:istio.networking.v1alpha3.RateLimit.LocalDescriptor.Entry) + }) + , + 'DESCRIPTOR' : _RATELIMIT_LOCALDESCRIPTOR, + '__module__' : 'networking.v1alpha3.virtual_service_pb2' + # @@protoc_insertion_point(class_scope:istio.networking.v1alpha3.RateLimit.LocalDescriptor) + }) + , + + 'Local' : _reflection.GeneratedProtocolMessageType('Local', (_message.Message,), { + 'DESCRIPTOR' : _RATELIMIT_LOCAL, + '__module__' : 'networking.v1alpha3.virtual_service_pb2' + # @@protoc_insertion_point(class_scope:istio.networking.v1alpha3.RateLimit.Local) + }) + , + 'DESCRIPTOR' : _RATELIMIT, + '__module__' : 'networking.v1alpha3.virtual_service_pb2' + # @@protoc_insertion_point(class_scope:istio.networking.v1alpha3.RateLimit) + }) +_sym_db.RegisterMessage(RateLimit) +_sym_db.RegisterMessage(RateLimit.TokenBucket) +_sym_db.RegisterMessage(RateLimit.LocalDescriptor) +_sym_db.RegisterMessage(RateLimit.LocalDescriptor.Entry) +_sym_db.RegisterMessage(RateLimit.Local) + +RateLimitDescriptor = _reflection.GeneratedProtocolMessageType('RateLimitDescriptor', (_message.Message,), { + + 'Entry' : _reflection.GeneratedProtocolMessageType('Entry', (_message.Message,), { + 'DESCRIPTOR' : _RATELIMITDESCRIPTOR_ENTRY, + '__module__' : 'networking.v1alpha3.virtual_service_pb2' + # @@protoc_insertion_point(class_scope:istio.networking.v1alpha3.RateLimitDescriptor.Entry) + }) + , + 'DESCRIPTOR' : _RATELIMITDESCRIPTOR, + '__module__' : 'networking.v1alpha3.virtual_service_pb2' + # @@protoc_insertion_point(class_scope:istio.networking.v1alpha3.RateLimitDescriptor) + }) +_sym_db.RegisterMessage(RateLimitDescriptor) +_sym_db.RegisterMessage(RateLimitDescriptor.Entry) + Delegate = _reflection.GeneratedProtocolMessageType('Delegate', (_message.Message,), { 'DESCRIPTOR' : _DELEGATE, '__module__' : 'networking.v1alpha3.virtual_service_pb2' diff --git a/python/istio_api/networking/v1beta1/virtual_service_pb2.py b/python/istio_api/networking/v1beta1/virtual_service_pb2.py index 7eb00c7d347..2f0493e95f3 100644 --- a/python/istio_api/networking/v1beta1/virtual_service_pb2.py +++ b/python/istio_api/networking/v1beta1/virtual_service_pb2.py @@ -23,7 +23,7 @@ package='istio.networking.v1beta1', syntax='proto3', serialized_options=_b('Z\037istio.io/api/networking/v1beta1'), - serialized_pb=_b('\n(networking/v1beta1/virtual_service.proto\x12\x18istio.networking.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xd9\x01\n\x0eVirtualService\x12\r\n\x05hosts\x18\x01 \x03(\t\x12\x10\n\x08gateways\x18\x02 \x03(\t\x12\x31\n\x04http\x18\x03 \x03(\x0b\x32#.istio.networking.v1beta1.HTTPRoute\x12/\n\x03tls\x18\x05 \x03(\x0b\x32\".istio.networking.v1beta1.TLSRoute\x12/\n\x03tcp\x18\x04 \x03(\x0b\x32\".istio.networking.v1beta1.TCPRoute\x12\x11\n\texport_to\x18\x06 \x03(\t\"f\n\x0b\x44\x65stination\x12\x11\n\x04host\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0e\n\x06subset\x18\x02 \x01(\t\x12\x34\n\x04port\x18\x03 \x01(\x0b\x32&.istio.networking.v1beta1.PortSelector\"\x89\x07\n\tHTTPRoute\x12\x0c\n\x04name\x18\x11 \x01(\t\x12\x39\n\x05match\x18\x01 \x03(\x0b\x32*.istio.networking.v1beta1.HTTPMatchRequest\x12=\n\x05route\x18\x02 \x03(\x0b\x32..istio.networking.v1beta1.HTTPRouteDestination\x12\x38\n\x08redirect\x18\x03 \x01(\x0b\x32&.istio.networking.v1beta1.HTTPRedirect\x12\x34\n\x08\x64\x65legate\x18\x14 \x01(\x0b\x32\".istio.networking.v1beta1.Delegate\x12\x36\n\x07rewrite\x18\x04 \x01(\x0b\x32%.istio.networking.v1beta1.HTTPRewrite\x12*\n\x07timeout\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x34\n\x07retries\x18\x07 \x01(\x0b\x32#.istio.networking.v1beta1.HTTPRetry\x12;\n\x05\x66\x61ult\x18\x08 \x01(\x0b\x32,.istio.networking.v1beta1.HTTPFaultInjection\x12\x35\n\x06mirror\x18\t \x01(\x0b\x32%.istio.networking.v1beta1.Destination\x12\x38\n\x0emirror_percent\x18\x12 \x01(\x0b\x32\x1c.google.protobuf.UInt32ValueB\x02\x18\x01\x12<\n\x11mirror_percentage\x18\x13 \x01(\x0b\x32!.istio.networking.v1beta1.Percent\x12\x39\n\x0b\x63ors_policy\x18\n \x01(\x0b\x32$.istio.networking.v1beta1.CorsPolicy\x12\x32\n\x07headers\x18\x10 \x01(\x0b\x32!.istio.networking.v1beta1.HeadersJ\x04\x08\x05\x10\x06J\x04\x08\x0b\x10\x10R\x11websocket_upgradeR\x0e\x61ppend_headersR\x17remove_response_headersR\x17\x61ppend_response_headersR\x16remove_request_headersR\x16\x61ppend_request_headers\"+\n\x08\x44\x65legate\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tnamespace\x18\x02 \x01(\t\"\xa5\x03\n\x07Headers\x12\x43\n\x07request\x18\x01 \x01(\x0b\x32\x32.istio.networking.v1beta1.Headers.HeaderOperations\x12\x44\n\x08response\x18\x02 \x01(\x0b\x32\x32.istio.networking.v1beta1.Headers.HeaderOperations\x1a\x8e\x02\n\x10HeaderOperations\x12H\n\x03set\x18\x01 \x03(\x0b\x32;.istio.networking.v1beta1.Headers.HeaderOperations.SetEntry\x12H\n\x03\x61\x64\x64\x18\x02 \x03(\x0b\x32;.istio.networking.v1beta1.Headers.HeaderOperations.AddEntry\x12\x0e\n\x06remove\x18\x03 \x03(\t\x1a*\n\x08SetEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a*\n\x08\x41\x64\x64\x45ntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x87\x01\n\x08TLSRoute\x12@\n\x05match\x18\x01 \x03(\x0b\x32,.istio.networking.v1beta1.TLSMatchAttributesB\x03\xe0\x41\x02\x12\x39\n\x05route\x18\x02 \x03(\x0b\x32*.istio.networking.v1beta1.RouteDestination\"\x81\x01\n\x08TCPRoute\x12:\n\x05match\x18\x01 \x03(\x0b\x32+.istio.networking.v1beta1.L4MatchAttributes\x12\x39\n\x05route\x18\x02 \x03(\x0b\x32*.istio.networking.v1beta1.RouteDestination\"\xdf\x07\n\x10HTTPMatchRequest\x12\x0c\n\x04name\x18\x0b \x01(\t\x12\x32\n\x03uri\x18\x01 \x01(\x0b\x32%.istio.networking.v1beta1.StringMatch\x12\x35\n\x06scheme\x18\x02 \x01(\x0b\x32%.istio.networking.v1beta1.StringMatch\x12\x35\n\x06method\x18\x03 \x01(\x0b\x32%.istio.networking.v1beta1.StringMatch\x12\x38\n\tauthority\x18\x04 \x01(\x0b\x32%.istio.networking.v1beta1.StringMatch\x12H\n\x07headers\x18\x05 \x03(\x0b\x32\x37.istio.networking.v1beta1.HTTPMatchRequest.HeadersEntry\x12\x0c\n\x04port\x18\x06 \x01(\r\x12S\n\rsource_labels\x18\x07 \x03(\x0b\x32<.istio.networking.v1beta1.HTTPMatchRequest.SourceLabelsEntry\x12\x10\n\x08gateways\x18\x08 \x03(\t\x12Q\n\x0cquery_params\x18\t \x03(\x0b\x32;.istio.networking.v1beta1.HTTPMatchRequest.QueryParamsEntry\x12\x17\n\x0fignore_uri_case\x18\n \x01(\x08\x12W\n\x0fwithout_headers\x18\x0c \x03(\x0b\x32>.istio.networking.v1beta1.HTTPMatchRequest.WithoutHeadersEntry\x12\x18\n\x10source_namespace\x18\r \x01(\t\x1aU\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.istio.networking.v1beta1.StringMatch:\x02\x38\x01\x1a\x33\n\x11SourceLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1aY\n\x10QueryParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.istio.networking.v1beta1.StringMatch:\x02\x38\x01\x1a\\\n\x13WithoutHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.istio.networking.v1beta1.StringMatch:\x02\x38\x01\"\x83\x02\n\x14HTTPRouteDestination\x12?\n\x0b\x64\x65stination\x18\x01 \x01(\x0b\x32%.istio.networking.v1beta1.DestinationB\x03\xe0\x41\x02\x12\x0e\n\x06weight\x18\x02 \x01(\x05\x12\x32\n\x07headers\x18\x07 \x01(\x0b\x32!.istio.networking.v1beta1.HeadersJ\x04\x08\x03\x10\x07R\x17remove_response_headersR\x17\x61ppend_response_headersR\x16remove_request_headersR\x16\x61ppend_request_headers\"c\n\x10RouteDestination\x12?\n\x0b\x64\x65stination\x18\x01 \x01(\x0b\x32%.istio.networking.v1beta1.DestinationB\x03\xe0\x41\x02\x12\x0e\n\x06weight\x18\x02 \x01(\x05\"\x8c\x02\n\x11L4MatchAttributes\x12\x1b\n\x13\x64\x65stination_subnets\x18\x01 \x03(\t\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x15\n\rsource_subnet\x18\x03 \x01(\t\x12T\n\rsource_labels\x18\x04 \x03(\x0b\x32=.istio.networking.v1beta1.L4MatchAttributes.SourceLabelsEntry\x12\x10\n\x08gateways\x18\x05 \x03(\t\x12\x18\n\x10source_namespace\x18\x06 \x01(\t\x1a\x33\n\x11SourceLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xa4\x02\n\x12TLSMatchAttributes\x12\x16\n\tsni_hosts\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12\x1b\n\x13\x64\x65stination_subnets\x18\x02 \x03(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\x12U\n\rsource_labels\x18\x05 \x03(\x0b\x32>.istio.networking.v1beta1.TLSMatchAttributes.SourceLabelsEntry\x12\x10\n\x08gateways\x18\x06 \x03(\t\x12\x18\n\x10source_namespace\x18\x07 \x01(\t\x1a\x33\n\x11SourceLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01J\x04\x08\x04\x10\x05R\rsource_subnet\"E\n\x0cHTTPRedirect\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x11\n\tauthority\x18\x02 \x01(\t\x12\x15\n\rredirect_code\x18\x03 \x01(\r\"-\n\x0bHTTPRewrite\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x11\n\tauthority\x18\x02 \x01(\t\"O\n\x0bStringMatch\x12\x0f\n\x05\x65xact\x18\x01 \x01(\tH\x00\x12\x10\n\x06prefix\x18\x02 \x01(\tH\x00\x12\x0f\n\x05regex\x18\x03 \x01(\tH\x00\x42\x0c\n\nmatch_type\"\xa5\x01\n\tHTTPRetry\x12\x15\n\x08\x61ttempts\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12\x32\n\x0fper_try_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x10\n\x08retry_on\x18\x03 \x01(\t\x12;\n\x17retry_remote_localities\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\"\x8d\x02\n\nCorsPolicy\x12\x18\n\x0c\x61llow_origin\x18\x01 \x03(\tB\x02\x18\x01\x12<\n\rallow_origins\x18\x07 \x03(\x0b\x32%.istio.networking.v1beta1.StringMatch\x12\x15\n\rallow_methods\x18\x02 \x03(\t\x12\x15\n\rallow_headers\x18\x03 \x03(\t\x12\x16\n\x0e\x65xpose_headers\x18\x04 \x03(\t\x12*\n\x07max_age\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x35\n\x11\x61llow_credentials\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\"\x9a\x04\n\x12HTTPFaultInjection\x12\x41\n\x05\x64\x65lay\x18\x01 \x01(\x0b\x32\x32.istio.networking.v1beta1.HTTPFaultInjection.Delay\x12\x41\n\x05\x61\x62ort\x18\x02 \x01(\x0b\x32\x32.istio.networking.v1beta1.HTTPFaultInjection.Abort\x1a\xd5\x01\n\x05\x44\x65lay\x12\x13\n\x07percent\x18\x01 \x01(\x05\x42\x02\x18\x01\x12\x35\n\x0b\x66ixed_delay\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02H\x00\x12\x36\n\x11\x65xponential_delay\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x12\x35\n\npercentage\x18\x05 \x01(\x0b\x32!.istio.networking.v1beta1.PercentB\x11\n\x0fhttp_delay_type\x1a\xa5\x01\n\x05\x41\x62ort\x12\x1a\n\x0bhttp_status\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02H\x00\x12\x15\n\x0bgrpc_status\x18\x03 \x01(\tH\x00\x12\x15\n\x0bhttp2_error\x18\x04 \x01(\tH\x00\x12\x35\n\npercentage\x18\x05 \x01(\x0b\x32!.istio.networking.v1beta1.PercentB\x0c\n\nerror_typeJ\x04\x08\x01\x10\x02R\x07percent\"*\n\x0cPortSelector\x12\x0e\n\x06number\x18\x01 \x01(\rJ\x04\x08\x02\x10\x03R\x04name\"\x18\n\x07Percent\x12\r\n\x05value\x18\x01 \x01(\x01\x42!Z\x1fistio.io/api/networking/v1beta1b\x06proto3') + serialized_pb=_b('\n(networking/v1beta1/virtual_service.proto\x12\x18istio.networking.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xd9\x01\n\x0eVirtualService\x12\r\n\x05hosts\x18\x01 \x03(\t\x12\x10\n\x08gateways\x18\x02 \x03(\t\x12\x31\n\x04http\x18\x03 \x03(\x0b\x32#.istio.networking.v1beta1.HTTPRoute\x12/\n\x03tls\x18\x05 \x03(\x0b\x32\".istio.networking.v1beta1.TLSRoute\x12/\n\x03tcp\x18\x04 \x03(\x0b\x32\".istio.networking.v1beta1.TCPRoute\x12\x11\n\texport_to\x18\x06 \x03(\t\"f\n\x0b\x44\x65stination\x12\x11\n\x04host\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0e\n\x06subset\x18\x02 \x01(\t\x12\x34\n\x04port\x18\x03 \x01(\x0b\x32&.istio.networking.v1beta1.PortSelector\"\xc2\x07\n\tHTTPRoute\x12\x0c\n\x04name\x18\x11 \x01(\t\x12\x39\n\x05match\x18\x01 \x03(\x0b\x32*.istio.networking.v1beta1.HTTPMatchRequest\x12=\n\x05route\x18\x02 \x03(\x0b\x32..istio.networking.v1beta1.HTTPRouteDestination\x12\x38\n\x08redirect\x18\x03 \x01(\x0b\x32&.istio.networking.v1beta1.HTTPRedirect\x12\x34\n\x08\x64\x65legate\x18\x14 \x01(\x0b\x32\".istio.networking.v1beta1.Delegate\x12\x36\n\x07rewrite\x18\x04 \x01(\x0b\x32%.istio.networking.v1beta1.HTTPRewrite\x12*\n\x07timeout\x18\x06 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x34\n\x07retries\x18\x07 \x01(\x0b\x32#.istio.networking.v1beta1.HTTPRetry\x12;\n\x05\x66\x61ult\x18\x08 \x01(\x0b\x32,.istio.networking.v1beta1.HTTPFaultInjection\x12\x35\n\x06mirror\x18\t \x01(\x0b\x32%.istio.networking.v1beta1.Destination\x12\x38\n\x0emirror_percent\x18\x12 \x01(\x0b\x32\x1c.google.protobuf.UInt32ValueB\x02\x18\x01\x12<\n\x11mirror_percentage\x18\x13 \x01(\x0b\x32!.istio.networking.v1beta1.Percent\x12\x39\n\x0b\x63ors_policy\x18\n \x01(\x0b\x32$.istio.networking.v1beta1.CorsPolicy\x12\x32\n\x07headers\x18\x10 \x01(\x0b\x32!.istio.networking.v1beta1.Headers\x12\x37\n\nrate_limit\x18\x15 \x01(\x0b\x32#.istio.networking.v1beta1.RateLimitJ\x04\x08\x05\x10\x06J\x04\x08\x0b\x10\x10R\x11websocket_upgradeR\x0e\x61ppend_headersR\x17remove_response_headersR\x17\x61ppend_response_headersR\x16remove_request_headersR\x16\x61ppend_request_headers\"\xf8\x04\n\tRateLimit\x12\x42\n\x0b\x64\x65scriptors\x18\x01 \x03(\x0b\x32-.istio.networking.v1beta1.RateLimitDescriptor\x12:\n\x05local\x18\x02 \x01(\x0b\x32).istio.networking.v1beta1.RateLimit.LocalH\x00\x1al\n\x0bTokenBucket\x12\x12\n\nmax_tokens\x18\x01 \x01(\r\x12\x17\n\x0ftokens_per_fill\x18\x02 \x01(\r\x12\x30\n\rfill_interval\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a\xc9\x01\n\x0fLocalDescriptor\x12J\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x39.istio.networking.v1beta1.RateLimit.LocalDescriptor.Entry\x12\x45\n\x0ctoken_bucket\x18\x02 \x01(\x0b\x32/.istio.networking.v1beta1.RateLimit.TokenBucket\x1a#\n\x05\x45ntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x1a\x98\x01\n\x05Local\x12\x45\n\x0ctoken_bucket\x18\x01 \x01(\x0b\x32/.istio.networking.v1beta1.RateLimit.TokenBucket\x12H\n\x0b\x64\x65scriptors\x18\x02 \x03(\x0b\x32\x33.istio.networking.v1beta1.RateLimit.LocalDescriptorB\x16\n\x14rate_limit_specifier\"\xcb\x01\n\x13RateLimitDescriptor\x12\x44\n\x07\x65ntries\x18\x01 \x03(\x0b\x32\x33.istio.networking.v1beta1.RateLimitDescriptor.Entry\x1an\n\x05\x45ntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x15\n\rskip_if_error\x18\x02 \x01(\x08\x12\x18\n\x0erequest_header\x18\x03 \x01(\tH\x00\x12\x14\n\nexpression\x18\x04 \x01(\tH\x00\x42\x11\n\x0f\x65ntry_specifier\"+\n\x08\x44\x65legate\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tnamespace\x18\x02 \x01(\t\"\xa5\x03\n\x07Headers\x12\x43\n\x07request\x18\x01 \x01(\x0b\x32\x32.istio.networking.v1beta1.Headers.HeaderOperations\x12\x44\n\x08response\x18\x02 \x01(\x0b\x32\x32.istio.networking.v1beta1.Headers.HeaderOperations\x1a\x8e\x02\n\x10HeaderOperations\x12H\n\x03set\x18\x01 \x03(\x0b\x32;.istio.networking.v1beta1.Headers.HeaderOperations.SetEntry\x12H\n\x03\x61\x64\x64\x18\x02 \x03(\x0b\x32;.istio.networking.v1beta1.Headers.HeaderOperations.AddEntry\x12\x0e\n\x06remove\x18\x03 \x03(\t\x1a*\n\x08SetEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a*\n\x08\x41\x64\x64\x45ntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x87\x01\n\x08TLSRoute\x12@\n\x05match\x18\x01 \x03(\x0b\x32,.istio.networking.v1beta1.TLSMatchAttributesB\x03\xe0\x41\x02\x12\x39\n\x05route\x18\x02 \x03(\x0b\x32*.istio.networking.v1beta1.RouteDestination\"\x81\x01\n\x08TCPRoute\x12:\n\x05match\x18\x01 \x03(\x0b\x32+.istio.networking.v1beta1.L4MatchAttributes\x12\x39\n\x05route\x18\x02 \x03(\x0b\x32*.istio.networking.v1beta1.RouteDestination\"\xdf\x07\n\x10HTTPMatchRequest\x12\x0c\n\x04name\x18\x0b \x01(\t\x12\x32\n\x03uri\x18\x01 \x01(\x0b\x32%.istio.networking.v1beta1.StringMatch\x12\x35\n\x06scheme\x18\x02 \x01(\x0b\x32%.istio.networking.v1beta1.StringMatch\x12\x35\n\x06method\x18\x03 \x01(\x0b\x32%.istio.networking.v1beta1.StringMatch\x12\x38\n\tauthority\x18\x04 \x01(\x0b\x32%.istio.networking.v1beta1.StringMatch\x12H\n\x07headers\x18\x05 \x03(\x0b\x32\x37.istio.networking.v1beta1.HTTPMatchRequest.HeadersEntry\x12\x0c\n\x04port\x18\x06 \x01(\r\x12S\n\rsource_labels\x18\x07 \x03(\x0b\x32<.istio.networking.v1beta1.HTTPMatchRequest.SourceLabelsEntry\x12\x10\n\x08gateways\x18\x08 \x03(\t\x12Q\n\x0cquery_params\x18\t \x03(\x0b\x32;.istio.networking.v1beta1.HTTPMatchRequest.QueryParamsEntry\x12\x17\n\x0fignore_uri_case\x18\n \x01(\x08\x12W\n\x0fwithout_headers\x18\x0c \x03(\x0b\x32>.istio.networking.v1beta1.HTTPMatchRequest.WithoutHeadersEntry\x12\x18\n\x10source_namespace\x18\r \x01(\t\x1aU\n\x0cHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.istio.networking.v1beta1.StringMatch:\x02\x38\x01\x1a\x33\n\x11SourceLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1aY\n\x10QueryParamsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.istio.networking.v1beta1.StringMatch:\x02\x38\x01\x1a\\\n\x13WithoutHeadersEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x34\n\x05value\x18\x02 \x01(\x0b\x32%.istio.networking.v1beta1.StringMatch:\x02\x38\x01\"\x83\x02\n\x14HTTPRouteDestination\x12?\n\x0b\x64\x65stination\x18\x01 \x01(\x0b\x32%.istio.networking.v1beta1.DestinationB\x03\xe0\x41\x02\x12\x0e\n\x06weight\x18\x02 \x01(\x05\x12\x32\n\x07headers\x18\x07 \x01(\x0b\x32!.istio.networking.v1beta1.HeadersJ\x04\x08\x03\x10\x07R\x17remove_response_headersR\x17\x61ppend_response_headersR\x16remove_request_headersR\x16\x61ppend_request_headers\"c\n\x10RouteDestination\x12?\n\x0b\x64\x65stination\x18\x01 \x01(\x0b\x32%.istio.networking.v1beta1.DestinationB\x03\xe0\x41\x02\x12\x0e\n\x06weight\x18\x02 \x01(\x05\"\x8c\x02\n\x11L4MatchAttributes\x12\x1b\n\x13\x64\x65stination_subnets\x18\x01 \x03(\t\x12\x0c\n\x04port\x18\x02 \x01(\r\x12\x15\n\rsource_subnet\x18\x03 \x01(\t\x12T\n\rsource_labels\x18\x04 \x03(\x0b\x32=.istio.networking.v1beta1.L4MatchAttributes.SourceLabelsEntry\x12\x10\n\x08gateways\x18\x05 \x03(\t\x12\x18\n\x10source_namespace\x18\x06 \x01(\t\x1a\x33\n\x11SourceLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xa4\x02\n\x12TLSMatchAttributes\x12\x16\n\tsni_hosts\x18\x01 \x03(\tB\x03\xe0\x41\x02\x12\x1b\n\x13\x64\x65stination_subnets\x18\x02 \x03(\t\x12\x0c\n\x04port\x18\x03 \x01(\r\x12U\n\rsource_labels\x18\x05 \x03(\x0b\x32>.istio.networking.v1beta1.TLSMatchAttributes.SourceLabelsEntry\x12\x10\n\x08gateways\x18\x06 \x03(\t\x12\x18\n\x10source_namespace\x18\x07 \x01(\t\x1a\x33\n\x11SourceLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01J\x04\x08\x04\x10\x05R\rsource_subnet\"E\n\x0cHTTPRedirect\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x11\n\tauthority\x18\x02 \x01(\t\x12\x15\n\rredirect_code\x18\x03 \x01(\r\"-\n\x0bHTTPRewrite\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x11\n\tauthority\x18\x02 \x01(\t\"O\n\x0bStringMatch\x12\x0f\n\x05\x65xact\x18\x01 \x01(\tH\x00\x12\x10\n\x06prefix\x18\x02 \x01(\tH\x00\x12\x0f\n\x05regex\x18\x03 \x01(\tH\x00\x42\x0c\n\nmatch_type\"\xa5\x01\n\tHTTPRetry\x12\x15\n\x08\x61ttempts\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12\x32\n\x0fper_try_timeout\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x10\n\x08retry_on\x18\x03 \x01(\t\x12;\n\x17retry_remote_localities\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\"\x8d\x02\n\nCorsPolicy\x12\x18\n\x0c\x61llow_origin\x18\x01 \x03(\tB\x02\x18\x01\x12<\n\rallow_origins\x18\x07 \x03(\x0b\x32%.istio.networking.v1beta1.StringMatch\x12\x15\n\rallow_methods\x18\x02 \x03(\t\x12\x15\n\rallow_headers\x18\x03 \x03(\t\x12\x16\n\x0e\x65xpose_headers\x18\x04 \x03(\t\x12*\n\x07max_age\x18\x05 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x35\n\x11\x61llow_credentials\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\"\x9a\x04\n\x12HTTPFaultInjection\x12\x41\n\x05\x64\x65lay\x18\x01 \x01(\x0b\x32\x32.istio.networking.v1beta1.HTTPFaultInjection.Delay\x12\x41\n\x05\x61\x62ort\x18\x02 \x01(\x0b\x32\x32.istio.networking.v1beta1.HTTPFaultInjection.Abort\x1a\xd5\x01\n\x05\x44\x65lay\x12\x13\n\x07percent\x18\x01 \x01(\x05\x42\x02\x18\x01\x12\x35\n\x0b\x66ixed_delay\x18\x02 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02H\x00\x12\x36\n\x11\x65xponential_delay\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x12\x35\n\npercentage\x18\x05 \x01(\x0b\x32!.istio.networking.v1beta1.PercentB\x11\n\x0fhttp_delay_type\x1a\xa5\x01\n\x05\x41\x62ort\x12\x1a\n\x0bhttp_status\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02H\x00\x12\x15\n\x0bgrpc_status\x18\x03 \x01(\tH\x00\x12\x15\n\x0bhttp2_error\x18\x04 \x01(\tH\x00\x12\x35\n\npercentage\x18\x05 \x01(\x0b\x32!.istio.networking.v1beta1.PercentB\x0c\n\nerror_typeJ\x04\x08\x01\x10\x02R\x07percent\"*\n\x0cPortSelector\x12\x0e\n\x06number\x18\x01 \x01(\rJ\x04\x08\x02\x10\x03R\x04name\"\x18\n\x07Percent\x12\r\n\x05value\x18\x01 \x01(\x01\x42!Z\x1fistio.io/api/networking/v1beta1b\x06proto3') , dependencies=[google_dot_api_dot_field__behavior__pb2.DESCRIPTOR,google_dot_protobuf_dot_duration__pb2.DESCRIPTOR,google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR,]) @@ -246,6 +246,13 @@ message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='rate_limit', full_name='istio.networking.v1beta1.HTTPRoute.rate_limit', index=14, + number=21, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], @@ -259,7 +266,288 @@ oneofs=[ ], serialized_start=492, - serialized_end=1397, + serialized_end=1454, +) + + +_RATELIMIT_TOKENBUCKET = _descriptor.Descriptor( + name='TokenBucket', + full_name='istio.networking.v1beta1.RateLimit.TokenBucket', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='max_tokens', full_name='istio.networking.v1beta1.RateLimit.TokenBucket.max_tokens', index=0, + number=1, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='tokens_per_fill', full_name='istio.networking.v1beta1.RateLimit.TokenBucket.tokens_per_fill', index=1, + number=2, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='fill_interval', full_name='istio.networking.v1beta1.RateLimit.TokenBucket.fill_interval', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1598, + serialized_end=1706, +) + +_RATELIMIT_LOCALDESCRIPTOR_ENTRY = _descriptor.Descriptor( + name='Entry', + full_name='istio.networking.v1beta1.RateLimit.LocalDescriptor.Entry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='istio.networking.v1beta1.RateLimit.LocalDescriptor.Entry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='value', full_name='istio.networking.v1beta1.RateLimit.LocalDescriptor.Entry.value', index=1, + number=2, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1875, + serialized_end=1910, +) + +_RATELIMIT_LOCALDESCRIPTOR = _descriptor.Descriptor( + name='LocalDescriptor', + full_name='istio.networking.v1beta1.RateLimit.LocalDescriptor', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='entries', full_name='istio.networking.v1beta1.RateLimit.LocalDescriptor.entries', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='token_bucket', full_name='istio.networking.v1beta1.RateLimit.LocalDescriptor.token_bucket', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_RATELIMIT_LOCALDESCRIPTOR_ENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1709, + serialized_end=1910, +) + +_RATELIMIT_LOCAL = _descriptor.Descriptor( + name='Local', + full_name='istio.networking.v1beta1.RateLimit.Local', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='token_bucket', full_name='istio.networking.v1beta1.RateLimit.Local.token_bucket', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='descriptors', full_name='istio.networking.v1beta1.RateLimit.Local.descriptors', index=1, + number=2, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1913, + serialized_end=2065, +) + +_RATELIMIT = _descriptor.Descriptor( + name='RateLimit', + full_name='istio.networking.v1beta1.RateLimit', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='descriptors', full_name='istio.networking.v1beta1.RateLimit.descriptors', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='local', full_name='istio.networking.v1beta1.RateLimit.local', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_RATELIMIT_TOKENBUCKET, _RATELIMIT_LOCALDESCRIPTOR, _RATELIMIT_LOCAL, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='rate_limit_specifier', full_name='istio.networking.v1beta1.RateLimit.rate_limit_specifier', + index=0, containing_type=None, fields=[]), + ], + serialized_start=1457, + serialized_end=2089, +) + + +_RATELIMITDESCRIPTOR_ENTRY = _descriptor.Descriptor( + name='Entry', + full_name='istio.networking.v1beta1.RateLimitDescriptor.Entry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='istio.networking.v1beta1.RateLimitDescriptor.Entry.key', index=0, + number=1, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='skip_if_error', full_name='istio.networking.v1beta1.RateLimitDescriptor.Entry.skip_if_error', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='request_header', full_name='istio.networking.v1beta1.RateLimitDescriptor.Entry.request_header', index=2, + number=3, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + _descriptor.FieldDescriptor( + name='expression', full_name='istio.networking.v1beta1.RateLimitDescriptor.Entry.expression', index=3, + number=4, type=9, cpp_type=9, label=1, + has_default_value=False, default_value=_b("").decode('utf-8'), + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='entry_specifier', full_name='istio.networking.v1beta1.RateLimitDescriptor.Entry.entry_specifier', + index=0, containing_type=None, fields=[]), + ], + serialized_start=2185, + serialized_end=2295, +) + +_RATELIMITDESCRIPTOR = _descriptor.Descriptor( + name='RateLimitDescriptor', + full_name='istio.networking.v1beta1.RateLimitDescriptor', + filename=None, + file=DESCRIPTOR, + containing_type=None, + fields=[ + _descriptor.FieldDescriptor( + name='entries', full_name='istio.networking.v1beta1.RateLimitDescriptor.entries', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR), + ], + extensions=[ + ], + nested_types=[_RATELIMITDESCRIPTOR_ENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2092, + serialized_end=2295, ) @@ -296,8 +584,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1399, - serialized_end=1442, + serialized_start=2297, + serialized_end=2340, ) @@ -334,8 +622,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1780, - serialized_end=1822, + serialized_start=2678, + serialized_end=2720, ) _HEADERS_HEADEROPERATIONS_ADDENTRY = _descriptor.Descriptor( @@ -371,8 +659,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1824, - serialized_end=1866, + serialized_start=2722, + serialized_end=2764, ) _HEADERS_HEADEROPERATIONS = _descriptor.Descriptor( @@ -415,8 +703,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1596, - serialized_end=1866, + serialized_start=2494, + serialized_end=2764, ) _HEADERS = _descriptor.Descriptor( @@ -452,8 +740,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1445, - serialized_end=1866, + serialized_start=2343, + serialized_end=2764, ) @@ -490,8 +778,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1869, - serialized_end=2004, + serialized_start=2767, + serialized_end=2902, ) @@ -528,8 +816,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2007, - serialized_end=2136, + serialized_start=2905, + serialized_end=3034, ) @@ -566,8 +854,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2807, - serialized_end=2892, + serialized_start=3705, + serialized_end=3790, ) _HTTPMATCHREQUEST_SOURCELABELSENTRY = _descriptor.Descriptor( @@ -603,8 +891,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2894, - serialized_end=2945, + serialized_start=3792, + serialized_end=3843, ) _HTTPMATCHREQUEST_QUERYPARAMSENTRY = _descriptor.Descriptor( @@ -640,8 +928,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2947, - serialized_end=3036, + serialized_start=3845, + serialized_end=3934, ) _HTTPMATCHREQUEST_WITHOUTHEADERSENTRY = _descriptor.Descriptor( @@ -677,8 +965,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=3038, - serialized_end=3130, + serialized_start=3936, + serialized_end=4028, ) _HTTPMATCHREQUEST = _descriptor.Descriptor( @@ -791,8 +1079,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2139, - serialized_end=3130, + serialized_start=3037, + serialized_end=4028, ) @@ -836,8 +1124,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=3133, - serialized_end=3392, + serialized_start=4031, + serialized_end=4290, ) @@ -874,8 +1162,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=3394, - serialized_end=3493, + serialized_start=4292, + serialized_end=4391, ) @@ -912,8 +1200,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2894, - serialized_end=2945, + serialized_start=3792, + serialized_end=3843, ) _L4MATCHATTRIBUTES = _descriptor.Descriptor( @@ -977,8 +1265,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=3496, - serialized_end=3764, + serialized_start=4394, + serialized_end=4662, ) @@ -1015,8 +1303,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2894, - serialized_end=2945, + serialized_start=3792, + serialized_end=3843, ) _TLSMATCHATTRIBUTES = _descriptor.Descriptor( @@ -1080,8 +1368,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=3767, - serialized_end=4059, + serialized_start=4665, + serialized_end=4957, ) @@ -1125,8 +1413,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=4061, - serialized_end=4130, + serialized_start=4959, + serialized_end=5028, ) @@ -1163,8 +1451,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=4132, - serialized_end=4177, + serialized_start=5030, + serialized_end=5075, ) @@ -1211,8 +1499,8 @@ name='match_type', full_name='istio.networking.v1beta1.StringMatch.match_type', index=0, containing_type=None, fields=[]), ], - serialized_start=4179, - serialized_end=4258, + serialized_start=5077, + serialized_end=5156, ) @@ -1263,8 +1551,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=4261, - serialized_end=4426, + serialized_start=5159, + serialized_end=5324, ) @@ -1336,8 +1624,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=4429, - serialized_end=4698, + serialized_start=5327, + serialized_end=5596, ) @@ -1391,8 +1679,8 @@ name='http_delay_type', full_name='istio.networking.v1beta1.HTTPFaultInjection.Delay.http_delay_type', index=0, containing_type=None, fields=[]), ], - serialized_start=4858, - serialized_end=5071, + serialized_start=5756, + serialized_end=5969, ) _HTTPFAULTINJECTION_ABORT = _descriptor.Descriptor( @@ -1445,8 +1733,8 @@ name='error_type', full_name='istio.networking.v1beta1.HTTPFaultInjection.Abort.error_type', index=0, containing_type=None, fields=[]), ], - serialized_start=5074, - serialized_end=5239, + serialized_start=5972, + serialized_end=6137, ) _HTTPFAULTINJECTION = _descriptor.Descriptor( @@ -1482,8 +1770,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=4701, - serialized_end=5239, + serialized_start=5599, + serialized_end=6137, ) @@ -1513,8 +1801,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=5241, - serialized_end=5283, + serialized_start=6139, + serialized_end=6181, ) @@ -1544,8 +1832,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=5285, - serialized_end=5309, + serialized_start=6183, + serialized_end=6207, ) _VIRTUALSERVICE.fields_by_name['http'].message_type = _HTTPROUTE @@ -1565,6 +1853,29 @@ _HTTPROUTE.fields_by_name['mirror_percentage'].message_type = _PERCENT _HTTPROUTE.fields_by_name['cors_policy'].message_type = _CORSPOLICY _HTTPROUTE.fields_by_name['headers'].message_type = _HEADERS +_HTTPROUTE.fields_by_name['rate_limit'].message_type = _RATELIMIT +_RATELIMIT_TOKENBUCKET.fields_by_name['fill_interval'].message_type = google_dot_protobuf_dot_duration__pb2._DURATION +_RATELIMIT_TOKENBUCKET.containing_type = _RATELIMIT +_RATELIMIT_LOCALDESCRIPTOR_ENTRY.containing_type = _RATELIMIT_LOCALDESCRIPTOR +_RATELIMIT_LOCALDESCRIPTOR.fields_by_name['entries'].message_type = _RATELIMIT_LOCALDESCRIPTOR_ENTRY +_RATELIMIT_LOCALDESCRIPTOR.fields_by_name['token_bucket'].message_type = _RATELIMIT_TOKENBUCKET +_RATELIMIT_LOCALDESCRIPTOR.containing_type = _RATELIMIT +_RATELIMIT_LOCAL.fields_by_name['token_bucket'].message_type = _RATELIMIT_TOKENBUCKET +_RATELIMIT_LOCAL.fields_by_name['descriptors'].message_type = _RATELIMIT_LOCALDESCRIPTOR +_RATELIMIT_LOCAL.containing_type = _RATELIMIT +_RATELIMIT.fields_by_name['descriptors'].message_type = _RATELIMITDESCRIPTOR +_RATELIMIT.fields_by_name['local'].message_type = _RATELIMIT_LOCAL +_RATELIMIT.oneofs_by_name['rate_limit_specifier'].fields.append( + _RATELIMIT.fields_by_name['local']) +_RATELIMIT.fields_by_name['local'].containing_oneof = _RATELIMIT.oneofs_by_name['rate_limit_specifier'] +_RATELIMITDESCRIPTOR_ENTRY.containing_type = _RATELIMITDESCRIPTOR +_RATELIMITDESCRIPTOR_ENTRY.oneofs_by_name['entry_specifier'].fields.append( + _RATELIMITDESCRIPTOR_ENTRY.fields_by_name['request_header']) +_RATELIMITDESCRIPTOR_ENTRY.fields_by_name['request_header'].containing_oneof = _RATELIMITDESCRIPTOR_ENTRY.oneofs_by_name['entry_specifier'] +_RATELIMITDESCRIPTOR_ENTRY.oneofs_by_name['entry_specifier'].fields.append( + _RATELIMITDESCRIPTOR_ENTRY.fields_by_name['expression']) +_RATELIMITDESCRIPTOR_ENTRY.fields_by_name['expression'].containing_oneof = _RATELIMITDESCRIPTOR_ENTRY.oneofs_by_name['entry_specifier'] +_RATELIMITDESCRIPTOR.fields_by_name['entries'].message_type = _RATELIMITDESCRIPTOR_ENTRY _HEADERS_HEADEROPERATIONS_SETENTRY.containing_type = _HEADERS_HEADEROPERATIONS _HEADERS_HEADEROPERATIONS_ADDENTRY.containing_type = _HEADERS_HEADEROPERATIONS _HEADERS_HEADEROPERATIONS.fields_by_name['set'].message_type = _HEADERS_HEADEROPERATIONS_SETENTRY @@ -1638,6 +1949,8 @@ DESCRIPTOR.message_types_by_name['VirtualService'] = _VIRTUALSERVICE DESCRIPTOR.message_types_by_name['Destination'] = _DESTINATION DESCRIPTOR.message_types_by_name['HTTPRoute'] = _HTTPROUTE +DESCRIPTOR.message_types_by_name['RateLimit'] = _RATELIMIT +DESCRIPTOR.message_types_by_name['RateLimitDescriptor'] = _RATELIMITDESCRIPTOR DESCRIPTOR.message_types_by_name['Delegate'] = _DELEGATE DESCRIPTOR.message_types_by_name['Headers'] = _HEADERS DESCRIPTOR.message_types_by_name['TLSRoute'] = _TLSROUTE @@ -1678,6 +1991,60 @@ }) _sym_db.RegisterMessage(HTTPRoute) +RateLimit = _reflection.GeneratedProtocolMessageType('RateLimit', (_message.Message,), { + + 'TokenBucket' : _reflection.GeneratedProtocolMessageType('TokenBucket', (_message.Message,), { + 'DESCRIPTOR' : _RATELIMIT_TOKENBUCKET, + '__module__' : 'networking.v1beta1.virtual_service_pb2' + # @@protoc_insertion_point(class_scope:istio.networking.v1beta1.RateLimit.TokenBucket) + }) + , + + 'LocalDescriptor' : _reflection.GeneratedProtocolMessageType('LocalDescriptor', (_message.Message,), { + + 'Entry' : _reflection.GeneratedProtocolMessageType('Entry', (_message.Message,), { + 'DESCRIPTOR' : _RATELIMIT_LOCALDESCRIPTOR_ENTRY, + '__module__' : 'networking.v1beta1.virtual_service_pb2' + # @@protoc_insertion_point(class_scope:istio.networking.v1beta1.RateLimit.LocalDescriptor.Entry) + }) + , + 'DESCRIPTOR' : _RATELIMIT_LOCALDESCRIPTOR, + '__module__' : 'networking.v1beta1.virtual_service_pb2' + # @@protoc_insertion_point(class_scope:istio.networking.v1beta1.RateLimit.LocalDescriptor) + }) + , + + 'Local' : _reflection.GeneratedProtocolMessageType('Local', (_message.Message,), { + 'DESCRIPTOR' : _RATELIMIT_LOCAL, + '__module__' : 'networking.v1beta1.virtual_service_pb2' + # @@protoc_insertion_point(class_scope:istio.networking.v1beta1.RateLimit.Local) + }) + , + 'DESCRIPTOR' : _RATELIMIT, + '__module__' : 'networking.v1beta1.virtual_service_pb2' + # @@protoc_insertion_point(class_scope:istio.networking.v1beta1.RateLimit) + }) +_sym_db.RegisterMessage(RateLimit) +_sym_db.RegisterMessage(RateLimit.TokenBucket) +_sym_db.RegisterMessage(RateLimit.LocalDescriptor) +_sym_db.RegisterMessage(RateLimit.LocalDescriptor.Entry) +_sym_db.RegisterMessage(RateLimit.Local) + +RateLimitDescriptor = _reflection.GeneratedProtocolMessageType('RateLimitDescriptor', (_message.Message,), { + + 'Entry' : _reflection.GeneratedProtocolMessageType('Entry', (_message.Message,), { + 'DESCRIPTOR' : _RATELIMITDESCRIPTOR_ENTRY, + '__module__' : 'networking.v1beta1.virtual_service_pb2' + # @@protoc_insertion_point(class_scope:istio.networking.v1beta1.RateLimitDescriptor.Entry) + }) + , + 'DESCRIPTOR' : _RATELIMITDESCRIPTOR, + '__module__' : 'networking.v1beta1.virtual_service_pb2' + # @@protoc_insertion_point(class_scope:istio.networking.v1beta1.RateLimitDescriptor) + }) +_sym_db.RegisterMessage(RateLimitDescriptor) +_sym_db.RegisterMessage(RateLimitDescriptor.Entry) + Delegate = _reflection.GeneratedProtocolMessageType('Delegate', (_message.Message,), { 'DESCRIPTOR' : _DELEGATE, '__module__' : 'networking.v1beta1.virtual_service_pb2' From a708552bb03da9f1a9d01735ddeb6ac29937fa7e Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Thu, 21 Jan 2021 18:14:29 -0800 Subject: [PATCH 2/3] make gen Signed-off-by: Kuat Yessenov --- kubernetes/customresourcedefinitions.gen.yaml | 104 ++++++++++ networking/v1alpha3/virtual_service.gen.json | 192 ++++++++++++++++++ networking/v1beta1/virtual_service.gen.json | 192 ++++++++++++++++++ 3 files changed, 488 insertions(+) diff --git a/kubernetes/customresourcedefinitions.gen.yaml b/kubernetes/customresourcedefinitions.gen.yaml index 0ee00ac2c2b..5a35912578e 100644 --- a/kubernetes/customresourcedefinitions.gen.yaml +++ b/kubernetes/customresourcedefinitions.gen.yaml @@ -2452,6 +2452,110 @@ spec: description: The name assigned to the route for debugging purposes. format: string type: string + rateLimit: + oneOf: + - not: + anyOf: + - required: + - local + - required: + - local + properties: + descriptors: + description: Specifies the rate limit descriptors to produce + for the route. + items: + properties: + entries: + description: Rate limit entries specify an ordered list + of string values composing the descriptor. + items: + oneOf: + - not: + anyOf: + - required: + - requestHeader + - required: + - expression + - required: + - requestHeader + - required: + - expression + properties: + expression: + description: CEL expression to populate the entry + value. + format: string + type: string + key: + description: The key to use in the descriptor + entry. + format: string + type: string + requestHeader: + description: The header name to be queried from + the request headers. + format: string + type: string + skipIfError: + description: If set to true, skip the entry when + the evaluation fails or when the header is missing. + type: boolean + type: object + type: array + type: object + type: array + local: + description: Local rate limit configuration. + properties: + descriptors: + items: + properties: + entries: + description: Descriptor entry match. + items: + properties: + key: + format: string + type: string + value: + format: string + type: string + type: object + type: array + tokenBucket: + description: Specifies the token bucket for matching + descriptors. + properties: + fillInterval: + description: The interval that tokens are added + to the bucket. + type: string + maxTokens: + description: Maximum amount of tokens in a bucket. + type: integer + tokensPerFill: + description: The amount of tokens added per + fill. + type: integer + type: object + type: object + type: array + tokenBucket: + properties: + fillInterval: + description: The interval that tokens are added to + the bucket. + type: string + maxTokens: + description: Maximum amount of tokens in a bucket. + type: integer + tokensPerFill: + description: The amount of tokens added per fill. + type: integer + type: object + type: object + type: object redirect: description: A HTTP rule can either redirect or forward (default) traffic. diff --git a/networking/v1alpha3/virtual_service.gen.json b/networking/v1alpha3/virtual_service.gen.json index 3f804faec33..aac31f56351 100644 --- a/networking/v1alpha3/virtual_service.gen.json +++ b/networking/v1alpha3/virtual_service.gen.json @@ -145,6 +145,9 @@ }, "headers": { "$ref": "#/components/schemas/istio.networking.v1alpha3.Headers" + }, + "rateLimit": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.RateLimit" } } }, @@ -444,6 +447,195 @@ } } }, + "istio.networking.v1alpha3.RateLimit": { + "description": "RateLimit configuration.", + "type": "object", + "properties": { + "descriptors": { + "description": "Specifies the rate limit descriptors to produce for the route.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.RateLimitDescriptor" + } + } + }, + "oneOf": [ + { + "not": { + "anyOf": [ + { + "required": [ + "local" + ], + "properties": { + "local": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.RateLimit.Local" + } + } + } + ] + } + }, + { + "required": [ + "local" + ], + "properties": { + "local": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.RateLimit.Local" + } + } + } + ] + }, + "istio.networking.v1alpha3.RateLimitDescriptor": { + "description": "Rate limit descriptor specifies the descriptors consisting of multiple actions.", + "type": "object", + "properties": { + "entries": { + "description": "Rate limit entries specify an ordered list of string values composing the descriptor. The order of the entries matters, as they are processed sequentially. If an entry fails to be computed, no descriptor is generated.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.RateLimitDescriptor.Entry" + } + } + } + }, + "istio.networking.v1alpha3.RateLimit.TokenBucket": { + "description": "Token bucket algorithm configuration. Each request consumes a single token.", + "type": "object", + "properties": { + "maxTokens": { + "description": "Maximum amount of tokens in a bucket.", + "type": "integer" + }, + "tokensPerFill": { + "description": "The amount of tokens added per fill.", + "type": "integer" + }, + "fillInterval": { + "description": "The interval that tokens are added to the bucket.", + "type": "string" + } + } + }, + "istio.networking.v1alpha3.RateLimit.LocalDescriptor": { + "description": "Local rate limit descriptor configuration.", + "type": "object", + "properties": { + "entries": { + "description": "Descriptor entry match.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.RateLimit.LocalDescriptor.Entry" + } + }, + "tokenBucket": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.RateLimit.TokenBucket" + } + } + }, + "istio.networking.v1alpha3.RateLimit.LocalDescriptor.Entry": { + "description": "Descriptor entry match.", + "type": "object", + "properties": { + "value": { + "type": "string", + "format": "string" + }, + "key": { + "type": "string", + "format": "string" + } + } + }, + "istio.networking.v1alpha3.RateLimit.Local": { + "description": "Local rate limit enforcement.", + "type": "object", + "properties": { + "descriptors": { + "description": "The rate limit descriptor list to use in the local rate limit to override on. The rate limit descriptor is selected by the first full match from the request descriptors. The descriptors token bucket fill interval must be a multiple of the global fill interval.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.RateLimit.LocalDescriptor" + } + }, + "tokenBucket": { + "$ref": "#/components/schemas/istio.networking.v1alpha3.RateLimit.TokenBucket" + } + } + }, + "istio.networking.v1alpha3.RateLimitDescriptor.Entry": { + "description": "Descriptor entry.", + "type": "object", + "properties": { + "key": { + "description": "The key to use in the descriptor entry.", + "type": "string", + "format": "string" + }, + "skipIfError": { + "description": "If set to true, skip the entry when the evaluation fails or when the header is missing. By default, the entire descriptor is not produced.", + "type": "boolean" + } + }, + "oneOf": [ + { + "not": { + "anyOf": [ + { + "required": [ + "requestHeader" + ], + "properties": { + "requestHeader": { + "description": "The header name to be queried from the request headers. The header’s value is used to populate the value of the descriptor entry for the descriptor_key.", + "type": "string", + "format": "string" + } + } + }, + { + "required": [ + "expression" + ], + "properties": { + "expression": { + "description": "CEL expression to populate the entry value.", + "type": "string", + "format": "string" + } + } + } + ] + } + }, + { + "required": [ + "requestHeader" + ], + "properties": { + "requestHeader": { + "description": "The header name to be queried from the request headers. The header’s value is used to populate the value of the descriptor entry for the descriptor_key.", + "type": "string", + "format": "string" + } + } + }, + { + "required": [ + "expression" + ], + "properties": { + "expression": { + "description": "CEL expression to populate the entry value.", + "type": "string", + "format": "string" + } + } + } + ] + }, "istio.networking.v1alpha3.Headers.HeaderOperations": { "description": "HeaderOperations Describes the header manipulations to apply", "type": "object", diff --git a/networking/v1beta1/virtual_service.gen.json b/networking/v1beta1/virtual_service.gen.json index 7a3832e682c..98e17df73fe 100644 --- a/networking/v1beta1/virtual_service.gen.json +++ b/networking/v1beta1/virtual_service.gen.json @@ -145,6 +145,9 @@ }, "headers": { "$ref": "#/components/schemas/istio.networking.v1beta1.Headers" + }, + "rateLimit": { + "$ref": "#/components/schemas/istio.networking.v1beta1.RateLimit" } } }, @@ -444,6 +447,195 @@ } } }, + "istio.networking.v1beta1.RateLimit": { + "description": "RateLimit configuration.", + "type": "object", + "properties": { + "descriptors": { + "description": "Specifies the rate limit descriptors to produce for the route.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1beta1.RateLimitDescriptor" + } + } + }, + "oneOf": [ + { + "not": { + "anyOf": [ + { + "required": [ + "local" + ], + "properties": { + "local": { + "$ref": "#/components/schemas/istio.networking.v1beta1.RateLimit.Local" + } + } + } + ] + } + }, + { + "required": [ + "local" + ], + "properties": { + "local": { + "$ref": "#/components/schemas/istio.networking.v1beta1.RateLimit.Local" + } + } + } + ] + }, + "istio.networking.v1beta1.RateLimitDescriptor": { + "description": "Rate limit descriptor specifies the descriptors consisting of multiple actions.", + "type": "object", + "properties": { + "entries": { + "description": "Rate limit entries specify an ordered list of string values composing the descriptor. The order of the entries matters, as they are processed sequentially. If an entry fails to be computed, no descriptor is generated.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1beta1.RateLimitDescriptor.Entry" + } + } + } + }, + "istio.networking.v1beta1.RateLimit.TokenBucket": { + "description": "Token bucket algorithm configuration. Each request consumes a single token.", + "type": "object", + "properties": { + "maxTokens": { + "description": "Maximum amount of tokens in a bucket.", + "type": "integer" + }, + "tokensPerFill": { + "description": "The amount of tokens added per fill.", + "type": "integer" + }, + "fillInterval": { + "description": "The interval that tokens are added to the bucket.", + "type": "string" + } + } + }, + "istio.networking.v1beta1.RateLimit.LocalDescriptor": { + "description": "Local rate limit descriptor configuration.", + "type": "object", + "properties": { + "entries": { + "description": "Descriptor entry match.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1beta1.RateLimit.LocalDescriptor.Entry" + } + }, + "tokenBucket": { + "$ref": "#/components/schemas/istio.networking.v1beta1.RateLimit.TokenBucket" + } + } + }, + "istio.networking.v1beta1.RateLimit.LocalDescriptor.Entry": { + "description": "Descriptor entry match.", + "type": "object", + "properties": { + "key": { + "type": "string", + "format": "string" + }, + "value": { + "type": "string", + "format": "string" + } + } + }, + "istio.networking.v1beta1.RateLimit.Local": { + "description": "Local rate limit enforcement.", + "type": "object", + "properties": { + "descriptors": { + "description": "The rate limit descriptor list to use in the local rate limit to override on. The rate limit descriptor is selected by the first full match from the request descriptors. The descriptors token bucket fill interval must be a multiple of the global fill interval.", + "type": "array", + "items": { + "$ref": "#/components/schemas/istio.networking.v1beta1.RateLimit.LocalDescriptor" + } + }, + "tokenBucket": { + "$ref": "#/components/schemas/istio.networking.v1beta1.RateLimit.TokenBucket" + } + } + }, + "istio.networking.v1beta1.RateLimitDescriptor.Entry": { + "description": "Descriptor entry.", + "type": "object", + "properties": { + "key": { + "description": "The key to use in the descriptor entry.", + "type": "string", + "format": "string" + }, + "skipIfError": { + "description": "If set to true, skip the entry when the evaluation fails or when the header is missing. By default, the entire descriptor is not produced.", + "type": "boolean" + } + }, + "oneOf": [ + { + "not": { + "anyOf": [ + { + "required": [ + "requestHeader" + ], + "properties": { + "requestHeader": { + "description": "The header name to be queried from the request headers. The header’s value is used to populate the value of the descriptor entry for the descriptor_key.", + "type": "string", + "format": "string" + } + } + }, + { + "required": [ + "expression" + ], + "properties": { + "expression": { + "description": "CEL expression to populate the entry value.", + "type": "string", + "format": "string" + } + } + } + ] + } + }, + { + "required": [ + "requestHeader" + ], + "properties": { + "requestHeader": { + "description": "The header name to be queried from the request headers. The header’s value is used to populate the value of the descriptor entry for the descriptor_key.", + "type": "string", + "format": "string" + } + } + }, + { + "required": [ + "expression" + ], + "properties": { + "expression": { + "description": "CEL expression to populate the entry value.", + "type": "string", + "format": "string" + } + } + } + ] + }, "istio.networking.v1beta1.Headers.HeaderOperations": { "description": "HeaderOperations Describes the header manipulations to apply", "type": "object", From 01bf2a645773a4f7c75058bea85dd3a1390d4a00 Mon Sep 17 00:00:00 2001 From: Kuat Yessenov Date: Fri, 22 Jan 2021 11:05:42 -0800 Subject: [PATCH 3/3] add examples Signed-off-by: Kuat Yessenov --- networking/v1alpha3/virtual_service.pb.go | 95 +++++++++++++++++++++ networking/v1alpha3/virtual_service.pb.html | 95 +++++++++++++++++++++ networking/v1alpha3/virtual_service.proto | 95 +++++++++++++++++++++ networking/v1beta1/virtual_service.pb.go | 95 +++++++++++++++++++++ networking/v1beta1/virtual_service.proto | 95 +++++++++++++++++++++ 5 files changed, 475 insertions(+) diff --git a/networking/v1alpha3/virtual_service.pb.go b/networking/v1alpha3/virtual_service.pb.go index cb546d80b65..591a0ceec13 100644 --- a/networking/v1alpha3/virtual_service.pb.go +++ b/networking/v1alpha3/virtual_service.pb.go @@ -896,6 +896,101 @@ func (m *HTTPRoute) GetRateLimit() *RateLimit { } // RateLimit configuration. +// +// Example 1: Limit the number of requests to product page by 1000 qps: +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo +// spec: +// hosts: +// - "bookinfo.com" +// gateways: +// - mygateway +// http: +// - match: +// - uri: +// prefix: "/productpage" +// rate_limit: +// local: +// token_bucket: +// max_tokens: 1000 +// tokens_per_fill: 1000 +// fill_interval: 1s +// ``` +// +// Example 2: Limit the number of requests to product page by 1000 qps +// and the requests with x-test header value foo by 100 qps: +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo +// spec: +// hosts: +// - "bookinfo.com" +// gateways: +// - mygateway +// http: +// - match: +// - uri: +// prefix: "/productpage" +// rate_limit: +// descriptors: +// - entries: +// - key: test +// request_header: x-test +// local: +// token_bucket: +// max_tokens: 1000 +// tokens_per_fill: 1000 +// fill_interval: 1s +// descriptors: +// - entries: +// - key: test +// value: foo +// token_bucket: +// max_tokens: 100 +// tokens_per_fill: 100 +// fill_interval: 1s +// ``` +// +// Example 3: Limit the number of requests to product page by 1000 qps +// and POST requests by 100 qps: +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo +// spec: +// hosts: +// - "bookinfo.com" +// gateways: +// - mygateway +// http: +// - match: +// - uri: +// prefix: "/productpage" +// rate_limit: +// descriptors: +// - entries: +// - key: method +// expression: request.method +// local: +// token_bucket: +// max_tokens: 1000 +// tokens_per_fill: 1000 +// fill_interval: 1s +// descriptors: +// - entries: +// - key: method +// value: POST +// token_bucket: +// max_tokens: 100 +// tokens_per_fill: 100 +// fill_interval: 1s +// ``` type RateLimit struct { // Specifies the rate limit descriptors to produce for the route. Descriptors []*RateLimitDescriptor `protobuf:"bytes,1,rep,name=descriptors,proto3" json:"descriptors,omitempty"` diff --git a/networking/v1alpha3/virtual_service.pb.html b/networking/v1alpha3/virtual_service.pb.html index fa001801c38..286bff492da 100644 --- a/networking/v1alpha3/virtual_service.pb.html +++ b/networking/v1alpha3/virtual_service.pb.html @@ -843,6 +843,101 @@

RateLimit

RateLimit configuration.

+

Example 1: Limit the number of requests to product page by 1000 qps:

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: bookinfo
+spec:
+  hosts:
+  - "bookinfo.com"
+  gateways:
+  - mygateway
+  http:
+  - match:
+    - uri:
+        prefix: "/productpage"
+    rate_limit:
+      local:
+        token_bucket:
+          max_tokens: 1000
+          tokens_per_fill: 1000
+          fill_interval: 1s
+
+ +

Example 2: Limit the number of requests to product page by 1000 qps +and the requests with x-test header value foo by 100 qps:

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: bookinfo
+spec:
+  hosts:
+  - "bookinfo.com"
+  gateways:
+  - mygateway
+  http:
+  - match:
+    - uri:
+        prefix: "/productpage"
+    rate_limit:
+      descriptors:
+      - entries:
+        - key: test
+          request_header: x-test
+      local:
+        token_bucket:
+          max_tokens: 1000
+          tokens_per_fill: 1000
+          fill_interval: 1s
+        descriptors:
+        - entries:
+          - key: test
+            value: foo
+          token_bucket:
+            max_tokens: 100
+            tokens_per_fill: 100
+            fill_interval: 1s
+
+ +

Example 3: Limit the number of requests to product page by 1000 qps +and POST requests by 100 qps:

+ +
apiVersion: networking.istio.io/v1alpha3
+kind: VirtualService
+metadata:
+  name: bookinfo
+spec:
+  hosts:
+  - "bookinfo.com"
+  gateways:
+  - mygateway
+  http:
+  - match:
+    - uri:
+        prefix: "/productpage"
+    rate_limit:
+      descriptors:
+      - entries:
+        - key: method
+          expression: request.method
+      local:
+        token_bucket:
+          max_tokens: 1000
+          tokens_per_fill: 1000
+          fill_interval: 1s
+        descriptors:
+        - entries:
+          - key: method
+            value: POST
+          token_bucket:
+            max_tokens: 100
+            tokens_per_fill: 100
+            fill_interval: 1s
+
+ diff --git a/networking/v1alpha3/virtual_service.proto b/networking/v1alpha3/virtual_service.proto index bcf3307602c..d1ff7e75c97 100644 --- a/networking/v1alpha3/virtual_service.proto +++ b/networking/v1alpha3/virtual_service.proto @@ -651,6 +651,101 @@ message HTTPRoute { } // RateLimit configuration. +// +// Example 1: Limit the number of requests to product page by 1000 qps: +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo +// spec: +// hosts: +// - "bookinfo.com" +// gateways: +// - mygateway +// http: +// - match: +// - uri: +// prefix: "/productpage" +// rate_limit: +// local: +// token_bucket: +// max_tokens: 1000 +// tokens_per_fill: 1000 +// fill_interval: 1s +// ``` +// +// Example 2: Limit the number of requests to product page by 1000 qps +// and the requests with x-test header value foo by 100 qps: +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo +// spec: +// hosts: +// - "bookinfo.com" +// gateways: +// - mygateway +// http: +// - match: +// - uri: +// prefix: "/productpage" +// rate_limit: +// descriptors: +// - entries: +// - key: test +// request_header: x-test +// local: +// token_bucket: +// max_tokens: 1000 +// tokens_per_fill: 1000 +// fill_interval: 1s +// descriptors: +// - entries: +// - key: test +// value: foo +// token_bucket: +// max_tokens: 100 +// tokens_per_fill: 100 +// fill_interval: 1s +// ``` +// +// Example 3: Limit the number of requests to product page by 1000 qps +// and POST requests by 100 qps: +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo +// spec: +// hosts: +// - "bookinfo.com" +// gateways: +// - mygateway +// http: +// - match: +// - uri: +// prefix: "/productpage" +// rate_limit: +// descriptors: +// - entries: +// - key: method +// expression: request.method +// local: +// token_bucket: +// max_tokens: 1000 +// tokens_per_fill: 1000 +// fill_interval: 1s +// descriptors: +// - entries: +// - key: method +// value: POST +// token_bucket: +// max_tokens: 100 +// tokens_per_fill: 100 +// fill_interval: 1s +// ``` message RateLimit { // Specifies the rate limit descriptors to produce for the route. repeated RateLimitDescriptor descriptors = 1; diff --git a/networking/v1beta1/virtual_service.pb.go b/networking/v1beta1/virtual_service.pb.go index 1185af515e0..08125e2ce1e 100644 --- a/networking/v1beta1/virtual_service.pb.go +++ b/networking/v1beta1/virtual_service.pb.go @@ -892,6 +892,101 @@ func (m *HTTPRoute) GetRateLimit() *RateLimit { } // RateLimit configuration. +// +// Example 1: Limit the number of requests to product page by 1000 qps: +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo +// spec: +// hosts: +// - "bookinfo.com" +// gateways: +// - mygateway +// http: +// - match: +// - uri: +// prefix: "/productpage" +// rate_limit: +// local: +// token_bucket: +// max_tokens: 1000 +// tokens_per_fill: 1000 +// fill_interval: 1s +// ``` +// +// Example 2: Limit the number of requests to product page by 1000 qps +// and the requests with x-test header value foo by 100 qps: +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo +// spec: +// hosts: +// - "bookinfo.com" +// gateways: +// - mygateway +// http: +// - match: +// - uri: +// prefix: "/productpage" +// rate_limit: +// descriptors: +// - entries: +// - key: test +// request_header: x-test +// local: +// token_bucket: +// max_tokens: 1000 +// tokens_per_fill: 1000 +// fill_interval: 1s +// descriptors: +// - entries: +// - key: test +// value: foo +// token_bucket: +// max_tokens: 100 +// tokens_per_fill: 100 +// fill_interval: 1s +// ``` +// +// Example 3: Limit the number of requests to product page by 1000 qps +// and POST requests by 100 qps: +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo +// spec: +// hosts: +// - "bookinfo.com" +// gateways: +// - mygateway +// http: +// - match: +// - uri: +// prefix: "/productpage" +// rate_limit: +// descriptors: +// - entries: +// - key: method +// expression: request.method +// local: +// token_bucket: +// max_tokens: 1000 +// tokens_per_fill: 1000 +// fill_interval: 1s +// descriptors: +// - entries: +// - key: method +// value: POST +// token_bucket: +// max_tokens: 100 +// tokens_per_fill: 100 +// fill_interval: 1s +// ``` type RateLimit struct { // Specifies the rate limit descriptors to produce for the route. Descriptors []*RateLimitDescriptor `protobuf:"bytes,1,rep,name=descriptors,proto3" json:"descriptors,omitempty"` diff --git a/networking/v1beta1/virtual_service.proto b/networking/v1beta1/virtual_service.proto index b82ffd8e67b..7ec87dc686a 100644 --- a/networking/v1beta1/virtual_service.proto +++ b/networking/v1beta1/virtual_service.proto @@ -648,6 +648,101 @@ message HTTPRoute { } // RateLimit configuration. +// +// Example 1: Limit the number of requests to product page by 1000 qps: +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo +// spec: +// hosts: +// - "bookinfo.com" +// gateways: +// - mygateway +// http: +// - match: +// - uri: +// prefix: "/productpage" +// rate_limit: +// local: +// token_bucket: +// max_tokens: 1000 +// tokens_per_fill: 1000 +// fill_interval: 1s +// ``` +// +// Example 2: Limit the number of requests to product page by 1000 qps +// and the requests with x-test header value foo by 100 qps: +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo +// spec: +// hosts: +// - "bookinfo.com" +// gateways: +// - mygateway +// http: +// - match: +// - uri: +// prefix: "/productpage" +// rate_limit: +// descriptors: +// - entries: +// - key: test +// request_header: x-test +// local: +// token_bucket: +// max_tokens: 1000 +// tokens_per_fill: 1000 +// fill_interval: 1s +// descriptors: +// - entries: +// - key: test +// value: foo +// token_bucket: +// max_tokens: 100 +// tokens_per_fill: 100 +// fill_interval: 1s +// ``` +// +// Example 3: Limit the number of requests to product page by 1000 qps +// and POST requests by 100 qps: +// ```yaml +// apiVersion: networking.istio.io/v1alpha3 +// kind: VirtualService +// metadata: +// name: bookinfo +// spec: +// hosts: +// - "bookinfo.com" +// gateways: +// - mygateway +// http: +// - match: +// - uri: +// prefix: "/productpage" +// rate_limit: +// descriptors: +// - entries: +// - key: method +// expression: request.method +// local: +// token_bucket: +// max_tokens: 1000 +// tokens_per_fill: 1000 +// fill_interval: 1s +// descriptors: +// - entries: +// - key: method +// value: POST +// token_bucket: +// max_tokens: 100 +// tokens_per_fill: 100 +// fill_interval: 1s +// ``` message RateLimit { // Specifies the rate limit descriptors to produce for the route. repeated RateLimitDescriptor descriptors = 1;