Skip to content

Treat a nil alert severity as disabled in alert helpers - #1102

Merged
ArnobKumarSaha merged 2 commits into
masterfrom
arnob-alert-nil
Jul 31, 2026
Merged

Treat a nil alert severity as disabled in alert helpers#1102
ArnobKumarSaha merged 2 commits into
masterfrom
arnob-alert-nil

Conversation

@ArnobKumarSaha

Copy link
Copy Markdown
Member

Creating a database with monitoring disabled failed to render:

template: kubedbcom-neo4j-editor-options/templates/monitoring/alert.yaml:3:7 ...
error calling dig: interface conversion: interface {} is nil, not string

The console can send form.alert.enabled as null; an explicit null in the model also drops the chart's own default during Helm coalesce. dig panics on a nil key, so every chart with a monitoring/alert.yaml template broke.

Every severity lookup in alertsEnabled / alertGroupEnabled / alertEnabled now falls back to "none", which the rank table already treats as disabled. Applied to all 61 charts that define these helpers.

Also documents the charts_pattern globs added in 8839601.

Verification

helm template over all 61 affected charts:

  • with --set-json 'form.alert.enabled=null': 56 charts failed with the error above before, 0 after (the other 5 have no monitoring/alert.yaml, so their alert helpers are unreachable).
  • with default values: rendered output is byte-identical before and after for all 61 charts.

make fmt could not run locally (Docker daemon down); the change is template text only, no Go or formatting-sensitive files.

The console can send form.alert.enabled as null (an explicit null in the
model also drops the chart default during coalesce), and dig panics on a
nil key, so rendering failed with:

  error calling dig: interface conversion: interface {} is nil, not string

Every severity lookup now falls back to "none", which the rank table
already treats as disabled. Rendered output for valid values is
unchanged.

Signed-off-by: Arnob Kumar Saha <arnob@appscode.com>
Signed-off-by: Arnob Kumar Saha <arnob@appscode.com>
@ArnobKumarSaha
ArnobKumarSaha merged commit d424c41 into master Jul 31, 2026
4 checks passed
@ArnobKumarSaha
ArnobKumarSaha deleted the arnob-alert-nil branch July 31, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant