mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
Handle Delete operation if pool not found
If the backend rbd or cephfs pool is already deleted
we need to return success to the DeleteVolume RPC
call to make it idempotent.
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit 8dcb6a6105
)
This commit is contained in:
committed by
Madhu Rajanna
parent
c4b6bb90d6
commit
edf79d1372
@ -114,7 +114,7 @@ func GetPoolName(ctx context.Context, monitors string, cr *Credentials, poolID i
|
||||
}
|
||||
}
|
||||
|
||||
return "", fmt.Errorf("pool ID (%d) not found in Ceph cluster", poolID)
|
||||
return "", ErrPoolNotFound{string(poolID), fmt.Errorf("pool ID (%d) not found in Ceph cluster", poolID)}
|
||||
}
|
||||
|
||||
// SetOMapKeyValue sets the given key and value into the provided Ceph omap name
|
||||
|
@ -56,3 +56,13 @@ type ErrSnapNameConflict struct {
|
||||
func (e ErrSnapNameConflict) Error() string {
|
||||
return e.err.Error()
|
||||
}
|
||||
|
||||
// ErrPoolNotFound is returned when pool is not found
|
||||
type ErrPoolNotFound struct {
|
||||
Pool string
|
||||
Err error
|
||||
}
|
||||
|
||||
func (e ErrPoolNotFound) Error() string {
|
||||
return e.Err.Error()
|
||||
}
|
||||
|
Reference in New Issue
Block a user