From c2437568027359c4adc71e476a4aef00115c2757 Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Fri, 7 Jun 2019 13:22:39 +0300 Subject: [PATCH] Make Istio port selector optional --- pkg/apis/istio/v1alpha3/virtual_service.go | 2 +- pkg/apis/istio/v1alpha3/zz_generated.deepcopy.go | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/pkg/apis/istio/v1alpha3/virtual_service.go b/pkg/apis/istio/v1alpha3/virtual_service.go index ed183172..e911f8ee 100644 --- a/pkg/apis/istio/v1alpha3/virtual_service.go +++ b/pkg/apis/istio/v1alpha3/virtual_service.go @@ -280,7 +280,7 @@ type Destination struct { // Specifies the port on the host that is being addressed. If a service // exposes only a single port it is not required to explicitly select the // port. - Port PortSelector `json:"port,omitempty"` + Port *PortSelector `json:"port,omitempty"` } // Describes match conditions and actions for routing HTTP/1.1, HTTP2, and diff --git a/pkg/apis/istio/v1alpha3/zz_generated.deepcopy.go b/pkg/apis/istio/v1alpha3/zz_generated.deepcopy.go index 1135d635..05cea4fe 100644 --- a/pkg/apis/istio/v1alpha3/zz_generated.deepcopy.go +++ b/pkg/apis/istio/v1alpha3/zz_generated.deepcopy.go @@ -111,7 +111,11 @@ func (in *CorsPolicy) DeepCopy() *CorsPolicy { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Destination) DeepCopyInto(out *Destination) { *out = *in - out.Port = in.Port + if in.Port != nil { + in, out := &in.Port, &out.Port + *out = new(PortSelector) + **out = **in + } return } @@ -216,7 +220,7 @@ func (in *DestinationRuleSpec) DeepCopy() *DestinationRuleSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DestinationWeight) DeepCopyInto(out *DestinationWeight) { *out = *in - out.Destination = in.Destination + in.Destination.DeepCopyInto(&out.Destination) return } @@ -388,7 +392,9 @@ func (in *HTTPRoute) DeepCopyInto(out *HTTPRoute) { if in.Route != nil { in, out := &in.Route, &out.Route *out = make([]DestinationWeight, len(*in)) - copy(*out, *in) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } if in.Redirect != nil { in, out := &in.Redirect, &out.Redirect @@ -413,7 +419,7 @@ func (in *HTTPRoute) DeepCopyInto(out *HTTPRoute) { if in.Mirror != nil { in, out := &in.Mirror, &out.Mirror *out = new(Destination) - **out = **in + (*in).DeepCopyInto(*out) } if in.CorsPolicy != nil { in, out := &in.CorsPolicy, &out.CorsPolicy @@ -717,7 +723,7 @@ func (in *TCPRoute) DeepCopyInto(out *TCPRoute) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - out.Route = in.Route + in.Route.DeepCopyInto(&out.Route) return }