Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Gerber <[email protected]>
  • Loading branch information
DebakelOrakel and simu authored Dec 24, 2024
1 parent f2ce187 commit f7752e3
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions component/alertrules.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,24 @@ assert
local ignore_alerts = std.set(
// Add set of upstream alerts that should be ignored from processed value of
// `params.ignore_alerts`
com.renderArray(std.get(params, 'ignore_alerts', []))
+ com.renderArray(std.get(params, 'ignore_alerts', []))
local old_ignore = if std.objectHas(params, 'ignore_alerts') then
std.trace('Parameter `ignore_alerts` is deprecated, please migrate your config to `alerts.ignore`.', params.ignore_alerts)
else
[];
com.renderArray(params.alerts.ignore)
+ com.renderArray(old_ignore)
);

// Alert rule patches.
// Provide partial objects for alert rules that need to be tuned compared to
// upstream. The keys in this object correspond to the `alert` field of the
// rule for which the patch is intended.
local patch_alerts = params.alerts.patch + std.get(params, 'patch_alerts', {});
local patch_alerts =
local old_patch = if std.objectHas(params, 'patch_alerts') then
std.trace("Parameter `patch_alerts` is deprecated, please migrate your config to `alerts.patch`, params.patch_alerts);
else
{};
params.alerts.patch + old_patch;
local loadFile(file) =
local fpath = 'openshift4-logging/component/extracted_alerts/%s/%s' % [ params.alerts.release, file ];
Expand Down

0 comments on commit f7752e3

Please sign in to comment.