mirror of https://github.com/minio/minio.git
				
				
				
			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.
This commit is contained in:
		
							parent
							
								
									94d37d05e5
								
							
						
					
					
						commit
						5dcf1d13a9
					
				|  | @ -212,21 +212,23 @@ func newXLStorage(ep Endpoint) (s *xlStorage, err error) { | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	var rootDisk bool | 	var rootDisk bool | ||||||
| 	if globalRootDiskThreshold > 0 { | 	if !globalIsCICD { | ||||||
| 		// Use MINIO_ROOTDISK_THRESHOLD_SIZE to figure out if
 | 		if globalRootDiskThreshold > 0 { | ||||||
| 		// this disk is a root disk.
 | 			// Use MINIO_ROOTDISK_THRESHOLD_SIZE to figure out if
 | ||||||
| 		info, err := disk.GetInfo(path) | 			// this disk is a root disk.
 | ||||||
| 		if err != nil { | 			info, err := disk.GetInfo(path) | ||||||
| 			return nil, err | 			if err != nil { | ||||||
| 		} | 				return nil, err | ||||||
|  | 			} | ||||||
| 
 | 
 | ||||||
| 		// treat those disks with size less than or equal to the
 | 			// treat those disks with size less than or equal to the
 | ||||||
| 		// threshold as rootDisks.
 | 			// threshold as rootDisks.
 | ||||||
| 		rootDisk = info.Total <= globalRootDiskThreshold | 			rootDisk = info.Total <= globalRootDiskThreshold | ||||||
| 	} else { | 		} else { | ||||||
| 		rootDisk, err = disk.IsRootDisk(path, SlashSeparator) | 			rootDisk, err = disk.IsRootDisk(path, SlashSeparator) | ||||||
| 		if err != nil { | 			if err != nil { | ||||||
| 			return nil, err | 				return nil, err | ||||||
|  | 			} | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue