Repository navigation
feat: attachMetadata.resources instead of a namespace bool - #2
Merged
dongjiang1989 merged 1 commit intoNov 17, 2026
Conversation
As requested in review: attachMetadata lists the objects whose metadata is attached, as a set, instead of one boolean per kind. - add `resources` (`Node`, `Namespace`) to v1 and v1alpha1 AttachMetadata; `node` stays and is deprecated - drop the `namespace` field added earlier in this PR - ScrapeConfig CEL rules check node metadata from either field, and namespace metadata from `resources` - topology sharding adds `Node` to the requested resources and keeps the others Assisted-by: Claude Opus 5.5 Signed-off-by: Maxim Khon <max@2you.io>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
1 task done
dongjiang1989
merged commit Nov 17, 2026
45f049e
into
kubeservice-stack:add-namespace-metadata
2 of 3 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on prometheus-operator#7811: implements the API asked for in its latest review, a set of resources instead of one boolean per kind.
resourcesin v1 and v1alpha1AttachMetadata; thenamespacefield of feat: Add support for attaching namespace metadata to Kubernetes SD prometheus-operator/prometheus-operator#7811 goes.nodestays, deprecated.HasResource/WithResourceonAttachMetadata, so the config generator reads both fields in one place.resources.Nodeto what was requested and keeps the rest (the review's "what if namespace == true?").Tests: unit tests for both helpers; goldens for a namespace-only ScrapeConfig and for a topology-sharded PodMonitor with namespace only; the existing cases of prometheus-operator#7811 use
resources, two keep the deprecatednode(goldens unchanged); e2e CRD validation cases for disallowed roles, an unknown resource and a duplicate.go test ./pkg/prometheus/... ./pkg/apis/monitoring/v1passes; the e2e cases are compiled, not run.🤖 Generated with Claude Code