From 6e568857f734b190d3220ddf7e6c2ceb83594b4d Mon Sep 17 00:00:00 2001
From: Pascal Bleser
Date: Thu, 3 Dec 2026 14:13:21 +0100
Subject: [PATCH] chore: 4200: import the time zone data explicitly
With TZ, the revision cleanup counts days in that time zone (#4200). The
container image (alpine) has no time zone files, so TZ only works there
because the binary embeds the time zone data, which today it does only
because a dependency, OPA, imports time/tzdata. Import it explicitly, so
that TZ doesn't stop working unnoticed when that dependency changes.
No change in behavior, nor in the size of the binary.
https://github.com/opencloud-eu/opencloud/issues/4200
Assisted-by: Claude Code:claude-opus-5-5
---
opencloud/cmd/opencloud/main.go | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/opencloud/cmd/opencloud/main.go b/opencloud/cmd/opencloud/main.go
index 7968efc1d8..0de22cda36 100644
--- a/opencloud/cmd/opencloud/main.go
+++ b/opencloud/cmd/opencloud/main.go
@@ -3,6 +3,10 @@ package main
import (
"fmt"
"os"
+ // the time zone data, so that TZ works in container images without time zone files,
+ // e.g. for the revision cleanup, which counts days in the local time zone; a
+ // dependency (OPA) imports it as well, but that's nothing to rely on
+ _ "time/tzdata"
"github.com/opencloud-eu/opencloud/opencloud/pkg/command"
)