Skip to content

Conversation

littlejawa
Copy link
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:

This is a cherry-pick of #9433

This commit implements the ReopenContainerLog function. This fixes an issue where kata container logs could not be rotated.

This required duplicating part of the createContainerIO function, so I am moving this in its own subfunction for reuse.

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Fix log rotation not working for containers running with the kata-containers runtime

This commit implements the ReopenContainerLog function.
This fixes an issue where kata container logs could not be rotated.

This required duplicating part of the createContainerIO function, so I am moving
this in its own subfunction for reuse.

Signed-off-by: Julien Ropé <jrope@redhat.com>
This commit adds a test that simulates log rotation, making sure
that the log file can be re-opened and used as expected.

Signed-off-by: Julien Ropé <jrope@redhat.com>
@openshift-ci openshift-ci bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/bug Categorizes issue or PR as related to a bug. labels Sep 4, 2025
@openshift-ci openshift-ci bot requested review from klihub and QiWang19 September 4, 2025 07:34
@littlejawa littlejawa changed the title Backport logrotate fix 1.31 [release-1.31] Backport kata logrotate fix Sep 4, 2025
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 4, 2025
Copy link
Contributor

openshift-ci bot commented Sep 4, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: littlejawa, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 4, 2025
@littlejawa
Copy link
Contributor Author

/retest

@openshift-merge-bot openshift-merge-bot bot merged commit dc59c78 into cri-o:release-1.31 Sep 4, 2025
35 of 40 checks passed
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants