Skip to content

Conversation

@wzshiming
Copy link
Member

@wzshiming wzshiming commented Oct 22, 2025

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?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

NONE

@wzshiming wzshiming requested a review from Copilot October 22, 2025 07:28
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. labels Oct 22, 2025
@netlify
Copy link

netlify bot commented Oct 22, 2025

Deploy Preview for k8s-kwok canceled.

Name Link
🔨 Latest commit d9622c0
🔍 Latest deploy log https://app.netlify.com/projects/k8s-kwok/deploys/694e601fe0d5e70008487fbd

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 22, 2025
@k8s-ci-robot
Copy link
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 22, 2025
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 22, 2025
Copy link

Copilot AI left a 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 startedAt times 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.

- key: '.status.initContainerStatuses.[].state.waiting.reason'
operator: 'DoesNotExist'
- key: '.status.containerStatuses.[].state.waiting.reason'
operator: 'Exists'
Copy link

Copilot AI Oct 22, 2025

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).

Suggested change
operator: 'Exists'
operator: 'DoesNotExist'

Copilot uses AI. Check for mistakes.
@wzshiming wzshiming force-pushed the general-stage-with-job-and-sidecar branch from 09fe981 to aec9425 Compare October 22, 2025 08:25
@wzshiming wzshiming force-pushed the general-stage-with-job-and-sidecar branch from aec9425 to caf7247 Compare December 26, 2025 08:19
@k8s-ci-robot k8s-ci-robot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/documentation Categorizes issue or PR as related to documentation. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 26, 2025
@wzshiming wzshiming force-pushed the general-stage-with-job-and-sidecar branch 2 times, most recently from 898c9d0 to 72eccad Compare December 26, 2025 10:11
@wzshiming wzshiming force-pushed the general-stage-with-job-and-sidecar branch from 72eccad to d9622c0 Compare December 26, 2025 10:14
@k8s-ci-robot
Copy link
Contributor

@wzshiming: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kwok-verify-main d9622c0 link true /test pull-kwok-verify-main

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.

Details

Instructions 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/documentation Categorizes issue or PR as related to documentation. kind/feature Categorizes issue or PR as related to a new feature. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants