Merge pull request #9112 from kargakis/expose-nits

expose: Better error formatting and generic flag message
This commit is contained in:
Brian Grant 2015-06-02 13:10:52 -07:00
commit 6508c04f24
3 changed files with 5 additions and 5 deletions

View File

@ -37,7 +37,7 @@ $ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream
--generator="service/v1": The name of the API generator to use. Default is 'service/v1'.
-h, --help=false: help for expose
-l, --labels="": Labels to apply to the service created by this call.
--name="": The name for the newly created service.
--name="": The name for the newly created object.
--no-headers=false: When using the default output, don't print headers.
-o, --output="": Output format. One of: json|yaml|template|templatefile.
--output-version="": Output the formatted object with the given version (default api-version).
@ -83,6 +83,6 @@ $ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream
### SEE ALSO
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-05-21 10:33:11.197790185 +0000 UTC
###### Auto generated by spf13/cobra at 2015-06-02 11:05:52.857144556 +0000 UTC
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/kubectl_expose.md?pixel)]()

View File

@ -48,7 +48,7 @@ re\-use the labels from the resource it exposes.
.PP
\fB\-\-name\fP=""
The name for the newly created service.
The name for the newly created object.
.PP
\fB\-\-no\-headers\fP=false

View File

@ -69,7 +69,7 @@ func NewCmdExposeService(f *cmdutil.Factory, out io.Writer) *cobra.Command {
cmd.Flags().String("target-port", "", "Name or number for the port on the container that the service should direct traffic to. Optional.")
cmd.Flags().String("public-ip", "", "Name of a public IP address to set for the service. The service will be assigned this IP in addition to its generated service IP.")
cmd.Flags().String("overrides", "", "An inline JSON override for the generated object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field.")
cmd.Flags().String("name", "", "The name for the newly created service.")
cmd.Flags().String("name", "", "The name for the newly created object.")
return cmd
}
@ -117,7 +117,7 @@ func RunExpose(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []str
generatorName := cmdutil.GetFlagString(cmd, "generator")
generator, found := f.Generator(generatorName)
if !found {
return cmdutil.UsageError(cmd, fmt.Sprintf("generator %q not found.", generator))
return cmdutil.UsageError(cmd, fmt.Sprintf("generator %q not found.", generatorName))
}
names := generator.ParamNames()
params := kubectl.MakeParams(cmd, names)