podman: fix --log-opt=path=%s

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
Giuseppe Scrivano 2020-04-24 12:50:13 +02:00
parent 145d74716c
commit 3eeb03d1f9
No known key found for this signature in database
GPG Key ID: E4730F97F60286ED
2 changed files with 8 additions and 2 deletions

View File

@ -602,7 +602,14 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string
if len(split) < 2 {
return errors.Errorf("invalid log option %q", o)
}
logOpts[split[0]] = split[1]
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]
}
}
s.LogConfiguration.Options = logOpts
s.Name = c.Name

View File

@ -469,7 +469,6 @@ var _ = Describe("Podman run", func() {
})
It("podman run log-opt", func() {
Skip(v2fail)
log := filepath.Join(podmanTest.TempDir, "/container.log")
session := podmanTest.Podman([]string{"run", "--rm", "--log-opt", fmt.Sprintf("path=%s", log), ALPINE, "ls"})
session.WaitWithDefaultTimeout()