logging
This commit is contained in:
parent
db2c12b1bc
commit
91e8ad3234
@ -2,6 +2,8 @@ package driver
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/golang/glog"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Implements Mounter
|
// Implements Mounter
|
||||||
@ -22,6 +24,8 @@ func newSeaweedFsMounter(bucketName string, filer string) (Mounter, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (seaweedFs *seaweedFsMounter) Mount(target string) error {
|
func (seaweedFs *seaweedFsMounter) Mount(target string) error {
|
||||||
|
glog.V(4).Infof("mounting %s%s to %s", seaweedFs.filerUrl, seaweedFs.bucketName, target)
|
||||||
|
|
||||||
args := []string{
|
args := []string{
|
||||||
"mount",
|
"mount",
|
||||||
fmt.Sprintf("-dir=%s", target),
|
fmt.Sprintf("-dir=%s", target),
|
||||||
@ -29,5 +33,9 @@ func (seaweedFs *seaweedFsMounter) Mount(target string) error {
|
|||||||
fmt.Sprintf("-filer=%s", seaweedFs.filerUrl),
|
fmt.Sprintf("-filer=%s", seaweedFs.filerUrl),
|
||||||
fmt.Sprintf("-filer.path=/buckets/%s", seaweedFs.bucketName),
|
fmt.Sprintf("-filer.path=/buckets/%s", seaweedFs.bucketName),
|
||||||
}
|
}
|
||||||
return fuseMount(target, seaweedFsCmd, args)
|
err := fuseMount(target, seaweedFsCmd, args)
|
||||||
|
if err != nil {
|
||||||
|
glog.Errorf("mount %s%s to %s: %s", seaweedFs.filerUrl, seaweedFs.bucketName, target, err)
|
||||||
|
}
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,6 +25,8 @@ func (ns *NodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublis
|
|||||||
// mount the fs here
|
// mount the fs here
|
||||||
targetPath := req.GetTargetPath()
|
targetPath := req.GetTargetPath()
|
||||||
|
|
||||||
|
glog.V(4).Infof("NodePublishVolume volume %s to %s", volumeID, targetPath)
|
||||||
|
|
||||||
// Check arguments
|
// Check arguments
|
||||||
if req.GetVolumeCapability() == nil {
|
if req.GetVolumeCapability() == nil {
|
||||||
return nil, status.Error(codes.InvalidArgument, "Volume capability missing in request")
|
return nil, status.Error(codes.InvalidArgument, "Volume capability missing in request")
|
||||||
@ -93,7 +95,7 @@ func (ns *NodeServer) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpu
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (ns *NodeServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) {
|
func (ns *NodeServer) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error) {
|
||||||
glog.V(5).Infof("Using default NodeGetInfo")
|
glog.V(5).Infof("Using default NodeGetInfo: nodeID %s", ns.Driver.nodeID)
|
||||||
|
|
||||||
return &csi.NodeGetInfoResponse{
|
return &csi.NodeGetInfoResponse{
|
||||||
NodeId: ns.Driver.nodeID,
|
NodeId: ns.Driver.nodeID,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user