-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
filesystem is not resized when restoring from snapshot/cloning to larger size than origin #972
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -340,6 +340,15 @@ func (ns *GCENodeServer) NodeStageVolume(ctx context.Context, req *csi.NodeStage | |
devicePath, stagingTargetPath, fstype, options, err)) | ||
} | ||
|
||
// Part 4: Resize filesystem. | ||
// https://github.com/kubernetes/kubernetes/issues/94929 | ||
resizer := resizefs.NewResizeFs(ns.Mounter) | ||
_, err = resizer.Resize(devicePath, stagingTargetPath) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In Windows this is https://github.com/kubernetes-csi/csi-proxy/blob/202a4e9cfa2c6277920c95f5325c9568bc520531/pkg/os/volume/api.go#L153 with Do you know if we have a test for this scenario (restore from a snapshot to a larger volume size) in the storage e2e tests in k8s? I checked in https://testgrid.k8s.io/provider-gcp-compute-persistent-disk-csi-driver#ci-windows-2019-provider-gcp-compute-persistent-disk-csi-driver that we're not testing resizing in Windows. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I have this PR open which is currently waiting for this PR to merge because the test would fail in CI for (any) driver that does not resize properly. To allow drivers to opt out from the test we've added the anti-capability. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good, I added a comment in that other PR, in the worst case we might need to add a skip for Windows or find a way to run the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Awesome, thank you. Are we good for approval now @mattcary? |
||
if err != nil { | ||
return nil, status.Error(codes.Internal, fmt.Sprintf("error when resizing volume %s: %v", volumeID, err)) | ||
|
||
} | ||
|
||
klog.V(4).Infof("NodeStageVolume succeeded on %v to %s", volumeID, stagingTargetPath) | ||
return &csi.NodeStageVolumeResponse{}, nil | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add a reason why we have this call here in addition to the NodeExpandVolume resize call, I think we can trace it back through blame too though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a link to the original issue in k/k where the reasons are explained.