kubernetes: k8s.io/kubernetes/pkg/volume/util/volumepathhandler Index | Files

package volumepathhandler

import "k8s.io/kubernetes/pkg/volume/util/volumepathhandler"

Index

Package Files

volume_path_handler.go volume_path_handler_linux.go

Constants

const (
    ErrDeviceNotFound     = "device not found"
    ErrDeviceNotSupported = "device not supported"
)

type BlockVolumePathHandler Uses

type BlockVolumePathHandler interface {
    // MapDevice creates a symbolic link to block device under specified map path
    MapDevice(devicePath string, mapPath string, linkName string) error
    // UnmapDevice removes a symbolic link to block device under specified map path
    UnmapDevice(mapPath string, linkName string) error
    // RemovePath removes a file or directory on specified map path
    RemoveMapPath(mapPath string) error
    // IsSymlinkExist retruns true if specified symbolic link exists
    IsSymlinkExist(mapPath string) (bool, error)
    // GetDeviceSymlinkRefs searches symbolic links under global map path
    GetDeviceSymlinkRefs(devPath string, mapPath string) ([]string, error)
    // FindGlobalMapPathUUIDFromPod finds {pod uuid} symbolic link under globalMapPath
    // corresponding to map path symlink, and then return global map path with pod uuid.
    FindGlobalMapPathUUIDFromPod(pluginDir, mapPath string, podUID types.UID) (string, error)
    // AttachFileDevice takes a path to a regular file and makes it available as an
    // attached block device.
    AttachFileDevice(path string) (string, error)
    // GetLoopDevice returns the full path to the loop device associated with the given path.
    GetLoopDevice(path string) (string, error)
    // RemoveLoopDevice removes specified loopback device
    RemoveLoopDevice(device string) error
}

BlockVolumePathHandler defines a set of operations for handling block volume-related operations

func NewBlockVolumePathHandler Uses

func NewBlockVolumePathHandler() BlockVolumePathHandler

NewBlockVolumePathHandler returns a new instance of BlockVolumeHandler.

type VolumePathHandler Uses

type VolumePathHandler struct {
}

VolumePathHandler is path related operation handlers for block volume

func (VolumePathHandler) AttachFileDevice Uses

func (v VolumePathHandler) AttachFileDevice(path string) (string, error)

AttachFileDevice takes a path to a regular file and makes it available as an attached block device.

func (VolumePathHandler) FindGlobalMapPathUUIDFromPod Uses

func (v VolumePathHandler) FindGlobalMapPathUUIDFromPod(pluginDir, mapPath string, podUID types.UID) (string, error)

FindGlobalMapPathUUIDFromPod finds {pod uuid} symbolic link under globalMapPath corresponding to map path symlink, and then return global map path with pod uuid. ex. mapPath symlink: pods/{podUid}}/{DefaultKubeletVolumeDevicesDirName}/{escapeQualifiedPluginName}/{volumeName} -> /dev/sdX

globalMapPath/{pod uuid}: plugins/kubernetes.io/{PluginName}/{DefaultKubeletVolumeDevicesDirName}/{volumePluginDependentPath}/{pod uuid} -> /dev/sdX

func (VolumePathHandler) GetDeviceSymlinkRefs Uses

func (v VolumePathHandler) GetDeviceSymlinkRefs(devPath string, mapPath string) ([]string, error)

GetDeviceSymlinkRefs searches symbolic links under global map path

func (VolumePathHandler) GetLoopDevice Uses

func (v VolumePathHandler) GetLoopDevice(path string) (string, error)

GetLoopDevice returns the full path to the loop device associated with the given path.

func (VolumePathHandler) IsSymlinkExist Uses

func (v VolumePathHandler) IsSymlinkExist(mapPath string) (bool, error)

IsSymlinkExist returns true if specified file exists and the type is symbolik link. If file doesn't exist, or file exists but not symbolic link, return false with no error. On other cases, return false with error from Lstat().

func (VolumePathHandler) MapDevice Uses

func (v VolumePathHandler) MapDevice(devicePath string, mapPath string, linkName string) error

MapDevice creates a symbolic link to block device under specified map path

func (VolumePathHandler) RemoveLoopDevice Uses

func (v VolumePathHandler) RemoveLoopDevice(device string) error

RemoveLoopDevice removes specified loopback device

func (VolumePathHandler) RemoveMapPath Uses

func (v VolumePathHandler) RemoveMapPath(mapPath string) error

RemoveMapPath removes a file or directory on specified map path

func (VolumePathHandler) UnmapDevice Uses

func (v VolumePathHandler) UnmapDevice(mapPath string, linkName string) error

UnmapDevice removes a symbolic link associated to block device under specified map path

Package volumepathhandler imports 9 packages (graph) and is imported by 87 packages. Updated 2019-05-18. Refresh now. Tools for package owners.