Skip to content

OCPBUGS-123174: Count app container restarts when native sidecars are present - #17394

Closed
nikitapal-12 wants to merge 1 commit into
openshift:release-4.20from
nikitapal-12:OCPBUGS-123174-release-4.20
Closed

nikitapal-12 wants to merge 1 commit into
openshift:release-4.20from
nikitapal-12:OCPBUGS-123174-release-4.20

Conversation

@nikitapal-12

Copy link
Copy Markdown

Analysis / Root cause:
podRestarts() treated a pod as still initializing when any init container had not exited 0. Native sidecars never terminate, so the Restarts column ignored CrashLoopBackOff counts on app containers. podPhase() was already updated for native sidecars in OCPBUGS-45843; podRestarts() was not.

Solution description:
Match kubectl printPod(): a native sidecar with started true is not initializing. After initialization, Restarts is app-container restarts plus restartable init (sidecar) restarts. Regular completed init containers stay excluded.

This pull request targets release-4.20 because OCPBUGS-123174 targets 4.20.z.

Screenshots / screen recording:
N/A. Numeric Restarts column only; no layout change.

Test setup:
On OCP 4.20, create a pod with a native sidecar (initContainers.restartPolicy Always) and an app container in CrashLoopBackOff. Compare Workloads -> Pods Restarts with oc get pods.

Test cases:

  • Regular init still initializing: init restart counts
  • Regular init completed: app restart counts only
  • Native sidecar started and app CrashLoopBackOff: includes app restarts
  • Native sidecar started with its own restarts: sidecar plus app
  • Native sidecar not yet started: init counts only

Covered by unit tests in frontend/tests/module/k8s/pods.spec.ts.

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:
Jira: https://redhat.atlassian.net/browse/OCPBUGS-123174

Related:

  • OCPBUGS-45843 (podPhase native sidecars)
  • OCPBUGS-53118 (podReadiness native sidecars)

Reported on OCP 4.20.34.

Reviewers and assignees:

… present

Native sidecars never terminate, so podRestarts treated those pods as still
initializing and hid CrashLoopBackOff restart counts.

https: //redhat.atlassian.net/browse/OCPBUGS-123174
Co-authored-by: Cursor <cursoragent@cursor.com>
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification

This PR uses the pipeline controller for second-stage tests. Selection and triggering follow the repository configuration.

Use /test ? to list jobs and /pipeline help for commands.

@openshift-ci-robot openshift-ci-robot added jira/severity-low Referenced Jira bug's severity is low for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Oct 19, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@nikitapal-12: This pull request references Jira Issue OCPBUGS-123174, which is invalid:

  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required". For more information you can reference the OpenShift Bug Process.
  • expected Jira Issue OCPBUGS-123174 to depend on a bug targeting a version in 4.21.0, 4.21.z and in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but no dependents were found

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Analysis / Root cause:
podRestarts() treated a pod as still initializing when any init container had not exited 0. Native sidecars never terminate, so the Restarts column ignored CrashLoopBackOff counts on app containers. podPhase() was already updated for native sidecars in OCPBUGS-45843; podRestarts() was not.

Solution description:
Match kubectl printPod(): a native sidecar with started true is not initializing. After initialization, Restarts is app-container restarts plus restartable init (sidecar) restarts. Regular completed init containers stay excluded.

This pull request targets release-4.20 because OCPBUGS-123174 targets 4.20.z.

Screenshots / screen recording:
N/A. Numeric Restarts column only; no layout change.

Test setup:
On OCP 4.20, create a pod with a native sidecar (initContainers.restartPolicy Always) and an app container in CrashLoopBackOff. Compare Workloads -> Pods Restarts with oc get pods.

Test cases:

  • Regular init still initializing: init restart counts
  • Regular init completed: app restart counts only
  • Native sidecar started and app CrashLoopBackOff: includes app restarts
  • Native sidecar started with its own restarts: sidecar plus app
  • Native sidecar not yet started: init counts only

Covered by unit tests in frontend/tests/module/k8s/pods.spec.ts.

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:
Jira: https://redhat.atlassian.net/browse/OCPBUGS-123174

Related:

  • OCPBUGS-45843 (podPhase native sidecars)
  • OCPBUGS-53118 (podReadiness native sidecars)

Reported on OCP 4.20.34.

Reviewers and assignees:

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
openshift-ci Bot requested review from cajieh and spadgett October 19, 2026 04:59
@openshift-ci openshift-ci Bot added the component/core Related to console core functionality label Oct 19, 2026
@openshift-ci

openshift-ci Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: nikitapal-12
Once this PR has been reviewed and has the lgtm label, please assign logonoff for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@openshift-ci openshift-ci Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 19, 2026
@openshift-ci

openshift-ci Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Hi @nikitapal-12. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: edefa02b-4312-4ebb-8331-04a27fe96cd6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@spadgett

Copy link
Copy Markdown
Member

Hi, @nikitapal-12. Thank you for the PR. The normal process is to open a fix against main, and then backport to each release branch. It looks like the fix hasn't been applied to newer versions yet, correct? We have a slash cherry-pick bot command that helps with the backports. I'd suggest retargeting the fix to 5.1 on main.

@nikitapal-12

Copy link
Copy Markdown
Author

Thanks @spadgett. podRestarts() on main still has the old initializing check, so this is not fixed in newer versions.

I opened the fix against main: #17418 (OCPBUGS-132854, target 5.1.0). The Jira check on that PR is valid.

After #17418 merges and QE verifies it, I will use /cherry-pick for the release branches, including release-4.20. Closing this PR so the 4.20 backport comes from the cherry-pick bot.

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@nikitapal-12: This pull request references Jira Issue OCPBUGS-123174. The bug has been updated to no longer refer to the pull request using the external bug tracker. All external bug links have been closed. The bug has been moved to the NEW state.

Details

In response to this:

Analysis / Root cause:
podRestarts() treated a pod as still initializing when any init container had not exited 0. Native sidecars never terminate, so the Restarts column ignored CrashLoopBackOff counts on app containers. podPhase() was already updated for native sidecars in OCPBUGS-45843; podRestarts() was not.

Solution description:
Match kubectl printPod(): a native sidecar with started true is not initializing. After initialization, Restarts is app-container restarts plus restartable init (sidecar) restarts. Regular completed init containers stay excluded.

This pull request targets release-4.20 because OCPBUGS-123174 targets 4.20.z.

Screenshots / screen recording:
N/A. Numeric Restarts column only; no layout change.

Test setup:
On OCP 4.20, create a pod with a native sidecar (initContainers.restartPolicy Always) and an app container in CrashLoopBackOff. Compare Workloads -> Pods Restarts with oc get pods.

Test cases:

  • Regular init still initializing: init restart counts
  • Regular init completed: app restart counts only
  • Native sidecar started and app CrashLoopBackOff: includes app restarts
  • Native sidecar started with its own restarts: sidecar plus app
  • Native sidecar not yet started: init counts only

Covered by unit tests in frontend/tests/module/k8s/pods.spec.ts.

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:
Jira: https://redhat.atlassian.net/browse/OCPBUGS-123174

Related:

  • OCPBUGS-45843 (podPhase native sidecars)
  • OCPBUGS-53118 (podReadiness native sidecars)

Reported on OCP 4.20.34.

Reviewers and assignees:

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 openshift-eng/jira-lifecycle-plugin repository.

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

Labels

component/core Related to console core functionality jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/severity-low Referenced Jira bug's severity is low for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants