From 0e0646dde731c4a4bef225f66ed9579fdbb402da Mon Sep 17 00:00:00 2001 From: Mauricio Poppe Date: Thu, 8 Apr 2021 00:05:18 +0000 Subject: [PATCH] make some methods private --- pkg/resizefs/resizefs_windows.go | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/pkg/resizefs/resizefs_windows.go b/pkg/resizefs/resizefs_windows.go index 3de45006a..ff490d72f 100644 --- a/pkg/resizefs/resizefs_windows.go +++ b/pkg/resizefs/resizefs_windows.go @@ -46,20 +46,17 @@ func NewResizeFs(mounter *mount.SafeFormatAndMount) *resizeFs { func (resizefs *resizeFs) Resize(devicePath string, deviceMountPath string) (bool, error) { switch resizefs.mounter.Interface.(type) { case *mounter.CSIProxyMounterV1: - return resizefs.ResizeV1(devicePath, deviceMountPath) + return resizefs.resizeV1(devicePath, deviceMountPath) case *mounter.CSIProxyMounterV1Beta: - return resizefs.ResizeV1Beta(devicePath, deviceMountPath) + return resizefs.resizeV1Beta(devicePath, deviceMountPath) } return false, fmt.Errorf("resize.mounter.Interface is not valid") } -func (resizefs *resizeFs) ResizeV1(devicePath string, deviceMountPath string) (bool, error) { +func (resizefs *resizeFs) resizeV1(devicePath string, deviceMountPath string) (bool, error) { klog.V(3).Infof("resizeFS.Resize - Expanding mounted volume %s", deviceMountPath) - proxy, ok := resizefs.mounter.Interface.(*mounter.CSIProxyMounterV1) - if !ok { - return false, fmt.Errorf("could not cast to csi proxy class") - } + proxy := resizefs.mounter.Interface.(*mounter.CSIProxyMounterV1) idRequest := &volumeapiv1.VolumeIDFromMountRequest{ Mount: deviceMountPath, @@ -81,13 +78,10 @@ func (resizefs *resizeFs) ResizeV1(devicePath string, deviceMountPath string) (b } // resize perform resize of file system -func (resizefs *resizeFs) ResizeV1Beta(devicePath string, deviceMountPath string) (bool, error) { +func (resizefs *resizeFs) resizeV1Beta(devicePath string, deviceMountPath string) (bool, error) { klog.V(3).Infof("resizeFS.Resize - Expanding mounted volume %s", deviceMountPath) - proxy, ok := resizefs.mounter.Interface.(*mounter.CSIProxyMounterV1Beta) - if !ok { - return false, fmt.Errorf("could not cast to csi proxy class") - } + proxy := resizefs.mounter.Interface.(*mounter.CSIProxyMounterV1Beta) idRequest := &volumeapiv1beta1.VolumeIDFromMountRequest{ Mount: deviceMountPath,