mirror of
https://github.com/containers/podman.git
synced 2025-12-03 19:59:39 +08:00
Add variable for global flags to runlabel
use $GLOBAL_OPTS to pass global flags to the runlabel command. Signed-off-by: Qi Wang <qiwan@redhat.com>
This commit is contained in:
@@ -18,6 +18,11 @@ var LsDockerfile = `
|
||||
FROM alpine:latest
|
||||
LABEL RUN ls -la`
|
||||
|
||||
var GlobalDockerfile = `
|
||||
FROM alpine:latest
|
||||
LABEL RUN echo \$GLOBAL_OPTS
|
||||
`
|
||||
|
||||
var _ = Describe("podman container runlabel", func() {
|
||||
var (
|
||||
tempdir string
|
||||
@@ -78,4 +83,18 @@ var _ = Describe("podman container runlabel", func() {
|
||||
Expect(result.ExitCode()).ToNot(Equal(0))
|
||||
|
||||
})
|
||||
|
||||
It("podman container runlabel global options", func() {
|
||||
image := "podman-global-test:ls"
|
||||
podmanTest.BuildImage(GlobalDockerfile, image, "false")
|
||||
result := podmanTest.Podman([]string{"--syslog", "--log-level", "debug", "container", "runlabel", "RUN", image})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result.ExitCode()).To(Equal(0))
|
||||
|
||||
Expect(result.OutputToString()).To(ContainSubstring("--syslog true"))
|
||||
Expect(result.OutputToString()).To(ContainSubstring("--log-level debug"))
|
||||
result = podmanTest.Podman([]string{"rmi", image})
|
||||
result.WaitWithDefaultTimeout()
|
||||
Expect(result.ExitCode()).To(Equal(0))
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user