From 76c4ea76822ea18754a0fbf56895f8f1f9eae6c5 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Fri, 4 Nov 2022 16:44:38 -0700 Subject: [PATCH] force all internal MinIO operations to be under UTC (#16009) --- internal/init/init.go | 7 +++++++ internal/init/init_darwin_amd64.go | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/internal/init/init.go b/internal/init/init.go index 7d0c432f8..36b9fe93a 100644 --- a/internal/init/init.go +++ b/internal/init/init.go @@ -16,3 +16,10 @@ // along with this program. If not, see . package init + +import "os" + +func init() { + // All MinIO operations must be under UTC. + os.Setenv("TZ", "UTC") +} diff --git a/internal/init/init_darwin_amd64.go b/internal/init/init_darwin_amd64.go index 7bc01758e..b72ba2a04 100644 --- a/internal/init/init_darwin_amd64.go +++ b/internal/init/init_darwin_amd64.go @@ -18,10 +18,15 @@ package init import ( + "os" + "github.com/klauspost/cpuid/v2" ) func init() { + // All MinIO operations must be under UTC. + os.Setenv("TZ", "UTC") + // Temporary workaround for // https://github.com/golang/go/issues/49233 // Keep until upstream has been fixed.