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

sosreport: Explicitly specify "host" in download channel options #21100

Merged

Conversation

mvollmer
Copy link
Member

@mvollmer mvollmer commented Oct 9, 2024

This makes it work when downloading from a remote machine.

No default will be provided by Cockpit itself, unlike with cockpit.channel() etc.

This makes it work when downloading from a remote machine.

No default will be provided by Cockpit itself, unlike with
cockpit.channel() etc.
@mvollmer
Copy link
Member Author

mvollmer commented Oct 9, 2024

We should probably have a function in cockpit.js to create these URLs, and that function can provide the right default for host.

@martinpitt
Copy link
Member

A test is straightforward (like in cockpit-project/cockpit-machines@6024303) but expensive 😢 We have quite a bunch of these cases, I wonder if we could do some nspawn magic to create some kind of fake container with a file system overlay?

@jelly
Copy link
Member

jelly commented Oct 9, 2024

A test is straightforward (like in cockpit-project/cockpit-machines@6024303) but expensive 😢 We have quite a bunch of these cases, I wonder if we could do some nspawn magic to create some kind of fake container with a file system overlay?

I also like the idea of not introducing a test for this but not an expensive one as in machines for files. As files tests are pretty speedy and that is awesome.

@mvollmer mvollmer marked this pull request as ready for review October 10, 2024 10:19
@mvollmer mvollmer requested a review from jelly October 10, 2024 10:19
@martinpitt
Copy link
Member

martinpitt commented Oct 10, 2024

I wonder if we could do some nspawn magic to create some kind of fake container with a file system overlay?

Yes we can! nspawn can boot its own host OS/file system in a container:

# auto-manage the host side of container veths 
systemctl enable --now systemd-networkd
systemd-nspawn --machine=cockpit1 --ephemeral --network-veth --directory=/ --boot --bind /home

Afterwards, check the container IP in ip -c a and log in with e.g. ssh [email protected] from the outer VM, or directly from the host:

ssh -i ~/upstream/bots/machine/identity -o ProxyCommand='ssh -A c nc %h %p' [email protected]

This gets its own /tmp and similar, and we can add arbitrary --overlay or --bind options if we need to diverge paths in e.g. /usr/ between the host and the container.

@martinpitt
Copy link
Member

See #21105 for a draft how this "lightweight container provision" can look like.

Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

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

... that said, I'm fine with adding a test for this as a follow-up.

@mvollmer mvollmer merged commit 353a3cb into cockpit-project:main Oct 11, 2024
86 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants