Log MCPRegistry deprecation at most once - #6366
Open
asjdf wants to merge 1 commit into
Open
Conversation
kube-apiserver emits a 299 Warning header for the deprecated MCPRegistry CRD on every cache LIST/WATCH, so controller-runtime logged it on each informer resync even with zero CRs. Collapse that header to a single log at first cache LIST. Fixes stacklok#6346 Signed-off-by: 杨成锴 <homeboyc@foxmail.com>
asjdf
requested review from
ChrisJBurns,
JAORMX,
blkt,
jerm-dro,
jhrozek,
rdimitrov,
reyortiz3 and
tgrunnagle
as code owners
August 18, 2026 19:29
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.
Summary
+kubebuilder:deprecatedversion, so kube-apiserver sends a 299 Warning header on every LIST/WATCH. controller-runtime's cache logged that on every informer resync (~6 minutes) even when zero MCPRegistry CRs exist (bug(operator): MCPRegistry deprecation warning logs on a timer even when no MCPRegistry CRs exist #6346).WarningHandlerat operator startup that forwards the MCPRegistry deprecation header once (sync.Once) and leaves every other API warning unchanged.Fixes #6346
Test plan
go test ./cmd/thv-operator/app/ ./cmd/thv-operator/controllers/task operator-e2e-testafter kind cluster + cloud-provider-kind):