-
Notifications
You must be signed in to change notification settings - Fork 606
feat: make default event severity filter configurable #4646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,6 +82,8 @@ type Config struct { | |
| UseOTLPHTTP *bool `koanf:"use-otlp-http"` | ||
| StdoutTraceEnabled *bool `koanf:"stdout-trace-enabled"` | ||
| SamplingRate *float64 `koanf:"sampling-rate"` | ||
| // FiltersWarningsOnly is the default state of the events filter (true = only warnings, false = all events). | ||
| FiltersWarningsOnly bool `koanf:"filters-warnings-only"` | ||
|
Comment on lines
+85
to
+86
|
||
| // TLS config | ||
| TLSCertPath string `koanf:"tls-cert-path"` | ||
| TLSKeyPath string `koanf:"tls-key-path"` | ||
|
|
@@ -448,6 +450,7 @@ func addGeneralFlags(f *flag.FlagSet) { | |
| f.Uint("port", defaultPort, "Port to listen from") | ||
| f.String("proxy-urls", "", "Allow proxy requests to specified URLs") | ||
| f.Bool("enable-helm", false, "Enable Helm operations") | ||
| f.Bool("filters-warnings-only", true, "Whether to filter events by warnings only by default") | ||
| } | ||
|
|
||
| func addOIDCFlags(f *flag.FlagSet) { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -325,6 +325,7 @@ spec: | |
| {{- with .Values.config.tlsKeyPath }} | ||
| - "-tls-key-path={{ . }}" | ||
| {{- end }} | ||
| - "-filters-warnings-only={{ .Values.config.events.warningsOnly }}" | ||
|
||
| {{- with .Values.config.extraArgs }} | ||
| {{- toYaml . | nindent 12 }} | ||
| {{- end }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,10 @@ export interface ConfigState { | |
| allClusters: { | ||
| [clusterName: string]: Cluster; | ||
| } | null; | ||
| /** | ||
| * Whether to filter events by warnings only by default. | ||
| */ | ||
| filtersWarningsOnly: boolean; | ||
| /** | ||
| * Settings is a map of settings names to settings values. | ||
| */ | ||
|
|
@@ -71,6 +75,7 @@ export const initialState: ConfigState = { | |
| clusters: null, | ||
| statelessClusters: null, | ||
| allClusters: null, | ||
| filtersWarningsOnly: true, | ||
| settings: { | ||
| tableRowsPerPageOptions: | ||
| storedSettings.tableRowsPerPageOptions || defaultTableRowsPerPageOptions, | ||
|
|
@@ -89,8 +94,14 @@ const configSlice = createSlice({ | |
| * @param state - The current state. | ||
| * @param action - The payload action containing the config. | ||
| */ | ||
| setConfig(state, action: PayloadAction<{ clusters: ConfigState['clusters'] }>) { | ||
| setConfig( | ||
| state, | ||
| action: PayloadAction<{ clusters: ConfigState['clusters']; filtersWarningsOnly?: boolean }> | ||
| ) { | ||
| state.clusters = action.payload.clusters; | ||
| if (action.payload.filtersWarningsOnly !== undefined) { | ||
| state.filtersWarningsOnly = action.payload.filtersWarningsOnly; | ||
| } | ||
| }, | ||
|
Comment on lines
97
to
105
|
||
| /** | ||
| * Save the config. To both the store, and localStorage. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PrometheusEndpointis now part of the/configresponse, but it doesn’t appear to be populated anywhere in the backend config parsing (no flags/env mapping found) and the frontend doesn’t referenceprometheusEndpoint. If this field isn’t intentionally being introduced as part of this feature, consider removing it fromclientConfigto avoid expanding the API surface with an always-empty value; otherwise ensure it’s properly configured and consumed.