mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
5
vendor/github.com/kubernetes-csi/drivers/pkg/csi-common/utils.go
generated
vendored
5
vendor/github.com/kubernetes-csi/drivers/pkg/csi-common/utils.go
generated
vendored
@ -22,6 +22,7 @@ import (
|
||||
|
||||
"github.com/container-storage-interface/spec/lib/go/csi"
|
||||
"github.com/golang/glog"
|
||||
"github.com/kubernetes-csi/csi-lib-utils/protosanitizer"
|
||||
"golang.org/x/net/context"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
@ -94,12 +95,12 @@ func RunControllerandNodePublishServer(endpoint string, d *CSIDriver, cs csi.Con
|
||||
|
||||
func logGRPC(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
|
||||
glog.V(3).Infof("GRPC call: %s", info.FullMethod)
|
||||
glog.V(5).Infof("GRPC request: %+v", req)
|
||||
glog.V(5).Infof("GRPC request: %s", protosanitizer.StripSecrets(req))
|
||||
resp, err := handler(ctx, req)
|
||||
if err != nil {
|
||||
glog.Errorf("GRPC error: %v", err)
|
||||
} else {
|
||||
glog.V(5).Infof("GRPC response: %+v", resp)
|
||||
glog.V(5).Infof("GRPC response: %s", protosanitizer.StripSecrets(resp))
|
||||
}
|
||||
return resp, err
|
||||
}
|
||||
|
14
vendor/github.com/kubernetes-csi/drivers/pkg/hostpath/controllerserver.go
generated
vendored
14
vendor/github.com/kubernetes-csi/drivers/pkg/hostpath/controllerserver.go
generated
vendored
@ -57,9 +57,21 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
|
||||
if len(req.GetName()) == 0 {
|
||||
return nil, status.Error(codes.InvalidArgument, "Name missing in request")
|
||||
}
|
||||
if req.GetVolumeCapabilities() == nil {
|
||||
caps := req.GetVolumeCapabilities()
|
||||
if caps == nil {
|
||||
return nil, status.Error(codes.InvalidArgument, "Volume Capabilities missing in request")
|
||||
}
|
||||
for _, cap := range caps {
|
||||
if cap.GetBlock() != nil {
|
||||
return nil, status.Error(codes.Unimplemented, "Block Volume not supported")
|
||||
}
|
||||
}
|
||||
// A real driver would also need to check that the other
|
||||
// fields in VolumeCapabilities are sane. The check above is
|
||||
// just enough to pass the "[Testpattern: Dynamic PV (block
|
||||
// volmode)] volumeMode should fail in binding dynamic
|
||||
// provisioned PV to PVC" storage E2E test.
|
||||
|
||||
// Need to check for already existing volume name, and if found
|
||||
// check for the requested capacity and already allocated capacity
|
||||
if exVol, err := getVolumeByName(req.GetName()); err == nil {
|
||||
|
Reference in New Issue
Block a user