It may take some time for the RBD-mirror daemon to start syncing the
image. After the resync operation is executed, the status of the resync
is checked with a small delay to prevent subsequent resync calls from
re-starting the resync quickly after each other.
Signed-off-by: Niels de Vos <ndevos@ibm.com>
By introducing a SyncInfo interface, the `getLastSyncInfo` function can
be removed from the csi-addons/rbd package. Getting details from an RBD
mirror status, should be part of the main internal/rbd package, the
CSI-Addons components should only use the internal API, and not add any
parsing logic.
This makes it easier to enhance the SyncInfo interface in the future.
Signed-off-by: Niels de Vos <ndevos@ibm.com>
Volumes that were requested with a read-only capability should not be
resized.
Reported-by: Alex Kalenyuk <akalenyu@redhat.com>
Signed-off-by: Niels de Vos <ndevos@ibm.com>
The internal/csi-common package offers helper functions like
`IsReaderOnly()` and `IsBlockMultiNode()`. These should be used instead
of checking the VolumeCapability that is passed in a request in
different places.
This also suggested that adding the "ro" mount option in
`NodeServer.mountVolumeToStagePath()` is not appropriate, as the
csi-common helper `ConstructMountOptions()` can take care of that
already too.
Signed-off-by: Niels de Vos <ndevos@ibm.com>
When cephfs is used with encryption an exclusive lock is acquired. This
needs the execute permission on the metadata pool.
Fixes: #4728
Signed-off-by: Felix Prasse <1330854+flx5@users.noreply.github.com>
Mergify rephrased the status when a PR is the 1st in the queue. Instead
of the "Queue: Embarked in merge train", the status is now reported as
"Queue: Embarked in merge queue".
Because the status did not match the rule in the configuration anymore,
the `ok-to-test` label was not automatically added.
Signed-off-by: Niels de Vos <ndevos@ibm.com>
This patch marks `userID` and `userKey` required in
helm values.
A release note has been added for the same as well.
Signed-off-by: Niraj Yadav <niryadav@redhat.com>
Fedora 42 has been released, and its container-image does not seem to
include `awk` anymore. `awk` is used during the preparation phase of the
golangci-lint test, and possibly others.
By installing `awk` in the test container-image, all scripts seem to
work well with the Fedora 42 container-image.
Signed-off-by: Niels de Vos <ndevos@ibm.com>
This commit fixes a bug in health checker that
caused shared checker to get keyed with volumeID+volumepath
instead of just volumeID and the other way around
for non-shared checkers.
Signed-off-by: Rakshith R <rar@redhat.com>
The Ginkgo `Skip()` function does not only skip the current `By()`, but
it's parent `It()` function. That means other `By()` tests will not be
run after a `Skip()` was called.
Replacing the `Skip()` with an early return of the function makes sure
that all `By()` tests are executed.
Signed-off-by: Niels de Vos <ndevos@ibm.com>
When running on Docker Swarm, the RBD-healer fails with an error like:
> healer had failures, err failed to get cluster config: unable to load
> in-cluster configuration, KUBERNETES_SERVICE_HOST and
> KUBERNETES_SERVICE_PORT must be defined
Before starting the healer, check if we're running on Kubernetes, so
that non-Kubernetes platforms do not get confusing warnings.
Updates: #3769
Signed-off-by: Niels de Vos <ndevos@ibm.com>
Running cephcsi in docker swarm currently requires serving both
the nodeserver and controllerserver over the same socket.
This leads to errors like
> FATAL: [core] grpc: Server.RegisterService found duplicate
> service registration for \"fence.FenceController\""
...since `FenceController` is registererd once per server type.
Commit proposes simple fix by registering `FenceController` only once
when at least one of `IsControllerServer` or `IsNodeServer` is `true`.
Signed-off-by: monoamin <precision1998@gmail.com>
we should continue to cleanup the volume info like the
omap data, mappings from the group if the image is not
part of the goup anymore.
Signed-off-by: Nikhil-Ladha <nikhilladha1999@gmail.com>
The `GetID()` and `GetName()` functions can be confusing, as names and
ID's are not always distinctive enough. The name is used to reference an
object that exists in a pool. The ID the CSI-handle formatted and can be
used to locate the entry for the object in the journal.
Signed-off-by: Niels de Vos <ndevos@ibm.com>
When a VolumeGroup has been created through the CSI-Addons API, the
VolumeGroupSnapshot CSI API will now use the existing VolumeGroup. There
are checks in place to validate that the Volumes in the VolumeGroup
match the Volumes in the VolumeGroupSnapshot request.
Signed-off-by: Niels de Vos <ndevos@ibm.com>
CompareVolumesInGroup() verifies that all the volumes are part of the
given VolumeGroup. It does so by obtaining the VolumeGroupID for each
volume with GetVolumeGroupByID().
The helper VolumesInSameGroup() verifies that all volumes belong to the
same (or no) VolumeGroup. It can be called by CSI(-Addons) procedures
before acting on a VolumeGroup.
Signed-off-by: Niels de Vos <ndevos@ibm.com>
The Manager.MakeVolumeGroupID() function can be used to build a CSI
VolumeGroupID from the backend (pool and name of the RBD-group). This
will be used when checking if an RBD-image belongs to a group already.
It is also possible to resolve the VolumeGroup by passing the
VolumeGroupID to the existing Manager.GetVolumeGroupByID() function.
Signed-off-by: Niels de Vos <ndevos@ibm.com>
The `prefix` is passed to several functions, but it can easily be
obtained with a small helper function. This makes calling the functions
a little simpler.
Signed-off-by: Niels de Vos <ndevos@ibm.com>
When an incorrect volumeID is passed while creating a VolumeGroup, the
`.Destroy()` function caused a panic. By appending each volume to the
volumes slice, the slice won't contain any `nil` volumes anymore.
Signed-off-by: Niels de Vos <ndevos@ibm.com>
fix codespell for "respository" and update ignore word list.
Fix extra whitespace lint issue from "tracevol.py" script
Signed-off-by: Nikhil-Ladha <nikhilladha1999@gmail.com>
VolumeGroup interface has more than 10 methods and it causes
golangci-lint to fail. Moving the `Destroy()` method to a base
interface journalledObject.
Signed-off-by: Praveen M <m.praveen@ibm.com>