Skip to content

Commit

Permalink
Include resources with kubernetes.io prefix.
Browse files Browse the repository at this point in the history
  • Loading branch information
fengyehong committed Oct 19, 2023
1 parent eac6d3b commit 5f0581e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
7 changes: 1 addition & 6 deletions internal/store/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,7 @@ func isExtendedResourceName(name v1.ResourceName) bool {
}

func isNativeResource(name v1.ResourceName) bool {
return !strings.Contains(string(name), "/") ||
isPrefixedNativeResource(name)
}

func isPrefixedNativeResource(name v1.ResourceName) bool {
return strings.Contains(string(name), v1.ResourceDefaultNamespacePrefix)
return !strings.Contains(string(name), "/")
}

// createPrometheusLabelKeysValues takes in passed kubernetes annotations/labels
Expand Down
2 changes: 1 addition & 1 deletion internal/store/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func TestIsExtendedResourceName(t *testing.T) {
},
{
resourceName: "kubernetes.io/resource-foo",
expectVal: false,
expectVal: true,
},
{
resourceName: "foo",
Expand Down

0 comments on commit 5f0581e

Please sign in to comment.