Provisioning: Return unmanaged count in stats (#109462)
* Unmanaged counts * Add integration test * Generate open api spec
This commit is contained in:
@@ -439,6 +439,11 @@ type ResourceStats struct {
|
||||
// +listType=atomic
|
||||
Instance []ResourceCount `json:"instance,omitempty"`
|
||||
|
||||
// Stats across all unified storage
|
||||
// When legacy storage is still used, this will offer a shim
|
||||
// +listType=atomic
|
||||
Unmanaged []ResourceCount `json:"unmanaged,omitempty"`
|
||||
|
||||
// Stats for each manager
|
||||
// +listType=atomic
|
||||
Managed []ManagerStats `json:"managed,omitempty"`
|
||||
|
||||
@@ -974,6 +974,11 @@ func (in *ResourceStats) DeepCopyInto(out *ResourceStats) {
|
||||
*out = make([]ResourceCount, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Unmanaged != nil {
|
||||
in, out := &in.Unmanaged, &out.Unmanaged
|
||||
*out = make([]ResourceCount, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.Managed != nil {
|
||||
in, out := &in.Managed, &out.Managed
|
||||
*out = make([]ManagerStats, len(*in))
|
||||
|
||||
@@ -2126,6 +2126,25 @@ func schema_pkg_apis_provisioning_v0alpha1_ResourceStats(ref common.ReferenceCal
|
||||
},
|
||||
},
|
||||
},
|
||||
"unmanaged": {
|
||||
VendorExtensible: spec.VendorExtensible{
|
||||
Extensions: spec.Extensions{
|
||||
"x-kubernetes-list-type": "atomic",
|
||||
},
|
||||
},
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Description: "Stats across all unified storage When legacy storage is still used, this will offer a shim",
|
||||
Type: []string{"array"},
|
||||
Items: &spec.SchemaOrArray{
|
||||
Schema: &spec.Schema{
|
||||
SchemaProps: spec.SchemaProps{
|
||||
Default: map[string]interface{}{},
|
||||
Ref: ref("github.com/grafana/grafana/apps/provisioning/pkg/apis/provisioning/v0alpha1.ResourceCount"),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"managed": {
|
||||
VendorExtensible: spec.VendorExtensible{
|
||||
Extensions: spec.Extensions{
|
||||
|
||||
Reference in New Issue
Block a user