move additional methods from factory

This commit is contained in:
juanvallejo
2018-05-17 13:04:35 -04:00
parent 0ef96cbaf4
commit f3a46cf626
14 changed files with 180 additions and 98 deletions

View File

@@ -36,6 +36,7 @@ import (
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/kubectl/genericclioptions"
"k8s.io/kubernetes/pkg/kubectl/polymorphichelpers"
"k8s.io/kubernetes/pkg/kubectl/util/i18n"
)
@@ -160,7 +161,7 @@ func (p *AttachOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, argsIn [
return err
}
attachablePod, err := f.AttachablePodForObject(obj, p.GetPodTimeout)
attachablePod, err := polymorphichelpers.AttachablePodForObjectFn(f, obj, p.GetPodTimeout)
if err != nil {
return err
}
@@ -187,6 +188,7 @@ func (p *AttachOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, argsIn [
if err != nil {
return err
}
p.PodClient = clientset.Core()
if p.CommandName == "" {