Provisioning: Return unmanaged count in stats (#109462)

* Unmanaged counts

* Add integration test

* Generate open api spec
This commit is contained in:
Roberto Jiménez Sánchez
2025-08-12 09:17:25 +02:00
committed by GitHub
parent 0d8518dc2f
commit 8a690e977e
6 changed files with 191 additions and 0 deletions
@@ -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{