-
Notifications
You must be signed in to change notification settings - Fork 626
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
ParentMain/nsenter: do not fail if getwd errors #3329
ParentMain/nsenter: do not fail if getwd errors #3329
Conversation
276b75f
to
d3a8c48
Compare
40f4bc0
to
ad6d20c
Compare
ad6d20c
to
e0d0079
Compare
Comment addressed. |
Signed-off-by: apostasie <[email protected]>
e0d0079
to
a1bd476
Compare
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, thanks. btw did you verify if this resolves the issue? i.e. the repro in #3328 works now:
mkdir foo
cd foo
rmdir ../foo
nerdctl container run -d --name foo debian sleep Inf
FATA[0000] getwd: no such file or directory
Yes, it does fix the issue. |
if err != nil { | ||
log.L.WithError(err).Warn("unable to determine working directory") | ||
} else { | ||
args = append(args, "-w"+wd) |
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.
IMO we may even set the working directory after nsenter with --wdns
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.
To what 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.
ah - you mean, in case getwd does NOT error, right?
Honestly, I would rather focus efforts on re-exec-ing instead of tweaking nsenter.
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, thanks
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.
Thanks
To fix #3328
It is not clear to me if there would be side-effects to this.
nsenter specialists opinion highly welcome.