Handle timezone on server containers.conf
Fixes: https://github.com/containers/podman/issues/11124 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Signed-off-by: Daniel J Walsh <dwalsh@localhost.localdomain> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
parent
3a922cbc99
commit
f40a0e7c81
|
@ -353,6 +353,10 @@ func (r *Runtime) setupContainer(ctx context.Context, ctr *Container) (_ *Contai
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ctr.config.Timezone == "" {
|
||||||
|
ctr.config.Timezone = r.config.Containers.TZ
|
||||||
|
}
|
||||||
|
|
||||||
if ctr.restoreFromCheckpoint {
|
if ctr.restoreFromCheckpoint {
|
||||||
// Remove information about bind mount
|
// Remove information about bind mount
|
||||||
// for new container from imported checkpoint
|
// for new container from imported checkpoint
|
||||||
|
|
|
@ -261,10 +261,16 @@ var _ = Describe("Podman run", func() {
|
||||||
|
|
||||||
It("podman run containers.conf timezone", func() {
|
It("podman run containers.conf timezone", func() {
|
||||||
//containers.conf timezone set to Pacific/Honolulu
|
//containers.conf timezone set to Pacific/Honolulu
|
||||||
session := podmanTest.Podman([]string{"run", ALPINE, "date", "+'%H %Z'"})
|
session := podmanTest.Podman([]string{"run", "--tz", "", ALPINE, "date", "+'%H %Z'"})
|
||||||
session.WaitWithDefaultTimeout()
|
session.WaitWithDefaultTimeout()
|
||||||
Expect(session).Should(Exit(0))
|
Expect(session).Should(Exit(0))
|
||||||
Expect(session.OutputToString()).To(ContainSubstring("HST"))
|
Expect(session.OutputToString()).To(ContainSubstring("HST"))
|
||||||
|
|
||||||
|
// verify flag still overrides
|
||||||
|
session = podmanTest.Podman([]string{"run", "--tz", "EST", ALPINE, "date", "+'%H %Z'"})
|
||||||
|
session.WaitWithDefaultTimeout()
|
||||||
|
Expect(session).Should(Exit(0))
|
||||||
|
Expect(session.OutputToString()).To(ContainSubstring("EST"))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("podman run containers.conf umask", func() {
|
It("podman run containers.conf umask", func() {
|
||||||
|
|
Loading…
Reference in New Issue