fix(operator): tolerate missing KEDA when cleaning up ScaledObject (#981)#985
Open
Anai-Guo wants to merge 1 commit into
Open
fix(operator): tolerate missing KEDA when cleaning up ScaledObject (#981)#985Anai-Guo wants to merge 1 commit into
Anai-Guo wants to merge 1 commit into
Conversation
The VLLMRuntime controller reconciled a stale ScaledObject delete in the autoscaling-disabled branch, guarding only errors.IsNotFound. On a cluster without KEDA the keda.sh/v1alpha1 API group is not registered, so the delete returns a NoKindMatchError rather than NotFound, and every reconcile failed -- making the operator unusable on clusters that never requested autoscaling. Also tolerate meta.IsNoMatchError on the cleanup path: there is nothing to delete when the CRD is absent, so the reconcile should succeed. Fixes vllm-project#981 Signed-off-by: Tai An <antai12232931@outlook.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the VLLMRuntimeReconciler to tolerate meta.IsNoMatchError when attempting to delete a ScaledObject during cleanup when autoscaling is disabled. This ensures that the reconciliation succeeds on Kubernetes clusters where KEDA is not installed, making the operator usable in non-autoscaling environments. I have no feedback to provide.
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
Fixes #981.
The
VLLMRuntimecontroller failed on every reconciliation on clusters without KEDA installed, even when noVLLMRuntimerequested autoscaling — making the operator unusable there.Root cause
In the autoscaling-disabled branch of
Reconcile, the controller best-effort deletes a possibly-stalekeda.sh/v1alpha1ScaledObject:When KEDA is not installed, the
keda.shAPI group is not registered, so the RESTMapper returns a*meta.NoKindMatchError— not aNotFound. The existing guard only tolerateserrors.IsNotFound(err), so the reconcile errored out and requeued forever.Fix
Also tolerate
meta.IsNoMatchError(err)on this cleanup path. If the CRD is absent there is nothing to delete, so the reconcile should succeed. The autoscaling-enabled path (reconcileScaledObject) is unchanged — enabling autoscaling legitimately requires KEDA.Two-line change plus an explanatory comment; no behavior change on clusters that do have KEDA.
Testing
NoKindMatchError(returned by controller-runtime's client when thekeda.sh/v1alpha1group/kind is unregistered), which is precisely the KEDA-absent case.🤖 Generated with Claude Code