mirror of
https://github.com/containers/podman.git
synced 2025-12-17 21:21:33 +08:00
podman: fix --log-opt=path=%s
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@@ -602,8 +602,15 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string
|
|||||||
if len(split) < 2 {
|
if len(split) < 2 {
|
||||||
return errors.Errorf("invalid log option %q", o)
|
return errors.Errorf("invalid log option %q", o)
|
||||||
}
|
}
|
||||||
|
switch {
|
||||||
|
case split[0] == "driver":
|
||||||
|
s.LogConfiguration.Driver = split[1]
|
||||||
|
case split[0] == "path":
|
||||||
|
s.LogConfiguration.Path = split[1]
|
||||||
|
default:
|
||||||
logOpts[split[0]] = split[1]
|
logOpts[split[0]] = split[1]
|
||||||
}
|
}
|
||||||
|
}
|
||||||
s.LogConfiguration.Options = logOpts
|
s.LogConfiguration.Options = logOpts
|
||||||
s.Name = c.Name
|
s.Name = c.Name
|
||||||
|
|
||||||
|
|||||||
@@ -469,7 +469,6 @@ var _ = Describe("Podman run", func() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
It("podman run log-opt", func() {
|
It("podman run log-opt", func() {
|
||||||
Skip(v2fail)
|
|
||||||
log := filepath.Join(podmanTest.TempDir, "/container.log")
|
log := filepath.Join(podmanTest.TempDir, "/container.log")
|
||||||
session := podmanTest.Podman([]string{"run", "--rm", "--log-opt", fmt.Sprintf("path=%s", log), ALPINE, "ls"})
|
session := podmanTest.Podman([]string{"run", "--rm", "--log-opt", fmt.Sprintf("path=%s", log), ALPINE, "ls"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
|
|||||||
Reference in New Issue
Block a user