Merge pull request #32152 from deads2k/client-02-make-clientset

Automatic merge from submit-queue

add ClientSet to factory to remove non-generated client

We should move to using generated clients in the `kubectl` client.  We should really move to generated external clients, but this at least moves away from using manually created clients.

@fabianofranz @mfojtik When I complete this work (move the other commands and eliminate the old API), this will ripple downstream.
This commit is contained in:
Kubernetes Submit Queue
2016-09-10 01:59:02 -07:00
committed by GitHub
5 changed files with 50 additions and 14 deletions

View File

@@ -274,7 +274,12 @@ func Run(f *cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer, cmd *cob
if err != nil {
return err
}
opts.Client = client
clientset, err := f.ClientSet()
if err != nil {
return err
}
opts.PodClient = clientset.Core()
attachablePod, err := f.AttachablePodForObject(obj)
if err != nil {
@@ -475,7 +480,13 @@ func handleAttachPod(f *cmdutil.Factory, c *client.Client, ns, name string, opts
_, err = io.Copy(opts.Out, readCloser)
return err
}
opts.Client = c
clientset, err := f.ClientSet()
if err != nil {
return nil
}
opts.PodClient = clientset.Core()
opts.PodName = name
opts.Namespace = ns
// TODO: opts.Run sets opts.Err to nil, we need to find a better way