Extract strings for the 'kubectl set' family of commands.

This commit is contained in:
Brendan Burns
2017-01-25 22:21:28 -08:00
parent a3f8ee6578
commit eecfcfb376
9 changed files with 51 additions and 6 deletions

View File

@@ -24,6 +24,7 @@ go_library(
"//pkg/kubectl/cmd/templates:go_default_library",
"//pkg/kubectl/cmd/util:go_default_library",
"//pkg/kubectl/resource:go_default_library",
"//pkg/util/i18n:go_default_library",
"//vendor:github.com/spf13/cobra",
"//vendor:k8s.io/apimachinery/pkg/api/errors",
"//vendor:k8s.io/apimachinery/pkg/api/meta",

View File

@@ -22,6 +22,7 @@ import (
"github.com/spf13/cobra"
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/util/i18n"
)
var (
@@ -34,7 +35,7 @@ var (
func NewCmdSet(f cmdutil.Factory, out, err io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "set SUBCOMMAND",
Short: "Set specific features on objects",
Short: i18n.T("Set specific features on objects"),
Long: set_long,
Run: cmdutil.DefaultSubCommandRun(err),
}

View File

@@ -29,6 +29,7 @@ import (
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/kubectl/resource"
"k8s.io/kubernetes/pkg/util/i18n"
)
// ImageOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of
@@ -91,7 +92,7 @@ func NewCmdImage(f cmdutil.Factory, out, err io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "image (-f FILENAME | TYPE NAME) CONTAINER_NAME_1=CONTAINER_IMAGE_1 ... CONTAINER_NAME_N=CONTAINER_IMAGE_N",
Short: "Update image of a pod template",
Short: i18n.T("Update image of a pod template"),
Long: image_long,
Example: image_example,
Run: func(cmd *cobra.Command, args []string) {

View File

@@ -32,6 +32,7 @@ import (
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/kubectl/resource"
"k8s.io/kubernetes/pkg/util/i18n"
)
var (
@@ -98,7 +99,7 @@ func NewCmdResources(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.
cmd := &cobra.Command{
Use: "resources (-f FILENAME | TYPE NAME) ([--limits=LIMITS & --requests=REQUESTS]",
Short: "Update resource requests/limits on objects with pod templates",
Short: i18n.T("Update resource requests/limits on objects with pod templates"),
Long: fmt.Sprintf(resources_long, strings.Join(resourceTypesWithPodTemplate, ", ")),
Example: resources_example,
Run: func(cmd *cobra.Command, args []string) {

View File

@@ -31,6 +31,7 @@ import (
"k8s.io/kubernetes/pkg/kubectl/cmd/templates"
cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/kubectl/resource"
"k8s.io/kubernetes/pkg/util/i18n"
)
// SelectorOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of
@@ -78,7 +79,7 @@ func NewCmdSelector(f cmdutil.Factory, out io.Writer) *cobra.Command {
cmd := &cobra.Command{
Use: "selector (-f FILENAME | TYPE NAME) EXPRESSIONS [--resource-version=version]",
Short: "Set the selector on a resource",
Short: i18n.T("Set the selector on a resource"),
Long: fmt.Sprintf(selectorLong, validation.LabelValueMaxLength),
Example: selectorExample,
Run: func(cmd *cobra.Command, args []string) {