From df0aea146213cbccce90cf6418f440268521c2e2 Mon Sep 17 00:00:00 2001 From: Alon Girmonsky <1990761+alongir@users.noreply.github.com> Date: Wed, 31 Jul 2024 15:14:36 -0700 Subject: [PATCH] stash (#1575) --- config/configStruct.go | 25 ++++++++++--------- helm-chart/README.md | 4 ++- helm-chart/templates/06-front-deployment.yaml | 2 +- helm-chart/templates/12-config-map.yaml | 2 +- helm-chart/values.yaml | 1 + 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/config/configStruct.go b/config/configStruct.go index 64adef9a0..34d1f9493 100644 --- a/config/configStruct.go +++ b/config/configStruct.go @@ -87,18 +87,19 @@ type ManifestsConfig struct { } type ConfigStruct struct { - Tap configStructs.TapConfig `yaml:"tap" json:"tap"` - Logs configStructs.LogsConfig `yaml:"logs" json:"logs"` - Config configStructs.ConfigConfig `yaml:"config,omitempty" json:"config,omitempty"` - Kube KubeConfig `yaml:"kube" json:"kube"` - DumpLogs bool `yaml:"dumpLogs" json:"dumpLogs" default:"false"` - HeadlessMode bool `yaml:"headless" json:"headless" default:"false"` - License string `yaml:"license" json:"license" default:""` - CloudLicenseEnabled bool `yaml:"cloudLicenseEnabled" json:"cloudLicenseEnabled" default:"true"` - SupportChatEnabled bool `yaml:"supportChatEnabled" json:"supportChatEnabled" default:"true"` - Scripting configStructs.ScriptingConfig `yaml:"scripting" json:"scripting"` - Manifests ManifestsConfig `yaml:"manifests,omitempty" json:"manifests,omitempty"` - Timezone string `yaml:"timezone" json:"timezone"` + Tap configStructs.TapConfig `yaml:"tap" json:"tap"` + Logs configStructs.LogsConfig `yaml:"logs" json:"logs"` + Config configStructs.ConfigConfig `yaml:"config,omitempty" json:"config,omitempty"` + Kube KubeConfig `yaml:"kube" json:"kube"` + DumpLogs bool `yaml:"dumpLogs" json:"dumpLogs" default:"false"` + HeadlessMode bool `yaml:"headless" json:"headless" default:"false"` + License string `yaml:"license" json:"license" default:""` + CloudLicenseEnabled bool `yaml:"cloudLicenseEnabled" json:"cloudLicenseEnabled" default:"true"` + SupportChatEnabled bool `yaml:"supportChatEnabled" json:"supportChatEnabled" default:"true"` + InternetConnectivity bool `yaml:"internetConnectivity" json:"internetConnectivity" default:"true"` + 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 d50904501..482fae814 100644 --- a/helm-chart/README.md +++ b/helm-chart/README.md @@ -171,6 +171,7 @@ Please refer to [metrics](./metrics.md) documentation for details. | `tap.telemetry.enabled` | Enable anonymous usage statistics collection | `true` | | `tap.defaultFilter` | Sets the default dashboard KFL filter (e.g. `http`) | `""` | | `tap.globalFilter` | Prepends to any KFL filter and can be used to limit what is visible in the dashboard. For example, `redact("request.headers.Authorization")` will redact the appropriate field. Another example `!dns` will not show any DNS traffic. | `""` | +| `tap.metrics.port` | Pod port used to expose Prometheus metrics | `49100` | | `logs.file` | Logs dump path | `""` | | `kube.configPath` | Path to the `kubeconfig` file (`$HOME/.kube/config`) | `""` | | `kube.context` | Kubernetes context to use for the deployment | `""` | @@ -180,8 +181,9 @@ Please refer to [metrics](./metrics.md) documentation for details. | `scripting.env` | Environment variables for the scripting | `{}` | | `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) | +| `supportChatEnabled` | Enable real-time support chat channel based on Intercom | `true` | +| `internetConnectivity` | Turns off API requests that are dependant on Internet connectivity such as `telemetry` and `online-support`. | `true` | 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 c238016a4..1fd0a366e 100644 --- a/helm-chart/templates/06-front-deployment.yaml +++ b/helm-chart/templates/06-front-deployment.yaml @@ -59,7 +59,7 @@ spec: {{ .Values.cloudLicenseEnabled }} {{- end }}' - name: REACT_APP_SUPPORT_CHAT_ENABLED - value: '{{ not .Values.supportChatEnabled | ternary "true" .Values.supportChatEnabled }}' + value: '{{ and .Values.supportChatEnabled .Values.internetConnectivity | ternary "true" "false" }}' {{- if .Values.tap.docker.overrideTag.front }} image: '{{ .Values.tap.docker.registry }}/front:{{ .Values.tap.docker.overrideTag.front }}' {{ else }} diff --git a/helm-chart/templates/12-config-map.yaml b/helm-chart/templates/12-config-map.yaml index 9351825c4..e8287db02 100644 --- a/helm-chart/templates/12-config-map.yaml +++ b/helm-chart/templates/12-config-map.yaml @@ -24,7 +24,7 @@ data: AUTH_SAML_IDP_METADATA_URL: '{{ .Values.tap.auth.saml.idpMetadataUrl }}' AUTH_SAML_ROLE_ATTRIBUTE: '{{ .Values.tap.auth.saml.roleAttribute }}' AUTH_SAML_ROLES: '{{ .Values.tap.auth.saml.roles | toJson }}' - TELEMETRY_DISABLED: '{{ not .Values.tap.telemetry.enabled | ternary "true" "" }}' + TELEMETRY_DISABLED: '{{ not .Values.internetConnectivity | ternary "true" (not .Values.tap.telemetry.enabled | ternary "true" "") }}' SCRIPTING_DISABLED: '{{ .Values.tap.scriptingDisabled | ternary "true" "" }}' TARGETED_PODS_UPDATE_DISABLED: '{{ .Values.tap.targetedPodsUpdateDisabled | ternary "true" "" }}' RECORDING_DISABLED: '{{ .Values.tap.recordingDisabled | ternary "true" "" }}' diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index fd2ea3a34..c93297e9c 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -138,6 +138,7 @@ headless: false license: "" cloudLicenseEnabled: true supportChatEnabled: true +internetConnectivity: true scripting: env: {} source: ""