[Federation] Kubefed doc fix

This commit is contained in:
Irfan Ur Rehman 2017-08-14 19:54:23 +05:30
parent 7477e184aa
commit 8a7709de9b

View File

@ -26,10 +26,20 @@ import (
kubectl "k8s.io/kubernetes/pkg/kubectl/cmd"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/util/i18n"
"github.com/spf13/cobra"
)
var (
kubefedVersionExample = templates.Examples(i18n.T(`
# Print the client and server versions for the current context
kubefed version`))
kubefedOptionsExample = templates.Examples(i18n.T(`
# Print flags inherited by all commands
kubefed options`))
)
// NewKubeFedCommand creates the `kubefed` command and its nested children.
func NewKubeFedCommand(f cmdutil.Factory, in io.Reader, out, err io.Writer, defaultServerImage, defaultEtcdImage string) *cobra.Command {
// Parent command to which all subcommands are added.
@ -66,8 +76,12 @@ func NewKubeFedCommand(f cmdutil.Factory, in io.Reader, out, err io.Writer, defa
}
templates.ActsAsRootCommand(cmds, filters, groups...)
cmds.AddCommand(kubectl.NewCmdVersion(f, out))
cmds.AddCommand(kubectl.NewCmdOptions(out))
cmdVersion := kubectl.NewCmdVersion(f, out)
cmdVersion.Example = kubefedVersionExample
cmds.AddCommand(cmdVersion)
cmdOptions := kubectl.NewCmdOptions(out)
cmdOptions.Example = kubefedOptionsExample
cmds.AddCommand(cmdOptions)
return cmds
}