Update fleetautoscalers.go#4556
Open
MusGaas wants to merge 2 commits intoagones-dev:mainfrom
Open
Conversation
Signed-off-by: Muss <muss@imgsrcxonerroralertdocument.domain> Signed-off-by: MusGaas <musgaas@gmail.com>
fix: nil-check Response field in webhook and Wasm autoscaler handlers Signed-off-by: MusGaas - Musgaas@gmail.com Signed-off-by: Muss <muss@imgsrcxonerroralertdocument.domain> Signed-off-by: MusGaas <musgaas@gmail.com>
Author
|
Hi, could a maintainer please run |
Member
|
We should add a unit test for this, to make sure it continues to not be a problem. |
Member
Two things:
|
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.
/kind bug
What this PR does / Why we need it:
applyWebhookPolicy and applyWasmPolicy both dereference Response.Scale
without checking if Response is nil. When a webhook or Wasm policy
returns a JSON body that omits the response field (e.g., {}),
json.Unmarshal succeeds with Response as a nil pointer. The subsequent
dereference panics, crashing both HA controller replicas via the shared
workqueue and halting cluster-wide FleetAutoscaler reconciliation until
an admin removes the resource.
Both sites now return an explicit error when Response is nil, allowing
the reconcile loop to handle the error gracefully rather than panicking.
Tested against helm install agones release 1.57.0 in a kind cluster.
Both controller pods entered CrashLoopBackOff before the fix. After
the fix, the error is returned cleanly with no panic.
Which issue(s) this PR fixes:
Closes #4555
Special notes for your reviewer:
This fix was identified and reported via Google's OSS VRP (Agones
documented security intake at g.co/vulnz). Two sites fixed in the
same file — applyWebhookPolicy and applyWasmPolicy — same root cause,
same one-line nil check pattern.