-
Notifications
You must be signed in to change notification settings - Fork 1.2k
runtime: Fix rootlessDir not correctly set in rootless VMM mode #11527
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
runtime: Fix rootlessDir not correctly set in rootless VMM mode #11527
Conversation
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!
@StevenFryto Commit message check throws the following error.
I checked your commit using
To append the correct S-o-b, execute |
4ce840c
to
a033295
Compare
Thanks, I’ve updated the commit metadata as suggested. |
Previously, the rootlessDir variable in `src/runtime/virtcontainers/pkg/rootless.go` was initialized at package load time using `os.Getenv("XDG_RUNTIME_DIR")`. However, in rootless VMM mode, the correct value of $XDG_RUNTIME_DIR is set later during runtime using os.Setenv(), so rootlessDir remained empty. This patch defers the initialization of rootlessDir until the first call to `GetRootlessDir()`, ensuring it always reflects the current environment value of $XDG_RUNTIME_DIR. Fixes: kata-containers#11526 Signed-off-by: stevenfryto <sunzitai_1832@bupt.edu.cn>
a033295
to
3c7a670
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.
Thx @StevenFryto LGTM
Previously, the rootlessDir variable in
src/runtime/virtcontainers/pkg/rootless.go
was initialized at package load time usingos.Getenv("XDG_RUNTIME_DIR")
. However, in rootless VMM mode, the correct value of $XDG_RUNTIME_DIR is set later during runtime using os.Setenv(), so rootlessDir remained empty.This patch defers the initialization of rootlessDir until the first call to
GetRootlessDir()
, ensuring it always reflects the current environment value of $XDG_RUNTIME_DIR.Fixes: #11526