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

nspawn wrongly detected as OCI #5937

Open
clementd64 opened this issue Apr 20, 2024 · 5 comments
Open

nspawn wrongly detected as OCI #5937

clementd64 opened this issue Apr 20, 2024 · 5 comments
Labels
🐛 bug Something isn't working as expected. 🌱 good first issue Good first issue to get your feet wet.

Comments

@clementd64
Copy link

Bug Report

Current Behavior

While running in a systemd-nspawn, the container module report OCI

Expected Behavior

systemd-nspawn or nspawn to be reported

Additional context/Screenshots

When /run/host/container-manager exist, OCI is hardcoded

if context_path(context, "/run/host/container-manager").exists() {
// OCI
return Some("OCI".into());
}

But systemd-nspawn also create this file with systemd-nspawn inside https://github.com/systemd/systemd/blob/8f0de5c433929782f7582a743d3b3d88bea9696d/src/nspawn/nspawn.c#L4148-L4149
This check is made early, bypassing the /run/systemd/container one.

Possible Solution

Check the file content.

@clementd64 clementd64 added the 🐛 bug Something isn't working as expected. label Apr 20, 2024
@andytom andytom added the 🌱 good first issue Good first issue to get your feet wet. label Apr 21, 2024
@brewedBorrows
Copy link

hey @andytom can I work on this?

@andytom
Copy link
Member

andytom commented Apr 22, 2024

hey @andytom can I work on this?

Yep sure please feel free to pick this up.

@brewedBorrows
Copy link

@andytom Hey, I fixed the issue, but can you have a look at the approach brewedBorrows/starship-fork1@master...brewedBorrows:starship-fork1:nspawn_OCI_#5937 . If you approve I will raise PR and add tests if needed.

@andytom
Copy link
Member

andytom commented Apr 27, 2024

Hey @brewedBorrows, the approach looks fine there are some things I would like to suggest but if you open a PR we can discuss them there.

@brewedBorrows
Copy link

#5943
Here's the PR @andytom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working as expected. 🌱 good first issue Good first issue to get your feet wet.
Projects
None yet
Development

No branches or pull requests

3 participants