From beda4cafb613fa4ece78cc3199d3c4cb853cd4dd Mon Sep 17 00:00:00 2001 From: Mengjiao Liu Date: Thu, 2 Sep 2021 18:49:42 +0800 Subject: [PATCH] kubelet: Remove the deprecated flag `--experimental-check-node-capabilities-before-mount` --- cluster/gce/util.sh | 1 - cmd/kubelet/app/options/options.go | 6 ---- cmd/kubelet/app/server.go | 3 -- .../attachdetach/attach_detach_controller.go | 1 - .../reconciler/reconciler_test.go | 11 ------- .../volume/expand/expand_controller.go | 1 - pkg/kubelet/kubelet.go | 3 -- pkg/kubelet/kubelet_test.go | 1 - pkg/kubelet/kubelet_volumes_test.go | 4 --- pkg/kubelet/runonce_test.go | 1 - .../reconciler/reconciler_test.go | 23 ++------------ pkg/kubelet/volumemanager/volume_manager.go | 2 -- .../volumemanager/volume_manager_test.go | 1 - pkg/volume/awsebs/aws_ebs.go | 7 ----- pkg/volume/azure_file/azure_file.go | 7 ----- pkg/volume/azuredd/azure_mounter.go | 4 --- pkg/volume/cephfs/cephfs.go | 7 ----- pkg/volume/cinder/cinder.go | 7 ----- pkg/volume/configmap/configmap.go | 7 ----- pkg/volume/csi/csi_mounter.go | 4 --- pkg/volume/csi/csi_test.go | 4 --- pkg/volume/downwardapi/downwardapi.go | 7 ----- pkg/volume/emptydir/empty_dir.go | 7 ----- pkg/volume/fc/fc.go | 7 ----- pkg/volume/flexvolume/mounter-defaults.go | 4 --- pkg/volume/flexvolume/mounter.go | 4 --- pkg/volume/flocker/flocker.go | 7 ----- pkg/volume/gcepd/gce_pd.go | 7 ----- pkg/volume/git_repo/git_repo.go | 7 ----- pkg/volume/glusterfs/glusterfs.go | 30 +++++-------------- pkg/volume/hostpath/host_path.go | 7 ----- pkg/volume/iscsi/iscsi.go | 7 ----- pkg/volume/local/local.go | 7 ----- pkg/volume/nfs/nfs.go | 23 -------------- pkg/volume/portworx/portworx.go | 7 ----- pkg/volume/projected/projected.go | 7 ----- pkg/volume/quobyte/quobyte.go | 7 ----- pkg/volume/rbd/rbd.go | 7 ----- pkg/volume/secret/secret.go | 7 ----- pkg/volume/storageos/storageos.go | 7 ----- pkg/volume/testing/testing.go | 4 --- .../operationexecutor/operation_generator.go | 27 ++++------------- .../operation_generator_test.go | 1 - pkg/volume/volume.go | 11 ------- pkg/volume/volume_linux_test.go | 4 --- pkg/volume/vsphere_volume/vsphere_volume.go | 7 ----- 46 files changed, 15 insertions(+), 310 deletions(-) diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index 2b3532c4138..61f00d3563a 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -749,7 +749,6 @@ function construct-linux-kubelet-flags { flags="$(construct-common-kubelet-flags)" # Keep in sync with CONTAINERIZED_MOUNTER_HOME in configure-helper.sh flags+=" --experimental-mounter-path=/home/kubernetes/containerized_mounter/mounter" - flags+=" --experimental-check-node-capabilities-before-mount=true" # Keep in sync with the mkdir command in configure-helper.sh (until the TODO is resolved) flags+=" --cert-dir=/var/lib/kubelet/pki/" diff --git a/cmd/kubelet/app/options/options.go b/cmd/kubelet/app/options/options.go index 5d76ffd9021..0c48056fbb9 100644 --- a/cmd/kubelet/app/options/options.go +++ b/cmd/kubelet/app/options/options.go @@ -108,10 +108,6 @@ type KubeletFlags struct { RemoteImageEndpoint string // experimentalMounterPath is the path of mounter binary. Leave empty to use the default mount path ExperimentalMounterPath string - // This flag, if set, enables a check prior to mount operations to verify that the required components - // (binaries, etc.) to mount the volume are available on the underlying node. If the check is enabled - // and fails the mount operation fails. - ExperimentalCheckNodeCapabilitiesBeforeMount bool // This flag, if set, will avoid including `EvictionHard` limits while computing Node Allocatable. // Refer to [Node Allocatable](https://git.k8s.io/community/contributors/design-proposals/node/node-allocatable.md) doc for more information. ExperimentalNodeAllocatableIgnoreEvictionThreshold bool @@ -343,8 +339,6 @@ func (f *KubeletFlags) AddFlags(mainfs *pflag.FlagSet) { fs.MarkDeprecated("keep-terminated-pod-volumes", "will be removed in a future version") fs.StringVar(&f.ExperimentalMounterPath, "experimental-mounter-path", f.ExperimentalMounterPath, "[Experimental] Path of mounter binary. Leave empty to use the default mount.") fs.MarkDeprecated("experimental-mounter-path", "will be removed in 1.24 or later. in favor of using CSI.") - fs.BoolVar(&f.ExperimentalCheckNodeCapabilitiesBeforeMount, "experimental-check-node-capabilities-before-mount", f.ExperimentalCheckNodeCapabilitiesBeforeMount, "[Experimental] if set true, the kubelet will check the underlying node for required components (binaries, etc.) before performing the mount") - fs.MarkDeprecated("experimental-check-node-capabilities-before-mount", "will be removed in 1.24 or later. in favor of using CSI.") fs.StringVar(&f.CloudProvider, "cloud-provider", f.CloudProvider, "The provider for cloud services. Set to empty string for running with no cloud provider. If set, the cloud provider determines the name of the node (consult cloud provider documentation to determine if and how the hostname is used).") fs.MarkDeprecated("cloud-provider", "will be removed in 1.24 or later, in favor of removing cloud provider code from Kubelet.") fs.StringVar(&f.CloudConfigFile, "cloud-config", f.CloudConfigFile, "The path to the cloud provider configuration file. Empty string for no configuration file.") diff --git a/cmd/kubelet/app/server.go b/cmd/kubelet/app/server.go index d6b63c27034..981ef8f2d26 100644 --- a/cmd/kubelet/app/server.go +++ b/cmd/kubelet/app/server.go @@ -1190,7 +1190,6 @@ func RunKubelet(kubeServer *options.KubeletServer, kubeDeps *kubelet.Dependencie kubeServer.AllowedUnsafeSysctls, kubeServer.ExperimentalMounterPath, kubeServer.KernelMemcgNotification, - kubeServer.ExperimentalCheckNodeCapabilitiesBeforeMount, kubeServer.ExperimentalNodeAllocatableIgnoreEvictionThreshold, kubeServer.MinimumGCAge, kubeServer.MaxPerPodContainerCount, @@ -1265,7 +1264,6 @@ func createAndInitKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, allowedUnsafeSysctls []string, experimentalMounterPath string, kernelMemcgNotification bool, - experimentalCheckNodeCapabilitiesBeforeMount bool, experimentalNodeAllocatableIgnoreEvictionThreshold bool, minimumGCAge metav1.Duration, maxPerPodContainerCount int32, @@ -1299,7 +1297,6 @@ func createAndInitKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, allowedUnsafeSysctls, experimentalMounterPath, kernelMemcgNotification, - experimentalCheckNodeCapabilitiesBeforeMount, experimentalNodeAllocatableIgnoreEvictionThreshold, minimumGCAge, maxPerPodContainerCount, diff --git a/pkg/controller/volume/attachdetach/attach_detach_controller.go b/pkg/controller/volume/attachdetach/attach_detach_controller.go index a7c1d5edc80..f84194934e8 100644 --- a/pkg/controller/volume/attachdetach/attach_detach_controller.go +++ b/pkg/controller/volume/attachdetach/attach_detach_controller.go @@ -166,7 +166,6 @@ func NewAttachDetachController( kubeClient, &adc.volumePluginMgr, recorder, - false, // flag for experimental binary check for volume mount blkutil)) adc.nodeStatusUpdater = statusupdater.NewNodeStatusUpdater( kubeClient, nodeInformer.Lister(), adc.actualStateOfWorld) diff --git a/pkg/controller/volume/attachdetach/reconciler/reconciler_test.go b/pkg/controller/volume/attachdetach/reconciler/reconciler_test.go index 552572ccaa4..413181a49c8 100644 --- a/pkg/controller/volume/attachdetach/reconciler/reconciler_test.go +++ b/pkg/controller/volume/attachdetach/reconciler/reconciler_test.go @@ -55,7 +55,6 @@ func Test_Run_Positive_DoNothing(t *testing.T) { fakeKubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) informerFactory := informers.NewSharedInformerFactory(fakeKubeClient, controller.NoResyncPeriodFunc()) nsu := statusupdater.NewNodeStatusUpdater( @@ -91,7 +90,6 @@ func Test_Run_Positive_OneDesiredVolumeAttach(t *testing.T) { fakeKubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */) reconciler := NewReconciler( @@ -143,7 +141,6 @@ func Test_Run_Positive_OneDesiredVolumeAttachThenDetachWithUnmountedVolume(t *te fakeKubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */) reconciler := NewReconciler( @@ -216,7 +213,6 @@ func Test_Run_Positive_OneDesiredVolumeAttachThenDetachWithMountedVolume(t *test fakeKubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */) reconciler := NewReconciler( @@ -289,7 +285,6 @@ func Test_Run_Negative_OneDesiredVolumeAttachThenDetachWithUnmountedVolumeUpdate fakeKubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) nsu := statusupdater.NewFakeNodeStatusUpdater(true /* returnError */) reconciler := NewReconciler( @@ -365,7 +360,6 @@ func Test_Run_OneVolumeAttachAndDetachMultipleNodesWithReadWriteMany(t *testing. fakeKubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */) reconciler := NewReconciler( @@ -458,7 +452,6 @@ func Test_Run_OneVolumeAttachAndDetachMultipleNodesWithReadWriteOnce(t *testing. fakeKubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */) reconciler := NewReconciler( @@ -549,7 +542,6 @@ func Test_Run_OneVolumeAttachAndDetachUncertainNodesWithReadWriteOnce(t *testing fakeKubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */) reconciler := NewReconciler( @@ -611,7 +603,6 @@ func Test_Run_OneVolumeDetachFailNodeWithReadWriteOnce(t *testing.T) { fakeKubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */) reconciler := NewReconciler( @@ -713,7 +704,6 @@ func Test_Run_OneVolumeAttachAndDetachTimeoutNodesWithReadWriteOnce(t *testing.T fakeKubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */) reconciler := NewReconciler( @@ -819,7 +809,6 @@ func Test_ReportMultiAttachError(t *testing.T) { fakeKubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */) rc := NewReconciler( diff --git a/pkg/controller/volume/expand/expand_controller.go b/pkg/controller/volume/expand/expand_controller.go index 78865c56b9f..93f04d6bac6 100644 --- a/pkg/controller/volume/expand/expand_controller.go +++ b/pkg/controller/volume/expand/expand_controller.go @@ -143,7 +143,6 @@ func NewExpandController( kubeClient, &expc.volumePluginMgr, expc.recorder, - false, blkutil) pvcInformer.Informer().AddEventHandler(kcache.ResourceEventHandlerFuncs{ diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index 3369e11cb95..41ab5a118cf 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -349,7 +349,6 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, allowedUnsafeSysctls []string, experimentalMounterPath string, kernelMemcgNotification bool, - experimentalCheckNodeCapabilitiesBeforeMount bool, experimentalNodeAllocatableIgnoreEvictionThreshold bool, minimumGCAge metav1.Duration, maxPerPodContainerCount int32, @@ -772,7 +771,6 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, // If the experimentalMounterPathFlag is set, we do not want to // check node capabilities since the mount path is not the default if len(experimentalMounterPath) != 0 { - experimentalCheckNodeCapabilitiesBeforeMount = false // Replace the nameserver in containerized-mounter's rootfs/etc/resolv.conf with kubelet.ClusterDNS // so that service name could be resolved klet.dnsConfigurer.SetupDNSinContainerizedMounter(experimentalMounterPath) @@ -791,7 +789,6 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, kubeDeps.HostUtil, klet.getPodsDir(), kubeDeps.Recorder, - experimentalCheckNodeCapabilitiesBeforeMount, keepTerminatedPodVolumes, volumepathhandler.NewBlockVolumePathHandler()) diff --git a/pkg/kubelet/kubelet_test.go b/pkg/kubelet/kubelet_test.go index f257acf6c14..a9983fb547f 100644 --- a/pkg/kubelet/kubelet_test.go +++ b/pkg/kubelet/kubelet_test.go @@ -363,7 +363,6 @@ func newTestKubeletWithImageList( kubelet.hostutil, kubelet.getPodsDir(), kubelet.recorder, - false, /* experimentalCheckNodeCapabilitiesBeforeMount*/ false, /* keepTerminatedPodVolumes */ volumetest.NewBlockVolumePathHandler()) diff --git a/pkg/kubelet/kubelet_volumes_test.go b/pkg/kubelet/kubelet_volumes_test.go index 24b3a71ca12..d5a0110b068 100644 --- a/pkg/kubelet/kubelet_volumes_test.go +++ b/pkg/kubelet/kubelet_volumes_test.go @@ -554,10 +554,6 @@ func (f *stubVolume) GetAttributes() volume.Attributes { return volume.Attributes{} } -func (f *stubVolume) CanMount() error { - return nil -} - func (f *stubVolume) SetUp(mounterArgs volume.MounterArgs) error { return nil } diff --git a/pkg/kubelet/runonce_test.go b/pkg/kubelet/runonce_test.go index 9f402d99418..7a7f5594f24 100644 --- a/pkg/kubelet/runonce_test.go +++ b/pkg/kubelet/runonce_test.go @@ -114,7 +114,6 @@ func TestRunOnce(t *testing.T) { kb.hostutil, kb.getPodsDir(), kb.recorder, - false, /* experimentalCheckNodeCapabilitiesBeforeMount */ false, /* keepTerminatedPodVolumes */ volumetest.NewBlockVolumePathHandler()) diff --git a/pkg/kubelet/volumemanager/reconciler/reconciler_test.go b/pkg/kubelet/volumemanager/reconciler/reconciler_test.go index b0c1c0aaa05..89e0319e992 100644 --- a/pkg/kubelet/volumemanager/reconciler/reconciler_test.go +++ b/pkg/kubelet/volumemanager/reconciler/reconciler_test.go @@ -76,7 +76,6 @@ func Test_Run_Positive_DoNothing(t *testing.T) { kubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler, )) reconciler := NewReconciler( @@ -121,7 +120,6 @@ func Test_Run_Positive_VolumeAttachAndMount(t *testing.T) { kubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) reconciler := NewReconciler( kubeClient, @@ -212,7 +210,6 @@ func Test_Run_Positive_VolumeMountControllerAttachEnabled(t *testing.T) { kubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) reconciler := NewReconciler( kubeClient, @@ -292,7 +289,6 @@ func Test_Run_Negative_VolumeMountControllerAttachEnabled(t *testing.T) { kubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) reconciler := NewReconciler( kubeClient, @@ -371,7 +367,6 @@ func Test_Run_Positive_VolumeAttachMountUnmountDetach(t *testing.T) { kubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) reconciler := NewReconciler( kubeClient, @@ -474,7 +469,6 @@ func Test_Run_Positive_VolumeUnmountControllerAttachEnabled(t *testing.T) { kubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) reconciler := NewReconciler( kubeClient, @@ -598,7 +592,6 @@ func Test_Run_Positive_VolumeAttachAndMap(t *testing.T) { kubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) reconciler := NewReconciler( kubeClient, @@ -714,7 +707,6 @@ func Test_Run_Positive_BlockVolumeMapControllerAttachEnabled(t *testing.T) { kubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) reconciler := NewReconciler( kubeClient, @@ -812,7 +804,6 @@ func Test_Run_Positive_BlockVolumeAttachMapUnmapDetach(t *testing.T) { kubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) reconciler := NewReconciler( kubeClient, @@ -937,7 +928,6 @@ func Test_Run_Positive_VolumeUnmapControllerAttachEnabled(t *testing.T) { kubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) reconciler := NewReconciler( kubeClient, @@ -1014,8 +1004,7 @@ func Test_GenerateMapVolumeFunc_Plugin_Not_Found(t *testing.T) { oex := operationexecutor.NewOperationExecutor(operationexecutor.NewOperationGenerator( nil, /* kubeClient */ volumePluginMgr, - nil, /* fakeRecorder */ - false, /* checkNodeCapabilitiesBeforeMount */ + nil, /* fakeRecorder */ nil)) pod := &v1.Pod{ @@ -1065,8 +1054,7 @@ func Test_GenerateUnmapVolumeFunc_Plugin_Not_Found(t *testing.T) { oex := operationexecutor.NewOperationExecutor(operationexecutor.NewOperationGenerator( nil, /* kubeClient */ volumePluginMgr, - nil, /* fakeRecorder */ - false, /* checkNodeCapabilitiesBeforeMount */ + nil, /* fakeRecorder */ nil)) volumeMode := v1.PersistentVolumeBlock tmpSpec := &volume.Spec{PersistentVolume: &v1.PersistentVolume{Spec: v1.PersistentVolumeSpec{VolumeMode: &volumeMode}}} @@ -1108,8 +1096,7 @@ func Test_GenerateUnmapDeviceFunc_Plugin_Not_Found(t *testing.T) { oex := operationexecutor.NewOperationExecutor(operationexecutor.NewOperationGenerator( nil, /* kubeClient */ volumePluginMgr, - nil, /* fakeRecorder */ - false, /* checkNodeCapabilitiesBeforeMount */ + nil, /* fakeRecorder */ nil)) var hostutil hostutil.HostUtils volumeMode := v1.PersistentVolumeBlock @@ -1259,7 +1246,6 @@ func Test_Run_Positive_VolumeFSResizeControllerAttachEnabled(t *testing.T) { kubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) reconciler := NewReconciler( @@ -1450,7 +1436,6 @@ func Test_UncertainDeviceGlobalMounts(t *testing.T) { kubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) reconciler := NewReconciler( @@ -1673,7 +1658,6 @@ func Test_UncertainVolumeMountState(t *testing.T) { kubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) reconciler := NewReconciler( @@ -1985,7 +1969,6 @@ func Test_Run_Positive_VolumeMountControllerAttachEnabledRace(t *testing.T) { kubeClient, volumePluginMgr, fakeRecorder, - false, /* checkNodeCapabilitiesBeforeMount */ fakeHandler)) reconciler := NewReconciler( kubeClient, diff --git a/pkg/kubelet/volumemanager/volume_manager.go b/pkg/kubelet/volumemanager/volume_manager.go index 22d89583e54..b1a84807ca4 100644 --- a/pkg/kubelet/volumemanager/volume_manager.go +++ b/pkg/kubelet/volumemanager/volume_manager.go @@ -180,7 +180,6 @@ func NewVolumeManager( hostutil hostutil.HostUtils, kubeletPodsDir string, recorder record.EventRecorder, - checkNodeCapabilitiesBeforeMount bool, keepTerminatedPodVolumes bool, blockVolumePathHandler volumepathhandler.BlockVolumePathHandler) VolumeManager { @@ -193,7 +192,6 @@ func NewVolumeManager( kubeClient, volumePluginMgr, recorder, - checkNodeCapabilitiesBeforeMount, blockVolumePathHandler)), } diff --git a/pkg/kubelet/volumemanager/volume_manager_test.go b/pkg/kubelet/volumemanager/volume_manager_test.go index 5698c79e2e4..8d23092b535 100644 --- a/pkg/kubelet/volumemanager/volume_manager_test.go +++ b/pkg/kubelet/volumemanager/volume_manager_test.go @@ -315,7 +315,6 @@ func newTestVolumeManager(t *testing.T, tmpDir string, podManager kubepod.Manage hostutil.NewFakeHostUtil(nil), "", fakeRecorder, - false, /* experimentalCheckNodeCapabilitiesBeforeMount */ false, /* keepTerminatedPodVolumes */ fakePathHandler) diff --git a/pkg/volume/awsebs/aws_ebs.go b/pkg/volume/awsebs/aws_ebs.go index 5d5745e3883..ac5eb2f3d88 100644 --- a/pkg/volume/awsebs/aws_ebs.go +++ b/pkg/volume/awsebs/aws_ebs.go @@ -356,13 +356,6 @@ func (b *awsElasticBlockStoreMounter) GetAttributes() volume.Attributes { } } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (b *awsElasticBlockStoreMounter) CanMount() error { - return nil -} - // SetUp attaches the disk and bind mounts to the volume path. func (b *awsElasticBlockStoreMounter) SetUp(mounterArgs volume.MounterArgs) error { return b.SetUpAt(b.GetPath(), mounterArgs) diff --git a/pkg/volume/azure_file/azure_file.go b/pkg/volume/azure_file/azure_file.go index bcf4e273f2c..77c6948a98f 100644 --- a/pkg/volume/azure_file/azure_file.go +++ b/pkg/volume/azure_file/azure_file.go @@ -245,13 +245,6 @@ func (b *azureFileMounter) GetAttributes() volume.Attributes { } } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (b *azureFileMounter) CanMount() error { - return nil -} - // SetUp attaches the disk and bind mounts to the volume path. func (b *azureFileMounter) SetUp(mounterArgs volume.MounterArgs) error { return b.SetUpAt(b.GetPath(), mounterArgs) diff --git a/pkg/volume/azuredd/azure_mounter.go b/pkg/volume/azuredd/azure_mounter.go index 647533510ff..251758124ef 100644 --- a/pkg/volume/azuredd/azure_mounter.go +++ b/pkg/volume/azuredd/azure_mounter.go @@ -62,10 +62,6 @@ func (m *azureDiskMounter) GetAttributes() volume.Attributes { } } -func (m *azureDiskMounter) CanMount() error { - return nil -} - func (m *azureDiskMounter) SetUp(mounterArgs volume.MounterArgs) error { return m.SetUpAt(m.GetPath(), mounterArgs) } diff --git a/pkg/volume/cephfs/cephfs.go b/pkg/volume/cephfs/cephfs.go index 9e997e35f55..c15195ca21b 100644 --- a/pkg/volume/cephfs/cephfs.go +++ b/pkg/volume/cephfs/cephfs.go @@ -212,13 +212,6 @@ func (cephfsVolume *cephfsMounter) GetAttributes() volume.Attributes { } } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (cephfsVolume *cephfsMounter) CanMount() error { - return nil -} - // SetUp attaches the disk and bind mounts to the volume path. func (cephfsVolume *cephfsMounter) SetUp(mounterArgs volume.MounterArgs) error { return cephfsVolume.SetUpAt(cephfsVolume.GetPath(), mounterArgs) diff --git a/pkg/volume/cinder/cinder.go b/pkg/volume/cinder/cinder.go index f917d2bc9d9..3e2f927b198 100644 --- a/pkg/volume/cinder/cinder.go +++ b/pkg/volume/cinder/cinder.go @@ -377,13 +377,6 @@ func (b *cinderVolumeMounter) GetAttributes() volume.Attributes { } } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (b *cinderVolumeMounter) CanMount() error { - return nil -} - func (b *cinderVolumeMounter) SetUp(mounterArgs volume.MounterArgs) error { return b.SetUpAt(b.GetPath(), mounterArgs) } diff --git a/pkg/volume/configmap/configmap.go b/pkg/volume/configmap/configmap.go index 607587938f1..a0c46b1002f 100644 --- a/pkg/volume/configmap/configmap.go +++ b/pkg/volume/configmap/configmap.go @@ -173,13 +173,6 @@ func wrappedVolumeSpec() volume.Spec { } } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (b *configMapVolumeMounter) CanMount() error { - return nil -} - func (b *configMapVolumeMounter) SetUp(mounterArgs volume.MounterArgs) error { return b.SetUpAt(b.GetPath(), mounterArgs) } diff --git a/pkg/volume/csi/csi_mounter.go b/pkg/volume/csi/csi_mounter.go index 95eb198b148..3165e24b53f 100644 --- a/pkg/volume/csi/csi_mounter.go +++ b/pkg/volume/csi/csi_mounter.go @@ -96,10 +96,6 @@ func getTargetPath(uid types.UID, specVolumeID string, host volume.VolumeHost) s // volume.Mounter methods var _ volume.Mounter = &csiMountMgr{} -func (c *csiMountMgr) CanMount() error { - return nil -} - func (c *csiMountMgr) SetUp(mounterArgs volume.MounterArgs) error { return c.SetUpAt(c.GetPath(), mounterArgs) } diff --git a/pkg/volume/csi/csi_test.go b/pkg/volume/csi/csi_test.go index 559fae6c1e9..a065efc92e1 100644 --- a/pkg/volume/csi/csi_test.go +++ b/pkg/volume/csi/csi_test.go @@ -444,10 +444,6 @@ func TestCSI_VolumeAll(t *testing.T) { t.Fatalf("csiTest.VolumeAll volPlugin.NewMounter is nil or error: %s", err) } - if err := mounter.CanMount(); err != nil { - t.Fatal("csiTest.VolumeAll mounter.CanMount failed, skipping mount") - } - var fsGroup *int64 if pod.Spec.SecurityContext != nil && pod.Spec.SecurityContext.FSGroup != nil { fsGroup = pod.Spec.SecurityContext.FSGroup diff --git a/pkg/volume/downwardapi/downwardapi.go b/pkg/volume/downwardapi/downwardapi.go index 9e3dedba472..fd5fd5afb61 100644 --- a/pkg/volume/downwardapi/downwardapi.go +++ b/pkg/volume/downwardapi/downwardapi.go @@ -159,13 +159,6 @@ func (d *downwardAPIVolume) GetAttributes() volume.Attributes { } } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (b *downwardAPIVolumeMounter) CanMount() error { - return nil -} - // SetUp puts in place the volume plugin. // This function is not idempotent by design. We want the data to be refreshed periodically. // The internal sync interval of kubelet will drive the refresh of data. diff --git a/pkg/volume/emptydir/empty_dir.go b/pkg/volume/emptydir/empty_dir.go index b8f6bbcbabd..6665b9fe952 100644 --- a/pkg/volume/emptydir/empty_dir.go +++ b/pkg/volume/emptydir/empty_dir.go @@ -225,13 +225,6 @@ func (ed *emptyDir) GetAttributes() volume.Attributes { } } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (ed *emptyDir) CanMount() error { - return nil -} - // SetUp creates new directory. func (ed *emptyDir) SetUp(mounterArgs volume.MounterArgs) error { return ed.SetUpAt(ed.GetPath(), mounterArgs) diff --git a/pkg/volume/fc/fc.go b/pkg/volume/fc/fc.go index 6cdfa925329..dd5ef899315 100644 --- a/pkg/volume/fc/fc.go +++ b/pkg/volume/fc/fc.go @@ -370,13 +370,6 @@ func (b *fcDiskMounter) GetAttributes() volume.Attributes { } } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (b *fcDiskMounter) CanMount() error { - return nil -} - func (b *fcDiskMounter) SetUp(mounterArgs volume.MounterArgs) error { return b.SetUpAt(b.GetPath(), mounterArgs) } diff --git a/pkg/volume/flexvolume/mounter-defaults.go b/pkg/volume/flexvolume/mounter-defaults.go index a1c89ab1911..2ec59a979c8 100644 --- a/pkg/volume/flexvolume/mounter-defaults.go +++ b/pkg/volume/flexvolume/mounter-defaults.go @@ -50,7 +50,3 @@ func (f *mounterDefaults) GetAttributes() volume.Attributes { SupportsSELinux: f.flexVolume.plugin.capabilities.SELinuxRelabel, } } - -func (f *mounterDefaults) CanMount() error { - return nil -} diff --git a/pkg/volume/flexvolume/mounter.go b/pkg/volume/flexvolume/mounter.go index 172e3fdb266..8098cfdb66e 100644 --- a/pkg/volume/flexvolume/mounter.go +++ b/pkg/volume/flexvolume/mounter.go @@ -107,7 +107,3 @@ func (f *flexVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) func (f *flexVolumeMounter) GetAttributes() volume.Attributes { return (*mounterDefaults)(f).GetAttributes() } - -func (f *flexVolumeMounter) CanMount() error { - return nil -} diff --git a/pkg/volume/flocker/flocker.go b/pkg/volume/flocker/flocker.go index 74eedc7220e..c27b67468d6 100644 --- a/pkg/volume/flocker/flocker.go +++ b/pkg/volume/flocker/flocker.go @@ -220,13 +220,6 @@ func (b *flockerVolumeMounter) GetAttributes() volume.Attributes { } } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (b *flockerVolumeMounter) CanMount() error { - return nil -} - func (b *flockerVolumeMounter) GetPath() string { return getPath(b.podUID, b.volName, b.plugin.host) } diff --git a/pkg/volume/gcepd/gce_pd.go b/pkg/volume/gcepd/gce_pd.go index dfc7a30f560..f75b22a9e4d 100644 --- a/pkg/volume/gcepd/gce_pd.go +++ b/pkg/volume/gcepd/gce_pd.go @@ -360,13 +360,6 @@ func (b *gcePersistentDiskMounter) GetAttributes() volume.Attributes { } } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (b *gcePersistentDiskMounter) CanMount() error { - return nil -} - // SetUp bind mounts the disk global mount to the volume path. func (b *gcePersistentDiskMounter) SetUp(mounterArgs volume.MounterArgs) error { return b.SetUpAt(b.GetPath(), mounterArgs) diff --git a/pkg/volume/git_repo/git_repo.go b/pkg/volume/git_repo/git_repo.go index ba23ceaf0b7..545e94cc3c5 100644 --- a/pkg/volume/git_repo/git_repo.go +++ b/pkg/volume/git_repo/git_repo.go @@ -167,13 +167,6 @@ func (b *gitRepoVolumeMounter) GetAttributes() volume.Attributes { } } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (b *gitRepoVolumeMounter) CanMount() error { - return nil -} - // SetUp creates new directory and clones a git repo. func (b *gitRepoVolumeMounter) SetUp(mounterArgs volume.MounterArgs) error { return b.SetUpAt(b.GetPath(), mounterArgs) diff --git a/pkg/volume/glusterfs/glusterfs.go b/pkg/volume/glusterfs/glusterfs.go index 2a91164836d..f586f4a93f4 100644 --- a/pkg/volume/glusterfs/glusterfs.go +++ b/pkg/volume/glusterfs/glusterfs.go @@ -25,7 +25,6 @@ import ( "net/http" "os" "path/filepath" - "runtime" "strconv" dstrings "strings" "sync" @@ -73,14 +72,13 @@ var _ volume.Provisioner = &glusterfsVolumeProvisioner{} var _ volume.Deleter = &glusterfsVolumeDeleter{} const ( - glusterfsPluginName = "kubernetes.io/glusterfs" - volPrefix = "vol_" - dynamicEpSvcPrefix = "glusterfs-dynamic" - replicaCount = 3 - secretKeyName = "key" // key name used in secret - gciLinuxGlusterMountBinaryPath = "/sbin/mount.glusterfs" - defaultGidMin = 2000 - defaultGidMax = math.MaxInt32 + glusterfsPluginName = "kubernetes.io/glusterfs" + volPrefix = "vol_" + dynamicEpSvcPrefix = "glusterfs-dynamic" + replicaCount = 3 + secretKeyName = "key" // key name used in secret + defaultGidMin = 2000 + defaultGidMax = math.MaxInt32 // maxCustomEpNamePrefix is the maximum number of chars. // which can be used as ep/svc name prefix. This number is carved @@ -257,20 +255,6 @@ func (b *glusterfsMounter) GetAttributes() volume.Attributes { } } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (b *glusterfsMounter) CanMount() error { - exe := b.plugin.host.GetExec(b.plugin.GetPluginName()) - switch runtime.GOOS { - case "linux": - if _, err := exe.Command("test", "-x", gciLinuxGlusterMountBinaryPath).CombinedOutput(); err != nil { - return fmt.Errorf("required binary %s is missing", gciLinuxGlusterMountBinaryPath) - } - } - return nil -} - // SetUp attaches the disk and bind mounts to the volume path. func (b *glusterfsMounter) SetUp(mounterArgs volume.MounterArgs) error { return b.SetUpAt(b.GetPath(), mounterArgs) diff --git a/pkg/volume/hostpath/host_path.go b/pkg/volume/hostpath/host_path.go index ece27cf21e3..ecc1b023a9b 100644 --- a/pkg/volume/hostpath/host_path.go +++ b/pkg/volume/hostpath/host_path.go @@ -218,13 +218,6 @@ func (b *hostPathMounter) GetAttributes() volume.Attributes { } } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (b *hostPathMounter) CanMount() error { - return nil -} - // SetUp does nothing. func (b *hostPathMounter) SetUp(mounterArgs volume.MounterArgs) error { err := validation.ValidatePathNoBacksteps(b.GetPath()) diff --git a/pkg/volume/iscsi/iscsi.go b/pkg/volume/iscsi/iscsi.go index 2e4c8873af5..0de664f0a7a 100644 --- a/pkg/volume/iscsi/iscsi.go +++ b/pkg/volume/iscsi/iscsi.go @@ -352,13 +352,6 @@ func (b *iscsiDiskMounter) GetAttributes() volume.Attributes { } } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (b *iscsiDiskMounter) CanMount() error { - return nil -} - func (b *iscsiDiskMounter) SetUp(mounterArgs volume.MounterArgs) error { return b.SetUpAt(b.GetPath(), mounterArgs) } diff --git a/pkg/volume/local/local.go b/pkg/volume/local/local.go index 6f1387db4b8..0709da30ab8 100644 --- a/pkg/volume/local/local.go +++ b/pkg/volume/local/local.go @@ -510,13 +510,6 @@ func (m *localVolumeMounter) GetAttributes() volume.Attributes { } } -// CanMount checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (m *localVolumeMounter) CanMount() error { - return nil -} - // SetUp bind mounts the directory to the volume path func (m *localVolumeMounter) SetUp(mounterArgs volume.MounterArgs) error { return m.SetUpAt(m.GetPath(), mounterArgs) diff --git a/pkg/volume/nfs/nfs.go b/pkg/volume/nfs/nfs.go index 5ad1d9c7372..fcf57af93c4 100644 --- a/pkg/volume/nfs/nfs.go +++ b/pkg/volume/nfs/nfs.go @@ -20,7 +20,6 @@ import ( "fmt" netutil "k8s.io/utils/net" "os" - "runtime" "time" "k8s.io/klog/v2" @@ -198,28 +197,6 @@ func (nfsVolume *nfs) GetPath() string { return nfsVolume.plugin.host.GetPodVolumeDir(nfsVolume.pod.UID, utilstrings.EscapeQualifiedName(name), nfsVolume.volName) } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (nfsMounter *nfsMounter) CanMount() error { - exec := nfsMounter.plugin.host.GetExec(nfsMounter.plugin.GetPluginName()) - switch runtime.GOOS { - case "linux": - if _, err := exec.Command("test", "-x", "/sbin/mount.nfs").CombinedOutput(); err != nil { - return fmt.Errorf("required binary /sbin/mount.nfs is missing") - } - if _, err := exec.Command("test", "-x", "/sbin/mount.nfs4").CombinedOutput(); err != nil { - return fmt.Errorf("required binary /sbin/mount.nfs4 is missing") - } - return nil - case "darwin": - if _, err := exec.Command("test", "-x", "/sbin/mount_nfs").CombinedOutput(); err != nil { - return fmt.Errorf("required binary /sbin/mount_nfs is missing") - } - } - return nil -} - type nfsMounter struct { *nfs server string diff --git a/pkg/volume/portworx/portworx.go b/pkg/volume/portworx/portworx.go index 103e244e1fd..4049224a31d 100644 --- a/pkg/volume/portworx/portworx.go +++ b/pkg/volume/portworx/portworx.go @@ -293,13 +293,6 @@ func (b *portworxVolumeMounter) GetAttributes() volume.Attributes { } } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (b *portworxVolumeMounter) CanMount() error { - return nil -} - // SetUp attaches the disk and bind mounts to the volume path. func (b *portworxVolumeMounter) SetUp(mounterArgs volume.MounterArgs) error { return b.SetUpAt(b.GetPath(), mounterArgs) diff --git a/pkg/volume/projected/projected.go b/pkg/volume/projected/projected.go index f6fca6d5790..0e76d791b39 100644 --- a/pkg/volume/projected/projected.go +++ b/pkg/volume/projected/projected.go @@ -175,13 +175,6 @@ func (sv *projectedVolume) GetAttributes() volume.Attributes { } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (s *projectedVolumeMounter) CanMount() error { - return nil -} - func (s *projectedVolumeMounter) SetUp(mounterArgs volume.MounterArgs) error { return s.SetUpAt(s.GetPath(), mounterArgs) } diff --git a/pkg/volume/quobyte/quobyte.go b/pkg/volume/quobyte/quobyte.go index bb71e22e79c..16b296ef50d 100644 --- a/pkg/volume/quobyte/quobyte.go +++ b/pkg/volume/quobyte/quobyte.go @@ -231,13 +231,6 @@ func (mounter *quobyteMounter) GetAttributes() volume.Attributes { } } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (mounter *quobyteMounter) CanMount() error { - return nil -} - // SetUp attaches the disk and bind mounts to the volume path. func (mounter *quobyteMounter) SetUp(mounterArgs volume.MounterArgs) error { pluginDir := mounter.plugin.host.GetPluginDir(utilstrings.EscapeQualifiedName(quobytePluginName)) diff --git a/pkg/volume/rbd/rbd.go b/pkg/volume/rbd/rbd.go index 25fc78561d3..ba3c1bc2498 100644 --- a/pkg/volume/rbd/rbd.go +++ b/pkg/volume/rbd/rbd.go @@ -838,13 +838,6 @@ func (rbd *rbd) GetAttributes() volume.Attributes { } } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (b *rbdMounter) CanMount() error { - return nil -} - func (b *rbdMounter) SetUp(mounterArgs volume.MounterArgs) error { return b.SetUpAt(b.GetPath(), mounterArgs) } diff --git a/pkg/volume/secret/secret.go b/pkg/volume/secret/secret.go index 8226b2209ee..472498daf1a 100644 --- a/pkg/volume/secret/secret.go +++ b/pkg/volume/secret/secret.go @@ -168,13 +168,6 @@ func (sv *secretVolume) GetAttributes() volume.Attributes { } } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (b *secretVolumeMounter) CanMount() error { - return nil -} - func (b *secretVolumeMounter) SetUp(mounterArgs volume.MounterArgs) error { return b.SetUpAt(b.GetPath(), mounterArgs) } diff --git a/pkg/volume/storageos/storageos.go b/pkg/volume/storageos/storageos.go index 591b7e45592..cc76cfac286 100644 --- a/pkg/volume/storageos/storageos.go +++ b/pkg/volume/storageos/storageos.go @@ -334,13 +334,6 @@ func (b *storageosMounter) GetAttributes() volume.Attributes { } } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (b *storageosMounter) CanMount() error { - return nil -} - // SetUp attaches the disk and bind mounts to the volume path. func (b *storageosMounter) SetUp(mounterArgs volume.MounterArgs) error { // Need a namespace to find the volume, try pod's namespace if not set. diff --git a/pkg/volume/testing/testing.go b/pkg/volume/testing/testing.go index 346cf4d9ad7..42542178e8e 100644 --- a/pkg/volume/testing/testing.go +++ b/pkg/volume/testing/testing.go @@ -692,10 +692,6 @@ func (_ *FakeVolume) GetAttributes() Attributes { } } -func (fv *FakeVolume) CanMount() error { - return nil -} - func (fv *FakeVolume) SetUp(mounterArgs MounterArgs) error { fv.Lock() defer fv.Unlock() diff --git a/pkg/volume/util/operationexecutor/operation_generator.go b/pkg/volume/util/operationexecutor/operation_generator.go index 9b7482f6f5d..25ae01a80c6 100644 --- a/pkg/volume/util/operationexecutor/operation_generator.go +++ b/pkg/volume/util/operationexecutor/operation_generator.go @@ -80,11 +80,6 @@ type operationGenerator struct { // recorder is used to record events in the API server recorder record.EventRecorder - // checkNodeCapabilitiesBeforeMount, if set, enables the CanMount check, - // which verifies that the components (binaries, etc.) required to mount - // the volume are available on the underlying node before attempting mount. - checkNodeCapabilitiesBeforeMount bool - // blkUtil provides volume path related operations for block volume blkUtil volumepathhandler.BlockVolumePathHandler @@ -95,16 +90,14 @@ type operationGenerator struct { func NewOperationGenerator(kubeClient clientset.Interface, volumePluginMgr *volume.VolumePluginMgr, recorder record.EventRecorder, - checkNodeCapabilitiesBeforeMount bool, blkUtil volumepathhandler.BlockVolumePathHandler) OperationGenerator { return &operationGenerator{ - kubeClient: kubeClient, - volumePluginMgr: volumePluginMgr, - recorder: recorder, - checkNodeCapabilitiesBeforeMount: checkNodeCapabilitiesBeforeMount, - blkUtil: blkUtil, - translator: csitrans.New(), + kubeClient: kubeClient, + volumePluginMgr: volumePluginMgr, + recorder: recorder, + blkUtil: blkUtil, + translator: csitrans.New(), } } @@ -712,16 +705,6 @@ func (og *operationGenerator) GenerateMountVolumeFunc( } } - if og.checkNodeCapabilitiesBeforeMount { - if canMountErr := volumeMounter.CanMount(); canMountErr != nil { - err = fmt.Errorf( - "verify that your node machine has the required components before attempting to mount this volume type. %s", - canMountErr) - eventErr, detailedErr := volumeToMount.GenerateError("MountVolume.CanMount failed", err) - return volumetypes.NewOperationContext(eventErr, detailedErr, migrated) - } - } - // Execute mount mountErr := volumeMounter.SetUp(volume.MounterArgs{ FsUser: util.FsUserFrom(volumeToMount.Pod), diff --git a/pkg/volume/util/operationexecutor/operation_generator_test.go b/pkg/volume/util/operationexecutor/operation_generator_test.go index c7888ef0901..c86613d54c5 100644 --- a/pkg/volume/util/operationexecutor/operation_generator_test.go +++ b/pkg/volume/util/operationexecutor/operation_generator_test.go @@ -419,7 +419,6 @@ func getTestOperationGenerator(volumePluginMgr *volume.VolumePluginMgr, objects fakeKubeClient, volumePluginMgr, fakeRecorder, - false, fakeHandler) return operationGenerator } diff --git a/pkg/volume/volume.go b/pkg/volume/volume.go index 13d75a63381..f51f6e39354 100644 --- a/pkg/volume/volume.go +++ b/pkg/volume/volume.go @@ -136,17 +136,6 @@ type Mounter interface { // Uses Interface to provide the path for Docker binds. Volume - // CanMount is called immediately prior to Setup to check if - // the required components (binaries, etc.) are available on - // the underlying node to complete the subsequent SetUp (mount) - // operation. If CanMount returns error, the mount operation is - // aborted and an event is generated indicating that the node - // does not have the required binaries to complete the mount. - // If CanMount succeeds, the mount operation continues - // normally. The CanMount check can be enabled or disabled - // using the experimental-check-mount-binaries binary flag - CanMount() error - // SetUp prepares and mounts/unpacks the volume to a // self-determined directory path. The mount point and its // content should be owned by `fsUser` or 'fsGroup' so that it can be diff --git a/pkg/volume/volume_linux_test.go b/pkg/volume/volume_linux_test.go index 8c8f4430aa3..38c3b5b3c7c 100644 --- a/pkg/volume/volume_linux_test.go +++ b/pkg/volume/volume_linux_test.go @@ -43,10 +43,6 @@ func (l *localFakeMounter) GetAttributes() Attributes { return l.attributes } -func (l *localFakeMounter) CanMount() error { - return nil -} - func (l *localFakeMounter) SetUp(mounterArgs MounterArgs) error { return nil } diff --git a/pkg/volume/vsphere_volume/vsphere_volume.go b/pkg/volume/vsphere_volume/vsphere_volume.go index a8b644a727c..878876bed1a 100644 --- a/pkg/volume/vsphere_volume/vsphere_volume.go +++ b/pkg/volume/vsphere_volume/vsphere_volume.go @@ -218,13 +218,6 @@ func (b *vsphereVolumeMounter) SetUp(mounterArgs volume.MounterArgs) error { return b.SetUpAt(b.GetPath(), mounterArgs) } -// Checks prior to mount operations to verify that the required components (binaries, etc.) -// to mount the volume are available on the underlying node. -// If not, it returns an error -func (b *vsphereVolumeMounter) CanMount() error { - return nil -} - // SetUp attaches the disk and bind mounts to the volume path. func (b *vsphereVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) error { klog.V(5).Infof("vSphere volume setup %s to %s", b.volPath, dir)