deviceutils

package
v1.13.7-rc1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDeviceUtils

func NewDeviceUtils() *deviceUtils

func NewFakeDeviceUtils

func NewFakeDeviceUtils(skipResize bool) *fakeDeviceUtils

Types

type DeviceUtils

type DeviceUtils interface {
	// GetDiskByIdPaths returns a list of all possible paths for a
	// given Persistent Disk
	GetDiskByIdPaths(deviceName string, partition string) []string

	// VerifyDevicePath returns the first of the list of device paths that
	// exists on the machine, or an empty string if none exists
	VerifyDevicePath(devicePaths []string, deviceName string) (string, error)

	// DisableDevice performs necessary disabling prior to a device being
	// detached from a node. The path is that from GetDiskByIdPaths.
	DisableDevice(devicePath string) error

	// Resize returns whether or not a device needs resizing.
	Resize(resizer resizefs.Resizefs, devicePath string, deviceMountPath string) (bool, error)

	// IsDeviceFilesystemInUse returns if a device path with the specified fstype
	// TODO: Mounter is passed in in order to call GetDiskFormat()
	// This is currently only implemented in mounter_linux, not mounter_windows.
	// Refactor this interface and function call up the stack to the caller once it is
	// implemented in mounter_windows.
	IsDeviceFilesystemInUse(mounter *mount.SafeFormatAndMount, devicePath, devFsPath string) (bool, error)
}

DeviceUtils are a collection of methods that act on the devices attached to a GCE Instance

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL