mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-27 08:40:23 +00:00
nfs: return gRPC status from CephFS CreateVolume failure
The NFS Controller returns a non-gRPC error in case the CreateVolume
call for the CephFS volume fails. It is better to return the gRPC-error
that the CephFS Controller passed along.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
(cherry picked from commit 2b71aac752
)
This commit is contained in:
parent
6e0e6df2db
commit
61ca06148e
@ -18,7 +18,6 @@ package controller
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/ceph/ceph-csi/internal/cephfs"
|
"github.com/ceph/ceph-csi/internal/cephfs"
|
||||||
"github.com/ceph/ceph-csi/internal/cephfs/store"
|
"github.com/ceph/ceph-csi/internal/cephfs/store"
|
||||||
@ -75,7 +74,7 @@ func (cs *Server) CreateVolume(
|
|||||||
req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error) {
|
req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error) {
|
||||||
res, err := cs.backendServer.CreateVolume(ctx, req)
|
res, err := cs.backendServer.CreateVolume(ctx, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return res, fmt.Errorf("failed to create CephFS volume: %w", err)
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
backend := res.Volume
|
backend := res.Volume
|
||||||
|
Loading…
Reference in New Issue
Block a user