Make Istio port selector optional

This commit is contained in:
stefanprodan
2019-06-07 13:22:39 +03:00
parent 27b1b882ea
commit c243756802
2 changed files with 12 additions and 6 deletions
+1 -1
View File
@@ -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
@@ -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
}