Treat a nil alert severity as disabled in alert helpers - #1102
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Creating a database with monitoring disabled failed to render:
The console can send
form.alert.enabledas null; an explicit null in the model also drops the chart's own default during Helm coalesce.digpanics on a nil key, so every chart with amonitoring/alert.yamltemplate broke.Every severity lookup in
alertsEnabled/alertGroupEnabled/alertEnablednow 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_patternglobs added in 8839601.Verification
helm templateover all 61 affected charts:--set-json 'form.alert.enabled=null': 56 charts failed with the error above before, 0 after (the other 5 have nomonitoring/alert.yaml, so their alert helpers are unreachable).make fmtcould not run locally (Docker daemon down); the change is template text only, no Go or formatting-sensitive files.