-
Notifications
You must be signed in to change notification settings - Fork 20
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
gather: Fix removal of empty files from gather #219
Conversation
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]>
|
||
} >>${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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
/lgtm |
@parth-gr: changing LGTM is restricted to collaborators In response to this:
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. |
[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 |
/cherry-pick release-4.18 |
@black-dragon74: new pull request created: #221 In response to this:
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. |
The MG currently uses
-empty
with find to remove the empty files. This only works for files with asize 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)