1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 05:14:13 +01:00

ReferencedResourceList: alias for map[v1.ResourceName]*resource.Quantity to avoid the type definition duplication

This commit is contained in:
Jan Chaloupka
2025-03-07 13:10:17 +01:00
parent fd9f2b4614
commit 50dd3b8971
9 changed files with 54 additions and 47 deletions

View File

@@ -18,6 +18,7 @@ package api
import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)
@@ -104,3 +105,6 @@ type MetricsCollector struct {
// Later, the collection can be extended to other providers.
Enabled bool
}
// ReferencedResourceList is an adaption of v1.ResourceList with resources as references
type ReferencedResourceList = map[v1.ResourceName]*resource.Quantity