From b52b4252c1f6117c749e4da961b4e31a508d6800 Mon Sep 17 00:00:00 2001 From: AlteredCoder <64792091+AlteredCoder@users.noreply.github.com> Date: Mon, 24 Jul 2023 15:19:28 +0200 Subject: [PATCH] scenario labels to map string interface (#2201) * labels are now map string interface * restore api url --------- Co-authored-by: Laurence Jones --- pkg/leakybucket/manager_load.go | 2 +- pkg/leakybucket/overflows.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/leakybucket/manager_load.go b/pkg/leakybucket/manager_load.go index 40c5eb8d6..337f6fd3f 100644 --- a/pkg/leakybucket/manager_load.go +++ b/pkg/leakybucket/manager_load.go @@ -43,7 +43,7 @@ type BucketFactory struct { GroupBy string `yaml:"groupby,omitempty"` //groupy is an expr that allows to determine the partitions of the bucket. A common example is the source_ip Distinct string `yaml:"distinct"` //Distinct, when present, adds a `Pour()` processor that will only pour uniq items (based on distinct expr result) Debug bool `yaml:"debug"` //Debug, when set to true, will enable debugging for _this_ scenario specifically - Labels map[string]string `yaml:"labels"` //Labels is K:V list aiming at providing context the overflow + Labels map[string]interface{} `yaml:"labels"` //Labels is K:V list aiming at providing context the overflow Blackhole string `yaml:"blackhole,omitempty"` //Blackhole is a duration that, if present, will prevent same bucket partition to overflow more often than $duration logger *log.Entry `yaml:"-"` //logger is bucket-specific logger (used by Debug as well) Reprocess bool `yaml:"reprocess"` //Reprocess, if true, will for the bucket to be re-injected into processing chain diff --git a/pkg/leakybucket/overflows.go b/pkg/leakybucket/overflows.go index 45446b8f6..5f5f0484b 100644 --- a/pkg/leakybucket/overflows.go +++ b/pkg/leakybucket/overflows.go @@ -303,7 +303,7 @@ func NewAlert(leaky *Leaky, queue *Queue) (types.RuntimeAlert, error) { newApiAlert := apiAlert srcCopy := srcValue newApiAlert.Source = &srcCopy - if v, ok := leaky.BucketConfig.Labels["remediation"]; ok && v == "true" { + if v, ok := leaky.BucketConfig.Labels["remediation"]; ok && v == true { newApiAlert.Remediation = true }