mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 23:47:50 +00:00
Kubectl exec support resource/name format
This commit is contained in:
@@ -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 == "" {
|
||||
|
||||
Reference in New Issue
Block a user