-
Notifications
You must be signed in to change notification settings - Fork 252
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
Fix windows runtime dir #1810
Fix windows runtime dir #1810
Conversation
Co-authored-by: Giuseppe Scrivano <[email protected]> Co-authored-by: Ashley Cui <[email protected]> Signed-off-by: Ashley Cui <[email protected]>
Thanks! @giuseppe |
LGTM |
/approve |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ashley-cui, baude The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
if err != nil { | ||
return "", err | ||
} | ||
runtimeDir := filepath.Join(data, "containers", "podman") |
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.
Looks like a weird name choice when the code making it lives in this repository.
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.
opened a PR to fix it: #1812
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 agree ... seems misplaced
// GetShortcutString returns the string that is shortcut to user's home directory | ||
// in the native shell of the platform running on. | ||
func GetShortcutString() string { | ||
return "%USERPROFILE%" // be careful while using in format functions | ||
} | ||
|
||
// StickRuntimeDirContents is a no-op on Windows | ||
func StickRuntimeDirContents(files []string) ([]string, error) { |
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.
(This has no callers, and IMHO pretty suspect description/implementation… I wouldn’t mind if it just somehow went missing ;) )
// environment variables depending on the target operating system. | ||
// Returned path should be used with "path/filepath" to form new paths. | ||
func GetConfigHome() (string, error) { | ||
return filepath.Join(Get(), ".config"), nil |
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.
Shouldn’t this preserve the error handling from homedir_others
? The path where Get()
returns ""
seems to be reachable in principle.
if err != nil { | ||
return "", err | ||
} | ||
runtimeDir := filepath.Join(data, "containers", "podman") |
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.
This is ~/.local/share/containers/podman? On Linux, “runtime” and “data” dirs are different directories with different lifetimes (and hypothetically naming conflicts).
OTOH I appreciate that Podman’s pkg/util.GetRootlessRuntimeDir
has been using this path… I guess we are trusting Jason?
Needed to un-break podman win main.
Needs to be vendored into common, then into podman.