-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix pinns error diagnostics, cleanup, and return #4148
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
Conversation
It is faster and also easier to read. Signed-off-by: Kir Kolyshkin <[email protected]>
We know the size of the slice already, so let's set its capacity in advance. Signed-off-by: Kir Kolyshkin <[email protected]>
1. In case pinns fails, we want to return a clear error message saying it has failed, not that we failed to unmount some mounts. So, do not return the "failed to unmount" error as it's minor in nature, and log the failures instead. 2. In case pinns fails, we want to see its stderr, not just stdout. Before this patch, only stdout is collected (and now shown as it's empty). 3. We can't be sure that the mounts we are trying to unmount were actually mounted, so ignore EINVAL from unmount(2). EINVAL means that either argument is not the mount point (i.e. not mounted), or that the flags are wrong. We only provide MNT_DETACH which is not a wrong flag, ergo EINVAL means "not mounted" and it should be ignored. 4. Only log pinns output in case of error, and do it as a warning since it is pretty serious. Signed-off-by: Kir Kolyshkin <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #4148 +/- ##
==========================================
+ Coverage 40.72% 40.74% +0.02%
==========================================
Files 111 111
Lines 9502 9497 -5
==========================================
Hits 3870 3870
+ Misses 5256 5251 -5
Partials 376 376 |
|
/retest |
saschagrunert
left a comment
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
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kolyshkin, saschagrunert The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
LGTM |
|
/lgtm |
|
/test integration_rhel |
1 similar comment
|
/test integration_rhel |
|
@kolyshkin: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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/test-infra repository. I understand the commands that are listed here. |
|
/retest |
/kind bug
What this PR does / why we need it:
In case pinns fails, we want to return a clear error message saying
it has failed, not that we failed to unmount some mounts. So, do not
return the "failed to unmount" error as it's minor in nature, and log
the failures instead.
In case pinns fails, we want to see its stderr, not just stdout.
Before this patch, only stdout is collected (and now shown as it's empty).
We can't be sure that the mounts we are trying to unmount were
actually mounted, so ignore EINVAL from unmount(2). EINVAL means
that either argument is not the mount point (i.e. not mounted),
or that the flags are wrong. We only provide MNT_DETACH which
is not a wrong flag, ergo EINVAL means "not mounted" and it should
be ignored.
Only log pinns output in case of error, and do it as a warning since
it is pretty serious.
While at it, make some minor improvements around the code we're touching.
Which issue(s) this PR fixes:
Fixes: #4147
Special notes for your reviewer:
Does this PR introduce a user-facing change?