fix: embed timezone database via time/tzdata#476
Merged
Conversation
Adds `_ "time/tzdata"` import to main.go so the provider binary includes an embedded copy of the IANA Time Zone database. This ensures timezone operations work correctly even when the host system lacks tzdata (e.g. scratch/distroless Docker images). Fixes #470
Changes the integration test for coder_workspace_preset scheduling from timezone = "UTC" to timezone = "America/New_York". UTC is hardcoded in Go and always works regardless of tzdata availability, so it never caught the bug described in #470. Using a real IANA timezone like America/New_York ensures the test exercises time.LoadLocation against the timezone database and will fail in environments without system tzdata unless the time/tzdata package is embedded in the binary. Also removes the overzealous AST-based main_test.go that was added previously. Refs #470
time/tzdata importtime/tzdata
johnstcn
approved these changes
Feb 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
_ "time/tzdata"import tomain.gosotime.LoadLocationworks in containers without system tzdata (e.g. scratch/distroless images).Also changes the integration test timezone from
UTCtoAmerica/New_York—UTCis hardcoded in Go and never hitsLoadLocation, so it never caught this.Fixes #470