-
Notifications
You must be signed in to change notification settings - Fork 106
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
Add support for advanced partitioning customizations (COMPOSER-2399) #4535
base: main
Are you sure you want to change the base?
Add support for advanced partitioning customizations (COMPOSER-2399) #4535
Conversation
Add DiskCustomization and all its children to the internal blueprint. Add the conversion to the images counterpart to the Convert() function.
Move the creation of the blueprint to a function. We'll then add a separate blueprint function for the new, alternative partitioning customization.
Version 94 of osbuild-composer is over a year old now. It should be fine to test these unconditionally.
75cb610
to
df59325
Compare
Add separate blueprint creation functions, one for each partitioning layout: - disk-plain - disk-lvm - disk-btrfs (Fedora only) The existing 'filesystem' blueprint is also kept. Each function also sets the $EXPECTED_MOUNTPOINTS variable for the mountpoint check that happens after the build.
Remove incorrect comment (not an ostree image). Add a greenprint for depsolving since it can take some time for that to run and it makes more sense than pausing output on "Preparing blueprint".
Run filesystem.sh with all the valid arguments for the customization type.
df59325
to
423fb63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR, I have a very silly question inline, it comes down to if we can find a way to avoid some of the duplication with the images code that are currently present in this PR.
@@ -19,6 +19,7 @@ type Customizations struct { | |||
Firewall *FirewallCustomization `json:"firewall,omitempty" toml:"firewall,omitempty"` | |||
Services *ServicesCustomization `json:"services,omitempty" toml:"services,omitempty"` | |||
Filesystem []FilesystemCustomization `json:"filesystem,omitempty" toml:"filesystem,omitempty"` | |||
Disk *DiskCustomization `json:"disk,omitempty" toml:"disk,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a very stupid (sorry!) question - could we simply do:
iff --git a/internal/blueprint/customizations.go b/internal/blueprint/customiza
tions.go
index 9ec43401f..5efe3eb40 100644
--- a/internal/blueprint/customizations.go
+++ b/internal/blueprint/customizations.go
@@ -5,33 +5,34 @@ import (
"reflect"
"strings"
+ "github.com/osbuild/images/pkg/blueprint"
"github.com/osbuild/images/pkg/disk"
)
...
- Disk *DiskCustomization `json:"disk,omitempty" toml:"disk,omitempty"`
+ Disk *blueprint.DiskCustomization `json:"disk,omitempty" toml:"disk,omitempty"`
...
here (and remove disk_customizations.go in this PR)?
And then we would add a "Validate()" that simply disallows the "dc.Type" (as it seems that is the only thing we do not support compared to the images disk_blueprint)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think with the work we're doing to unify blueprints, it might be a good idea to just drop the whole copy from here and make it use the one from images directly.
"github.com/osbuild/images/pkg/datasizes" | ||
) | ||
|
||
type DiskCustomization struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my question above, I really would like to avoid this duplication, I'm worried it will lead to drift and I am also not sure why we need it (but maybe/surely I'm missing something here?)
I need to update image-info to handle btrfs subvolumes and ignore swap partitions when mounting filesystems. |
This PR enables the
disk
customizations in osbuild-composer.Tests for the new blueprint configurations have been added to filesystem.sh.
This pull request includes: