mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Add getting Storage Quantity to ResourceList
This commit is contained in:
parent
cf16e4988f
commit
d146e1941d
@ -40,6 +40,14 @@ func (rl *ResourceList) Memory() *resource.Quantity {
|
||||
return &resource.Quantity{Format: resource.BinarySI}
|
||||
}
|
||||
|
||||
// Storage returns the Storage limit if specified.
|
||||
func (rl *ResourceList) Storage() *resource.Quantity {
|
||||
if val, ok := (*rl)[ResourceStorage]; ok {
|
||||
return &val
|
||||
}
|
||||
return &resource.Quantity{Format: resource.BinarySI}
|
||||
}
|
||||
|
||||
// Pods returns the list of pods
|
||||
func (rl *ResourceList) Pods() *resource.Quantity {
|
||||
if val, ok := (*rl)[ResourcePods]; ok {
|
||||
|
@ -41,6 +41,14 @@ func (self *ResourceList) Memory() *resource.Quantity {
|
||||
return &resource.Quantity{Format: resource.BinarySI}
|
||||
}
|
||||
|
||||
// Returns the Storage limit if specified.
|
||||
func (self *ResourceList) Storage() *resource.Quantity {
|
||||
if val, ok := (*self)[ResourceStorage]; ok {
|
||||
return &val
|
||||
}
|
||||
return &resource.Quantity{Format: resource.BinarySI}
|
||||
}
|
||||
|
||||
func (self *ResourceList) Pods() *resource.Quantity {
|
||||
if val, ok := (*self)[ResourcePods]; ok {
|
||||
return &val
|
||||
|
Loading…
Reference in New Issue
Block a user