mirror of
https://github.com/outbackdingo/kubernetes.git
synced 2026-02-18 00:40:32 +00:00
Merge pull request #90448 from soltysh/issue87851
Fix run command when waiting for pods
This commit is contained in:
@@ -522,13 +522,21 @@ var _ = SIGDescribe("Kubectl client", func() {
|
||||
_, err = framework.NewKubectlCommand(ns, nsFlag, "run", "-i", "--image="+busyboxImage, "--restart=OnFailure", "failure-2", "--", "/bin/sh", "-c", "cat && exit 42").
|
||||
WithStdinData("abcd1234").
|
||||
Exec()
|
||||
framework.ExpectNoError(err)
|
||||
ee, ok = err.(uexec.ExitError)
|
||||
framework.ExpectEqual(ok, true)
|
||||
if !strings.Contains(ee.String(), "timed out") {
|
||||
framework.Failf("Missing expected 'timed out' error, got: %#v", ee)
|
||||
}
|
||||
|
||||
ginkgo.By("running a failing command without --restart=Never, but with --rm")
|
||||
_, err = framework.NewKubectlCommand(ns, nsFlag, "run", "-i", "--image="+busyboxImage, "--restart=OnFailure", "--rm", "failure-3", "--", "/bin/sh", "-c", "cat && exit 42").
|
||||
WithStdinData("abcd1234").
|
||||
Exec()
|
||||
framework.ExpectNoError(err)
|
||||
ee, ok = err.(uexec.ExitError)
|
||||
framework.ExpectEqual(ok, true)
|
||||
if !strings.Contains(ee.String(), "timed out") {
|
||||
framework.Failf("Missing expected 'timed out' error, got: %#v", ee)
|
||||
}
|
||||
e2epod.WaitForPodToDisappear(f.ClientSet, ns, "failure-3", labels.Everything(), 2*time.Second, wait.ForeverTestTimeout)
|
||||
|
||||
ginkgo.By("running a failing command with --leave-stdin-open")
|
||||
|
||||
Reference in New Issue
Block a user