localdisk

package
v0.15.4 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIVersion          = "v1alpha1"
	LocalDiskKind       = "localDisk"
	LocalDiskAPIVersion = "localdiskmanager.hwameistor" + "/" + APIVersion
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// Mgr k8s runtime controller
	Mgr crmanager.Manager

	// Namespace is the namespace in which v1alpha1 is installed
	NameSpace string

	// NodeName is the node in which v1alpha1 is installed
	NodeName string
}

Controller The smallest unit to be processed here should be the disk. The main thing to do is how to convert the local disk into resources in the cluster

func NewController

func NewController(mgr crmanager.Manager) Controller

func (Controller) ConvertDiskToLocalDisk

func (ctr Controller) ConvertDiskToLocalDisk(disk manager.DiskInfo) (ld v1alpha1.LocalDisk)

func (Controller) CreateLocalDisk

func (ctr Controller) CreateLocalDisk(ld v1alpha1.LocalDisk) error

func (Controller) GenLocalDiskName

func (ctr Controller) GenLocalDiskName(disk manager.DiskInfo) string

func (Controller) GetLocalDisk

func (ctr Controller) GetLocalDisk(key client.ObjectKey) (v1alpha1.LocalDisk, error)

func (Controller) IsAlreadyExist

func (ctr Controller) IsAlreadyExist(ld v1alpha1.LocalDisk) bool

func (Controller) ListLocalDiskByNodeDevicePath

func (ctr Controller) ListLocalDiskByNodeDevicePath(nodeName, devPath string) ([]v1alpha1.LocalDisk, error)

ListLocalDiskByNodeDevicePath returns LocalDisks by given node device path This is should only be used when disk serial cannot be found(e.g. trigger by disk remove events)

func (Controller) ListLocalDisksByNode

func (ctr Controller) ListLocalDisksByNode(nodeName string) ([]v1alpha1.LocalDisk, error)

func (Controller) UpdateLocalDiskAttr

func (ctr Controller) UpdateLocalDiskAttr(newLocalDisk v1alpha1.LocalDisk) error

Jump to

Keyboard shortcuts

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