mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Make DrainOptions.getPodsForDeletion public to be reused in ClusterAutoscaler
This commit is contained in:
		@@ -183,7 +183,7 @@ func (o *DrainOptions) RunDrain() error {
 | 
				
			|||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pods, err := o.getPodsForDeletion()
 | 
						pods, err := o.GetPodsForDeletion()
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return err
 | 
							return err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@@ -195,10 +195,10 @@ func (o *DrainOptions) RunDrain() error {
 | 
				
			|||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// getPodsForDeletion returns all the pods we're going to delete.  If there are
 | 
					// GetPodsForDeletion returns all the pods we're going to delete.  If there are
 | 
				
			||||||
// any unmanaged pods and the user didn't pass --force, we return that list in
 | 
					// any unmanaged pods and the user didn't pass --force, we return that list in
 | 
				
			||||||
// an error.
 | 
					// an error.
 | 
				
			||||||
func (o *DrainOptions) getPodsForDeletion() ([]api.Pod, error) {
 | 
					func (o *DrainOptions) GetPodsForDeletion() ([]api.Pod, error) {
 | 
				
			||||||
	pods := []api.Pod{}
 | 
						pods := []api.Pod{}
 | 
				
			||||||
	podList, err := o.client.Pods(api.NamespaceAll).List(api.ListOptions{FieldSelector: fields.SelectorFromSet(fields.Set{"spec.nodeName": o.nodeInfo.Name})})
 | 
						podList, err := o.client.Pods(api.NamespaceAll).List(api.ListOptions{FieldSelector: fields.SelectorFromSet(fields.Set{"spec.nodeName": o.nodeInfo.Name})})
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user