Fix space calculation on recovery (#128)

This commit is contained in:
Itxaka
2023-08-16 22:59:50 +02:00
committed by GitHub
parent 1a72f56d67
commit 1cf9813f43
3 changed files with 7 additions and 7 deletions

View File

@@ -127,7 +127,7 @@ func NewInstallElementalPartitions(spec *v1.InstallSpec) v1.ElementalPartitions
pt.Recovery = &v1.Partition{
FilesystemLabel: constants.RecoveryLabel,
Size: spec.Recovery.Size + 100,
Size: spec.Recovery.Size + 200,
Name: constants.RecoveryPartName,
FS: constants.LinuxFs,
MountPoint: constants.RecoveryDir,
@@ -136,7 +136,7 @@ func NewInstallElementalPartitions(spec *v1.InstallSpec) v1.ElementalPartitions
pt.State = &v1.Partition{
FilesystemLabel: constants.StateLabel,
Size: spec.Active.Size + spec.Passive.Size + 100,
Size: spec.Active.Size + spec.Passive.Size + 200,
Name: constants.StatePartName,
FS: constants.LinuxFs,
MountPoint: constants.StateDir,
@@ -525,7 +525,7 @@ func ReadSpecFromCloudConfig(r *Config, spec string) (v1.Spec, error) {
if err != nil {
r.Logger.Warnf("Error sanitizing the % spec: %s", spec, err)
}
r.Logger.Debugf("Loaded %s spec: %s", litter.Sdump(sp))
r.Logger.Debugf("Loaded %s spec: %s", spec, litter.Sdump(sp))
return sp, nil
}

View File

@@ -351,7 +351,7 @@ func (e *Elemental) DeployImage(img *v1.Image, leaveMounted bool) (info interfac
// DumpSource sets the image data according to the image source type
func (e *Elemental) DumpSource(target string, imgSrc *v1.ImageSource) (info interface{}, err error) { // nolint:gocyclo
e.config.Logger.Infof("Copying %s source...", imgSrc.Value())
e.config.Logger.Infof("Copying %s source to %s", imgSrc.Value(), target)
if imgSrc.IsDocker() {
if e.config.Cosign {

View File

@@ -387,13 +387,13 @@ var _ = Describe("Elemental", Label("elemental"), func() {
"mkpart", "oem", "ext4", "133120", "264191",
}, {"mkfs.ext4", "-L", "COS_OEM", "/some/device2"}, {
"parted", "--script", "--machine", "--", "/some/device", "unit", "s",
"mkpart", "recovery", "ext4", "264192", "468991",
"mkpart", "recovery", "ext4", "264192", "673791",
}, {"mkfs.ext4", "-L", "COS_RECOVERY", "/some/device3"}, {
"parted", "--script", "--machine", "--", "/some/device", "unit", "s",
"mkpart", "state", "ext4", "468992", "673791",
"mkpart", "state", "ext4", "673792", "1083391",
}, {"mkfs.ext4", "-L", "COS_STATE", "/some/device4"}, {
"parted", "--script", "--machine", "--", "/some/device", "unit", "s",
"mkpart", "persistent", "ext4", "673792", "100%",
"mkpart", "persistent", "ext4", "1083392", "100%",
}, {"mkfs.ext4", "-L", "COS_PERSISTENT", "/some/device5"},
}