2 Commits

Author SHA1 Message Date
Niels de Vos
457ffe884a cleanup: address golangci 'usetesting' linter issues
When a context.Context is needed in a unit test, t.Context() should be
used instead of creating a new one with context.TODO() or
context.Background().

Signed-off-by: Niels de Vos <ndevos@ibm.com>
2025-05-06 11:26:06 +00:00
Niels de Vos
ac8cda5e37 rbd: add validation to ToCSI() for rbdVolume and rbdSnapshot
After an unfortnate timed restart of the provisioner, a volume that got
cloned did not get a `rbdVolume.VolID` set. The `.VolID` is used as the
CSI Volume Handle, and is a required attribute.

The `rbdVolume` and `rbdSnapshot` structs have a `.ToCSI()` function
that can do the validation of required attributes. This is now added,
including unit-tests.

Signed-off-by: Niels de Vos <ndevos@ibm.com>
2025-02-20 10:14:29 +00:00