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

distro: run ValidateLayoutConstraints() when using PartitionCustomizations #1063

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

mvo5
Copy link
Contributor

@mvo5 mvo5 commented Nov 25, 2024

This commit will run ValidateLayoutConstraints() when a DiskCustomization is used.

Fwiw, the fact that we have to implement this in every distro (and in bib) and must not forget about it makes me wonder if we shouldn't flip this around. Call it by default but return a distinct error type (ValidateLayoutConstraintsError) when it is violated that clients (like a potential low-level otk partitioner) could choose to ignore. Wdyt?

…zations

This commit will run `ValidateLayoutConstraints()` when a `DiskCustomization`
is used.
@achilleas-k
Copy link
Member

Fwiw, the fact that we have to implement this in every distro (and in bib) and must not forget about it makes me wonder if we shouldn't flip this around. Call it by default but return a distinct error type (ValidateLayoutConstraintsError) when it is violated that clients (like a potential low-level otk partitioner) could choose to ignore. Wdyt?

It does seem cleaner, implementation wise, I just don't know if an error is the right way to handle this. Another alternative would be an argument, which is a bit ugly (unless we had optional arguments, but sadly we don't).

Copy link
Member

@achilleas-k achilleas-k left a comment

Choose a reason for hiding this comment

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

LGTM. We can reconsider the split later, but for now, let's at least get this in so we have the validation applied.

@mvo5
Copy link
Contributor Author

mvo5 commented Nov 25, 2024

Fwiw, the fact that we have to implement this in every distro (and in bib) and must not forget about it makes me wonder if we shouldn't flip this around. Call it by default but return a distinct error type (ValidateLayoutConstraintsError) when it is violated that clients (like a potential low-level otk partitioner) could choose to ignore. Wdyt?

It does seem cleaner, implementation wise, I just don't know if an error is the right way to handle this. Another alternative would be an argument, which is a bit ugly (unless we had optional arguments, but sadly we don't).

Yeah, I was thinking argument at first too but then we have no way (except for in the customization itself) to set it :/

@achilleas-k achilleas-k added this pull request to the merge queue Nov 25, 2024
Merged via the queue into osbuild:main with commit 36d86e4 Nov 25, 2024
19 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.

2 participants