mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
kubelet: Remove the deprecated flag --experimental-check-node-capabilities-before-mount
This commit is contained in:
parent
2b0ddeb23b
commit
beda4cafb6
@ -749,7 +749,6 @@ function construct-linux-kubelet-flags {
|
|||||||
flags="$(construct-common-kubelet-flags)"
|
flags="$(construct-common-kubelet-flags)"
|
||||||
# Keep in sync with CONTAINERIZED_MOUNTER_HOME in configure-helper.sh
|
# Keep in sync with CONTAINERIZED_MOUNTER_HOME in configure-helper.sh
|
||||||
flags+=" --experimental-mounter-path=/home/kubernetes/containerized_mounter/mounter"
|
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)
|
# Keep in sync with the mkdir command in configure-helper.sh (until the TODO is resolved)
|
||||||
flags+=" --cert-dir=/var/lib/kubelet/pki/"
|
flags+=" --cert-dir=/var/lib/kubelet/pki/"
|
||||||
|
|
||||||
|
@ -108,10 +108,6 @@ type KubeletFlags struct {
|
|||||||
RemoteImageEndpoint string
|
RemoteImageEndpoint string
|
||||||
// experimentalMounterPath is the path of mounter binary. Leave empty to use the default mount path
|
// experimentalMounterPath is the path of mounter binary. Leave empty to use the default mount path
|
||||||
ExperimentalMounterPath string
|
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.
|
// 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.
|
// Refer to [Node Allocatable](https://git.k8s.io/community/contributors/design-proposals/node/node-allocatable.md) doc for more information.
|
||||||
ExperimentalNodeAllocatableIgnoreEvictionThreshold bool
|
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.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.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.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.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.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.")
|
fs.StringVar(&f.CloudConfigFile, "cloud-config", f.CloudConfigFile, "The path to the cloud provider configuration file. Empty string for no configuration file.")
|
||||||
|
@ -1190,7 +1190,6 @@ func RunKubelet(kubeServer *options.KubeletServer, kubeDeps *kubelet.Dependencie
|
|||||||
kubeServer.AllowedUnsafeSysctls,
|
kubeServer.AllowedUnsafeSysctls,
|
||||||
kubeServer.ExperimentalMounterPath,
|
kubeServer.ExperimentalMounterPath,
|
||||||
kubeServer.KernelMemcgNotification,
|
kubeServer.KernelMemcgNotification,
|
||||||
kubeServer.ExperimentalCheckNodeCapabilitiesBeforeMount,
|
|
||||||
kubeServer.ExperimentalNodeAllocatableIgnoreEvictionThreshold,
|
kubeServer.ExperimentalNodeAllocatableIgnoreEvictionThreshold,
|
||||||
kubeServer.MinimumGCAge,
|
kubeServer.MinimumGCAge,
|
||||||
kubeServer.MaxPerPodContainerCount,
|
kubeServer.MaxPerPodContainerCount,
|
||||||
@ -1265,7 +1264,6 @@ func createAndInitKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
|
|||||||
allowedUnsafeSysctls []string,
|
allowedUnsafeSysctls []string,
|
||||||
experimentalMounterPath string,
|
experimentalMounterPath string,
|
||||||
kernelMemcgNotification bool,
|
kernelMemcgNotification bool,
|
||||||
experimentalCheckNodeCapabilitiesBeforeMount bool,
|
|
||||||
experimentalNodeAllocatableIgnoreEvictionThreshold bool,
|
experimentalNodeAllocatableIgnoreEvictionThreshold bool,
|
||||||
minimumGCAge metav1.Duration,
|
minimumGCAge metav1.Duration,
|
||||||
maxPerPodContainerCount int32,
|
maxPerPodContainerCount int32,
|
||||||
@ -1299,7 +1297,6 @@ func createAndInitKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
|
|||||||
allowedUnsafeSysctls,
|
allowedUnsafeSysctls,
|
||||||
experimentalMounterPath,
|
experimentalMounterPath,
|
||||||
kernelMemcgNotification,
|
kernelMemcgNotification,
|
||||||
experimentalCheckNodeCapabilitiesBeforeMount,
|
|
||||||
experimentalNodeAllocatableIgnoreEvictionThreshold,
|
experimentalNodeAllocatableIgnoreEvictionThreshold,
|
||||||
minimumGCAge,
|
minimumGCAge,
|
||||||
maxPerPodContainerCount,
|
maxPerPodContainerCount,
|
||||||
|
@ -166,7 +166,6 @@ func NewAttachDetachController(
|
|||||||
kubeClient,
|
kubeClient,
|
||||||
&adc.volumePluginMgr,
|
&adc.volumePluginMgr,
|
||||||
recorder,
|
recorder,
|
||||||
false, // flag for experimental binary check for volume mount
|
|
||||||
blkutil))
|
blkutil))
|
||||||
adc.nodeStatusUpdater = statusupdater.NewNodeStatusUpdater(
|
adc.nodeStatusUpdater = statusupdater.NewNodeStatusUpdater(
|
||||||
kubeClient, nodeInformer.Lister(), adc.actualStateOfWorld)
|
kubeClient, nodeInformer.Lister(), adc.actualStateOfWorld)
|
||||||
|
@ -55,7 +55,6 @@ func Test_Run_Positive_DoNothing(t *testing.T) {
|
|||||||
fakeKubeClient,
|
fakeKubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
informerFactory := informers.NewSharedInformerFactory(fakeKubeClient, controller.NoResyncPeriodFunc())
|
informerFactory := informers.NewSharedInformerFactory(fakeKubeClient, controller.NoResyncPeriodFunc())
|
||||||
nsu := statusupdater.NewNodeStatusUpdater(
|
nsu := statusupdater.NewNodeStatusUpdater(
|
||||||
@ -91,7 +90,6 @@ func Test_Run_Positive_OneDesiredVolumeAttach(t *testing.T) {
|
|||||||
fakeKubeClient,
|
fakeKubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */)
|
nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */)
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
@ -143,7 +141,6 @@ func Test_Run_Positive_OneDesiredVolumeAttachThenDetachWithUnmountedVolume(t *te
|
|||||||
fakeKubeClient,
|
fakeKubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */)
|
nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */)
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
@ -216,7 +213,6 @@ func Test_Run_Positive_OneDesiredVolumeAttachThenDetachWithMountedVolume(t *test
|
|||||||
fakeKubeClient,
|
fakeKubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */)
|
nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */)
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
@ -289,7 +285,6 @@ func Test_Run_Negative_OneDesiredVolumeAttachThenDetachWithUnmountedVolumeUpdate
|
|||||||
fakeKubeClient,
|
fakeKubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
nsu := statusupdater.NewFakeNodeStatusUpdater(true /* returnError */)
|
nsu := statusupdater.NewFakeNodeStatusUpdater(true /* returnError */)
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
@ -365,7 +360,6 @@ func Test_Run_OneVolumeAttachAndDetachMultipleNodesWithReadWriteMany(t *testing.
|
|||||||
fakeKubeClient,
|
fakeKubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */)
|
nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */)
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
@ -458,7 +452,6 @@ func Test_Run_OneVolumeAttachAndDetachMultipleNodesWithReadWriteOnce(t *testing.
|
|||||||
fakeKubeClient,
|
fakeKubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */)
|
nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */)
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
@ -549,7 +542,6 @@ func Test_Run_OneVolumeAttachAndDetachUncertainNodesWithReadWriteOnce(t *testing
|
|||||||
fakeKubeClient,
|
fakeKubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */)
|
nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */)
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
@ -611,7 +603,6 @@ func Test_Run_OneVolumeDetachFailNodeWithReadWriteOnce(t *testing.T) {
|
|||||||
fakeKubeClient,
|
fakeKubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */)
|
nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */)
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
@ -713,7 +704,6 @@ func Test_Run_OneVolumeAttachAndDetachTimeoutNodesWithReadWriteOnce(t *testing.T
|
|||||||
fakeKubeClient,
|
fakeKubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */)
|
nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */)
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
@ -819,7 +809,6 @@ func Test_ReportMultiAttachError(t *testing.T) {
|
|||||||
fakeKubeClient,
|
fakeKubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */)
|
nsu := statusupdater.NewFakeNodeStatusUpdater(false /* returnError */)
|
||||||
rc := NewReconciler(
|
rc := NewReconciler(
|
||||||
|
@ -143,7 +143,6 @@ func NewExpandController(
|
|||||||
kubeClient,
|
kubeClient,
|
||||||
&expc.volumePluginMgr,
|
&expc.volumePluginMgr,
|
||||||
expc.recorder,
|
expc.recorder,
|
||||||
false,
|
|
||||||
blkutil)
|
blkutil)
|
||||||
|
|
||||||
pvcInformer.Informer().AddEventHandler(kcache.ResourceEventHandlerFuncs{
|
pvcInformer.Informer().AddEventHandler(kcache.ResourceEventHandlerFuncs{
|
||||||
|
@ -349,7 +349,6 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
|
|||||||
allowedUnsafeSysctls []string,
|
allowedUnsafeSysctls []string,
|
||||||
experimentalMounterPath string,
|
experimentalMounterPath string,
|
||||||
kernelMemcgNotification bool,
|
kernelMemcgNotification bool,
|
||||||
experimentalCheckNodeCapabilitiesBeforeMount bool,
|
|
||||||
experimentalNodeAllocatableIgnoreEvictionThreshold bool,
|
experimentalNodeAllocatableIgnoreEvictionThreshold bool,
|
||||||
minimumGCAge metav1.Duration,
|
minimumGCAge metav1.Duration,
|
||||||
maxPerPodContainerCount int32,
|
maxPerPodContainerCount int32,
|
||||||
@ -772,7 +771,6 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
|
|||||||
// If the experimentalMounterPathFlag is set, we do not want to
|
// If the experimentalMounterPathFlag is set, we do not want to
|
||||||
// check node capabilities since the mount path is not the default
|
// check node capabilities since the mount path is not the default
|
||||||
if len(experimentalMounterPath) != 0 {
|
if len(experimentalMounterPath) != 0 {
|
||||||
experimentalCheckNodeCapabilitiesBeforeMount = false
|
|
||||||
// Replace the nameserver in containerized-mounter's rootfs/etc/resolv.conf with kubelet.ClusterDNS
|
// Replace the nameserver in containerized-mounter's rootfs/etc/resolv.conf with kubelet.ClusterDNS
|
||||||
// so that service name could be resolved
|
// so that service name could be resolved
|
||||||
klet.dnsConfigurer.SetupDNSinContainerizedMounter(experimentalMounterPath)
|
klet.dnsConfigurer.SetupDNSinContainerizedMounter(experimentalMounterPath)
|
||||||
@ -791,7 +789,6 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
|
|||||||
kubeDeps.HostUtil,
|
kubeDeps.HostUtil,
|
||||||
klet.getPodsDir(),
|
klet.getPodsDir(),
|
||||||
kubeDeps.Recorder,
|
kubeDeps.Recorder,
|
||||||
experimentalCheckNodeCapabilitiesBeforeMount,
|
|
||||||
keepTerminatedPodVolumes,
|
keepTerminatedPodVolumes,
|
||||||
volumepathhandler.NewBlockVolumePathHandler())
|
volumepathhandler.NewBlockVolumePathHandler())
|
||||||
|
|
||||||
|
@ -363,7 +363,6 @@ func newTestKubeletWithImageList(
|
|||||||
kubelet.hostutil,
|
kubelet.hostutil,
|
||||||
kubelet.getPodsDir(),
|
kubelet.getPodsDir(),
|
||||||
kubelet.recorder,
|
kubelet.recorder,
|
||||||
false, /* experimentalCheckNodeCapabilitiesBeforeMount*/
|
|
||||||
false, /* keepTerminatedPodVolumes */
|
false, /* keepTerminatedPodVolumes */
|
||||||
volumetest.NewBlockVolumePathHandler())
|
volumetest.NewBlockVolumePathHandler())
|
||||||
|
|
||||||
|
@ -554,10 +554,6 @@ func (f *stubVolume) GetAttributes() volume.Attributes {
|
|||||||
return volume.Attributes{}
|
return volume.Attributes{}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *stubVolume) CanMount() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (f *stubVolume) SetUp(mounterArgs volume.MounterArgs) error {
|
func (f *stubVolume) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,6 @@ func TestRunOnce(t *testing.T) {
|
|||||||
kb.hostutil,
|
kb.hostutil,
|
||||||
kb.getPodsDir(),
|
kb.getPodsDir(),
|
||||||
kb.recorder,
|
kb.recorder,
|
||||||
false, /* experimentalCheckNodeCapabilitiesBeforeMount */
|
|
||||||
false, /* keepTerminatedPodVolumes */
|
false, /* keepTerminatedPodVolumes */
|
||||||
volumetest.NewBlockVolumePathHandler())
|
volumetest.NewBlockVolumePathHandler())
|
||||||
|
|
||||||
|
@ -76,7 +76,6 @@ func Test_Run_Positive_DoNothing(t *testing.T) {
|
|||||||
kubeClient,
|
kubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler,
|
fakeHandler,
|
||||||
))
|
))
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
@ -121,7 +120,6 @@ func Test_Run_Positive_VolumeAttachAndMount(t *testing.T) {
|
|||||||
kubeClient,
|
kubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
kubeClient,
|
kubeClient,
|
||||||
@ -212,7 +210,6 @@ func Test_Run_Positive_VolumeMountControllerAttachEnabled(t *testing.T) {
|
|||||||
kubeClient,
|
kubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
kubeClient,
|
kubeClient,
|
||||||
@ -292,7 +289,6 @@ func Test_Run_Negative_VolumeMountControllerAttachEnabled(t *testing.T) {
|
|||||||
kubeClient,
|
kubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
kubeClient,
|
kubeClient,
|
||||||
@ -371,7 +367,6 @@ func Test_Run_Positive_VolumeAttachMountUnmountDetach(t *testing.T) {
|
|||||||
kubeClient,
|
kubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
kubeClient,
|
kubeClient,
|
||||||
@ -474,7 +469,6 @@ func Test_Run_Positive_VolumeUnmountControllerAttachEnabled(t *testing.T) {
|
|||||||
kubeClient,
|
kubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
kubeClient,
|
kubeClient,
|
||||||
@ -598,7 +592,6 @@ func Test_Run_Positive_VolumeAttachAndMap(t *testing.T) {
|
|||||||
kubeClient,
|
kubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
kubeClient,
|
kubeClient,
|
||||||
@ -714,7 +707,6 @@ func Test_Run_Positive_BlockVolumeMapControllerAttachEnabled(t *testing.T) {
|
|||||||
kubeClient,
|
kubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
kubeClient,
|
kubeClient,
|
||||||
@ -812,7 +804,6 @@ func Test_Run_Positive_BlockVolumeAttachMapUnmapDetach(t *testing.T) {
|
|||||||
kubeClient,
|
kubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
kubeClient,
|
kubeClient,
|
||||||
@ -937,7 +928,6 @@ func Test_Run_Positive_VolumeUnmapControllerAttachEnabled(t *testing.T) {
|
|||||||
kubeClient,
|
kubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
kubeClient,
|
kubeClient,
|
||||||
@ -1014,8 +1004,7 @@ func Test_GenerateMapVolumeFunc_Plugin_Not_Found(t *testing.T) {
|
|||||||
oex := operationexecutor.NewOperationExecutor(operationexecutor.NewOperationGenerator(
|
oex := operationexecutor.NewOperationExecutor(operationexecutor.NewOperationGenerator(
|
||||||
nil, /* kubeClient */
|
nil, /* kubeClient */
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
nil, /* fakeRecorder */
|
nil, /* fakeRecorder */
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
nil))
|
nil))
|
||||||
|
|
||||||
pod := &v1.Pod{
|
pod := &v1.Pod{
|
||||||
@ -1065,8 +1054,7 @@ func Test_GenerateUnmapVolumeFunc_Plugin_Not_Found(t *testing.T) {
|
|||||||
oex := operationexecutor.NewOperationExecutor(operationexecutor.NewOperationGenerator(
|
oex := operationexecutor.NewOperationExecutor(operationexecutor.NewOperationGenerator(
|
||||||
nil, /* kubeClient */
|
nil, /* kubeClient */
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
nil, /* fakeRecorder */
|
nil, /* fakeRecorder */
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
nil))
|
nil))
|
||||||
volumeMode := v1.PersistentVolumeBlock
|
volumeMode := v1.PersistentVolumeBlock
|
||||||
tmpSpec := &volume.Spec{PersistentVolume: &v1.PersistentVolume{Spec: v1.PersistentVolumeSpec{VolumeMode: &volumeMode}}}
|
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(
|
oex := operationexecutor.NewOperationExecutor(operationexecutor.NewOperationGenerator(
|
||||||
nil, /* kubeClient */
|
nil, /* kubeClient */
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
nil, /* fakeRecorder */
|
nil, /* fakeRecorder */
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
nil))
|
nil))
|
||||||
var hostutil hostutil.HostUtils
|
var hostutil hostutil.HostUtils
|
||||||
volumeMode := v1.PersistentVolumeBlock
|
volumeMode := v1.PersistentVolumeBlock
|
||||||
@ -1259,7 +1246,6 @@ func Test_Run_Positive_VolumeFSResizeControllerAttachEnabled(t *testing.T) {
|
|||||||
kubeClient,
|
kubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
|
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
@ -1450,7 +1436,6 @@ func Test_UncertainDeviceGlobalMounts(t *testing.T) {
|
|||||||
kubeClient,
|
kubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
|
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
@ -1673,7 +1658,6 @@ func Test_UncertainVolumeMountState(t *testing.T) {
|
|||||||
kubeClient,
|
kubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
|
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
@ -1985,7 +1969,6 @@ func Test_Run_Positive_VolumeMountControllerAttachEnabledRace(t *testing.T) {
|
|||||||
kubeClient,
|
kubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* checkNodeCapabilitiesBeforeMount */
|
|
||||||
fakeHandler))
|
fakeHandler))
|
||||||
reconciler := NewReconciler(
|
reconciler := NewReconciler(
|
||||||
kubeClient,
|
kubeClient,
|
||||||
|
@ -180,7 +180,6 @@ func NewVolumeManager(
|
|||||||
hostutil hostutil.HostUtils,
|
hostutil hostutil.HostUtils,
|
||||||
kubeletPodsDir string,
|
kubeletPodsDir string,
|
||||||
recorder record.EventRecorder,
|
recorder record.EventRecorder,
|
||||||
checkNodeCapabilitiesBeforeMount bool,
|
|
||||||
keepTerminatedPodVolumes bool,
|
keepTerminatedPodVolumes bool,
|
||||||
blockVolumePathHandler volumepathhandler.BlockVolumePathHandler) VolumeManager {
|
blockVolumePathHandler volumepathhandler.BlockVolumePathHandler) VolumeManager {
|
||||||
|
|
||||||
@ -193,7 +192,6 @@ func NewVolumeManager(
|
|||||||
kubeClient,
|
kubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
recorder,
|
recorder,
|
||||||
checkNodeCapabilitiesBeforeMount,
|
|
||||||
blockVolumePathHandler)),
|
blockVolumePathHandler)),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,7 +315,6 @@ func newTestVolumeManager(t *testing.T, tmpDir string, podManager kubepod.Manage
|
|||||||
hostutil.NewFakeHostUtil(nil),
|
hostutil.NewFakeHostUtil(nil),
|
||||||
"",
|
"",
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false, /* experimentalCheckNodeCapabilitiesBeforeMount */
|
|
||||||
false, /* keepTerminatedPodVolumes */
|
false, /* keepTerminatedPodVolumes */
|
||||||
fakePathHandler)
|
fakePathHandler)
|
||||||
|
|
||||||
|
@ -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.
|
// SetUp attaches the disk and bind mounts to the volume path.
|
||||||
func (b *awsElasticBlockStoreMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
func (b *awsElasticBlockStoreMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
return b.SetUpAt(b.GetPath(), mounterArgs)
|
return b.SetUpAt(b.GetPath(), mounterArgs)
|
||||||
|
@ -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.
|
// SetUp attaches the disk and bind mounts to the volume path.
|
||||||
func (b *azureFileMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
func (b *azureFileMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
return b.SetUpAt(b.GetPath(), mounterArgs)
|
return b.SetUpAt(b.GetPath(), mounterArgs)
|
||||||
|
@ -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 {
|
func (m *azureDiskMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
return m.SetUpAt(m.GetPath(), mounterArgs)
|
return m.SetUpAt(m.GetPath(), mounterArgs)
|
||||||
}
|
}
|
||||||
|
@ -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.
|
// SetUp attaches the disk and bind mounts to the volume path.
|
||||||
func (cephfsVolume *cephfsMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
func (cephfsVolume *cephfsMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
return cephfsVolume.SetUpAt(cephfsVolume.GetPath(), mounterArgs)
|
return cephfsVolume.SetUpAt(cephfsVolume.GetPath(), mounterArgs)
|
||||||
|
@ -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 {
|
func (b *cinderVolumeMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
return b.SetUpAt(b.GetPath(), mounterArgs)
|
return b.SetUpAt(b.GetPath(), mounterArgs)
|
||||||
}
|
}
|
||||||
|
@ -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 {
|
func (b *configMapVolumeMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
return b.SetUpAt(b.GetPath(), mounterArgs)
|
return b.SetUpAt(b.GetPath(), mounterArgs)
|
||||||
}
|
}
|
||||||
|
@ -96,10 +96,6 @@ func getTargetPath(uid types.UID, specVolumeID string, host volume.VolumeHost) s
|
|||||||
// volume.Mounter methods
|
// volume.Mounter methods
|
||||||
var _ volume.Mounter = &csiMountMgr{}
|
var _ volume.Mounter = &csiMountMgr{}
|
||||||
|
|
||||||
func (c *csiMountMgr) CanMount() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *csiMountMgr) SetUp(mounterArgs volume.MounterArgs) error {
|
func (c *csiMountMgr) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
return c.SetUpAt(c.GetPath(), mounterArgs)
|
return c.SetUpAt(c.GetPath(), mounterArgs)
|
||||||
}
|
}
|
||||||
|
@ -444,10 +444,6 @@ func TestCSI_VolumeAll(t *testing.T) {
|
|||||||
t.Fatalf("csiTest.VolumeAll volPlugin.NewMounter is nil or error: %s", err)
|
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
|
var fsGroup *int64
|
||||||
if pod.Spec.SecurityContext != nil && pod.Spec.SecurityContext.FSGroup != nil {
|
if pod.Spec.SecurityContext != nil && pod.Spec.SecurityContext.FSGroup != nil {
|
||||||
fsGroup = pod.Spec.SecurityContext.FSGroup
|
fsGroup = pod.Spec.SecurityContext.FSGroup
|
||||||
|
@ -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.
|
// SetUp puts in place the volume plugin.
|
||||||
// This function is not idempotent by design. We want the data to be refreshed periodically.
|
// 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.
|
// The internal sync interval of kubelet will drive the refresh of data.
|
||||||
|
@ -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.
|
// SetUp creates new directory.
|
||||||
func (ed *emptyDir) SetUp(mounterArgs volume.MounterArgs) error {
|
func (ed *emptyDir) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
return ed.SetUpAt(ed.GetPath(), mounterArgs)
|
return ed.SetUpAt(ed.GetPath(), mounterArgs)
|
||||||
|
@ -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 {
|
func (b *fcDiskMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
return b.SetUpAt(b.GetPath(), mounterArgs)
|
return b.SetUpAt(b.GetPath(), mounterArgs)
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,3 @@ func (f *mounterDefaults) GetAttributes() volume.Attributes {
|
|||||||
SupportsSELinux: f.flexVolume.plugin.capabilities.SELinuxRelabel,
|
SupportsSELinux: f.flexVolume.plugin.capabilities.SELinuxRelabel,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *mounterDefaults) CanMount() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
@ -107,7 +107,3 @@ func (f *flexVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs)
|
|||||||
func (f *flexVolumeMounter) GetAttributes() volume.Attributes {
|
func (f *flexVolumeMounter) GetAttributes() volume.Attributes {
|
||||||
return (*mounterDefaults)(f).GetAttributes()
|
return (*mounterDefaults)(f).GetAttributes()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *flexVolumeMounter) CanMount() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
@ -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 {
|
func (b *flockerVolumeMounter) GetPath() string {
|
||||||
return getPath(b.podUID, b.volName, b.plugin.host)
|
return getPath(b.podUID, b.volName, b.plugin.host)
|
||||||
}
|
}
|
||||||
|
@ -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.
|
// SetUp bind mounts the disk global mount to the volume path.
|
||||||
func (b *gcePersistentDiskMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
func (b *gcePersistentDiskMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
return b.SetUpAt(b.GetPath(), mounterArgs)
|
return b.SetUpAt(b.GetPath(), mounterArgs)
|
||||||
|
@ -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.
|
// SetUp creates new directory and clones a git repo.
|
||||||
func (b *gitRepoVolumeMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
func (b *gitRepoVolumeMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
return b.SetUpAt(b.GetPath(), mounterArgs)
|
return b.SetUpAt(b.GetPath(), mounterArgs)
|
||||||
|
@ -25,7 +25,6 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
dstrings "strings"
|
dstrings "strings"
|
||||||
"sync"
|
"sync"
|
||||||
@ -73,14 +72,13 @@ var _ volume.Provisioner = &glusterfsVolumeProvisioner{}
|
|||||||
var _ volume.Deleter = &glusterfsVolumeDeleter{}
|
var _ volume.Deleter = &glusterfsVolumeDeleter{}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
glusterfsPluginName = "kubernetes.io/glusterfs"
|
glusterfsPluginName = "kubernetes.io/glusterfs"
|
||||||
volPrefix = "vol_"
|
volPrefix = "vol_"
|
||||||
dynamicEpSvcPrefix = "glusterfs-dynamic"
|
dynamicEpSvcPrefix = "glusterfs-dynamic"
|
||||||
replicaCount = 3
|
replicaCount = 3
|
||||||
secretKeyName = "key" // key name used in secret
|
secretKeyName = "key" // key name used in secret
|
||||||
gciLinuxGlusterMountBinaryPath = "/sbin/mount.glusterfs"
|
defaultGidMin = 2000
|
||||||
defaultGidMin = 2000
|
defaultGidMax = math.MaxInt32
|
||||||
defaultGidMax = math.MaxInt32
|
|
||||||
|
|
||||||
// maxCustomEpNamePrefix is the maximum number of chars.
|
// maxCustomEpNamePrefix is the maximum number of chars.
|
||||||
// which can be used as ep/svc name prefix. This number is carved
|
// 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.
|
// SetUp attaches the disk and bind mounts to the volume path.
|
||||||
func (b *glusterfsMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
func (b *glusterfsMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
return b.SetUpAt(b.GetPath(), mounterArgs)
|
return b.SetUpAt(b.GetPath(), mounterArgs)
|
||||||
|
@ -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.
|
// SetUp does nothing.
|
||||||
func (b *hostPathMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
func (b *hostPathMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
err := validation.ValidatePathNoBacksteps(b.GetPath())
|
err := validation.ValidatePathNoBacksteps(b.GetPath())
|
||||||
|
@ -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 {
|
func (b *iscsiDiskMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
return b.SetUpAt(b.GetPath(), mounterArgs)
|
return b.SetUpAt(b.GetPath(), mounterArgs)
|
||||||
}
|
}
|
||||||
|
@ -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
|
// SetUp bind mounts the directory to the volume path
|
||||||
func (m *localVolumeMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
func (m *localVolumeMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
return m.SetUpAt(m.GetPath(), mounterArgs)
|
return m.SetUpAt(m.GetPath(), mounterArgs)
|
||||||
|
@ -20,7 +20,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
netutil "k8s.io/utils/net"
|
netutil "k8s.io/utils/net"
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"k8s.io/klog/v2"
|
"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)
|
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 {
|
type nfsMounter struct {
|
||||||
*nfs
|
*nfs
|
||||||
server string
|
server string
|
||||||
|
@ -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.
|
// SetUp attaches the disk and bind mounts to the volume path.
|
||||||
func (b *portworxVolumeMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
func (b *portworxVolumeMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
return b.SetUpAt(b.GetPath(), mounterArgs)
|
return b.SetUpAt(b.GetPath(), mounterArgs)
|
||||||
|
@ -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 {
|
func (s *projectedVolumeMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
return s.SetUpAt(s.GetPath(), mounterArgs)
|
return s.SetUpAt(s.GetPath(), mounterArgs)
|
||||||
}
|
}
|
||||||
|
@ -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.
|
// SetUp attaches the disk and bind mounts to the volume path.
|
||||||
func (mounter *quobyteMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
func (mounter *quobyteMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
pluginDir := mounter.plugin.host.GetPluginDir(utilstrings.EscapeQualifiedName(quobytePluginName))
|
pluginDir := mounter.plugin.host.GetPluginDir(utilstrings.EscapeQualifiedName(quobytePluginName))
|
||||||
|
@ -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 {
|
func (b *rbdMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
return b.SetUpAt(b.GetPath(), mounterArgs)
|
return b.SetUpAt(b.GetPath(), mounterArgs)
|
||||||
}
|
}
|
||||||
|
@ -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 {
|
func (b *secretVolumeMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
return b.SetUpAt(b.GetPath(), mounterArgs)
|
return b.SetUpAt(b.GetPath(), mounterArgs)
|
||||||
}
|
}
|
||||||
|
@ -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.
|
// SetUp attaches the disk and bind mounts to the volume path.
|
||||||
func (b *storageosMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
func (b *storageosMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
||||||
// Need a namespace to find the volume, try pod's namespace if not set.
|
// Need a namespace to find the volume, try pod's namespace if not set.
|
||||||
|
@ -692,10 +692,6 @@ func (_ *FakeVolume) GetAttributes() Attributes {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fv *FakeVolume) CanMount() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (fv *FakeVolume) SetUp(mounterArgs MounterArgs) error {
|
func (fv *FakeVolume) SetUp(mounterArgs MounterArgs) error {
|
||||||
fv.Lock()
|
fv.Lock()
|
||||||
defer fv.Unlock()
|
defer fv.Unlock()
|
||||||
|
@ -80,11 +80,6 @@ type operationGenerator struct {
|
|||||||
// recorder is used to record events in the API server
|
// recorder is used to record events in the API server
|
||||||
recorder record.EventRecorder
|
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 provides volume path related operations for block volume
|
||||||
blkUtil volumepathhandler.BlockVolumePathHandler
|
blkUtil volumepathhandler.BlockVolumePathHandler
|
||||||
|
|
||||||
@ -95,16 +90,14 @@ type operationGenerator struct {
|
|||||||
func NewOperationGenerator(kubeClient clientset.Interface,
|
func NewOperationGenerator(kubeClient clientset.Interface,
|
||||||
volumePluginMgr *volume.VolumePluginMgr,
|
volumePluginMgr *volume.VolumePluginMgr,
|
||||||
recorder record.EventRecorder,
|
recorder record.EventRecorder,
|
||||||
checkNodeCapabilitiesBeforeMount bool,
|
|
||||||
blkUtil volumepathhandler.BlockVolumePathHandler) OperationGenerator {
|
blkUtil volumepathhandler.BlockVolumePathHandler) OperationGenerator {
|
||||||
|
|
||||||
return &operationGenerator{
|
return &operationGenerator{
|
||||||
kubeClient: kubeClient,
|
kubeClient: kubeClient,
|
||||||
volumePluginMgr: volumePluginMgr,
|
volumePluginMgr: volumePluginMgr,
|
||||||
recorder: recorder,
|
recorder: recorder,
|
||||||
checkNodeCapabilitiesBeforeMount: checkNodeCapabilitiesBeforeMount,
|
blkUtil: blkUtil,
|
||||||
blkUtil: blkUtil,
|
translator: csitrans.New(),
|
||||||
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
|
// Execute mount
|
||||||
mountErr := volumeMounter.SetUp(volume.MounterArgs{
|
mountErr := volumeMounter.SetUp(volume.MounterArgs{
|
||||||
FsUser: util.FsUserFrom(volumeToMount.Pod),
|
FsUser: util.FsUserFrom(volumeToMount.Pod),
|
||||||
|
@ -419,7 +419,6 @@ func getTestOperationGenerator(volumePluginMgr *volume.VolumePluginMgr, objects
|
|||||||
fakeKubeClient,
|
fakeKubeClient,
|
||||||
volumePluginMgr,
|
volumePluginMgr,
|
||||||
fakeRecorder,
|
fakeRecorder,
|
||||||
false,
|
|
||||||
fakeHandler)
|
fakeHandler)
|
||||||
return operationGenerator
|
return operationGenerator
|
||||||
}
|
}
|
||||||
|
@ -136,17 +136,6 @@ type Mounter interface {
|
|||||||
// Uses Interface to provide the path for Docker binds.
|
// Uses Interface to provide the path for Docker binds.
|
||||||
Volume
|
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
|
// SetUp prepares and mounts/unpacks the volume to a
|
||||||
// self-determined directory path. The mount point and its
|
// self-determined directory path. The mount point and its
|
||||||
// content should be owned by `fsUser` or 'fsGroup' so that it can be
|
// content should be owned by `fsUser` or 'fsGroup' so that it can be
|
||||||
|
@ -43,10 +43,6 @@ func (l *localFakeMounter) GetAttributes() Attributes {
|
|||||||
return l.attributes
|
return l.attributes
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *localFakeMounter) CanMount() error {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (l *localFakeMounter) SetUp(mounterArgs MounterArgs) error {
|
func (l *localFakeMounter) SetUp(mounterArgs MounterArgs) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -218,13 +218,6 @@ func (b *vsphereVolumeMounter) SetUp(mounterArgs volume.MounterArgs) error {
|
|||||||
return b.SetUpAt(b.GetPath(), mounterArgs)
|
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.
|
// SetUp attaches the disk and bind mounts to the volume path.
|
||||||
func (b *vsphereVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) error {
|
func (b *vsphereVolumeMounter) SetUpAt(dir string, mounterArgs volume.MounterArgs) error {
|
||||||
klog.V(5).Infof("vSphere volume setup %s to %s", b.volPath, dir)
|
klog.V(5).Infof("vSphere volume setup %s to %s", b.volPath, dir)
|
||||||
|
Loading…
Reference in New Issue
Block a user