From c5499ff112493216a943f1d618ab227d694bdf49 Mon Sep 17 00:00:00 2001 From: Harold Ozouf Date: Wed, 29 Jul 2020 09:43:07 +0200 Subject: [PATCH] Fix TrafficTarget v1alpha2 Spec type TrafficTarget v1alpha2 defines the Spec attribute as a slice of TrafficTargetSpec. This is inconsistent with the specification as it should just be a TrafficTargetSpec, not a slice. Signed-off-by: Harold Ozouf --- pkg/apis/access/v1alpha2/traffic_target.go | 2 +- pkg/apis/access/v1alpha2/zz_generated.deepcopy.go | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/pkg/apis/access/v1alpha2/traffic_target.go b/pkg/apis/access/v1alpha2/traffic_target.go index fff17a9..4fea3b9 100644 --- a/pkg/apis/access/v1alpha2/traffic_target.go +++ b/pkg/apis/access/v1alpha2/traffic_target.go @@ -22,7 +22,7 @@ type TrafficTarget struct { // +optional metav1.ObjectMeta `json:"metadata,omitempty"` - Spec []TrafficTargetSpec `json:"spec"` + Spec TrafficTargetSpec `json:"spec"` } // TrafficTargetSpec is the specification of a TrafficTarget diff --git a/pkg/apis/access/v1alpha2/zz_generated.deepcopy.go b/pkg/apis/access/v1alpha2/zz_generated.deepcopy.go index 3943228..e874857 100644 --- a/pkg/apis/access/v1alpha2/zz_generated.deepcopy.go +++ b/pkg/apis/access/v1alpha2/zz_generated.deepcopy.go @@ -48,13 +48,7 @@ func (in *TrafficTarget) DeepCopyInto(out *TrafficTarget) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - if in.Spec != nil { - in, out := &in.Spec, &out.Spec - *out = make([]TrafficTargetSpec, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } + in.Spec.DeepCopyInto(&out.Spec) return }