-
Notifications
You must be signed in to change notification settings - Fork 85
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
install: Guide user towards the correct podman flags #953
Conversation
Needs a |
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 generally sane to me!
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.
Marking requested changes per above
Modified the error / root checking code a bit to better guide the user towards the correct bootc invocation. Issue BIFROST-552 [1] ``` [omer@hal9000 ~]$ podman run -it quay.io/otuchfel/bootc:comfy bootc install to-existing-root ERROR Installing to filesystem: Querying root privilege: The container must be executed with full privileges (e.g. --privileged flag) [omer@hal9000 ~]$ podman run -it --privileged quay.io/otuchfel/bootc:comfy bootc install to-existing-root ERROR Installing to filesystem: This command must be run with the podman --pid=host flag [omer@hal9000 ~]$ podman run -it --pid=host --privileged quay.io/otuchfel/bootc:comfy bootc install to-existing-root ERROR Installing to filesystem: /proc/1 is owned by 65534, not zero; this command must be run in the root user namespace (e.g. not rootless podman) [omer@hal9000 ~]$ sudo podman run -it --privileged --pid=host quay.io/otuchfel/bootc:comfy bootc install to-existing-root Installing image: docker://quay.io/otuchfel/bootc:comfy ... ``` [1] https://issues.redhat.com/browse/BIFROST-552 Signed-off-by: Omer Tuchfeld <[email protected]>
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 improvement from the commit message looks great!
We could have some tests, but I wouldn't block on that.
@@ -245,7 +245,7 @@ pub(crate) async fn run_from_anaconda(rootfs: &Dir) -> Result<()> { | |||
|
|||
/// From ostree-rs-ext, run through the rest of bootc install functionality | |||
pub async fn run_from_ostree(rootfs: &Dir, sysroot: &Utf8Path, stateroot: &str) -> Result<()> { | |||
crate::cli::require_root()?; | |||
crate::cli::require_root(false)?; |
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.
Non-blocking: One larger cleanup I think we could do is have an Environment
struct that gathers global state like this (uid, whether we have cap_sys_admin, whether /run/ostree-booted
exists, whether we appear to be in a container), and then query requirements on it.
e.g. here we're passing false
for is_container
but we don't actually know that's false or not.
Not a blocker, just an optional followup.
See commit message