Merge pull request #11138 from feihujiang/portForwardWithoutP

kubectl port-forward accept a pod without -p
This commit is contained in:
Alex Robinson
2015-08-10 13:29:14 -07:00
7 changed files with 89 additions and 22 deletions

View File

@@ -169,7 +169,7 @@ var _ = Describe("Kubectl client", func() {
})
It("should support port-forward", func() {
By("forwarding the container port to a local port")
cmd := kubectlCmd("port-forward", fmt.Sprintf("--namespace=%v", ns), "-p", simplePodName, fmt.Sprintf(":%d", simplePodPort))
cmd := kubectlCmd("port-forward", fmt.Sprintf("--namespace=%v", ns), simplePodName, fmt.Sprintf(":%d", simplePodPort))
defer tryKill(cmd)
// This is somewhat ugly but is the only way to retrieve the port that was picked
// by the port-forward command. We don't want to hard code the port as we have no