mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
vendor updates
This commit is contained in:
29
vendor/k8s.io/kubernetes/pkg/kubectl/cmd/cmd.go
generated
vendored
29
vendor/k8s.io/kubernetes/pkg/kubectl/cmd/cmd.go
generated
vendored
@ -19,6 +19,7 @@ package cmd
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"k8s.io/apiserver/pkg/util/flag"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
@ -31,7 +32,6 @@ import (
|
||||
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
|
||||
"k8s.io/kubernetes/pkg/kubectl/util/i18n"
|
||||
|
||||
"github.com/golang/glog"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
@ -212,6 +212,10 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
func NewDefaultKubectlCommand() *cobra.Command {
|
||||
return NewKubectlCommand(cmdutil.NewFactory(nil), os.Stdin, os.Stdout, os.Stderr)
|
||||
}
|
||||
|
||||
// NewKubectlCommand creates the `kubectl` command and its nested children.
|
||||
func NewKubectlCommand(f cmdutil.Factory, in io.Reader, out, err io.Writer) *cobra.Command {
|
||||
// Parent command to which all subcommands are added.
|
||||
@ -221,7 +225,8 @@ func NewKubectlCommand(f cmdutil.Factory, in io.Reader, out, err io.Writer) *cob
|
||||
Long: templates.LongDesc(`
|
||||
kubectl controls the Kubernetes cluster manager.
|
||||
|
||||
Find more information at https://github.com/kubernetes/kubernetes.`),
|
||||
Find more information at:
|
||||
https://kubernetes.io/docs/reference/kubectl/overview/`),
|
||||
Run: runHelp,
|
||||
BashCompletionFunction: bashCompletionFunc,
|
||||
}
|
||||
@ -264,7 +269,7 @@ func NewKubectlCommand(f cmdutil.Factory, in io.Reader, out, err io.Writer) *cob
|
||||
Commands: []*cobra.Command{
|
||||
rollout.NewCmdRollout(f, out, err),
|
||||
NewCmdRollingUpdate(f, out),
|
||||
NewCmdScale(f, out),
|
||||
NewCmdScale(f, out, err),
|
||||
NewCmdAutoscale(f, out),
|
||||
},
|
||||
},
|
||||
@ -284,7 +289,7 @@ func NewKubectlCommand(f cmdutil.Factory, in io.Reader, out, err io.Writer) *cob
|
||||
Message: "Troubleshooting and Debugging Commands:",
|
||||
Commands: []*cobra.Command{
|
||||
NewCmdDescribe(f, out, err),
|
||||
NewCmdLogs(f, out),
|
||||
NewCmdLogs(f, out, err),
|
||||
NewCmdAttach(f, in, out, err),
|
||||
NewCmdExec(f, in, out, err),
|
||||
NewCmdPortForward(f, out, err),
|
||||
@ -336,7 +341,7 @@ func NewKubectlCommand(f cmdutil.Factory, in io.Reader, out, err io.Writer) *cob
|
||||
}
|
||||
|
||||
cmds.AddCommand(alpha)
|
||||
cmds.AddCommand(cmdconfig.NewCmdConfig(clientcmd.NewDefaultPathOptions(), out, err))
|
||||
cmds.AddCommand(cmdconfig.NewCmdConfig(f, clientcmd.NewDefaultPathOptions(), out, err))
|
||||
cmds.AddCommand(NewCmdPlugin(f, in, out, err))
|
||||
cmds.AddCommand(NewCmdVersion(f, out))
|
||||
cmds.AddCommand(NewCmdApiVersions(f, out))
|
||||
@ -349,8 +354,8 @@ func runHelp(cmd *cobra.Command, args []string) {
|
||||
cmd.Help()
|
||||
}
|
||||
|
||||
func printDeprecationWarning(command, alias string) {
|
||||
glog.Warningf("%s is DEPRECATED and will be removed in a future version. Use %s instead.", alias, command)
|
||||
func printDeprecationWarning(errOut io.Writer, command, alias string) {
|
||||
fmt.Fprintf(errOut, "%s is DEPRECATED and will be removed in a future version. Use %s instead.", alias, command)
|
||||
}
|
||||
|
||||
// deprecatedAlias is intended to be used to create a "wrapper" command around
|
||||
@ -367,13 +372,3 @@ func deprecatedAlias(deprecatedVersion string, cmd *cobra.Command) *cobra.Comman
|
||||
cmd.Hidden = true
|
||||
return cmd
|
||||
}
|
||||
|
||||
// deprecated is similar to deprecatedAlias, but it is used for deprecations
|
||||
// that are not simple aliases; this command is actually a different
|
||||
// (deprecated) codepath.
|
||||
func deprecated(baseName, to string, parent, cmd *cobra.Command) string {
|
||||
cmd.Long = fmt.Sprintf("Deprecated: all functionality can be found in \"%s %s\"", baseName, to)
|
||||
cmd.Short = fmt.Sprintf("Deprecated: use %s", to)
|
||||
parent.AddCommand(cmd)
|
||||
return cmd.Name()
|
||||
}
|
||||
|
Reference in New Issue
Block a user