Repository navigation
fix: normalize annotation side of validateDeploymentMode before compare - #6069
Merged
spolti merged 1 commit intoSep 30, 2026
Merged
Conversation
Contributor
Author
|
@pierDipi @spolti could one of you take a look when you get a chance? This fixes the deletion deadlock in #5885 — reproduced with a unit test against master (a legacy alias annotation like |
Contributor
|
Thanks @UgaTheDev! |
Contributor
|
/lgtm |
Contributor
|
@UgaTheDev can you please rebase your PR? |
…DeploymentMode validateDeploymentMode normalized the status side through ParseDeploymentMode but compared it against the raw annotation string. Legacy alias annotations (Serverless/RawDeployment) never normalize-equal their raw form, so an unchanged update using a legacy alias annotation was rejected once status.deploymentMode was normalized. On versions lacking the DeletionTimestamp bypass in ValidateUpdate this also deadlocks deletion, since finalizer removal goes through the same validation. Fixes kserve#5885 Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01EWug344hH7N5dRsGQMvuhJ Signed-off-by: Kush Zingade <[email protected]>
UgaTheDev
force-pushed
the
fix-deployment-mode-alias-validation
branch
from
September 13, 2026 23:14
9e2a100 to
bf1c6d1
Compare
Contributor
Author
|
Rebased onto master ( |
Contributor
Author
Contributor
|
/lgtm |
1 of 3 tasks
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.
Fixes #5885
Problem
validateDeploymentModenormalizesoldIsvc.Status.DeploymentModethroughconstants.ParseDeploymentModebut compares it against the rawnewIsvc.Annotations[constants.DeploymentMode]string. Legacy aliasannotations (
Serverless/RawDeployment) never normalize-equal their rawform, so once the controller records the normalized status
(
Knative/Standard), every subsequent update — including a completelyunchanged
kubectl apply— is rejected:On versions without the
DeletionTimestampbypass inValidateUpdate(v0.16.x), this also blocks the finalizer-removal update the controller
issues during deletion, so the
InferenceServicedeadlocks inTerminatingand no
kubectl patchcan remove the finalizer either, since the samewebhook path validates that update too.
This is the sibling of #5793/#5799: that pair fixed the empty status case
of the same comparison; this is the legacy alias case, left over because
only the status side was ever normalized.
Fix
Normalize the annotation the same way the status side already is, before
comparing:
The error message still reports the raw annotation string (what the user
actually wrote), only the comparison itself is normalized. A real mode
change (e.g. legacy status
Standard-> legacy annotationServerless) isstill rejected — only a semantically-unchanged legacy alias now passes.
Sibling pattern found (not fixed here, flagging for maintainers)
validateCanarySpecs(same file, ~line 188) has the identical class of bug:This compares the raw annotation directly against the literal string
"Standard", so anInferenceServiceusing the legacyRawDeploymentannotation (which is semantically
Standard) would have its canary specrejected even though the deployment mode is correct. Left out of this PR to
keep the diff focused on the reported issue and its exact repro — happy to
open a follow-up if maintainers agree it's in scope.
Testing
Added regression cases to
TestDeploymentModeUpdateininference_service_validation_test.go:Serverlessannotation against normalizedKnativestatus -> now accepted (previously rejected, reproduced the fail-before
the fix)
RawDeploymentannotation against normalizedStandardstatus -> now accepted
(guards against over-normalizing away real change detection)
Before the fix, the added test failed with exactly the error from the issue
report:
I have not reproduced the deletion-deadlock symptom itself end-to-end
(that needs envtest/a real cluster on a v0.16.x build without the
DeletionTimestampbypass); the unit tests cover the underlying comparisonbug that causes it.