Merge pull request #7575 from rhatdan/runlabel
Fix podman container runlabel --display
This commit is contained in:
commit
08b602043e
|
|
@ -36,6 +36,11 @@ func (ic *ContainerEngine) ContainerRunlabel(ctx context.Context, label string,
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if options.Display {
|
||||||
|
fmt.Printf("command: %s\n", strings.Join(append([]string{os.Args[0]}, cmd[1:]...), " "))
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
stdErr := os.Stderr
|
stdErr := os.Stderr
|
||||||
stdOut := os.Stdout
|
stdOut := os.Stdout
|
||||||
stdIn := os.Stdin
|
stdIn := os.Stdin
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,21 @@ var _ = Describe("podman container runlabel", func() {
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
Expect(result.ExitCode()).To(Equal(0))
|
Expect(result.ExitCode()).To(Equal(0))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
It("podman container runlabel --display", func() {
|
||||||
|
SkipIfRemote()
|
||||||
|
image := "podman-runlabel-test:ls"
|
||||||
|
podmanTest.BuildImage(LsDockerfile, image, "false")
|
||||||
|
|
||||||
|
result := podmanTest.Podman([]string{"container", "runlabel", "--display", "RUN", image})
|
||||||
|
result.WaitWithDefaultTimeout()
|
||||||
|
Expect(result.ExitCode()).To(Equal(0))
|
||||||
|
Expect(result.OutputToString()).To(ContainSubstring(podmanTest.PodmanBinary + " -la"))
|
||||||
|
|
||||||
|
result = podmanTest.Podman([]string{"rmi", image})
|
||||||
|
result.WaitWithDefaultTimeout()
|
||||||
|
Expect(result.ExitCode()).To(Equal(0))
|
||||||
|
})
|
||||||
It("podman container runlabel bogus label should result in non-zero exit code", func() {
|
It("podman container runlabel bogus label should result in non-zero exit code", func() {
|
||||||
result := podmanTest.Podman([]string{"container", "runlabel", "RUN", ALPINE})
|
result := podmanTest.Podman([]string{"container", "runlabel", "RUN", ALPINE})
|
||||||
result.WaitWithDefaultTimeout()
|
result.WaitWithDefaultTimeout()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue