Skip to content

use cluster-name label to broad nodeselector of watcher#16

Merged
syutogether merged 1 commit into
masterfrom
syu/tcl-6128-use-clusterx-k8siocluster-name-label-to-broaden-label
May 11, 2026
Merged

use cluster-name label to broad nodeselector of watcher#16
syutogether merged 1 commit into
masterfrom
syu/tcl-6128-use-clusterx-k8siocluster-name-label-to-broaden-label

Conversation

@syutogether
Copy link
Copy Markdown

No description provided.

@syutogether syutogether self-assigned this May 10, 2026
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 25623840412

Warning

No base build found for commit 156d563 on master.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 56.119%

Details

  • Patch coverage: 2 uncovered changes across 1 file (6 of 8 lines covered, 75.0%).

Uncovered Changes

File Changed Covered %
pkg/watcher/watcher.go 8 6 75.0%

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 1814
Covered Lines: 1018
Line Coverage: 56.12%
Coverage Strength: 23.11 hits per line

💛 - Coveralls

Comment thread pkg/watcher/watcher.go
// covers both KubeVirt virt-launcher pods (via CAPK) and Virtink VM pods (via CAPCH).
// CAPI propagates this label onto every machine-owned pod regardless of provider.
var capiClusterNameSelector = func() string {
req, err := labels.NewRequirement("cluster.x-k8s.io/cluster-name", selection.Exists, nil)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super tiny nit: I think the reason I did the mustValidate and panic was to fail early if the label was malformed. If this provides the same protection or you think it's unnecessary, feel free to ignore

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it validates the key format too. And panic if it's malformed

@syutogether syutogether merged commit b0b5983 into master May 11, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants