mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-02 19:28:16 +00:00 
			
		
		
		
	Add getting Storage Quantity to ResourceList
This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user