-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Fixed a make clean
regression
#77137
Fixed a make clean
regression
#77137
Conversation
/sig testing |
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fejta, Huang-Wei 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 |
@@ -29,7 +29,7 @@ CLEAN_PATTERNS=( | |||
) | |||
|
|||
for pattern in "${CLEAN_PATTERNS[@]}"; do | |||
while IFS=$'\n' read -r -d match; do | |||
while IFS=$'\n' read -r match; do | |||
echo "Removing ${match#${KUBE_ROOT}\/} .." | |||
rm -rf "${match#${KUBE_ROOT}\/}" | |||
done < <(find "${KUBE_ROOT}" -iregex "^${KUBE_ROOT}/${pattern}$") |
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.
We should probably use -print0
and use this as the delimiter.
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.
@BenTheElder do you mean (1) eliminate IFS
(2) append -print0
in "find" clause, and (3) use $'\0' as delimiter?
diff --git a/hack/make-rules/clean.sh b/hack/make-rules/clean.sh
index 9305c8df6c..9e85c3f879 100755
--- a/hack/make-rules/clean.sh
+++ b/hack/make-rules/clean.sh
@@ -29,10 +29,10 @@ CLEAN_PATTERNS=(
)
for pattern in "${CLEAN_PATTERNS[@]}"; do
- while IFS=$'\n' read -r match; do
+ while read -r -d $'\0' match; do
echo "Removing ${match#${KUBE_ROOT}\/} .."
rm -rf "${match#${KUBE_ROOT}\/}"
- done < <(find "${KUBE_ROOT}" -iregex "^${KUBE_ROOT}/${pattern}$")
+ done < <(find "${KUBE_ROOT}" -iregex "^${KUBE_ROOT}/${pattern}$" -print0)
done
# ex: ts=2 sw=2 et filetype=sh
/hold |
/hold cancel |
What type of PR is this?
/kind bug
/assign @BenTheElder
What this PR does / why we need it:
There is a regression introduced in #76840:
We shouldn't put "match" as a delimiter (followed by
-d
). IMO a delimiter other than newline (default) is unnecessary in this case.With this PR, the bug can be fixed:
Special notes for your reviewer:
Does this PR introduce a user-facing change?: