mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-06 01:38:10 +00:00
Fix namespaced bug of node resource, node resource should be a non-namespaced resource as the resource namespace. By doing this fix, node resouce can be accessed as expected, as the issue explains. Closes issue:[#178](https://github.com/DirectXMan12/k8s-prometheus-adapter/issues/178)
This commit is contained in:
parent
ab6ada9081
commit
27c3bc1b88
3 changed files with 3 additions and 2 deletions
|
|
@ -14,6 +14,7 @@ import (
|
|||
)
|
||||
|
||||
var nsGroupResource = schema.GroupResource{Resource: "namespaces"}
|
||||
var nodeGroupResource = schema.GroupResource{Resource: "nodes"}
|
||||
var groupNameSanitizer = strings.NewReplacer(".", "_", "-", "_")
|
||||
|
||||
// MetricNamer knows how to convert Prometheus series names and label names to
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ func (r *basicSeriesRegistry) SetSeries(newSeriesSlices [][]prom.Series, namers
|
|||
}
|
||||
|
||||
// namespace metrics aren't counted as namespaced
|
||||
if resource == nsGroupResource {
|
||||
if resource == nsGroupResource || resource == nodeGroupResource {
|
||||
info.Namespaced = false
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue