Add rootless_storage_path directive to storage.conf#529
Conversation
df33f73 to
1c1be21
Compare
|
@QiWang19 this needs a rebase. |
1c1be21 to
82e34e8
Compare
| **rootless_storage_path**="$HOME/.local/share/containers/storage" | ||
| Storage path for rootless users. By default the graphroot for rootless users | ||
| is set to `$XDG_DATA_HOME/containers/storage`, if XDG_DATA_HOME is set. | ||
| Otherwise the `$HOME/.local/share/containers/storage` is used. This field can |
There was a problem hiding this comment.
"Otherwise the" -> "Otherwise"
| * `$USER` => Replaced by the users name | ||
|
|
||
| A common use case for this field is `NFS home directories`, which do not work | ||
| with rootless container storage. |
There was a problem hiding this comment.
"do not work" -> "does not work"
or do we want to soften it a bit with something like "which is not currently supported with rootless container storage"?
| **rootless_storage_path**="$HOME/.local/share/containers/storage" | ||
| Storage path for rootless users. By default the graphroot for rootless users | ||
| is set to `$XDG_DATA_HOME/containers/storage`, if XDG_DATA_HOME is set. | ||
| Otherwise the `$HOME/.local/share/containers/storage` is used. This field can |
There was a problem hiding this comment.
https://github.com/containers/storage/pull/529/files#diff-81a17eae8a51582de5ca93d298bf0162R18 says it uses "$HOME/.config/containers/storage". Is $HOME/.local/share/containers/storage used?
There was a problem hiding this comment.
Fixed. The path is not used, the default is set to "".
82e34e8 to
a4f0b3a
Compare
|
|
||
| # Storage path for rootless users | ||
| # | ||
| # rootless_storage_path = "$HOME/.config/containers/storage" |
There was a problem hiding this comment.
Maybe I've over code-reviewed today, but the man page seems to say this should be $HOME/.local/share/containers/storage?
There was a problem hiding this comment.
Are they talking about no need to specify rootless_storage_path = "$HOME/.config/containers/storage" in storage.conf? I need ask @rhatdan
There was a problem hiding this comment.
Yes Tom is correct this should be something like
# rootless_storage_path = "/var/tmp/$USER/containers/storage"
There was a problem hiding this comment.
/var/tmp? not $HOME/.config/containers/storage? also change thoses man pages to /var/tmp/$USER/containers/storage?
There was a problem hiding this comment.
Let's talk today. If we are showing the default then it should be
$HOME/.local/share/containers/storage
a4f0b3a to
843211d
Compare
843211d to
4d559c6
Compare
edsantiago
left a comment
There was a problem hiding this comment.
Sorry; I hadn't seen this earlier.
| // GraphRoot is the filesystem path under which we will store the | ||
| // contents of layers, images, and containers. | ||
| GraphRoot string `json:"root,omitempty"` | ||
| // RooltessStoragePath is the storage path for rootless users |
| if storageOpts.GraphRoot == "" { | ||
| storageOpts.GraphRoot = defaultRootlessGraphRoot | ||
| } else if storageOpts.RootlessStoragePath != "" { | ||
| rootlessStoragePath := strings.Replace(storageOpts.RootlessStoragePath, "$HOME", homedir.Get(), -1) |
There was a problem hiding this comment.
Oh, ouch. This sort of string replacement isn't as simple as that: for instance, what if someone writes $HOMEDIR or $USERNAME? What you probably want here is something closer to:
look for dollar sign followed by any number of letters
if those letters are HOME, UID, or USER, replace as needed
otherwise, throw an error
| container storage graph dir (default: "/var/lib/containers/storage") | ||
| Default directory to store all writable content created by container storage programs. | ||
|
|
||
| **rootless_storage_path**="$HOME/.local/share/containers/storage" |
There was a problem hiding this comment.
What is the RHS of the = supposed to be? In all other options it's simply an empty string "". Why is this one different? Especially why is it misleadingly different? The = here implies that it's a default, but right below it says otherwise.
There was a problem hiding this comment.
the value of rootless_storage_path will not be used unless the user overwrites it in storage.conf. I think it can be described as "". But I'n not sure. I need ask @rhatdan
| * `$UID` => Replaced by the users UID | ||
| * `$USER` => Replaced by the users name | ||
|
|
||
| A common use case for this field is `NFS home directories`, which is not currently supported with rootless container storage. |
There was a problem hiding this comment.
This is confusing. Perhaps something more like "A common use case for this field is to provide a local storage directory when user home directories are NFS-mounted (podman does not support container storage over NFS)."
This allows rootless admins to setup alternative paths to content in the homedir. Rootless users on NFS homedirs will not be allowed to run podman, if an admin wants to setup alternative directory say in /var/tmp on local storage, they could configure the storage.conf file and then all users would automatically get storage in /var/tmp. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Signed-off-by: Qi Wang <qiwan@redhat.com>
4d559c6 to
e4f65e7
Compare
|
LGTM. Thank you for addressing my concerns. |
This allows rootless admins to setup alternative
paths to content in the homedir.
Rootless users on NFS homedirs will not be allowed to run
podman, if an admin wants to setup alternative directory say
in /var/tmp on local storage, they could configure the storage.conf
file and then all users would automatically get storage in /var/tmp.
Signed-off-by: Daniel J Walsh dwalsh@redhat.com
Signed-off-by: Qi Wang qiwan@redhat.com