Skip to content

Commit

Permalink
resize fs in NodeStageVolume
Browse files Browse the repository at this point in the history
While restoring from a snapshot to larger size PVC the volume needs to
be resized. We can use ResizeFs resizer (like extend already uses) in
NodeStageVolume to improve user experience and remove manual
intervention that is currently required after restoring to larger size.
  • Loading branch information
RomanBednar committed Oct 13, 2022
1 parent b8a22ac commit c676ada
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/ibmcsidriver/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package ibmcsidriver

import (
"fmt"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"os"
"path/filepath"
"runtime"
Expand Down Expand Up @@ -307,6 +309,10 @@ func (csiNS *CSINodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeSt
return nil, commonError.GetCSIError(ctxLogger, commonError.FormatAndMountFailed, requestID, err, source, stagingTargetPath)
}

if _, err := mountmgr.Resize(csiNS.Mounter, devicePath, stagingTargetPath); err != nil {
return nil, commonError.GetCSIError(ctxLogger, commonError.FileSystemResizeFailed, requestID, err)
}

nodeStageVolumeResponse := &csi.NodeStageVolumeResponse{}
return nodeStageVolumeResponse, err
}
Expand Down

0 comments on commit c676ada

Please sign in to comment.