func canAPFSResize()

in internal/diskutil/grow.go [84:102]


func canAPFSResize(disk *types.DiskInfo) error {
	if disk == nil {
		return errors.New("no disk information")
	}

	// If the disk has ContainerInfo, check the FilesystemType
	if (disk.ContainerInfo != types.ContainerInfo{}) {
		if disk.ContainerInfo.FilesystemType == "apfs" {
			return nil
		}
	}

	// Check if the disk has an APFS Container reference and APFS Physical Stores
	if disk.APFSContainerReference != "" && len(disk.APFSPhysicalStores) > 0 {
		return nil
	}

	return errors.New("disk is not apfs")
}