Skip to content

Commit

Permalink
rename var
Browse files Browse the repository at this point in the history
Signed-off-by: Antoine THEBAUD <antoine.thebaud@yahoo.fr>
  • Loading branch information
AntoineThebaud committed Oct 28, 2024
1 parent 4e91345 commit cd64154
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cue/dac-utils/prometheus/filter/filter.cue
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import (

// Have to use an intermediary variable here to handle the fact that labelNames variable should be excluded from the filter
// This is again a case where proper support of short-circuit on CUE side would help simplify the code (see https://github.com/cue-lang/cue/issues/2232)
_filterArr: [for var in #input {
_matchers: [for var in #input {
[// switch
if var.#kind == "TextVariable" {"\(var.#name)=~\"$\(var.#name)\""},
if var.#kind == "ListVariable" if var.#pluginKind != labelNamesVar.kind {"\(var.#name)=~\"$\(var.#name)\""},
null,
][0]
}]

filter: strings.Join([for matcher in _filterArr if matcher != null {matcher}], ",")
filter: strings.Join([for matcher in _matchers if matcher != null {matcher}], ",")

0 comments on commit cd64154

Please sign in to comment.