Skip to content
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

Add manual overrides for container user namespaces. #891

Merged
merged 1 commit into from
Jul 1, 2022

Conversation

Alexhuszagh
Copy link
Contributor

@Alexhuszagh Alexhuszagh commented Jul 1, 2022

Support manual overrides of the container user namespace via the CROSS_CONTAINER_USER_NAMESPACE environment variable. If not set or set to auto, it will use the default value for the container engine (host). If none is provided, no --userns flag will be used. If any other value is provided, that will be the value passed to --userns.

This is required for using lima/nerdctl, which currently does not support the --userns flag.

Related to #888.

Comment on lines 413 to 414
None | Some("auto") if !is_nerdctl => Some("host".to_string()),
None | Some("auto") | Some("none") => None,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.62 bool::then_some would work nicely here

@Emilgardis
Copy link
Member

Emilgardis commented Jul 1, 2022

I don't know if we should explicitly support this. Maybe instead it should be more that the ContainerEngine is custom (i.e any random binary)

edit: "this" being Lima, the ns stuff is good

@Alexhuszagh
Copy link
Contributor Author

I don't know if we should explicitly support this. Maybe instead it should be more that the ContainerEngine is custom (i.e any random binary)

Maybe, we should probably at least support changing the user namespace, which would be necessary for lima support right now. But you're probably right: there's too many niche things here that can be covered in a more general case. Just keep the user namespace manual overrides, get rid of everything else?

@Alexhuszagh Alexhuszagh mentioned this pull request Jul 1, 2022
2 tasks
@Emilgardis
Copy link
Member

Just keep the user namespace manual overrides, get rid of everything else?

yep, sounds good to me

@Alexhuszagh Alexhuszagh changed the title Add Lima (Nerdctl) support. Add manual overrides for container user namespaces. Jul 1, 2022
Copy link
Member

@Emilgardis Emilgardis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Support manual overrides of the container user namespace via the `CROSS_CONTAINER_USER_NAMESPACE` environment variable. If not set or set to `auto`, it will use the default value for the container engine (`host`). If `none` is provided, no `--userns` flag will be used. If any other value is provided, that will be the value passed to `--userns`.

This is required for using lima/nerdctl, which currently does not support the `--userns` flag.

Related to cross-rs#888.
@Alexhuszagh
Copy link
Contributor Author

bors r=Emilgardis

@bors
Copy link
Contributor

bors bot commented Jul 1, 2022

Build succeeded:

@bors bors bot merged commit 6facb8f into cross-rs:main Jul 1, 2022
@Emilgardis Emilgardis modified the milestone: v0.2.3 Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants