Repository navigation
refactor(common): one hasTaint for the agent's taint remover and the controller's guard - #1173
Merged
Merged
Conversation
…controller's guard The node agent's TaintRemover and the controller's nodetaint Guard each had a private hasTaint with the same body. The controller must not import agent internals, so it moves to a new leaf package, common/taint (Has), whose only dependency is k8s.io/api/core/v1. Both packages already link that. Pure refactor: no behaviour change, no binary gains a module. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr
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.
What
The two writers of the proposal 033 node taint each had a private
hasTaintwith the same body:agent/internal/node/taint.go:47: the agent'sTaintRemovercontroller/internal/nodetaint/guard.go:225: the controller's re-armGuardThe controller must not import agent internals, so the function moves to a new leaf package,
common/taint, astaint.Has(node, key). That package's only dependency isk8s.io/api/core/v1, and both callers already link it. Both production call sites and the three test files that usedhasTaintas an assertion helper now calltaint.Has.Tests:
hasTainthad no direct unit test, so there was nothing to move. Every existing test in both packages is unchanged apart from the call rename.Proof the copies were identical
Signatures and bodies on
origin/main, compared with a function-extracting diff:Module counts (
bazel query 'deps(<bin>)', external repos / external labels)Verification
bazel test --config=raceon//agent/internal/node:alland//controller/internal/nodetaint:all: all pass.bazel build --config=lint --@aspect_rules_lint//lint:fail_on_violation //...: clean.make format-check: clean.make gazelle: done.🤖 Generated with Claude Code
https://claude.ai/code/session_01NArCRTfMPZkw4Y97U9Gdsr