mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Merge pull request #8059 from pmorie/volume-cleanup
NFS plugin should use correct mounter
This commit is contained in:
commit
d80b43838c
@ -30,12 +30,11 @@ import (
|
|||||||
|
|
||||||
// This is the primary entrypoint for volume plugins.
|
// This is the primary entrypoint for volume plugins.
|
||||||
func ProbeVolumePlugins() []volume.VolumePlugin {
|
func ProbeVolumePlugins() []volume.VolumePlugin {
|
||||||
return []volume.VolumePlugin{&nfsPlugin{nil, mount.New()}}
|
return []volume.VolumePlugin{&nfsPlugin{nil}}
|
||||||
}
|
}
|
||||||
|
|
||||||
type nfsPlugin struct {
|
type nfsPlugin struct {
|
||||||
host volume.VolumeHost
|
host volume.VolumeHost
|
||||||
mounter mount.Interface
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ volume.VolumePlugin = &nfsPlugin{}
|
var _ volume.VolumePlugin = &nfsPlugin{}
|
||||||
@ -64,8 +63,8 @@ func (plugin *nfsPlugin) GetAccessModes() []api.AccessModeType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *nfsPlugin) NewBuilder(spec *volume.Spec, pod *api.Pod, _ volume.VolumeOptions, _ mount.Interface) (volume.Builder, error) {
|
func (plugin *nfsPlugin) NewBuilder(spec *volume.Spec, pod *api.Pod, _ volume.VolumeOptions, mounter mount.Interface) (volume.Builder, error) {
|
||||||
return plugin.newBuilderInternal(spec, pod, plugin.mounter)
|
return plugin.newBuilderInternal(spec, pod, mounter)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *nfsPlugin) newBuilderInternal(spec *volume.Spec, pod *api.Pod, mounter mount.Interface) (volume.Builder, error) {
|
func (plugin *nfsPlugin) newBuilderInternal(spec *volume.Spec, pod *api.Pod, mounter mount.Interface) (volume.Builder, error) {
|
||||||
@ -80,8 +79,8 @@ func (plugin *nfsPlugin) newBuilderInternal(spec *volume.Spec, pod *api.Pod, mou
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *nfsPlugin) NewCleaner(volName string, podUID types.UID, _ mount.Interface) (volume.Cleaner, error) {
|
func (plugin *nfsPlugin) NewCleaner(volName string, podUID types.UID, mounter mount.Interface) (volume.Cleaner, error) {
|
||||||
return plugin.newCleanerInternal(volName, podUID, plugin.mounter)
|
return plugin.newCleanerInternal(volName, podUID, mounter)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (plugin *nfsPlugin) newCleanerInternal(volName string, podUID types.UID, mounter mount.Interface) (volume.Cleaner, error) {
|
func (plugin *nfsPlugin) newCleanerInternal(volName string, podUID types.UID, mounter mount.Interface) (volume.Cleaner, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user