From a71dfe806a3e6dc58f239ff458b28dcbef15c5bd Mon Sep 17 00:00:00 2001 From: Carl Bergquist Date: Thu, 28 Mar 2024 18:22:21 +0100 Subject: [PATCH] Scopes: Create binding per relationship (#85332) scopes: create binding per relationship Signed-off-by: bergquist --- pkg/apis/scope/v0alpha1/types.go | 4 ++-- .../scope/v0alpha1/zz_generated.deepcopy.go | 7 +------ pkg/apis/scope/v0alpha1/zz_generated.openapi.go | 17 +++++------------ ..._generated.openapi_violation_exceptions.list | 1 - 4 files changed, 8 insertions(+), 21 deletions(-) delete mode 100644 pkg/apis/scope/v0alpha1/zz_generated.openapi_violation_exceptions.list diff --git a/pkg/apis/scope/v0alpha1/types.go b/pkg/apis/scope/v0alpha1/types.go index 0a26d491d76..0bab9e922c8 100644 --- a/pkg/apis/scope/v0alpha1/types.go +++ b/pkg/apis/scope/v0alpha1/types.go @@ -62,8 +62,8 @@ type ScopeDashboardBinding struct { } type ScopeDashboardBindingSpec struct { - Dashboards []string `json:"dashboards"` - Scope string `json:"scope"` + Dashboard string `json:"dashboard"` + Scope string `json:"scope"` } // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object diff --git a/pkg/apis/scope/v0alpha1/zz_generated.deepcopy.go b/pkg/apis/scope/v0alpha1/zz_generated.deepcopy.go index 82a254ef224..a7840e969a6 100644 --- a/pkg/apis/scope/v0alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/scope/v0alpha1/zz_generated.deepcopy.go @@ -43,7 +43,7 @@ func (in *ScopeDashboardBinding) DeepCopyInto(out *ScopeDashboardBinding) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) + out.Spec = in.Spec return } @@ -101,11 +101,6 @@ func (in *ScopeDashboardBindingList) DeepCopyObject() runtime.Object { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ScopeDashboardBindingSpec) DeepCopyInto(out *ScopeDashboardBindingSpec) { *out = *in - if in.Dashboards != nil { - in, out := &in.Dashboards, &out.Dashboards - *out = make([]string, len(*in)) - copy(*out, *in) - } return } diff --git a/pkg/apis/scope/v0alpha1/zz_generated.openapi.go b/pkg/apis/scope/v0alpha1/zz_generated.openapi.go index ff517d31422..b1857d6c49a 100644 --- a/pkg/apis/scope/v0alpha1/zz_generated.openapi.go +++ b/pkg/apis/scope/v0alpha1/zz_generated.openapi.go @@ -159,18 +159,11 @@ func schema_pkg_apis_scope_v0alpha1_ScopeDashboardBindingSpec(ref common.Referen SchemaProps: spec.SchemaProps{ Type: []string{"object"}, Properties: map[string]spec.Schema{ - "dashboards": { + "dashboard": { SchemaProps: spec.SchemaProps{ - Type: []string{"array"}, - Items: &spec.SchemaOrArray{ - Schema: &spec.Schema{ - SchemaProps: spec.SchemaProps{ - Default: "", - Type: []string{"string"}, - Format: "", - }, - }, - }, + Default: "", + Type: []string{"string"}, + Format: "", }, }, "scope": { @@ -181,7 +174,7 @@ func schema_pkg_apis_scope_v0alpha1_ScopeDashboardBindingSpec(ref common.Referen }, }, }, - Required: []string{"dashboards", "scope"}, + Required: []string{"dashboard", "scope"}, }, }, } diff --git a/pkg/apis/scope/v0alpha1/zz_generated.openapi_violation_exceptions.list b/pkg/apis/scope/v0alpha1/zz_generated.openapi_violation_exceptions.list deleted file mode 100644 index c72408369bf..00000000000 --- a/pkg/apis/scope/v0alpha1/zz_generated.openapi_violation_exceptions.list +++ /dev/null @@ -1 +0,0 @@ -API rule violation: list_type_missing,github.com/grafana/grafana/pkg/apis/scope/v0alpha1,ScopeDashboardBindingSpec,Dashboards