From 0070aaf3eb53bf64df1e03690ef6059ccba41e46 Mon Sep 17 00:00:00 2001 From: tiptophelmet Date: Sat, 14 Mar 2026 01:16:45 +0200 Subject: [PATCH] :hammer: Replace `liveConfigMapChangesDisabled` with `demoModeEnabled` flag --- config/configStructs/tapConfig.go | 1 - helm-chart/README.md | 1 - helm-chart/templates/06-front-deployment.yaml | 32 +++++++------------ helm-chart/templates/12-config-map.yaml | 30 +++++++---------- helm-chart/values.yaml | 1 - 5 files changed, 23 insertions(+), 42 deletions(-) diff --git a/config/configStructs/tapConfig.go b/config/configStructs/tapConfig.go index 508a482cb..f6bce6917 100644 --- a/config/configStructs/tapConfig.go +++ b/config/configStructs/tapConfig.go @@ -412,7 +412,6 @@ type TapConfig struct { Gitops GitopsConfig `yaml:"gitops" json:"gitops"` Sentry SentryConfig `yaml:"sentry" json:"sentry"` DefaultFilter string `yaml:"defaultFilter" json:"defaultFilter" default:""` - LiveConfigMapChangesDisabled bool `yaml:"liveConfigMapChangesDisabled" json:"liveConfigMapChangesDisabled" default:"false"` GlobalFilter string `yaml:"globalFilter" json:"globalFilter" default:""` EnabledDissectors []string `yaml:"enabledDissectors" json:"enabledDissectors"` PortMapping PortMapping `yaml:"portMapping" json:"portMapping"` diff --git a/helm-chart/README.md b/helm-chart/README.md index 12c186153..17c613d7e 100644 --- a/helm-chart/README.md +++ b/helm-chart/README.md @@ -232,7 +232,6 @@ Example for overriding image names: | `tap.sentry.enabled` | Enable sending of error logs to Sentry | `false` | | `tap.sentry.environment` | Sentry environment to label error logs with | `production` | | `tap.defaultFilter` | Sets the default dashboard KFL filter (e.g. `http`). By default, this value is set to filter out noisy protocols such as DNS, UDP, ICMP and TCP. The user can easily change this, **temporarily**, in the Dashboard. For a permanent change, you should change this value in the `values.yaml` or `config.yaml` file. | `""` | -| `tap.liveConfigMapChangesDisabled` | If set to `true`, all user functionality (scripting, targeting settings, global & default KFL modification, traffic recording, traffic capturing on/off, protocol dissectors) involving dynamic ConfigMap changes from UI will be disabled | `false` | | `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` | | `tap.enabledDissectors` | This is an array of strings representing the list of supported protocols. Remove or comment out redundant protocols (e.g., dns).| The default list excludes: `udp` and `tcp` | diff --git a/helm-chart/templates/06-front-deployment.yaml b/helm-chart/templates/06-front-deployment.yaml index 64965a767..8f988ff09 100644 --- a/helm-chart/templates/06-front-deployment.yaml +++ b/helm-chart/templates/06-front-deployment.yaml @@ -26,15 +26,15 @@ spec: - env: - name: REACT_APP_AUTH_ENABLED value: '{{- if or (and .Values.cloudLicenseEnabled (not (empty .Values.license))) (not .Values.internetConnectivity) -}} - {{ (and .Values.tap.auth.enabled (eq .Values.tap.auth.type "dex")) | ternary true false }} + {{ .Values.demoModeEnabled | ternary true ((and .Values.tap.auth.enabled (eq .Values.tap.auth.type "dex")) | ternary true false) }} {{- else -}} - {{ .Values.cloudLicenseEnabled | ternary "true" .Values.tap.auth.enabled }} + {{ .Values.cloudLicenseEnabled | ternary "true" (.Values.demoModeEnabled | ternary "true" .Values.tap.auth.enabled) }} {{- end }}' - name: REACT_APP_AUTH_TYPE value: '{{- if and .Values.cloudLicenseEnabled (not (eq .Values.tap.auth.type "dex")) -}} default {{- else -}} - {{ .Values.tap.auth.type }} + {{ .Values.demoModeEnabled | ternary "default" .Values.tap.auth.type }} {{- end }}' - name: REACT_APP_COMPLETE_STREAMING_ENABLED value: '{{- if and (hasKey .Values.tap "dashboard") (hasKey .Values.tap.dashboard "completeStreamingEnabled") -}} @@ -55,30 +55,22 @@ spec: false {{- end }}' - name: REACT_APP_SCRIPTING_DISABLED - value: '{{- if .Values.tap.liveConfigMapChangesDisabled -}} - {{- if .Values.demoModeEnabled -}} - {{ .Values.demoModeEnabled | ternary false true }} - {{- else -}} - true - {{- end }} - {{- else -}} - false - {{- end }}' + value: '{{ .Values.demoModeEnabled | ternary true false }}' - name: REACT_APP_TARGETED_PODS_UPDATE_DISABLED - value: '{{ .Values.tap.liveConfigMapChangesDisabled }}' + value: '{{ .Values.demoModeEnabled | ternary true false }}' - name: REACT_APP_PRESET_FILTERS_CHANGING_ENABLED - value: '{{ .Values.tap.liveConfigMapChangesDisabled | ternary "false" "true" }}' + value: '{{ .Values.demoModeEnabled | ternary false true }}' - name: REACT_APP_BPF_OVERRIDE_DISABLED value: '{{ eq .Values.tap.packetCapture "af_packet" | ternary "false" "true" }}' - name: REACT_APP_RECORDING_DISABLED - value: '{{ .Values.tap.liveConfigMapChangesDisabled }}' + value: '{{ .Values.demoModeEnabled | ternary true false }}' - name: REACT_APP_DISSECTION_ENABLED value: '{{ .Values.tap.capture.dissection.enabled | ternary "true" "false" }}' - name: REACT_APP_DISSECTION_CONTROL_ENABLED - value: '{{- if and .Values.tap.liveConfigMapChangesDisabled (not .Values.tap.capture.dissection.enabled) -}} + value: '{{- if and (not .Values.demoModeEnabled) (not .Values.tap.capture.dissection.enabled) -}} true {{- else -}} - {{ not .Values.tap.liveConfigMapChangesDisabled | ternary "true" "false" }} + {{ not .Values.demoModeEnabled | ternary false true }} {{- end -}}' - name: 'REACT_APP_CLOUD_LICENSE_ENABLED' value: '{{- if or (and .Values.cloudLicenseEnabled (not (empty .Values.license))) (not .Values.internetConnectivity) -}} @@ -91,11 +83,11 @@ spec: - name: REACT_APP_BETA_ENABLED value: '{{ default false .Values.betaEnabled | ternary "true" "false" }}' - name: REACT_APP_DISSECTORS_UPDATING_ENABLED - value: '{{ .Values.tap.liveConfigMapChangesDisabled | ternary "false" "true" }}' + value: '{{ .Values.demoModeEnabled | ternary false true }}' - name: REACT_APP_SNAPSHOTS_UPDATING_ENABLED - value: '{{ .Values.tap.liveConfigMapChangesDisabled | ternary "false" "true" }}' + value: '{{ .Values.demoModeEnabled | ternary false true }}' - name: REACT_APP_DEMO_MODE_ENABLED - value: '{{ .Values.demoModeEnabled | ternary "true" "false" }}' + value: '{{ .Values.demoModeEnabled | ternary true false }}' - name: REACT_APP_CLUSTER_WIDE_MAP_ENABLED value: '{{ default false (((.Values).tap).dashboard).clusterWideMapEnabled }}' - name: REACT_APP_RAW_CAPTURE_ENABLED diff --git a/helm-chart/templates/12-config-map.yaml b/helm-chart/templates/12-config-map.yaml index 975183921..b1b19e37e 100644 --- a/helm-chart/templates/12-config-map.yaml +++ b/helm-chart/templates/12-config-map.yaml @@ -19,14 +19,14 @@ data: INGRESS_HOST: '{{ .Values.tap.ingress.host }}' PROXY_FRONT_PORT: '{{ .Values.tap.proxy.front.port }}' AUTH_ENABLED: '{{- if and .Values.cloudLicenseEnabled (not (empty .Values.license)) -}} - {{ and .Values.tap.auth.enabled (eq .Values.tap.auth.type "dex") | ternary true false }} + {{ .Values.demoModeEnabled | ternary true ((and .Values.tap.auth.enabled (eq .Values.tap.auth.type "dex")) | ternary true false) }} {{- else -}} - {{ .Values.cloudLicenseEnabled | ternary "true" (.Values.tap.auth.enabled | ternary "true" "") }} + {{ .Values.cloudLicenseEnabled | ternary "true" (.Values.demoModeEnabled | ternary "true" .Values.tap.auth.enabled) }} {{- end }}' AUTH_TYPE: '{{- if and .Values.cloudLicenseEnabled (not (eq .Values.tap.auth.type "dex")) -}} default {{- else -}} - {{ .Values.tap.auth.type }} + {{ .Values.demoModeEnabled | ternary "default" .Values.tap.auth.type }} {{- end }}' AUTH_SAML_IDP_METADATA_URL: '{{ .Values.tap.auth.saml.idpMetadataUrl }}' AUTH_SAML_ROLE_ATTRIBUTE: '{{ .Values.tap.auth.saml.roleAttribute }}' @@ -44,22 +44,14 @@ data: false {{- end }}' TELEMETRY_DISABLED: '{{ not .Values.internetConnectivity | ternary "true" (not .Values.tap.telemetry.enabled | ternary "true" "false") }}' - SCRIPTING_DISABLED: '{{- if .Values.tap.liveConfigMapChangesDisabled -}} - {{- if .Values.demoModeEnabled -}} - {{ .Values.demoModeEnabled | ternary false true }} - {{- else -}} - true - {{- end }} - {{- else -}} - false - {{- end }}' - TARGETED_PODS_UPDATE_DISABLED: '{{ .Values.tap.liveConfigMapChangesDisabled | ternary "true" "" }}' - PRESET_FILTERS_CHANGING_ENABLED: '{{ .Values.tap.liveConfigMapChangesDisabled | ternary "false" "true" }}' - RECORDING_DISABLED: '{{ .Values.tap.liveConfigMapChangesDisabled | ternary "true" "" }}' - DISSECTION_CONTROL_ENABLED: '{{- if and .Values.tap.liveConfigMapChangesDisabled (not .Values.tap.capture.dissection.enabled) -}} + SCRIPTING_DISABLED: '{{ .Values.demoModeEnabled | ternary true false }}' + TARGETED_PODS_UPDATE_DISABLED: '{{ .Values.demoModeEnabled | ternary true false }}' + PRESET_FILTERS_CHANGING_ENABLED: '{{ .Values.demoModeEnabled | ternary false true }}' + RECORDING_DISABLED: '{{ .Values.demoModeEnabled | ternary true false }}' + DISSECTION_CONTROL_ENABLED: '{{- if and (not .Values.demoModeEnabled) (not .Values.tap.capture.dissection.enabled) -}} true {{- else -}} - {{ not .Values.tap.liveConfigMapChangesDisabled | ternary "true" "false" }} + {{ .Values.demoModeEnabled | ternary false true }} {{- end }}' GLOBAL_FILTER: {{ include "kubeshark.escapeDoubleQuotes" .Values.tap.globalFilter | quote }} DEFAULT_FILTER: {{ include "kubeshark.escapeDoubleQuotes" .Values.tap.defaultFilter | quote }} @@ -76,8 +68,8 @@ data: DUPLICATE_TIMEFRAME: '{{ .Values.tap.misc.duplicateTimeframe }}' ENABLED_DISSECTORS: '{{ gt (len .Values.tap.enabledDissectors) 0 | ternary (join "," .Values.tap.enabledDissectors) "" }}' CUSTOM_MACROS: '{{ toJson .Values.tap.customMacros }}' - DISSECTORS_UPDATING_ENABLED: '{{ .Values.tap.liveConfigMapChangesDisabled | ternary "false" "true" }}' - SNAPSHOTS_UPDATING_ENABLED: '{{ .Values.tap.liveConfigMapChangesDisabled | ternary "false" "true" }}' + DISSECTORS_UPDATING_ENABLED: '{{ .Values.demoModeEnabled | ternary false true }}' + SNAPSHOTS_UPDATING_ENABLED: '{{ .Values.demoModeEnabled | ternary false true }}' DEMO_MODE_ENABLED: '{{ .Values.demoModeEnabled | ternary "true" "false" }}' DETECT_DUPLICATES: '{{ .Values.tap.misc.detectDuplicates | ternary "true" "false" }}' PCAP_DUMP_ENABLE: '{{ .Values.pcapdump.enabled }}' diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index bcd24af86..9be64a54e 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -198,7 +198,6 @@ tap: enabled: false environment: production defaultFilter: "" - liveConfigMapChangesDisabled: false globalFilter: "" enabledDissectors: - amqp