operator/identitygc: fix nil pointer dereference on shutdown#45091
Merged
tklauser merged 1 commit intocilium:mainfrom Apr 1, 2026
Merged
operator/identitygc: fix nil pointer dereference on shutdown#45091tklauser merged 1 commit intocilium:mainfrom
tklauser merged 1 commit intocilium:mainfrom
Conversation
When DisableCiliumEndpointCRD is set (e.g. via --disable-endpoint-crd=true) and the CiliumEndpoint CRD is missing from the cluster, the startCRDModeGC startup function returns early to skip running the Garbage Collector. However, the OnStop lifecycle hook unconditionally attempts to call RemoveAllAndWait() on the internal controller manager (gc.mgr). Since it remains uninitialized (nil) due to the early return, this causes a panic when the operator shuts down. Fix this by adding a defensive nil check for gc.mgr in OnStop. Fixes: cilium#45087 Signed-off-by: Tsotne Chakhvadze <tsotne@google.com>
Member
|
/test |
Contributor
Author
|
/ci-ginkgo |
tklauser
approved these changes
Apr 1, 2026
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.
When DisableCiliumEndpointCRD is set (e.g. via --disable-endpoint-crd=true) and the CiliumEndpoint CRD is missing from the cluster, the startCRDModeGC startup function returns early to skip running the Garbage Collector.
However, the OnStop lifecycle hook unconditionally attempts to call RemoveAllAndWait() on the internal controller manager (gc.mgr). Since it remains uninitialized (nil) due to the early return, this causes a panic when the operator shuts down.
Fix this by adding a defensive nil check for gc.mgr in OnStop.
Fixes: #45087