From 5dcf1d13a92d7f45ad3fae43f008d44291bb8dd7 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Wed, 23 Feb 2022 19:11:33 +0100 Subject: [PATCH] ci: Always set disks as non root disks (#14389) In the testing mode, reformatting disks will fail because the healing code will complain if one disk is in root mode. This commit will automatically set all disks as non-root if MINIO_CI_CD is set. --- cmd/xl-storage.go | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/cmd/xl-storage.go b/cmd/xl-storage.go index 204b24bb3..c277677a4 100644 --- a/cmd/xl-storage.go +++ b/cmd/xl-storage.go @@ -212,21 +212,23 @@ func newXLStorage(ep Endpoint) (s *xlStorage, err error) { } var rootDisk bool - if globalRootDiskThreshold > 0 { - // Use MINIO_ROOTDISK_THRESHOLD_SIZE to figure out if - // this disk is a root disk. - info, err := disk.GetInfo(path) - if err != nil { - return nil, err - } + if !globalIsCICD { + if globalRootDiskThreshold > 0 { + // Use MINIO_ROOTDISK_THRESHOLD_SIZE to figure out if + // this disk is a root disk. + info, err := disk.GetInfo(path) + if err != nil { + return nil, err + } - // treat those disks with size less than or equal to the - // threshold as rootDisks. - rootDisk = info.Total <= globalRootDiskThreshold - } else { - rootDisk, err = disk.IsRootDisk(path, SlashSeparator) - if err != nil { - return nil, err + // treat those disks with size less than or equal to the + // threshold as rootDisks. + rootDisk = info.Total <= globalRootDiskThreshold + } else { + rootDisk, err = disk.IsRootDisk(path, SlashSeparator) + if err != nil { + return nil, err + } } }