mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Scopes: Add groups property to ScopeDashboardBinding (#92077)
- Note: The `dashboardTitle` property and this property (`groups`) are likely to move from the `spec` container to the `status` container within the `scopeDashboardBinding` object in the future.
This commit is contained in:
parent
15a623c344
commit
cab5818bc7
@ -53,6 +53,7 @@ var ScopeDashboardBindingResourceInfo = common.NewResourceInfo(GROUP, VERSION,
|
|||||||
{Name: "Created At", Type: "date"},
|
{Name: "Created At", Type: "date"},
|
||||||
{Name: "Dashboard", Type: "string"},
|
{Name: "Dashboard", Type: "string"},
|
||||||
{Name: "Scope", Type: "string"},
|
{Name: "Scope", Type: "string"},
|
||||||
|
{Name: "Groups", Type: "array"},
|
||||||
},
|
},
|
||||||
Reader: func(obj any) ([]interface{}, error) {
|
Reader: func(obj any) ([]interface{}, error) {
|
||||||
m, ok := obj.(*ScopeDashboardBinding)
|
m, ok := obj.(*ScopeDashboardBinding)
|
||||||
@ -64,6 +65,7 @@ var ScopeDashboardBindingResourceInfo = common.NewResourceInfo(GROUP, VERSION,
|
|||||||
m.CreationTimestamp.UTC().Format(time.RFC3339),
|
m.CreationTimestamp.UTC().Format(time.RFC3339),
|
||||||
m.Spec.Dashboard,
|
m.Spec.Dashboard,
|
||||||
m.Spec.Scope,
|
m.Spec.Scope,
|
||||||
|
m.Spec.Groups,
|
||||||
}, nil
|
}, nil
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -61,8 +61,15 @@ type ScopeDashboardBinding struct {
|
|||||||
|
|
||||||
type ScopeDashboardBindingSpec struct {
|
type ScopeDashboardBindingSpec struct {
|
||||||
Dashboard string `json:"dashboard"`
|
Dashboard string `json:"dashboard"`
|
||||||
|
|
||||||
|
// DashboardTitle should be populated and update from the dashboard
|
||||||
DashboardTitle string `json:"dashboardTitle"`
|
DashboardTitle string `json:"dashboardTitle"`
|
||||||
|
|
||||||
|
// Groups is used for the grouping of dashboards that are suggested based
|
||||||
|
// on a scope. The source of truth for this information has not been
|
||||||
|
// determined yet.
|
||||||
|
Groups []string `json:"groups,omitempty"`
|
||||||
|
|
||||||
Scope string `json:"scope"`
|
Scope string `json:"scope"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ func (in *ScopeDashboardBinding) DeepCopyInto(out *ScopeDashboardBinding) {
|
|||||||
*out = *in
|
*out = *in
|
||||||
out.TypeMeta = in.TypeMeta
|
out.TypeMeta = in.TypeMeta
|
||||||
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
|
||||||
out.Spec = in.Spec
|
in.Spec.DeepCopyInto(&out.Spec)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,6 +166,11 @@ func (in *ScopeDashboardBindingList) DeepCopyObject() runtime.Object {
|
|||||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||||
func (in *ScopeDashboardBindingSpec) DeepCopyInto(out *ScopeDashboardBindingSpec) {
|
func (in *ScopeDashboardBindingSpec) DeepCopyInto(out *ScopeDashboardBindingSpec) {
|
||||||
*out = *in
|
*out = *in
|
||||||
|
if in.Groups != nil {
|
||||||
|
in, out := &in.Groups, &out.Groups
|
||||||
|
*out = make([]string, len(*in))
|
||||||
|
copy(*out, *in)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,11 +265,27 @@ func schema_pkg_apis_scope_v0alpha1_ScopeDashboardBindingSpec(ref common.Referen
|
|||||||
},
|
},
|
||||||
"dashboardTitle": {
|
"dashboardTitle": {
|
||||||
SchemaProps: spec.SchemaProps{
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Description: "DashboardTitle should be populated and update from the dashboard",
|
||||||
Default: "",
|
Default: "",
|
||||||
Type: []string{"string"},
|
Type: []string{"string"},
|
||||||
Format: "",
|
Format: "",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"groups": {
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Description: "Groups is used for the grouping of dashboards that are suggested based on a scope. The source of truth for this information has not been determined yet.",
|
||||||
|
Type: []string{"array"},
|
||||||
|
Items: &spec.SchemaOrArray{
|
||||||
|
Schema: &spec.Schema{
|
||||||
|
SchemaProps: spec.SchemaProps{
|
||||||
|
Default: "",
|
||||||
|
Type: []string{"string"},
|
||||||
|
Format: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
"scope": {
|
"scope": {
|
||||||
SchemaProps: spec.SchemaProps{
|
SchemaProps: spec.SchemaProps{
|
||||||
Default: "",
|
Default: "",
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
API rule violation: list_type_missing,github.com/grafana/grafana/pkg/apis/scope/v0alpha1,FindScopeDashboardBindingsResults,Items
|
API rule violation: list_type_missing,github.com/grafana/grafana/pkg/apis/scope/v0alpha1,FindScopeDashboardBindingsResults,Items
|
||||||
|
API rule violation: list_type_missing,github.com/grafana/grafana/pkg/apis/scope/v0alpha1,ScopeDashboardBindingSpec,Groups
|
||||||
API rule violation: names_match,github.com/grafana/grafana/pkg/apis/scope/v0alpha1,ScopeNodeSpec,LinkID
|
API rule violation: names_match,github.com/grafana/grafana/pkg/apis/scope/v0alpha1,ScopeNodeSpec,LinkID
|
||||||
|
@ -5,3 +5,5 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
scope: example
|
scope: example
|
||||||
dashboard: abc
|
dashboard: abc
|
||||||
|
dashboardTitle: "Example Dashboard ABC"
|
||||||
|
groups: ["group1", "group2"]
|
@ -5,3 +5,5 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
scope: example
|
scope: example
|
||||||
dashboard: xyz
|
dashboard: xyz
|
||||||
|
dashboardTitle: "Example Dashboard XYZ"
|
||||||
|
groups: ["group2", "group3"]
|
Loading…
Reference in New Issue
Block a user