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

[RFC] blueprint: make minsize required for disk.Customizations #1061

Merged
merged 1 commit into from
Nov 25, 2024

Conversation

mvo5
Copy link
Contributor

@mvo5 mvo5 commented Nov 25, 2024

This commit enforces the use of "minsize" for disk customizations. Without this the disk code will create zero sized partitions when minsize is omited which then later yields a strange error from osbuild:

Building manifest-qcow2-raw-vmdk-vhd-gce.json
<stdin> has errors:

.pipelines[1].stages[2].options.volumes[0].size:
  '0B' does not match '[1-9][0-9]*[bBsSkKmMgGtTpPeE]?'

2024/11/25 09:35:42 error: cannot run osbuild: running osbuild failed: exit status 2

We could also attempt to fix this by making guesses about minsize (which is what the existing filesystem customizations do). But that seems less appropriate here as this is about finer control and an arbitrary size of e.g. 1 GiB seems unexpected. Another alternative would be to infere from the parent container size and split equally. But we can always do this later and relax the rules (and even add things like minsize: 50% which would imply the parent container).

[edit: one wart of this is that for partitions with requiedMinsize data this should not be required but at this level we have no way of knowing :(]

This commit enforces the use of "minsize" for disk customizations.
Without this the `disk` code will create zero sized partitions when
`minsize` is omited which then later yields a strange error from
osbuild:
```
Building manifest-qcow2-raw-vmdk-vhd-gce.json
<stdin> has errors:

.pipelines[1].stages[2].options.volumes[0].size:
  '0B' does not match '[1-9][0-9]*[bBsSkKmMgGtTpPeE]?'

2024/11/25 09:35:42 error: cannot run osbuild: running osbuild failed: exit status 2
```

We could also attempt to fix this by making guesses about minsize
(which is what the existing filesystem customizations do). But that
seems less appropriate here as this is about finer control and an
arbitrary size of e.g. `1 GiB` seems unexpected. Another alternative
would be to infere from the parent container size and split equally.
But we can always do this later and relax the rules (and even add
things like `minsize: 50%` which would imply the parent container).
@mvo5 mvo5 requested a review from achilleas-k November 25, 2024 12:20
@achilleas-k
Copy link
Member

We could also attempt to fix this by making guesses about minsize (which is what the existing filesystem customizations do). But that seems less appropriate here as this is about finer control and an arbitrary size of e.g. 1 GiB seems unexpected.

I had the same thought and I agree. I think it makes sense that these "advanced" customizations don't do too much automatically.

You make a good point about the required min sizes. Perhaps we should rethink those too.

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