cephfs: ceph.conf is created in NodePublishVolume instead of CreateVolume

This commit is contained in:
gman 2018-05-18 18:15:37 +02:00
parent b6c3376961
commit bf89151b87
2 changed files with 6 additions and 6 deletions

View File

@ -77,12 +77,6 @@ func (cs *controllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
volId := newVolumeIdentifier(volOptions, req) volId := newVolumeIdentifier(volOptions, req)
conf := cephConfigData{Monitors: volOptions.Monitors}
if err = conf.writeToFile(); err != nil {
glog.Errorf("couldn't generate ceph.conf: %v", err)
return nil, status.Error(codes.Internal, err.Error())
}
// Create a volume in case the user didn't provide one // Create a volume in case the user didn't provide one
if volOptions.ProvisionVolume { if volOptions.ProvisionVolume {

View File

@ -119,6 +119,12 @@ func (ns *nodeServer) NodePublishVolume(ctx context.Context, req *csi.NodePublis
return nil, status.Error(codes.Internal, err.Error()) return nil, status.Error(codes.Internal, err.Error())
} }
conf := cephConfigData{Monitors: volOptions.Monitors, VolumeUuid: volUuid}
if err = conf.writeToFile(); err != nil {
glog.Errorf("couldn't generate ceph.conf: %v", err)
return nil, status.Error(codes.Internal, err.Error())
}
// Check if the volume is already mounted // Check if the volume is already mounted
isMnt, err := isMountPoint(targetPath) isMnt, err := isMountPoint(targetPath)