resourcemonitor

package
v0.0.0-...-eec02a6 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ControllerName    = "Trident Resource Monitor"
	ControllerVersion = "0.1"
)
View Source
const (
	// Constants for FSxN configuration
	FSxFilesystemIDParam                 = "fsxFilesystemID"
	AdditionalFsxNFileSystemIDAnnotation = "trident.netapp.io/additionalFsxNFileSystemID"

	// Backend naming pattern for FSxN
	SCManagedBackendNamePattern = "trident-%s-%s-%s"
)
View Source
const (
	// Annotations used for StorageClass to TridentConfigurator mapping
	TridentConfiguratorNameAnnotation    = "trident.netapp.io/configuratorName"
	TridentConfiguratorStatusAnnotation  = "trident.netapp.io/configuratorStatus"
	TridentConfiguratorMessageAnnotation = "trident.netapp.io/configuratorMessage"
	AdditionalStoragePoolsAnnotation     = "trident.netapp.io/additionalStoragePools"
	TridentManagedAnnotation             = "trident.netapp.io/managed"

	// Common constants
	TridentCSIProvisioner  = "csi.trident.netapp.io"
	StorageDriverNameParam = "storageDriverName"
	CredentialsNameParam   = "credentialsName"

	// Status values
	StatusSuccess = "Success"
	StatusFailed  = "Failed"
	StatusPending = "Pending"

	// Labels
	ScNameLabel    = "trident.netapp.io/scName"
	CreatedByLabel = "trident.netapp.io/createdBy"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	Clients *clients.Clients
	// contains filtered or unexported fields
}

func NewController

func NewController(clientFactory *clients.Clients) (*Controller, error)

NewController creates a new resource monitor controller

func (*Controller) Activate

func (c *Controller) Activate() error

Activate starts the controller

func (*Controller) Deactivate

func (c *Controller) Deactivate() error

Deactivate stops the controller

func (*Controller) EnqueueWork

func (c *Controller) EnqueueWork(workItem *WorkItem)

EnqueueWork adds a work item to the queue

func (*Controller) GetName

func (c *Controller) GetName() string

GetName returns the controller name

func (*Controller) Version

func (c *Controller) Version() string

Version returns the controller version

type FsxStorageDriverHandler

type FsxStorageDriverHandler struct{}

FsxStorageDriverHandler implements StorageDriverHandler for FSxN

func (*FsxStorageDriverHandler) BuildAdditionalStoragePoolsValue

func (h *FsxStorageDriverHandler) BuildAdditionalStoragePoolsValue(sc *storagev1.StorageClass) (string, error)

BuildAdditionalStoragePoolsValue constructs the additionalStoragePools annotation value for FSxN Format: "backend1:pool1;backend2:pool2" where each backend corresponds to a filesystem

func (*FsxStorageDriverHandler) BuildTridentConfiguratorSpec

func (h *FsxStorageDriverHandler) BuildTridentConfiguratorSpec(sc *storagev1.StorageClass) (*netappv1.TridentConfiguratorSpec, error)

BuildTridentConfiguratorSpec builds a TridentConfigurator spec from StorageClass for FSxN

func (*FsxStorageDriverHandler) HasRelevantChanges

func (h *FsxStorageDriverHandler) HasRelevantChanges(oldSC, newSC *storagev1.StorageClass) bool

HasRelevantChanges checks if there are relevant changes between old and new StorageClass

func (*FsxStorageDriverHandler) ShouldManageStorageClass

func (h *FsxStorageDriverHandler) ShouldManageStorageClass(sc *storagev1.StorageClass) bool

ShouldManageStorageClass determines if a StorageClass should be managed by FSxN handler

func (*FsxStorageDriverHandler) ValidateStorageClass

func (h *FsxStorageDriverHandler) ValidateStorageClass(sc *storagev1.StorageClass) error

ValidateStorageClass validates the StorageClass configuration for FSxN

type OperationType

type OperationType string

OperationType represents the type of operation

const (
	OperationAdd    OperationType = "Add"
	OperationUpdate OperationType = "Update"
	OperationDelete OperationType = "Delete"
)

type ResourceHandler

type ResourceHandler interface {
	// Start starts watching the resource
	Start(stopChan chan struct{}) error

	// Reconcile reconciles the resource
	Reconcile(workItem *WorkItem) error

	// GetResourceType returns the type of resource this handler manages
	GetResourceType() ResourceType
}

ResourceHandler interface defines methods that each resource handler must implement

type ResourceType

type ResourceType string
const (
	ResourceTypeStorageClass ResourceType = "StorageClass"
)

type StorageClassHandler

type StorageClassHandler struct {
	// contains filtered or unexported fields
}

StorageClassHandler handles StorageClass resources

func NewStorageClassHandler

func NewStorageClassHandler(controller *Controller) (*StorageClassHandler, error)

NewStorageClassHandler creates a new StorageClass handler

func (*StorageClassHandler) GetResourceType

func (h *StorageClassHandler) GetResourceType() ResourceType

GetResourceType returns the resource type

func (*StorageClassHandler) Reconcile

func (h *StorageClassHandler) Reconcile(workItem *WorkItem) error

Reconcile reconciles a StorageClass

func (*StorageClassHandler) Start

func (h *StorageClassHandler) Start(stopChan chan struct{}) error

Start starts the StorageClass watcher

type StorageDriverHandler

type StorageDriverHandler interface {
	ShouldManageStorageClass(sc *storagev1.StorageClass) bool

	ValidateStorageClass(sc *storagev1.StorageClass) error

	HasRelevantChanges(oldSC, newSC *storagev1.StorageClass) bool

	BuildAdditionalStoragePoolsValue(sc *storagev1.StorageClass) (string, error)

	BuildTridentConfiguratorSpec(sc *storagev1.StorageClass) (*netappv1.TridentConfiguratorSpec, error)
}

StorageDriverHandler defines the interface for driver-specific storage class operations

func NewFsxStorageDriverHandler

func NewFsxStorageDriverHandler() StorageDriverHandler

NewFsxStorageDriverHandler creates a new FSxN driver handler

type WorkItem

type WorkItem struct {
	ResourceType ResourceType
	Key          string
	Operation    OperationType
	Object       runtime.Object
}

WorkItem represents a work item to be processed

Jump to

Keyboard shortcuts

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