Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --tz flag to create, run #6836

Merged
merged 1 commit into from
Jul 6, 2020

Conversation

ashley-cui
Copy link
Member

@ashley-cui ashley-cui commented Jul 1, 2020

--tz flag sets timezone inside container
Can be set to IANA timezone as well as local to match host machine

Closes #5128

Signed-off-by: Ashley Cui [email protected]

@openshift-ci-robot openshift-ci-robot requested review from baude and mheon July 1, 2020 17:58
@ashley-cui
Copy link
Member Author

@rhatdan PTAL

docs/source/markdown/podman-create.1.md Outdated Show resolved Hide resolved
docs/source/markdown/podman-run.1.md Outdated Show resolved Hide resolved
@@ -449,6 +449,11 @@ func GetCreateFlags(cf *ContainerCLIOpts) *pflag.FlagSet {
"tty", "t", false,
"Allocate a pseudo-TTY for container",
)
createFlags.StringVar(
&cf.TZ,
"tz", containerConfig.TZ(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do in podman-remote?

Copy link
Member Author

@ashley-cui ashley-cui Jul 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, I haven't done anything in the remote area, should I add the remote implementation to this PR as well? Or save it for another

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you don't do it here, i would exect you to wire up the tz stuff asap for the api (remote) side.

Copy link
Member Author

@ashley-cui ashley-cui Jul 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can definitely do that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@baude uhh it looks like somehow i actually got this wired to the api remote side without knowing i did. pleasant surprise(?)

docs/source/markdown/podman-run.1.md Outdated Show resolved Hide resolved
libpod/container.go Outdated Show resolved Hide resolved
libpod/container_internal_linux.go Outdated Show resolved Hide resolved
@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ashley-cui, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 1, 2020
test/e2e/create_test.go Outdated Show resolved Hide resolved
libpod/container.go Outdated Show resolved Hide resolved
libpod/options.go Outdated Show resolved Hide resolved
pkg/specgen/specgen.go Outdated Show resolved Hide resolved
@mheon
Copy link
Member

mheon commented Jul 2, 2020

I see that a lot of the timezones are symlinks in non-Red Hat OSes; we might need to do some sort of resolution on the link to get the correct target. For example: In Debian, the GB timezone is a symlink (GB -> Europe/London). We should also have some sort of detection to ensure we don't accidentally mount in an entire folder if the user specifies Australia as a timezone, instead of Australia/Brisbane

@ashley-cui
Copy link
Member Author

@mheon Ooh, thanks, great point! I'll add that in now, a simple IsDir and EvalSymlinks should suffice?

@mheon
Copy link
Member

mheon commented Jul 2, 2020

Yeah, those should be fine

@ashley-cui ashley-cui force-pushed the tzlibpod branch 3 times, most recently from adaa637 to c2a0d90 Compare July 2, 2020 17:28
--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 <[email protected]>
@ashley-cui
Copy link
Member Author

@mheon @rhatdan fixed it up and added a few more tests, PTAL

@rhatdan
Copy link
Member

rhatdan commented Jul 2, 2020

LGTM

@mheon
Copy link
Member

mheon commented Jul 6, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 6, 2020
@openshift-merge-robot openshift-merge-robot merged commit 9532509 into containers:master Jul 6, 2020
@ashley-cui ashley-cui deleted the tzlibpod branch July 6, 2020 17:28
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add flag to podman run/create to automatically set the timezone in container to match host.
7 participants