-
Notifications
You must be signed in to change notification settings - Fork 637
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
Cleanup XDGRuntime #3850
base: main
Are you sure you want to change the base?
Cleanup XDGRuntime #3850
Conversation
b1c9415
to
890d40e
Compare
Was wondering if we should even incorporate into
but (for now) elected for pure refactoring with no change of behavior. |
Not clear why the failures (some of it is definitely the usual stargz / layer not found), but the rest is weird (eg: platform timeout). If we can poke it in case it is a fluke... |
Signed-off-by: apostasie <[email protected]>
890d40e
to
a769865
Compare
CI failure seems to be a timeout. |
return "/run/user/" + euid, nil | ||
euid, err := strconv.Atoi(os.Getenv("ROOTLESSKIT_PARENT_EUID")) | ||
if err != nil { | ||
return "", errors.New("environment variable XDG_RUNTIME_DIR is not set, see https://rootlesscontaine.rs/getting-started/common/login/") |
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.
The new code is harder to read, as the error returned here is about XDG_RUNTIME_DIR
while the original err
is about ROOTLESSKIT_PARENT_EUID
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.
I don't like any of that code either.
We can add more fine grained errors. Just not sure this is worth the effort.
Lmk what you would prefer.
From reading code, it seems to me like:
XDGRuntimeDir()
should check the value ofROOTLESSKIT_PARENT_EUID
(likeParentEUID
does)getXDGRuntimeDir()
in bypass4netns is essentially duplicatingXDGRuntimeDir()
getRuntimeVariableDataDir
andCNIRuntimeDir
should not ignore errors, and they seem to have faulty logic (relying onGeteuid
regardless of conditions), or callingrootlessutil.ParentEUID
which will redo stuff done already inXDGRuntimeDir()
PR addresses these.