Conversation
|
@solidnerd Request review |
|
@gjrtimmer Thanks for the PR! Would mounting |
|
@splattael Never tested that, and I don't know if it would be a solution. I think there would be quite a few situations where there is a complete different timezone between the containers and the host. With this fix it the container will get the correct timezone. Got this fix from This image might even be used by parties that are hosting gitlab environments for clients in different timezone. So I don't want to mount the localtime from the host I want to set it correctly. |
|
@solidnerd @sameersbn Any Update |
94ab5d9 to
21108a8
Compare
|
Rebased on new master |
21108a8 to
60652dc
Compare
|
@solidnerd Rebased on new master |
60652dc to
4324367
Compare
|
@solidnerd Rebased to 11.5.0 |
4324367 to
0494c2f
Compare
|
Rebased to 11.5.1 |
0494c2f to
7b1099c
Compare
|
@solidnerd rebased |
7b1099c to
90759c9
Compare
90759c9 to
2a00b8a
Compare
|
@solidnerd Rebased |
|
@gjrtimmer Hi is there a reason you don't just set the We have been using this since we started and we don't have issues with timezones/cron. |
|
sorry about the delay in attending to this PR. I really have no issues getting it merged but I am just curious to know if there is a use-case that just setting the |
Sorry for the delay; I have environment variable TZ=Europe/Amsterdam set on the container. Still the shell is not reporting the current correct time which results that for example my backup files have an offset of 2 hours because of GMT+2 (Daylight Saving Time). Proposed PR would fix that; as noted in the change in the README; this PR will also fix the timestamp being used within the CRON. |
2a00b8a to
6d7661a
Compare
|
@solidnerd @sameersbn Rebased & Implemented conversation suggestion |
|
@solidnerd @sameersbn Why is the build not completing ? |
|
needs a rebase. |
Fix Container TimeZone Fix Container TimeZone
Resolve conversation
|
@sameersbn Rebased, very sorry for the delay |
Gitlab can have a different timezone in relation to the container
Introduction
Default the containers run with timezone set to
UTC, which means that the cron daemon can be using a different timezone than gitlab, because the timezone from gitlab can be configured withGITLAB_TIMEZONE.Use case
My current TimeZone is
Europe/AmsterdamGitlab has the corrent time, but because the container time isUTCit means that the cron daemon which runs the backups does this ` hour to early.Provided solution
configure_container_timezone()->assets/runtime/functionsconfigure_container_timezone()to functionconfigure_system()before the functioninstall_configuration_templatesbecause timezone is a lower level then templates.TZGITLAB_TIMZONEconfigure_container_timezone()
The provided function has a sanity check which will use
UTCas default. The sanity check will check that the user provided value is a valid timezone, by checking if the provided timezone exists within thetzdatazoneinfo.Configuration
Container TimeZone will use the environment variable
TZ, and defaults toUTC. The variableTZexpects values in Canonical format. Link to acceptable values has been added to the README. The format which is expected causes that theGITLAB_TIMEZONEcannot be used here becauseGITLAB_TIMEZONEcan accept timezone in different formats.