mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-08-05 00:15:44 +00:00
Merge pull request #29158 from Honny1/fix-args-inspect
Some checks failed
ci / path-filter (push) Has been cancelled
ci / Validate source code changes (push) Has been cancelled
ci / Cross Build (Linux, FreeBSD) (push) Has been cancelled
ci / build debian-sid (push) Has been cancelled
ci / build fedora-current (push) Has been cancelled
ci / build fedora-prior (push) Has been cancelled
ci / build fedora-rawhide (push) Has been cancelled
ci / windows installer hyperv (push) Has been cancelled
ci / windows installer wsl (push) Has been cancelled
ci / macos installer (push) Has been cancelled
zizmor: GitHub Actions Security Analysis / Zizmor (push) Has been cancelled
ci / int local root debian-sid (push) Has been cancelled
ci / sys local root debian-sid (push) Has been cancelled
ci / int local rootless debian-sid (push) Has been cancelled
ci / sys local rootless debian-sid (push) Has been cancelled
ci / int remote root debian-sid (push) Has been cancelled
ci / sys remote root debian-sid (push) Has been cancelled
ci / bud local root fedora-current (push) Has been cancelled
ci / int local root fedora-current (push) Has been cancelled
ci / sys local root fedora-current (push) Has been cancelled
ci / int local rootless fedora-current (push) Has been cancelled
ci / sys local rootless fedora-current (push) Has been cancelled
ci / bud remote root fedora-current (push) Has been cancelled
ci / int remote root fedora-current (push) Has been cancelled
ci / sys remote root fedora-current (push) Has been cancelled
ci / int remote rootless fedora-current (push) Has been cancelled
ci / sys remote rootless fedora-current (push) Has been cancelled
ci / int local root fedora-prior (push) Has been cancelled
ci / sys local root fedora-prior (push) Has been cancelled
ci / int local rootless fedora-prior (push) Has been cancelled
ci / sys local rootless fedora-prior (push) Has been cancelled
ci / int remote root fedora-prior (push) Has been cancelled
ci / sys remote root fedora-prior (push) Has been cancelled
ci / int local root fedora-rawhide (push) Has been cancelled
ci / sys local root fedora-rawhide (push) Has been cancelled
ci / int local rootless fedora-rawhide (push) Has been cancelled
ci / sys local rootless fedora-rawhide (push) Has been cancelled
ci / int remote root fedora-rawhide (push) Has been cancelled
ci / sys remote root fedora-rawhide (push) Has been cancelled
ci / apiv2 root fedora-current (push) Has been cancelled
ci / bindings root fedora-current (push) Has been cancelled
ci / compose_v2 root fedora-current (push) Has been cancelled
ci / docker_py root fedora-current (push) Has been cancelled
ci / unit root fedora-current (push) Has been cancelled
ci / apiv2 rootless fedora-current (push) Has been cancelled
ci / compose_v2 rootless fedora-current (push) Has been cancelled
ci / unit rootless fedora-current (push) Has been cancelled
ci / upgrade v5.3.1 root fedora-current (push) Has been cancelled
ci / upgrade v5.6.2 root fedora-current (push) Has been cancelled
ci / machine linux amd64 (push) Has been cancelled
ci / windows unit (push) Has been cancelled
ci / windows e2e (push) Has been cancelled
ci / windows machine hyperv (push) Has been cancelled
ci / windows machine wsl (push) Has been cancelled
ci / macos machine applehv (push) Has been cancelled
ci / macos machine libkrun (push) Has been cancelled
ci / Total Success (push) Has been cancelled
Some checks failed
ci / path-filter (push) Has been cancelled
ci / Validate source code changes (push) Has been cancelled
ci / Cross Build (Linux, FreeBSD) (push) Has been cancelled
ci / build debian-sid (push) Has been cancelled
ci / build fedora-current (push) Has been cancelled
ci / build fedora-prior (push) Has been cancelled
ci / build fedora-rawhide (push) Has been cancelled
ci / windows installer hyperv (push) Has been cancelled
ci / windows installer wsl (push) Has been cancelled
ci / macos installer (push) Has been cancelled
zizmor: GitHub Actions Security Analysis / Zizmor (push) Has been cancelled
ci / int local root debian-sid (push) Has been cancelled
ci / sys local root debian-sid (push) Has been cancelled
ci / int local rootless debian-sid (push) Has been cancelled
ci / sys local rootless debian-sid (push) Has been cancelled
ci / int remote root debian-sid (push) Has been cancelled
ci / sys remote root debian-sid (push) Has been cancelled
ci / bud local root fedora-current (push) Has been cancelled
ci / int local root fedora-current (push) Has been cancelled
ci / sys local root fedora-current (push) Has been cancelled
ci / int local rootless fedora-current (push) Has been cancelled
ci / sys local rootless fedora-current (push) Has been cancelled
ci / bud remote root fedora-current (push) Has been cancelled
ci / int remote root fedora-current (push) Has been cancelled
ci / sys remote root fedora-current (push) Has been cancelled
ci / int remote rootless fedora-current (push) Has been cancelled
ci / sys remote rootless fedora-current (push) Has been cancelled
ci / int local root fedora-prior (push) Has been cancelled
ci / sys local root fedora-prior (push) Has been cancelled
ci / int local rootless fedora-prior (push) Has been cancelled
ci / sys local rootless fedora-prior (push) Has been cancelled
ci / int remote root fedora-prior (push) Has been cancelled
ci / sys remote root fedora-prior (push) Has been cancelled
ci / int local root fedora-rawhide (push) Has been cancelled
ci / sys local root fedora-rawhide (push) Has been cancelled
ci / int local rootless fedora-rawhide (push) Has been cancelled
ci / sys local rootless fedora-rawhide (push) Has been cancelled
ci / int remote root fedora-rawhide (push) Has been cancelled
ci / sys remote root fedora-rawhide (push) Has been cancelled
ci / apiv2 root fedora-current (push) Has been cancelled
ci / bindings root fedora-current (push) Has been cancelled
ci / compose_v2 root fedora-current (push) Has been cancelled
ci / docker_py root fedora-current (push) Has been cancelled
ci / unit root fedora-current (push) Has been cancelled
ci / apiv2 rootless fedora-current (push) Has been cancelled
ci / compose_v2 rootless fedora-current (push) Has been cancelled
ci / unit rootless fedora-current (push) Has been cancelled
ci / upgrade v5.3.1 root fedora-current (push) Has been cancelled
ci / upgrade v5.6.2 root fedora-current (push) Has been cancelled
ci / machine linux amd64 (push) Has been cancelled
ci / windows unit (push) Has been cancelled
ci / windows e2e (push) Has been cancelled
ci / windows machine hyperv (push) Has been cancelled
ci / windows machine wsl (push) Has been cancelled
ci / macos machine applehv (push) Has been cancelled
ci / macos machine libkrun (push) Has been cancelled
ci / Total Success (push) Has been cancelled
Fix duplicated command in inspect Args when container has single-elenent command
This commit is contained in:
commit
ac46410007
3 changed files with 22 additions and 5 deletions
|
|
@ -77,8 +77,6 @@ func (c *Container) getContainerInspectData(size bool, driverData *define.Driver
|
|||
var path string
|
||||
if len(args) > 0 {
|
||||
path = args[0]
|
||||
}
|
||||
if len(args) > 1 {
|
||||
args = args[1:]
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -500,7 +500,7 @@ var _ = Describe("Podman pod create", func() {
|
|||
check2 := podmanTest.Podman([]string{"container", "inspect", "--format", "{{.Path}}:{{.Args}}", data.Containers[0].ID})
|
||||
check2.WaitWithDefaultTimeout()
|
||||
Expect(check2).Should(ExitCleanly())
|
||||
Expect(check2.OutputToString()).To(Equal("/pause1:[/pause1]"))
|
||||
Expect(check2.OutputToString()).To(Equal("/pause1:[]"))
|
||||
})
|
||||
|
||||
It("podman create pod with --infra-image", func() {
|
||||
|
|
@ -527,7 +527,7 @@ entrypoint ["/fromimage"]
|
|||
check2 := podmanTest.Podman([]string{"container", "inspect", "--format", "{{.Path}}:{{.Args}}", data.Containers[0].ID})
|
||||
check2.WaitWithDefaultTimeout()
|
||||
Expect(check2).Should(ExitCleanly())
|
||||
Expect(check2.OutputToString()).To(Equal("/fromimage:[/fromimage]"))
|
||||
Expect(check2.OutputToString()).To(Equal("/fromimage:[]"))
|
||||
})
|
||||
|
||||
It("podman create pod with --infra-command --infra-image", func() {
|
||||
|
|
@ -554,7 +554,7 @@ entrypoint ["/fromimage"]
|
|||
check2 := podmanTest.Podman([]string{"container", "inspect", "--format", "{{.Path}}:{{.Args}}", data.Containers[0].ID})
|
||||
check2.WaitWithDefaultTimeout()
|
||||
Expect(check2).Should(ExitCleanly())
|
||||
Expect(check2.OutputToString()).To(Equal("/fromcommand:[/fromcommand]"))
|
||||
Expect(check2.OutputToString()).To(Equal("/fromcommand:[]"))
|
||||
})
|
||||
|
||||
It("podman pod status test", func() {
|
||||
|
|
|
|||
|
|
@ -1961,4 +1961,23 @@ spec:
|
|||
run_podman rmi $image
|
||||
}
|
||||
|
||||
# bats test_tags=ci:parallel
|
||||
@test "podman inspect - Args does not duplicate Path for single command" {
|
||||
cname=c_$(safename)
|
||||
|
||||
run_podman run --name $cname -d $IMAGE top -b
|
||||
run_podman inspect $cname --format '{{.Path}}'
|
||||
is "$output" "top" ".Path is the command"
|
||||
run_podman inspect $cname --format '{{join .Args " "}}'
|
||||
is "$output" "-b" ".Args holds only the arguments after the command"
|
||||
run_podman rm -f $cname
|
||||
|
||||
run_podman run --name $cname -d $IMAGE top
|
||||
run_podman inspect $cname --format '{{.Path}}'
|
||||
is "$output" "top" ".Path is the command"
|
||||
run_podman inspect $cname --format '{{len .Args}}'
|
||||
is "$output" "0" ".Args should be empty when command has no arguments"
|
||||
run_podman rm -f $cname
|
||||
}
|
||||
|
||||
# vim: filetype=sh
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue