mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user