Skip to content

Commit

Permalink
Merge pull request #11128 from rhatdan/timezone
Browse files Browse the repository at this point in the history
Handle timezone on server containers.conf
  • Loading branch information
openshift-ci[bot] authored Aug 4, 2021
2 parents 9c2fc4b + f40a0e7 commit c887018
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions libpod/runtime_ctr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion test/e2e/containers_conf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit c887018

Please sign in to comment.