fix(kubernetes): fail sandbox after main container restart - #1482
ruirui6946 wants to merge 13 commits into
Conversation
c592784 to
eaa4329
Compare
There was a problem hiding this comment.
Pull request overview
Updates the Kubernetes BatchSandbox status controller so a sandbox that previously reached Succeed is transitioned to Failed if the main (first) container restarts after the sandbox became ready, preventing “Succeeded” from masking a reset runtime (e.g., OOM + restart) as described in #1450.
Changes:
- Extend pod failure detection to treat a post-ready main-container restart as a failure signal (while ignoring sidecar restarts).
- Introduce a restart-detection baseline keyed off the existing
Readytransition time plus stable generation/replica count and stable endpoint membership. - Add focused unit tests covering post-ready restarts, pre-ready restart history, sidecar restarts, and baseline resets when pod membership changes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| kubernetes/internal/controller/batchsandbox_status.go | Adds restart detection logic and a baseline mechanism, and wires it into steady-state runtime phase evaluation. |
| kubernetes/internal/controller/batchsandbox_pause_resume_test.go | Adds new test cases validating the new restart-based failure behavior and baseline reset behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c592784c5d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
10a2c94 to
02f162f
Compare
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
02f162f to
4141987
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 41419870f7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d3aa4ab7a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dcc16e9b6b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b44c4452c9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6a087245bd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ace0ef4de3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 49da87fa7b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Addressed all five remaining review threads in 48b0388 and synced the branch with current main at 51c0b2c. The full Kubernetes make test suite now passes on Tencent Cloud Linux with Kubernetes 1.33 envtest assets (controller coverage 79.7%), including manifests, generation, formatting, vet, and all non-E2E packages. All review threads are resolved. The new external-fork workflow runs are currently action_required; please approve them when convenient. Ready for re-review. |
Summary
Testing
go test -v ./internal/controller -run '^(TestBuildRuntimeView|TestGetPodFailureReasonAndMessage|TestPersistRuntimeView|TestFindBatchSandboxesForPooledPod)' -count=1go test ./internal/controller -run '^Test[^C]' -count=1make test ENVTEST_K8S_VERSION=1.33.0(manifests, generate, fmt, vet, and all non-E2E packages with envtest; controller coverage 79.7%)make test(no content drift)git diff --checkFixes #1450