Skip to content

Commit

Permalink
test: check restart policy of init containers
Browse files Browse the repository at this point in the history
make the sure restart policy is "no" for init containers created by
`podman kube play`

Signed-off-by: Tony Duan <[email protected]>
  • Loading branch information
tony84727 committed May 10, 2023
1 parent 5322071 commit 74a5b92
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/e2e/play_kube_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2234,6 +2234,12 @@ var _ = Describe("Podman play kube", func() {
Expect(inspect).Should(Exit(0))
Expect(inspect.OutputToString()).To(ContainSubstring("running"))

// Init containers should not be restarted
inspect = podmanTest.Podman([]string{"inspect", "--format", "{{ .HostConfig.RestartPolicy.Name }}", "testPod-" + defaultCtrName})
inspect.WaitWithDefaultTimeout()
Expect(inspect).Should(Exit(0))
Expect(inspect.OutputToString()).To(ContainSubstring(define.RestartPolicyNo))

// Init containers need environment too! #18384
logs := podmanTest.Podman([]string{"logs", "testPod-init-test"})
logs.WaitWithDefaultTimeout()
Expand Down

0 comments on commit 74a5b92

Please sign in to comment.