From 247498492afa2c2d17d64185ab46bebbdf48ef22 Mon Sep 17 00:00:00 2001 From: Serhii Ponomarenko <116438358+tiptophelmet@users.noreply.github.com> Date: Tue, 19 Mar 2024 13:06:50 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Set=20custom=20timezone=20(#1517)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🔨 Add timezone config * 🔨 Update `complete.yaml` * 📝 Document `timezone` config * 📝 Update `timezone` config docs * 📝 Update `timezone` config docs * 🔥 Remove unused `TIMEZONE` field from `ConfigMap` * 🦺 Handle empty `tap.timezone` case * 🔨 Move `timezone` from `.Values.tap` to `.Values` * 🔨 Add `timezone` field to helm values * 🔨 Update `complete.yaml` * 📝 Update `timezone` config docs * 🔨 Add `TIMEZONE` field to `ConfigMap` --------- Co-authored-by: Alon Girmonsky <1990761+alongir@users.noreply.github.com> --- config/configStruct.go | 1 + helm-chart/README.md | 1 + helm-chart/templates/06-front-deployment.yaml | 2 ++ helm-chart/templates/12-config-map.yaml | 1 + helm-chart/values.yaml | 1 + manifests/complete.yaml | 2 ++ 6 files changed, 8 insertions(+) diff --git a/config/configStruct.go b/config/configStruct.go index b3d474325..068bf0bd0 100644 --- a/config/configStruct.go +++ b/config/configStruct.go @@ -96,6 +96,7 @@ type ConfigStruct struct { License string `yaml:"license" json:"license" default:""` Scripting configStructs.ScriptingConfig `yaml:"scripting" json:"scripting"` Manifests ManifestsConfig `yaml:"manifests,omitempty" json:"manifests,omitempty"` + Timezone string `yaml:"timezone" json:"timezone"` } func (config *ConfigStruct) ImagePullPolicy() v1.PullPolicy { diff --git a/helm-chart/README.md b/helm-chart/README.md index 47d0b7120..cde69126d 100644 --- a/helm-chart/README.md +++ b/helm-chart/README.md @@ -173,6 +173,7 @@ Please refer to [metrics](./metrics.md) documentation for details. | `scripting.source` | Source directory of the scripts | `""` | | `scripting.watchScripts` | Enable watch mode for the scripts in source directory | `true` | | `tap.metrics.port` | Pod port used to expose Prometheus metrics | `49100` | +| `timezone` | IANA time zone applied to time shown in the front-end | `""` (local time zone applies) | KernelMapping pairs kernel versions with a DriverContainer image. Kernel versions can be matched diff --git a/helm-chart/templates/06-front-deployment.yaml b/helm-chart/templates/06-front-deployment.yaml index 0dc4d5b6d..c088ea3d5 100644 --- a/helm-chart/templates/06-front-deployment.yaml +++ b/helm-chart/templates/06-front-deployment.yaml @@ -32,6 +32,8 @@ spec: value: '{{ not (eq .Values.tap.auth.type "") | ternary .Values.tap.auth.type " " }}' - name: REACT_APP_AUTH_SAML_IDP_METADATA_URL value: '{{ not (eq .Values.tap.auth.saml.idpMetadataUrl "") | ternary .Values.tap.auth.saml.idpMetadataUrl " " }}' + - name: REACT_APP_TIMEZONE + value: '{{ not (eq .Values.timezone "") | ternary .Values.timezone " " }}' - name: REACT_APP_REPLAY_DISABLED value: '{{ .Values.tap.replayDisabled }}' - name: REACT_APP_SCRIPTING_DISABLED diff --git a/helm-chart/templates/12-config-map.yaml b/helm-chart/templates/12-config-map.yaml index 4f9feb6a9..936bb9932 100644 --- a/helm-chart/templates/12-config-map.yaml +++ b/helm-chart/templates/12-config-map.yaml @@ -28,3 +28,4 @@ data: JSON_TTL: '{{ .Values.tap.misc.jsonTTL }}' PCAP_TTL: '{{ .Values.tap.misc.pcapTTL }}' PCAP_ERROR_TTL: '{{ .Values.tap.misc.pcapErrorTTL }}' + TIMEZONE: '{{ not (eq .Values.timezone "") | ternary .Values.timezone " " }}' diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 65c5ee738..2717988a9 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -128,3 +128,4 @@ scripting: env: {} source: "" watchScripts: true +timezone: "" diff --git a/manifests/complete.yaml b/manifests/complete.yaml index fa8011dd1..386abf9c1 100644 --- a/manifests/complete.yaml +++ b/manifests/complete.yaml @@ -727,6 +727,8 @@ spec: value: 'saml' - name: REACT_APP_AUTH_SAML_IDP_METADATA_URL value: ' ' + - name: REACT_APP_TIMEZONE + value: ' ' - name: REACT_APP_REPLAY_DISABLED value: 'false' - name: REACT_APP_SCRIPTING_DISABLED