From 41dde2041026a8a2bd8acb370ad999edacf1f7e2 Mon Sep 17 00:00:00 2001 From: Marcin Wielgus Date: Wed, 27 Apr 2016 11:47:34 +0200 Subject: [PATCH] Make DrainOptions.getPodsForDeletion public to be reused in ClusterAutoscaler --- pkg/kubectl/cmd/drain.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/kubectl/cmd/drain.go b/pkg/kubectl/cmd/drain.go index e83ac8321c2..6be2cc4b9bc 100644 --- a/pkg/kubectl/cmd/drain.go +++ b/pkg/kubectl/cmd/drain.go @@ -183,7 +183,7 @@ func (o *DrainOptions) RunDrain() error { return err } - pods, err := o.getPodsForDeletion() + pods, err := o.GetPodsForDeletion() if err != nil { return err } @@ -195,10 +195,10 @@ func (o *DrainOptions) RunDrain() error { 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 // an error. -func (o *DrainOptions) getPodsForDeletion() ([]api.Pod, error) { +func (o *DrainOptions) GetPodsForDeletion() ([]api.Pod, error) { pods := []api.Pod{} podList, err := o.client.Pods(api.NamespaceAll).List(api.ListOptions{FieldSelector: fields.SelectorFromSet(fields.Set{"spec.nodeName": o.nodeInfo.Name})}) if err != nil {