disk

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiskController

type DiskController struct {
	Log *slog.Logger
	EAC *entityserver_v1alpha.EntityAccessClient

	// NodeId is the ID of this node, used for creating volume entities
	NodeId string
	// contains filtered or unexported fields
}

DiskController manages disk entities and their lifecycle. It uses disk_volume entities to coordinate volume operations via loop devices.

func NewDiskController

func NewDiskController(log *slog.Logger, eac *entityserver_v1alpha.EntityAccessClient, nodeId string, diskMode string) *DiskController

NewDiskController creates a disk controller that uses disk_volume entities. The diskMode parameter comes from server config (MIREN_DISK_MODE); pass "" for auto-detection.

func (*DiskController) Close

func (d *DiskController) Close() error

Close gracefully shuts down the disk controller

func (*DiskController) Create

func (d *DiskController) Create(ctx context.Context, disk *storage_v1alpha.Disk, meta *entity.Meta) error

Create handles creation of a new disk entity

func (*DiskController) Delete

func (d *DiskController) Delete(ctx context.Context, id entity.Id, obj *storage_v1alpha.Disk) error

Delete handles deletion of a disk entity

func (*DiskController) ForceUniversalMode added in v0.6.0

func (d *DiskController) ForceUniversalMode()

ForceUniversalMode forces the controller to use disk_volume entities with loop devices. This is used by integration tests.

func (*DiskController) Init

func (d *DiskController) Init(ctx context.Context) error

Init initializes the disk controller

func (*DiskController) Start

func (d *DiskController) Start(ctx context.Context) error

Start starts the disk controller

func (*DiskController) Update

func (d *DiskController) Update(ctx context.Context, disk *storage_v1alpha.Disk, meta *entity.Meta) error

Update handles updates to an existing disk entity

type DiskLeaseController

type DiskLeaseController struct {
	Log *slog.Logger
	EAC *entityserver_v1alpha.EntityAccessClient

	// NodeId is the ID of this node, used for creating disk_mount entities
	NodeId string
	// contains filtered or unexported fields
}

DiskLeaseController manages disk lease entities and exclusive access. It uses disk_mount entities to coordinate mount operations via loop devices.

func NewDiskLeaseController

func NewDiskLeaseController(log *slog.Logger, eac *entityserver_v1alpha.EntityAccessClient, nodeId string, diskMode string) *DiskLeaseController

NewDiskLeaseController creates a disk lease controller that uses disk_mount entities. The diskMode parameter comes from server config (MIREN_DISK_MODE); pass "" for auto-detection.

func (*DiskLeaseController) CleanupOldReleasedLeases

func (d *DiskLeaseController) CleanupOldReleasedLeases(ctx context.Context) error

CleanupOldReleasedLeases deletes released leases that haven't been updated for over 1 hour

func (*DiskLeaseController) Create

Create handles creation of a new disk lease entity

func (*DiskLeaseController) Delete

Delete handles deletion of a disk lease entity

func (*DiskLeaseController) ForceUniversalMode added in v0.6.0

func (d *DiskLeaseController) ForceUniversalMode()

ForceUniversalMode forces the controller to use disk_mount entities with loop devices. This is used by integration tests.

func (*DiskLeaseController) Init

Init initializes the disk lease controller

func (*DiskLeaseController) Update

Update handles updates to an existing disk lease entity

type DiskMountWatchController added in v0.6.0

type DiskMountWatchController struct {
	Log *slog.Logger
	EAC *entityserver_v1alpha.EntityAccessClient

	LeaseController *controller.ReconcileController
}

DiskMountWatchController watches for disk_mount state changes and triggers re-reconciliation of the parent disk_lease entity. This bridges the gap where the disk lease controller creates a disk_mount and needs to know when the mount controller finishes mounting it.

func NewDiskMountWatchController added in v0.6.0

func NewDiskMountWatchController(log *slog.Logger, eac *entityserver_v1alpha.EntityAccessClient, leaseController *controller.ReconcileController) *DiskMountWatchController

NewDiskMountWatchController creates a new disk mount watch controller.

func (*DiskMountWatchController) Create added in v0.6.0

func (*DiskMountWatchController) Delete added in v0.6.0

func (*DiskMountWatchController) Init added in v0.6.0

func (*DiskMountWatchController) Update added in v0.6.0

type DiskVolumeWatchController added in v0.6.0

type DiskVolumeWatchController struct {
	Log *slog.Logger
	EAC *entityserver_v1alpha.EntityAccessClient

	DiskController *controller.ReconcileController
}

DiskVolumeWatchController watches for disk_volume state changes and triggers re-reconciliation of the parent disk entity. This bridges the gap where the disk controller creates a disk_volume and needs to know when the volume controller finishes provisioning it.

func NewDiskVolumeWatchController added in v0.6.0

func NewDiskVolumeWatchController(log *slog.Logger, eac *entityserver_v1alpha.EntityAccessClient, diskController *controller.ReconcileController) *DiskVolumeWatchController

NewDiskVolumeWatchController creates a new disk volume watch controller.

func (*DiskVolumeWatchController) Create added in v0.6.0

func (*DiskVolumeWatchController) Delete added in v0.6.0

func (*DiskVolumeWatchController) Init added in v0.6.0

func (*DiskVolumeWatchController) Update added in v0.6.0

type DiskWatchController

type DiskWatchController struct {
	Log *slog.Logger
	EAC *entityserver_v1alpha.EntityAccessClient

	// Reference to the disk lease controller to enqueue lease reconciliations
	LeaseController *controller.ReconcileController
}

DiskWatchController watches for disk state changes and triggers reconciliation of dependent leases

func NewDiskWatchController

func NewDiskWatchController(log *slog.Logger, eac *entityserver_v1alpha.EntityAccessClient, leaseController *controller.ReconcileController) *DiskWatchController

NewDiskWatchController creates a new disk watch controller

func (*DiskWatchController) Create

func (d *DiskWatchController) Create(ctx context.Context, disk *storage_v1alpha.Disk, meta *entity.Meta) error

Create handles creation of a disk entity (triggers lease reconciliation)

func (*DiskWatchController) Delete

Delete handles deletion of a disk entity

func (*DiskWatchController) Init

Init initializes the disk watch controller

func (*DiskWatchController) Update

func (d *DiskWatchController) Update(ctx context.Context, disk *storage_v1alpha.Disk, meta *entity.Meta) error

Update handles updates to a disk entity (triggers lease reconciliation)

Jump to

Keyboard shortcuts

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