Skip to content

Commit

Permalink
Merge pull request #1772 from saschagrunert/tzdir
Browse files Browse the repository at this point in the history
Allow searching `$TZDIR` for timezone data
  • Loading branch information
openshift-merge-bot[bot] authored Dec 20, 2023
2 parents 405c428 + 11bd9aa commit a328c8c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/config/config_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ func (c *ContainersConfig) validateTZ() error {
"/etc/zoneinfo",
}

// Allow using TZDIR per:
// https://sourceware.org/git/?p=glibc.git;a=blob;f=time/tzfile.c;h=8a923d0cccc927a106dc3e3c641be310893bab4e;hb=HEAD#l149
tzdir := os.Getenv("TZDIR")
if tzdir != "" {
lookupPaths = append(lookupPaths, tzdir)
}

for _, paths := range lookupPaths {
zonePath := filepath.Join(paths, c.TZ)
if _, err := os.Stat(zonePath); err == nil {
Expand Down

0 comments on commit a328c8c

Please sign in to comment.