diff --git a/pkg/monitor/monitor/util.go b/pkg/monitor/monitor/util.go index 53735d4d18f..943c7ea1b98 100644 --- a/pkg/monitor/monitor/util.go +++ b/pkg/monitor/monitor/util.go @@ -328,10 +328,6 @@ func getMonitorInitContainer(monitor *v1alpha1.TidbMonitor, tc *v1alpha1.TidbClu Name: "GF_TIDB_PROMETHEUS_URL", Value: "http://127.0.0.1:9090", }, - { - Name: "TZ", - Value: monitor.Timezone(), - }, { Name: "TIDB_VERSION", Value: getAlertManagerRulesVersion(monitor), @@ -370,6 +366,13 @@ func getMonitorInitContainer(monitor *v1alpha1.TidbMonitor, tc *v1alpha1.TidbClu Value: tc.Namespace, }, }...) + } else { + container.Env = append(container.Env, []core.EnvVar{ + { + Name: "TZ", + Value: monitor.Timezone(), + }, + }...) } if monitor.Spec.Initializer.ImagePullPolicy != nil {