Refactored multiple conditional if-else blocks into switch statements to improve readability and maintainability. Also removed outdated staticcheck rule comments (QF1002, QF1003) from .golangci.yaml.
Signed-off-by: Carlos Barria <cbarria@yahoo.com>
During the sgdisk command test, there was no output assignment,
causing uuid not found for device /dev/testa. Follow the log.
2020-04-27 18:24:21.921337 I | rook-discover: RUN Command lsblk
[--all --noheadings --list --output KNAME]
2020-04-27 18:24:21.921491 I | rook-discover: RUN Command lsblk
[/dev/testa --bytes --nodeps --pairs --paths --output SIZE,ROTA,
RO,TYPE,PKNAME,NAME]
2020-04-27 18:24:21.921549 I | rook-discover: RUN Command sgdisk
[--print /dev/testa]
2020-04-27 18:24:21.921576 W | inventory: skipping device "testa"
because 'lsblk' failed. uuid not found for device /dev/testa. output=
2020-04-27 18:24:21.921592 I | rook-discover: localdevices: []
2020-04-27 18:24:21.921598 I | rook-discover: available devices: []
--- FAIL: TestProbeDevices (0.00s)
discover_test.go:95:
Error Trace: discover_test.go:95
Error: Not equal:
expected: 1
actual : 0
Test: TestProbeDevices
panic: runtime error: index out of range [0] with length 0 [recovered]
panic: runtime error: index out of range [0] with length 0
FAIL github.com/rook/rook/pkg/daemon/discover 0.050s
Signed-off-by: Haichao Li <haichao.li@arm.com>
The helpers for executing a process have long required an actionName
param which is not being used. Now we remove the old param
while also cleaning up various other usages of the exec
package.
Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
**Description of your changes:**
This modification adds the information extracted from 'ceph-volume inventory':
command to the device configmaps generated by the discovery daemon when
"rook discover" starts with the new boolean "--use-ceph-volume" parameter.
Resolves #
https://github.com/rook/rook/issues/2606
Now the <cephVolumeData> field contains all the information returned
from <ceph-volume inventory> command.
Signed-off-by: Juan Miguel Olmo Martínez <jolmomar@redhat.com>
- Added code to support StorageClassDeviceSet spec provided in the cluster-on-pvc.yaml
- The code reads the StorageClassDeviceSet spec and creates pvc based on the ‘count’ field for each device set.
- OSD prepare job is started for each PVC which activates the ceph-volume on each PVC
- Finally OSD is started on each of the PVC device.
Co-authored-by: rohan47 <rohgupta@redhat.com>
Co-authored-by: Ashish Ranjan <aranjan@redhat.com>
Signed-off-by: Santosh Pillai <sapillai@redhat.com>
the only exception to a naive device list comparison had been to ignore
drive UUID information which was unreliable when a device wasn't
formatted / partitioned. however various users have reported different
type of false positives that resulted in orchestration being run
continuously due to the wrong observation that devices were changing.
this patch fixes the cases we have observed and attempts to be slightly
more conservative in the calculation.
1. the devlinks is ignored. when a device is setup for lvm, for example,
the devlinks will be updated with different paths that point to the
device in addition to its standard paths addressable by pci address.
2. in the lvm case, the "model" field and "filesystem" field may also
change.
3. we ignore devices with devlinks that contain "usb" to avoid issues
when using usb drives.
4. be smart about detecting device availability. if a device transitions
from a non-empty (or has-partitions) state to an empty (or unpartitioned)
state then orchestration is triggered. this like observing that a device
is now available (e.g. in the allDevices case). however, when a device
transistions from empty to non-empty, then this is ignored as while it
is a change, it's generally a change associated with the new consumption
of the device.
fixes: #3059fixes: #3185fixes: #3131
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
this patch monitors udev events from the block subsystem via the udevadm
tool. it watches for add and delete events within a specified period
(e.g. 2 seconds) and then emits a trigger which starts a new device
probe operation.
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
run "rook discover" on storage nodes and discover devices on each node. The discovered disks are saved in a per node configmap, local-device-nodename.
Device information consits of name and persistent names, uuid, partition, filesystem, rotational, readonly, size, etc.
Signed-off-by: Huamin Chen <hchen@redhat.com>