Skip to content
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

gather: Fix removal of empty files from gather #219

Merged

Conversation

black-dragon74
Copy link
Member

The MG currently uses -empty with find to remove the empty files. This only works for files with a
size of 0 bytes.

In cases where the file has an empty line or a single character this doesn't work.

This patch updates the logic to also consider files with LF endings (just a new line)

The MG currently uses `-empty` with find to remove
the empty files. This only works for files with a
size of 0 bytes.

In cases where the file has an empty line or a single
character this doesn't work.

This patch updates the logic to also consider files with
LF endings (just a new line)

Signed-off-by: Niraj Yadav <[email protected]>
@black-dragon74
Copy link
Member Author

/cc: @parth-gr @yati1998

@black-dragon74 black-dragon74 changed the title gather: Fix removal of empty file from gather gather: Fix removal of empty files from gather Jan 29, 2025

} >>${BASE_COLLECTION_PATH}/gather-debug.log 2>&1
find "${BASE_COLLECTION_PATH}" -empty -delete >>${BASE_COLLECTION_PATH}/gather-debug.log 2>&1
find "${BASE_COLLECTION_PATH}" -type f \( -empty -o -size 1c \) -print -delete >>${BASE_COLLECTION_PATH}/gather-debug.log 2>&1
Copy link
Member

Choose a reason for hiding this comment

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

-size 1c

Does it mean empty line?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, files with exactly one (newline) character.

@parth-gr
Copy link
Member

/lgtm

Copy link
Contributor

openshift-ci bot commented Jan 30, 2025

@parth-gr: changing LGTM is restricted to collaborators

In response to this:

/lgtm

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.

Copy link
Contributor

openshift-ci bot commented Jan 30, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: black-dragon74, parth-gr

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-merge-bot openshift-merge-bot bot merged commit 808df1b into red-hat-storage:main Feb 3, 2025
5 checks passed
@black-dragon74
Copy link
Member Author

/cherry-pick release-4.18

@openshift-cherrypick-robot

@black-dragon74: new pull request created: #221

In response to this:

/cherry-pick release-4.18

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.

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

Successfully merging this pull request may close these issues.

3 participants