mirror of
https://github.com/containers/podman.git
synced 2025-12-04 04:09:40 +08:00
vendor latest c/{buildah,common,image,storage}
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
14
vendor/github.com/containers/common/pkg/timezone/timezone.go
generated
vendored
14
vendor/github.com/containers/common/pkg/timezone/timezone.go
generated
vendored
@@ -23,18 +23,20 @@ func ConfigureContainerTimeZone(timezone, containerRunDir, mountPoint, etcPath,
|
||||
switch {
|
||||
case timezone == "":
|
||||
return "", nil
|
||||
case os.Getenv("TZDIR") != "":
|
||||
// Allow using TZDIR per:
|
||||
// https://sourceware.org/git/?p=glibc.git;a=blob;f=time/tzfile.c;h=8a923d0cccc927a106dc3e3c641be310893bab4e;hb=HEAD#l149
|
||||
|
||||
timezonePath = filepath.Join(os.Getenv("TZDIR"), timezone)
|
||||
case timezone == "local":
|
||||
timezonePath, err = filepath.EvalSymlinks("/etc/localtime")
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("finding local timezone for container %s: %w", containerID, err)
|
||||
}
|
||||
default:
|
||||
timezonePath = filepath.Join("/usr/share/zoneinfo", timezone)
|
||||
// Allow using TZDIR per:
|
||||
// https://sourceware.org/git/?p=glibc.git;a=blob;f=time/tzfile.c;h=8a923d0cccc927a106dc3e3c641be310893bab4e;hb=HEAD#l149
|
||||
zoneinfo := os.Getenv("TZDIR")
|
||||
if zoneinfo == "" {
|
||||
// default zoneinfo location
|
||||
zoneinfo = "/usr/share/zoneinfo"
|
||||
}
|
||||
timezonePath = filepath.Join(zoneinfo, timezone)
|
||||
}
|
||||
|
||||
etcFd, err := openDirectory(etcPath)
|
||||
|
||||
Reference in New Issue
Block a user