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

On solo5 manifest mismatch print the manifest #196

Merged
merged 3 commits into from
Nov 20, 2024
Merged

On solo5 manifest mismatch print the manifest #196

merged 3 commits into from
Nov 20, 2024

Conversation

reynir
Copy link
Contributor

@reynir reynir commented Nov 20, 2024

This makes it easier for users of the client to figure out what devices are expected without them having to know to query the solo5 manifest using solo5-elftool themselves. I personally often either get the expected devices wrong or simply don't remember. In that case albatross-client can be a bit more helpful and display the information we have.

The output looks like the following (the indendation is a bit odd):

$ albatross-client create teeeest ~/workspace/./dnsvizor/dns-only/dist/dns-stub.hvt
albatross-client: specified bridge(s) does not match with the manifest. Declared manifest: {
                   "type": "solo5.manifest", "version": 1,
                   "devices": [ { "name": "service", "type": "NET_BASIC" } ]
                  }

If there's a mismatch of block devices the error message will not say anything about network devices. I'm okay with that.

This makes it easier for users of the client to figure out what devices
are expected without them having to know to query the solo5 manifest
using solo5-elftool themselves.
@hannesm
Copy link
Collaborator

hannesm commented Nov 20, 2024

Thanks for your PR. I wonder whether printing the names (of network / block devices) and the names used in the manifest is more concise, and easier to comprehend?

@reynir
Copy link
Contributor Author

reynir commented Nov 20, 2024

Thank you for your comment. I pushed a change which alters the error message:

$ albatross-client create teeeest mirror.hvt --block foo --net bar --block quux
albatross-client: specified block device(s) does not match with manifest. Declared devices: net "service", block "tar"

I added quotes around the device names. This should not be necessary as solo5 device names are rather restrictive, but I find it makes it more clear what is the device type and what is the name. A somewhat malicious example would be block "net" which would read rather confusingly without the quotes.

@hannesm
Copy link
Collaborator

hannesm commented Nov 20, 2024

I do like that. But can we reformulate the "Declared devices", and maybe use "devices oresent in manifest"?

I find the term "declared" confusing... these devices are also declared as boot parameters..

Co-authored-by: Hannes Mehnert <hannes@mehnert.org>
@hannesm hannesm merged commit 80d24b5 into main Nov 20, 2024
11 of 13 checks passed
@hannesm
Copy link
Collaborator

hannesm commented Nov 20, 2024

thanks a lot :)

@hannesm hannesm deleted the print-manifest branch November 20, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants