Automated cherry pick of #23386: fix(host-deployer): allow growpart on primary partition (#23394)

* fix(host): init cgroup ignore disable cgroup option

* fix(host-deployer): allow growpart on primary partition
This commit is contained in:
wanyaoqi
2025-09-27 12:02:06 +08:00
committed by GitHub
parent 9a19621da0
commit 59089c6792
2 changed files with 5 additions and 6 deletions
+1 -1
View File
@@ -180,7 +180,7 @@ func (d *SFsutilDriver) ResizeDiskPartition(diskPath string, sizeMb int) (string
fsType = d.GetFsFormat(partDev)
log.Infof("blkid get fstype %s", fsType)
}
if part[5] == "lvm" || IsSupportResizeFs(fsType) {
if part[5] == "lvm" || IsSupportResizeFs(fsType) || part[5] == "primary" {
// growpart script replace parted resizepart
output, err := d.Exec("growpart", diskPath, part[0])
if err != nil {
+4 -5
View File
@@ -524,12 +524,11 @@ func (h *SHostInfo) prepareEnv() error {
if err != nil {
log.Warningf("modprobe vhost_net error: %s", output)
}
if !options.HostOptions.DisableSetCgroup {
if err := cgrouputils.Init(h.IoScheduler); err != nil {
return fmt.Errorf("Cannot initialize control group subsystem: %s", err)
}
h.sysinfo.CgroupVersion = cgrouputils.GetCgroupVersion()
if err := cgrouputils.Init(h.IoScheduler); err != nil {
return fmt.Errorf("Cannot initialize control group subsystem: %s", err)
}
h.sysinfo.CgroupVersion = cgrouputils.GetCgroupVersion()
// err = h.resetIptables()
// if err != nil {