Merge pull request #11128 from rhatdan/timezone

Handle timezone on server containers.conf
This commit is contained in:
openshift-ci[bot]
2021-08-04 18:47:18 +00:00
committed by GitHub
2 changed files with 11 additions and 1 deletions

View File

@ -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 {
// Remove information about bind mount
// for new container from imported checkpoint

View File

@ -261,10 +261,16 @@ var _ = Describe("Podman run", func() {
It("podman run containers.conf timezone", func() {
//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()
Expect(session).Should(Exit(0))
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() {