Skip to content

MG-240: Proposal to optionally skip rotated pod logs from must-gather#1964

Merged
openshift-merge-bot[bot] merged 3 commits intoopenshift:masterfrom
shivprakashmuley:skip-rotated-log-EP
Apr 8, 2026
Merged

MG-240: Proposal to optionally skip rotated pod logs from must-gather#1964
openshift-merge-bot[bot] merged 3 commits intoopenshift:masterfrom
shivprakashmuley:skip-rotated-log-EP

Conversation

@shivprakashmuley
Copy link
Copy Markdown
Contributor

This PR addresses https://redhat.atlassian.net/browse/MG-240 .

Context
The default must-gather image uses --rotated-pod-logs on its main inspect paths. That improves diagnostics but can grow archives, lengthen collection, and add API/node load. The must-gather image is expected to honor MUST_GATHER_SKIP_ROTATED_POD_LOGS=True (strict string equality) to omit that flag on covered invocations.

What changed
Describes the mapping from spec.additionalConfig.skipRotatedPodLogs to MUST_GATHER_SKIP_ROTATED_POD_LOGS=True on the gather container, references the must-gather implementation (collection-scripts/common.sh, get_log_collection_args / rotated_pod_logs_arg), and states that omitted, null, or false preserves today’s default (rotated pod logs collected).

Workflow: Optional additionalConfig step, including skipRotatedPodLogs: true and env injection on the gather container only.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 30, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Mar 30, 2026

@shivprakashmuley: This pull request references MG-240 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

This PR addresses https://redhat.atlassian.net/browse/MG-240 .

Context
The default must-gather image uses --rotated-pod-logs on its main inspect paths. That improves diagnostics but can grow archives, lengthen collection, and add API/node load. The must-gather image is expected to honor MUST_GATHER_SKIP_ROTATED_POD_LOGS=True (strict string equality) to omit that flag on covered invocations.

What changed
Describes the mapping from spec.additionalConfig.skipRotatedPodLogs to MUST_GATHER_SKIP_ROTATED_POD_LOGS=True on the gather container, references the must-gather implementation (collection-scripts/common.sh, get_log_collection_args / rotated_pod_logs_arg), and states that omitted, null, or false preserves today’s default (rotated pod logs collected).

Workflow: Optional additionalConfig step, including skipRotatedPodLogs: true and env injection on the gather container only.

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 jmguzik and yuqi-zhang March 30, 2026 09:29

The Must Gather Operator is an OLM-installable operator deployed on an OpenShift cluster that closely integrates with the must-gather tool. This enhancement describes how the operator provides a user-configurable interface (a new CustomResource) to gather data, diagnostic information from a cluster using must-gather and upload it to a Red Hat support case.

Gather behavior is configured under `spec.gatherSpec`: `audit` toggles audit log collection, and optional `command` / `args` override the gather container entrypoint and arguments. For optional skip of rotated pod logs, set `gatherSpec.command` to `/bin/bash`, `-c`, and a third element that is the shell command line passed to `-c`: a per-invocation environment assignment plus `gather`, i.e. `REDUCE_LOGS=skip_rotated_logs gather`. This omits `oc adm inspect --rotated-pod-logs` on the paths covered by the [must-gather image](https://github.com/openshift/must-gather). When those overrides are not used, behavior matches today’s default (rotated pod logs are collected).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe make this bulleted and not this verbose

- User provides a reference to the service account to be used for the collection Job
- User sets `spec.serviceAccountName` for the ServiceAccount that runs the collection Job
- User provides a reference to the secret to be used to authenticate to sftp.access.redhat.com
- Optionally, user sets `spec.gatherSpec` (`command` for the gather container); to skip rotated pod logs, use `gatherSpec.command` with `/bin/bash`, `-c`, and a third element that runs `gather` with `REDUCE_LOGS=skip_rotated_logs` set for that invocation only (see example below)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just mention that we need to set the env variable and point to the example below rather than saying the same thing over again?

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 6, 2026

@shivprakashmuley: all tests passed!

Full PR test history. Your PR dashboard.

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.

@Prashanth684
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 6, 2026
@Prashanth684 Prashanth684 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 8, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 8, 2026

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

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

@openshift-merge-bot openshift-merge-bot bot merged commit fcc9177 into openshift:master Apr 8, 2026
2 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. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants