fix panic on repeated IsReachable calls - #32184
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR hardens Kubernetes client creation/caching to avoid invalid cached state after a clientset creation failure, and adds a regression test to ensure IsReachable() behaves safely across repeated calls.
Changes:
- Update
getKubeClient()to only cache the client after successful factory creation. - Add a regression test that calls
IsReachable()twice after a forced client creation error.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/kube/client.go | Avoids caching kubeClient when factory creation returns an error. |
| pkg/kube/client_test.go | Adds a regression test for repeated IsReachable() calls after client creation failure. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
I can't approve your work but I think it is a good fix. |
Member
|
just approved workflows to run |
Member
|
CI succeeded. As I said in #32183 (comment) the Copilot comment is actually a good point in this case. Should be an easy update. |
atkrad
force-pushed
the
fix/kube-isreachable-nil-panic
branch
from
June 12, 2026 09:19
446aedc to
d46dbaa
Compare
atkrad
force-pushed
the
fix/kube-isreachable-nil-panic
branch
from
June 12, 2026 09:31
d46dbaa to
b82bbd5
Compare
- only cache kube client when creation succeeds - add regression test for two failed reachability checks Signed-off-by: Mohammad Abdolirad <m.abdolirad@gmail.com>
atkrad
force-pushed
the
fix/kube-isreachable-nil-panic
branch
from
June 12, 2026 09:34
b82bbd5 to
1f7869c
Compare
gjenkins8
approved these changes
Jun 18, 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.
Closes #32183