Skip to content

Commit

Permalink
fixup! fixup! Allow labelFromKey field
Browse files Browse the repository at this point in the history
  • Loading branch information
rexagod committed Nov 9, 2022
1 parent 83d68c5 commit a1716fa
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions pkg/customresourcestate/registry_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,18 +269,13 @@ func (c *compiledInfo) Values(v interface{}) (result []eachValue, errs []error)
break
}
// labelFromKey logic
for key, val := range iter {
for key := range iter {
if key != "" && c.labelFromKey != "" {
n, err := toFloat64(val, false)
if err != nil {
onError(err)
continue
}
result = append(result, eachValue{
Labels: map[string]string{
c.labelFromKey: key,
},
Value: n,
Value: 1,
})
}
}
Expand Down

0 comments on commit a1716fa

Please sign in to comment.