Conversation
Signed-off-by: Valentin Daviot <valentin.daviot@scality.com>
…sts not working for now. Signed-off-by: Valentin Daviot <valentin.daviot@scality.com>
Signed-off-by: Valentin Daviot <valentin.daviot@scality.com>
Comment on lines
+290
to
+313
| func (s *SSACLI) getBlockDevice(devicePath string) (*BlockDevice, error) { | ||
| output, err := s.lsblk.Run([]string{ | ||
| devicePath, | ||
| "--paths", | ||
| "--bytes", | ||
| "--nodeps", | ||
| "--output", | ||
| "name,rota,size,type,tran,mountpoint,fstype,parttype", | ||
| }) | ||
| if err != nil { | ||
| return nil, errors.Wrap(err, "failed to get block device using lsblk") | ||
| } | ||
|
|
||
| blockDevices, err := ParseLSBLKOutput(output) | ||
| if err != nil { | ||
| return nil, errors.Wrap(err, "failed to parse lsblk command output") | ||
| } | ||
|
|
||
| if len(blockDevices) <= 0 { | ||
| return nil, errors.Errorf("block device not found: %s", devicePath) | ||
| } | ||
|
|
||
| return &blockDevices[0], nil | ||
| } |
Contributor
There was a problem hiding this comment.
To me ideally we should use the same function as for rhel8
Contributor
Author
There was a problem hiding this comment.
IMHO this should come in the next PR, because it will require a new package (something like drivestatusgetter or something)
I have two things to address following the merge:
- That ☝️
- As we're now using empty methods returning errors, SoftwareRaidController doesn't make sense, so I need to harmonize the declarations
Which I'd like to do in a separate PR
Comment on lines
+345
to
+354
| // isBlockDeviceUsed checks if a block device is used. | ||
| // If the device is mounted or has a filesystem type, it is considered used. | ||
| // Otherwise, it is considered unassigned good. | ||
| func isBlockDeviceUsed(device *BlockDevice) physicaldrive.PDStatus { | ||
| if device.MountPoint != "" || device.FilesystemType != "" || device.PartitionType != "" { | ||
| return physicaldrive.PDStatusUsed | ||
| } | ||
|
|
||
| return physicaldrive.PDStatusUnassignedGood | ||
| } |
Contributor
There was a problem hiding this comment.
Ditto we should mutualise it with rhel8
Contributor
Author
There was a problem hiding this comment.
Added to todolist from above message
Signed-off-by: Valentin Daviot <valentin.daviot@scality.com>
Signed-off-by: Valentin Daviot <valentin.daviot@scality.com>
Signed-off-by: Valentin Daviot <valentin.daviot@scality.com>
Signed-off-by: Valentin Daviot <valentin.daviot@scality.com>
TeddyAndrieux
approved these changes
Mar 10, 2025
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.