Scopes: Create binding per relationship (#85332)

scopes: create binding per relationship

Signed-off-by: bergquist <carl.bergquist@gmail.com>
This commit is contained in:
Carl Bergquist 2024-03-28 18:22:21 +01:00 committed by GitHub
parent e4250a72db
commit a71dfe806a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 21 deletions

View File

@ -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

View File

@ -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
}

View File

@ -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"},
},
},
}

View File

@ -1 +0,0 @@
API rule violation: list_type_missing,github.com/grafana/grafana/pkg/apis/scope/v0alpha1,ScopeDashboardBindingSpec,Dashboards