Skip to content

Commit bdd9eb9

Browse files
authored
fix: support namespaces requests for client-go metrics (#56)
1 parent 2457d6a commit bdd9eb9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

metrics/metrics.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ func parsePath(path string) *pathData {
105105
if len(parts) < groupIdx+3 {
106106
return nil
107107
}
108-
// This resource is namespaced
109-
if parts[groupIdx+2] == "namespaces" {
108+
// This resource is namespaced and the resource is not the namespace
109+
if parts[groupIdx+2] == "namespaces" && len(parts) > groupIdx+4 {
110110
versionIdx = groupIdx + 1
111111
kindIdx = versionIdx + 3
112112
} else {

0 commit comments

Comments
 (0)