Fix small nits for kubectl port-forward command
This commit is contained in:
parent
77be29e3da
commit
eca0ae08c5
@ -8,7 +8,7 @@ Forward one or more local ports to a pod.
|
|||||||
Forward one or more local ports to a pod.
|
Forward one or more local ports to a pod.
|
||||||
|
|
||||||
```
|
```
|
||||||
kubectl port-forward -p POD [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N]
|
kubectl port-forward -p POD_NAME [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N]
|
||||||
```
|
```
|
||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
@ -67,6 +67,6 @@ $ kubectl port-forward -p mypod 0:5000
|
|||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
|
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
|
||||||
|
|
||||||
###### Auto generated by spf13/cobra at 2015-05-21 10:33:11.187520496 +0000 UTC
|
###### Auto generated by spf13/cobra at 2015-07-08 07:53:42.570511034 +0000 UTC
|
||||||
|
|
||||||
[]()
|
[]()
|
||||||
|
@ -45,7 +45,7 @@ $ kubectl port-forward -p mypod 0:5000`
|
|||||||
|
|
||||||
func NewCmdPortForward(f *cmdutil.Factory) *cobra.Command {
|
func NewCmdPortForward(f *cmdutil.Factory) *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "port-forward -p POD [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N]",
|
Use: "port-forward -p POD_NAME [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N]",
|
||||||
Short: "Forward one or more local ports to a pod.",
|
Short: "Forward one or more local ports to a pod.",
|
||||||
Long: "Forward one or more local ports to a pod.",
|
Long: "Forward one or more local ports to a pod.",
|
||||||
Example: portforward_example,
|
Example: portforward_example,
|
||||||
@ -77,7 +77,7 @@ func (*defaultPortForwarder) ForwardPorts(req *client.Request, config *client.Co
|
|||||||
func RunPortForward(f *cmdutil.Factory, cmd *cobra.Command, args []string, fw portForwarder) error {
|
func RunPortForward(f *cmdutil.Factory, cmd *cobra.Command, args []string, fw portForwarder) error {
|
||||||
podName := cmdutil.GetFlagString(cmd, "pod")
|
podName := cmdutil.GetFlagString(cmd, "pod")
|
||||||
if len(podName) == 0 {
|
if len(podName) == 0 {
|
||||||
return cmdutil.UsageError(cmd, "POD is required for exec")
|
return cmdutil.UsageError(cmd, "POD_NAME is required for port-forward")
|
||||||
}
|
}
|
||||||
if len(args) < 1 {
|
if len(args) < 1 {
|
||||||
return cmdutil.UsageError(cmd, "at least 1 PORT is required for port-forward")
|
return cmdutil.UsageError(cmd, "at least 1 PORT is required for port-forward")
|
||||||
|
Loading…
Reference in New Issue
Block a user