-
Notifications
You must be signed in to change notification settings - Fork 797
defaults: use user-writable data root on darwin #4842
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably (most of) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,12 @@ | |
|
|
||
| package defaults | ||
|
|
||
| import gocni "github.com/containerd/go-cni" | ||
| import ( | ||
| "os" | ||
| "path/filepath" | ||
|
|
||
| gocni "github.com/containerd/go-cni" | ||
| ) | ||
|
|
||
| const ( | ||
| AppArmorProfileName = "" | ||
|
|
@@ -41,6 +46,9 @@ func CNINetConfPath() string { | |
| } | ||
|
|
||
| func DataRoot() string { | ||
| if home, err := os.UserHomeDir(); err == nil && home != "" { | ||
| return filepath.Join(home, ".local", "share", "nerdctl") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in a5cdb0d. For non-root on Darwin, DataRoot now respects XDG_DATA_HOME (fallback: ~/.local/share).
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The convention should be consistent with nerdbox.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed in a5cdb0d. Updated Darwin defaults to follow the same user-writable/XDG convention consistently across paths for non-root, while keeping system defaults for root. |
||
| } | ||
| return "/var/lib/nerdctl" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should remain the default when EUID is 0
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in a5cdb0d. DataRoot now keeps /var/lib/nerdctl when EUID == 0. |
||
| } | ||
|
|
||
|
|
||
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.
All the paths should be handled consistently, not just
DataRootThere 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.
Fixed in a5cdb0d. I applied the same root/non-root + XDG convention consistently to DataRoot, CNINetConfPath, CNIRuntimeDir, NerdctlTOML, HostsDirs, and CDISpecDirs.