Kubectl exec support resource/name format

This commit is contained in:
Ahmad Nurus S
2019-02-02 21:12:11 +07:00
parent 20b76a2b4a
commit 0c39d7d380
6 changed files with 242 additions and 54 deletions

View File

@@ -78,6 +78,7 @@ const (
guestbookResponseTimeout = 3 * time.Minute
simplePodSelector = "name=nginx"
simplePodName = "nginx"
simplePodResourceName = "pod/nginx"
nginxDefaultOutput = "Welcome to nginx!"
simplePodPort = 80
pausePodSelector = "name=pause"
@@ -408,6 +409,14 @@ var _ = SIGDescribe("Kubectl client", func() {
}
})
ginkgo.It("should support exec using resource/name", func() {
ginkgo.By("executing a command in the container")
execOutput := framework.RunKubectlOrDie("exec", fmt.Sprintf("--namespace=%v", ns), simplePodResourceName, "echo", "running", "in", "container")
if e, a := "running in container", strings.TrimSpace(execOutput); e != a {
framework.Failf("Unexpected kubectl exec output. Wanted %q, got %q", e, a)
}
})
ginkgo.It("should support exec through an HTTP proxy", func() {
// Fail if the variable isn't set
if framework.TestContext.Host == "" {