Skip to content

Commit

Permalink
rbd: Use rados namespace when getting clone depth
Browse files Browse the repository at this point in the history
When the Ceph user is restricted to a specific namespace in the pool, it is
crucial that evey interaction with the cluster is done within that namespace.
This wasn't the case in `getCloneDepth()`.

This issue was causing snapshot creation to fail with

> Failed to check and update snapshot content: failed to take snapshot of the
> volume X: "rpc error: code = Internal desc = rbd: ret=-1, Operation not
> permitted"

Signed-off-by: Benoît Knecht <[email protected]>
  • Loading branch information
BenoitKnecht authored and mergify[bot] committed Jul 7, 2022
1 parent aed7d8d commit 507844c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/rbd/rbd_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ func (ri *rbdImage) getCloneDepth(ctx context.Context) (uint, error) {
vol.Pool = ri.Pool
vol.Monitors = ri.Monitors
vol.RbdImageName = ri.RbdImageName
vol.RadosNamespace = ri.RadosNamespace
vol.conn = ri.conn.Copy()

for {
Expand Down

0 comments on commit 507844c

Please sign in to comment.