mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-01 18:58:18 +00:00
convert more command to use a generated clientset
This commit is contained in:
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
@@ -45,11 +46,16 @@ func RunVersion(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
client, err := f.Client()
|
||||
clientset, err := f.ClientSet()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
kubectl.GetServerVersion(out, client)
|
||||
serverVersion, err := clientset.Discovery().ServerVersion()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Fprintf(out, "Server Version: %#v\n", *serverVersion)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user