-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Closes: 15858 (podman system reset --force destroy machine) #16268
Conversation
I rejigged my fork, and accidentally closed the previous WIP PR: #15904. Waiting on CICD, and then will attempt to remove draft. |
Safe guards calls to os.RemoveAll in order to prevent calls from accidently deleting the root file system in very strange edge cases. Did this by creating GuardedRemoveAll and migrated machine os.RemoveAll calls to it. Signed-off-by: Mike Perry <mike@bitbistro.org>
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: giuseppe, mikewwwperry 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 |
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
One non-blocking nit. Thanks!
// will not delete certain catastrophic paths. | ||
func GuardedRemoveAll(path string) error { | ||
if path == "" || path == "/" { | ||
return fmt.Errorf("refusing to recusively delete `%s`", path) |
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.
return fmt.Errorf("refusing to recusively delete `%s`", path) | |
return fmt.Errorf("refusing to recusively delete %q", path) |
%q
will do the quoting for us.
/lgtm |
Safe guards calls to os.RemoveAll in order to prevent calls from accidently deleting the root file system in very strange edge cases. Did this by creating GuardedRemoveAll and migrated machine os.RemoveAll calls to it.
Signed-off-by: Mike Perry mike@bitbistro.org
Closes #15858
Does this PR introduce a user-facing change?