diff options
author | Ashley Cui <acui@redhat.com> | 2020-06-30 17:21:52 -0400 |
---|---|---|
committer | Ashley Cui <acui@redhat.com> | 2020-07-02 13:30:59 -0400 |
commit | 9a1543caec75a7b02dd2ec9a1111756bb1716454 (patch) | |
tree | fb1223410fe7ce9e0831a39c73a70bd9efa0caee /pkg | |
parent | e84695213e35c22ba085e3831cbd025cd55a4c84 (diff) | |
download | podman-9a1543caec75a7b02dd2ec9a1111756bb1716454.tar.gz podman-9a1543caec75a7b02dd2ec9a1111756bb1716454.tar.bz2 podman-9a1543caec75a7b02dd2ec9a1111756bb1716454.zip |
Add --tz flag to create, run
--tz flag sets timezone inside container
Can be set to IANA timezone as well as `local` to match host machine
Signed-off-by: Ashley Cui <acui@redhat.com>
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/specgen/generate/container_create.go | 4 | ||||
-rw-r--r-- | pkg/specgen/specgen.go | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/pkg/specgen/generate/container_create.go b/pkg/specgen/generate/container_create.go index 7b4fbebf4..160a0fa55 100644 --- a/pkg/specgen/generate/container_create.go +++ b/pkg/specgen/generate/container_create.go @@ -135,6 +135,10 @@ func createContainerOptions(ctx context.Context, rt *libpod.Runtime, s *specgen. options = append(options, libpod.WithStdin()) } + if s.Timezone != "" { + options = append(options, libpod.WithTimezone(s.Timezone)) + } + useSystemd := false switch s.Systemd { case "always": diff --git a/pkg/specgen/specgen.go b/pkg/specgen/specgen.go index 361f09379..fe735bc1f 100644 --- a/pkg/specgen/specgen.go +++ b/pkg/specgen/specgen.go @@ -135,6 +135,9 @@ type ContainerBasicConfig struct { // passed will be 3 + PreserveFDs. // set tags as `json:"-"` for not supported remote PreserveFDs uint `json:"-"` + // Timezone is the timezone inside the container. + // Local means it has the same timezone as the host machine + Timezone string `json:"timezone,omitempty"` } // ContainerStorageConfig contains information on the storage configuration of a |