-
Notifications
You must be signed in to change notification settings - Fork 235
Update pod general stage #1477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Update pod general stage #1477
Conversation
✅ Deploy Preview for k8s-kwok canceled.
|
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: wzshiming The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the pod general stage configuration to improve handling of pod lifecycle states, particularly for init containers, sidecars, and pod completion scenarios. The changes focus on more accurate state transitions and timestamp management.
Key changes:
- Enhanced init container completion logic to handle sidecar containers with
restartPolicy: Always - Improved timestamp handling by preserving original
startedAttimes instead of overwriting with current time - Added new test cases for pods with sidecars in various completion states
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| pod-init-container-completed.yaml | Updated to differentiate between regular init containers and sidecar containers, with conditional state handling based on restart policy |
| pod-complete.yaml | Enhanced to handle init containers and sidecars during pod completion, with improved condition management |
| pod-ready.yaml | Modified readiness checks to properly detect waiting states in both init and regular containers |
| pod-init-container-completed.output.yaml | Test data updated to reflect preserved startedAt timestamps |
| pod-init-container-completed-with-sidecar.output.yaml | New test case for init container completion with running sidecar |
| pod-init-container-completed-with-sidecar.input.yaml | New test input for sidecar scenario |
| pod-complete.output.yaml | Updated test output with new condition fields and preserved timestamps |
| pod-complete.input.yaml | Added restartPolicy field to test input |
| pod-complete-with-sidecar.output.yaml | New test case for pod completion with sidecar containers |
| pod-complete-with-sidecar.input.yaml | New test input for completion with sidecar |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
kustomize/stage/pod/general/testdata/pod-complete-with-sidecar.output.yaml
Outdated
Show resolved
Hide resolved
kustomize/stage/pod/general/testdata/pod-complete-with-sidecar.input.yaml
Outdated
Show resolved
Hide resolved
kustomize/stage/pod/general/testdata/pod-complete-with-sidecar.output.yaml
Outdated
Show resolved
Hide resolved
kustomize/stage/pod/general/testdata/pod-complete-with-sidecar.input.yaml
Outdated
Show resolved
Hide resolved
| - key: '.status.initContainerStatuses.[].state.waiting.reason' | ||
| operator: 'DoesNotExist' | ||
| - key: '.status.containerStatuses.[].state.waiting.reason' | ||
| operator: 'Exists' |
Copilot
AI
Oct 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic appears inverted: initContainerStatuses checks for DoesNotExist while containerStatuses checks for Exists. For a pod to be ready, typically both init containers should not be waiting (DoesNotExist is correct) AND regular containers should also not be waiting (should be DoesNotExist, not Exists).
| operator: 'Exists' | |
| operator: 'DoesNotExist' |
09fe981 to
aec9425
Compare
aec9425 to
caf7247
Compare
898c9d0 to
72eccad
Compare
72eccad to
d9622c0
Compare
|
@wzshiming: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
xref #1406
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: