Skip to content

Commit

Permalink
(feat): Adding resize to config
Browse files Browse the repository at this point in the history
  • Loading branch information
lasith-kg committed May 22, 2024
1 parent 73c64cb commit 09cb4f2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions configs/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
defaults:
lvmConsumption: 100
resizeFs: true
resizeThreshold: 99
devices:
/dev/vdb:
fs: xfs
lvm: ifmx-var
lvm: ifmx-etc
mountPoint: /mnt/foo
user: ubuntu
group: ubuntu
permissions: 755
resize: true
resizeThreshold: 99
/dev/vdc:
fs: xfs
lvm: ifmx-var
mountPoint: /mnt/bar
user: ubuntu
group: ubuntu
permissions: 755
2 changes: 1 addition & 1 deletion internal/layer/pv_resize.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (rpvl *ResizePhysicalVolumeLayer) Validate(c *config.Config) error {
continue
}
if rpvl.lvmBackend.ShouldResizePhysicalVolume(name, ResizeThreshold) {
return fmt.Errorf("🔴 %s: Failed to resize physical volume", name)
return fmt.Errorf("🔴 %s: Failed to resize validation checks. Physical volume %s still needs to be resized", name, name)
}
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion internal/service/lvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (ls *LinuxLvmService) GetPhysicalVolumes() ([]*model.PhysicalVolume, error)
for i, pv := range pr.Report[0].PhysicalVolume {
size, err := strconv.ParseUint(pv.PhysicalVolumeSize, 10, 64)
if err != nil {
return nil, fmt.Errorf("🔴 Failed to cast device size to unsigned 64-bit integer")
return nil, fmt.Errorf("🔴 Failed to cast physical volume size to unsigned 64-bit integer")
}
pvs[i] = &model.PhysicalVolume{
Name: pv.Name,
Expand Down

0 comments on commit 09cb4f2

Please sign in to comment.