core

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: 45 Imported by: 126

Documentation

Index

Constants

View Source
const (
	NodeAccessReconcilePeriod      = time.Second * 30
	NodeRegistrationCooldownPeriod = time.Second * 30
	AttachISCSIVolumeTimeoutLong   = time.Second * 90
)

Variables

View Source
var (
	FlagConcurrent = "concurrent"
)

Functions

This section is empty.

Types

type ConcurrentTridentOrchestrator

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

func (*ConcurrentTridentOrchestrator) AddAutogrowPolicy

AddAutogrowPolicy creates a new Autogrow policy in the orchestrator. The policy can be referenced by volumes directly or as a default in StorageClass. This method does not persist policies to the backing store as they are managed by the frontend.

func (*ConcurrentTridentOrchestrator) AddBackend

func (o *ConcurrentTridentOrchestrator) AddBackend(
	ctx context.Context, configJSON, configRef string,
) (backendExternal *storage.BackendExternal, err error)

func (*ConcurrentTridentOrchestrator) AddFrontend

func (*ConcurrentTridentOrchestrator) AddNode

func (o *ConcurrentTridentOrchestrator) AddNode(
	ctx context.Context, node *models.Node, nodeEventCallback NodeEventCallback,
) (err error)

func (*ConcurrentTridentOrchestrator) AddStorageClass

func (o *ConcurrentTridentOrchestrator) AddStorageClass(
	ctx context.Context, scConfig *storageclass.Config,
) (scExternal *storageclass.External, err error)

func (*ConcurrentTridentOrchestrator) AddVolume

func (o *ConcurrentTridentOrchestrator) AddVolume(
	ctx context.Context, volumeConfig *storage.VolumeConfig,
) (volExternal *storage.VolumeExternal, err error)

func (*ConcurrentTridentOrchestrator) AddVolumeTransaction

func (o *ConcurrentTridentOrchestrator) AddVolumeTransaction(ctx context.Context, volTxn *storage.VolumeTransaction) error

func (*ConcurrentTridentOrchestrator) AttachVolume

func (o *ConcurrentTridentOrchestrator) AttachVolume(
	ctx context.Context, volumeName, mountpoint string, publishInfo *models.VolumePublishInfo,
) error

AttachVolume mounts a volume to the local host. This method is currently only used by Docker, and it should be able to accomplish its task using only the data passed in; it should not need to use the storage controller API. It may be assumed that this method always runs on the host to which the volume will be attached.

func (*ConcurrentTridentOrchestrator) Bootstrap

func (o *ConcurrentTridentOrchestrator) Bootstrap(_ bool) error

func (*ConcurrentTridentOrchestrator) CanBackendMirror

func (o *ConcurrentTridentOrchestrator) CanBackendMirror(ctx context.Context, backendUUID string) (bool, error)

func (*ConcurrentTridentOrchestrator) CheckMirrorTransferState

func (o *ConcurrentTridentOrchestrator) CheckMirrorTransferState(
	ctx context.Context, volumeName string,
) (*time.Time, error)

func (*ConcurrentTridentOrchestrator) CloneVolume

func (o *ConcurrentTridentOrchestrator) CloneVolume(
	ctx context.Context, volumeConfig *storage.VolumeConfig,
) (volExternal *storage.VolumeExternal, err error)

func (*ConcurrentTridentOrchestrator) CreateGroupSnapshot

func (o *ConcurrentTridentOrchestrator) CreateGroupSnapshot(
	ctx context.Context, config *storage.GroupSnapshotConfig,
) (externalGroupSnapshot *storage.GroupSnapshotExternal, err error)

CreateGroupSnapshot creates a group snapshot across the source volumes named in config. A single db.Lock write-locks every constituent snapshot and the group record while read-locking the source volumes and backends. Cache upserts commit only after all store writes succeed; on failure the deferred addGroupSnapshotCleanup removes backend snapshots and the transaction.

func (*ConcurrentTridentOrchestrator) CreateSnapshot

func (o *ConcurrentTridentOrchestrator) CreateSnapshot(
	ctx context.Context, snapshotConfig *storage.SnapshotConfig,
) (*storage.SnapshotExternal, error)

func (*ConcurrentTridentOrchestrator) DeleteAutogrowPolicy

func (o *ConcurrentTridentOrchestrator) DeleteAutogrowPolicy(
	ctx context.Context, agPolicyName string,
) error

DeleteAutogrowPolicy removes an Autogrow policy from the orchestrator.

Behavior:

  • If policy has no volumes: Immediately deletes from cache (hard delete)
  • If policy has volumes: Sets state to Deleting (soft delete), returns nil
  • Soft-deleted policies are automatically cleaned up when the last volume is disassociated

This matches the backend deletion pattern for consistency.

func (*ConcurrentTridentOrchestrator) DeleteBackend

func (o *ConcurrentTridentOrchestrator) DeleteBackend(ctx context.Context, backendName string) (err error)

func (*ConcurrentTridentOrchestrator) DeleteBackendByBackendUUID

func (o *ConcurrentTridentOrchestrator) DeleteBackendByBackendUUID(
	ctx context.Context, backendName, backendUUID string,
) (err error)

func (*ConcurrentTridentOrchestrator) DeleteGroupSnapshot

func (o *ConcurrentTridentOrchestrator) DeleteGroupSnapshot(
	ctx context.Context, groupName string,
) (err error)

DeleteGroupSnapshot deletes a group snapshot and its constituents. The locking idiom mirrors CreateGroupSnapshot: a cheap pre-read to learn the constituent IDs, then a single multi-tree db.Lock that takes write locks on every constituent snapshot and the group record while also read-locking each constituent's parent backend/volume and listing read-only-clone volumes for validation. The serializing txnMutex keyed on the group name prevents an interleaved create or delete of the same group between the pre-read and the multi-tree lock acquisition. The group record is removed from the store and cache only after every constituent has been deleted from the backend and persistent store; if any constituent delete fails, the group record is left in place so the user (or recovery) can retry.

func (*ConcurrentTridentOrchestrator) DeleteNode

func (o *ConcurrentTridentOrchestrator) DeleteNode(ctx context.Context, nodeName string) (err error)

func (*ConcurrentTridentOrchestrator) DeleteSnapshot

func (o *ConcurrentTridentOrchestrator) DeleteSnapshot(
	ctx context.Context, volumeName, snapshotName string,
) (err error)

func (*ConcurrentTridentOrchestrator) DeleteStorageClass

func (o *ConcurrentTridentOrchestrator) DeleteStorageClass(ctx context.Context, scName string) (err error)

func (*ConcurrentTridentOrchestrator) DeleteVolume

func (o *ConcurrentTridentOrchestrator) DeleteVolume(ctx context.Context, volumeName string) (err error)

DeleteVolume removes a volume from storage, persistence, and cache.

func (*ConcurrentTridentOrchestrator) DeleteVolumeTransaction

func (o *ConcurrentTridentOrchestrator) DeleteVolumeTransaction(
	ctx context.Context, volTxn *storage.VolumeTransaction,
) error

func (*ConcurrentTridentOrchestrator) DetachVolume

func (o *ConcurrentTridentOrchestrator) DetachVolume(ctx context.Context, volumeName, mountpoint string) error

DetachVolume unmounts a volume from the local host. This method is currently only used by Docker, and it should be able to accomplish its task using only the data passed in; it should not need to use the storage controller API. It may be assumed that this method always runs on the host to which the volume will be attached. It ensures the volume is already mounted, and it attempts to delete the mount point.

func (*ConcurrentTridentOrchestrator) EstablishMirror

func (o *ConcurrentTridentOrchestrator) EstablishMirror(
	ctx context.Context, backendUUID, volumeName, localInternalVolumeName, remoteVolumeHandle, replicationPolicy,
	replicationSchedule string,
) error

func (*ConcurrentTridentOrchestrator) GetAutogrowPolicy

func (o *ConcurrentTridentOrchestrator) GetAutogrowPolicy(
	ctx context.Context, agPolicyName string,
) (*storage.AutogrowPolicyExternal, error)

GetAutogrowPolicy retrieves a single Autogrow policy by name. The returned external representation includes the policy configuration and a list of all volumes currently using the policy.

func (*ConcurrentTridentOrchestrator) GetBackend

func (o *ConcurrentTridentOrchestrator) GetBackend(
	ctx context.Context, backendName string,
) (backendExternal *storage.BackendExternal, err error)

func (*ConcurrentTridentOrchestrator) GetBackendByBackendUUID

func (o *ConcurrentTridentOrchestrator) GetBackendByBackendUUID(
	ctx context.Context, backendUUID string,
) (backendExternal *storage.BackendExternal, err error)

func (*ConcurrentTridentOrchestrator) GetCHAP

func (o *ConcurrentTridentOrchestrator) GetCHAP(
	ctx context.Context, volumeName, nodeName string,
) (chapInfo *models.IscsiChapInfo, err error)

func (*ConcurrentTridentOrchestrator) GetFrontend

func (*ConcurrentTridentOrchestrator) GetGroupSnapshot

func (o *ConcurrentTridentOrchestrator) GetGroupSnapshot(
	ctx context.Context, groupSnapshotID string,
) (groupSnapshotExternal *storage.GroupSnapshotExternal, err error)

GetGroupSnapshot returns the group snapshot with the given ID. The group snapshot is a parentless resource in the cache, so an inconsistent read (acquire, copy, release) is sufficient.

func (*ConcurrentTridentOrchestrator) GetLogLevel

func (o *ConcurrentTridentOrchestrator) GetLogLevel(ctx context.Context) (string, error)

func (*ConcurrentTridentOrchestrator) GetMirrorStatus

func (o *ConcurrentTridentOrchestrator) GetMirrorStatus(
	ctx context.Context, backendUUID, localInternalVolumeName, remoteVolumeHandle string,
) (string, error)

func (*ConcurrentTridentOrchestrator) GetMirrorTransferTime

func (o *ConcurrentTridentOrchestrator) GetMirrorTransferTime(
	ctx context.Context, volumeName string,
) (*time.Time, error)

func (*ConcurrentTridentOrchestrator) GetNode

func (o *ConcurrentTridentOrchestrator) GetNode(
	ctx context.Context, nodeName string,
) (node *models.NodeExternal, err error)

func (*ConcurrentTridentOrchestrator) GetReplicationDetails

func (o *ConcurrentTridentOrchestrator) GetReplicationDetails(
	ctx context.Context, backendUUID, localInternalVolumeName, remoteVolumeHandle string,
) (string, string, string, error)

func (*ConcurrentTridentOrchestrator) GetResizeDeltaForBackend

func (o *ConcurrentTridentOrchestrator) GetResizeDeltaForBackend(ctx context.Context, backendUUID string) (int64, error)

GetResizeDeltaForBackend returns the resize delta (bytes) for the backend. Returns (0, err) when the orchestrator is not ready (e.g. bootstrap error).

func (*ConcurrentTridentOrchestrator) GetSelectedLogLayers

func (o *ConcurrentTridentOrchestrator) GetSelectedLogLayers(ctx context.Context) (string, error)

func (*ConcurrentTridentOrchestrator) GetSelectedLoggingWorkflows

func (o *ConcurrentTridentOrchestrator) GetSelectedLoggingWorkflows(ctx context.Context) (string, error)

func (*ConcurrentTridentOrchestrator) GetSnapshot

func (o *ConcurrentTridentOrchestrator) GetSnapshot(ctx context.Context, volumeName, snapshotName string,
) (snapshotExternal *storage.SnapshotExternal, err error)

func (*ConcurrentTridentOrchestrator) GetStorageClass

func (o *ConcurrentTridentOrchestrator) GetStorageClass(
	ctx context.Context, scName string,
) (scExternal *storageclass.External, err error)

func (*ConcurrentTridentOrchestrator) GetStorageClassPoolMap

func (o *ConcurrentTridentOrchestrator) GetStorageClassPoolMap() *storageclass.PoolMap

TODO (cknight): we're using deep copy semantics to mimic the lockless reads of the cache layer.

func (*ConcurrentTridentOrchestrator) GetSubordinateSourceVolume

func (o *ConcurrentTridentOrchestrator) GetSubordinateSourceVolume(
	ctx context.Context, subordinateVolumeName string,
) (volume *storage.VolumeExternal, err error)

GetSubordinateSourceVolume returns the parent volume for a given subordinate volume.

func (*ConcurrentTridentOrchestrator) GetVersion

func (*ConcurrentTridentOrchestrator) GetVolume

func (o *ConcurrentTridentOrchestrator) GetVolume(
	ctx context.Context, volumeName string,
) (volExternal *storage.VolumeExternal, err error)

func (*ConcurrentTridentOrchestrator) GetVolumeByInternalName

func (o *ConcurrentTridentOrchestrator) GetVolumeByInternalName(
	ctx context.Context, volumeInternal string,
) (volume string, err error)

func (*ConcurrentTridentOrchestrator) GetVolumeForImport

func (o *ConcurrentTridentOrchestrator) GetVolumeForImport(
	ctx context.Context, volumeID, backendName string,
) (volExternal *storage.VolumeExternal, err error)

func (*ConcurrentTridentOrchestrator) GetVolumePublication

func (o *ConcurrentTridentOrchestrator) GetVolumePublication(
	ctx context.Context, volumeName, nodeName string,
) (publication *models.VolumePublication, err error)

GetVolumePublication returns the volume publication for a given volume/node pair

func (*ConcurrentTridentOrchestrator) GetVolumeTransaction

func (*ConcurrentTridentOrchestrator) ImportSnapshot

func (o *ConcurrentTridentOrchestrator) ImportSnapshot(
	ctx context.Context, snapshotConfig *storage.SnapshotConfig,
) (externalSnapshot *storage.SnapshotExternal, err error)

func (*ConcurrentTridentOrchestrator) ImportVolume

func (o *ConcurrentTridentOrchestrator) ImportVolume(
	ctx context.Context, volumeConfig *storage.VolumeConfig,
) (v *storage.VolumeExternal, err error)

func (*ConcurrentTridentOrchestrator) ListAutogrowPolicies

func (o *ConcurrentTridentOrchestrator) ListAutogrowPolicies(
	ctx context.Context,
) ([]*storage.AutogrowPolicyExternal, error)

ListAutogrowPolicies returns all Autogrow policies currently registered in the orchestrator. Each policy includes its configuration and the list of volumes using it.

func (*ConcurrentTridentOrchestrator) ListBackends

func (o *ConcurrentTridentOrchestrator) ListBackends(
	ctx context.Context,
) (backendExternals []*storage.BackendExternal, err error)

func (*ConcurrentTridentOrchestrator) ListGroupSnapshots

func (o *ConcurrentTridentOrchestrator) ListGroupSnapshots(
	ctx context.Context,
) (groupSnapshotExternals []*storage.GroupSnapshotExternal, err error)

ListGroupSnapshots returns all group snapshots known to the cache.

func (*ConcurrentTridentOrchestrator) ListLogLayers

func (o *ConcurrentTridentOrchestrator) ListLogLayers(ctx context.Context) ([]string, error)

func (*ConcurrentTridentOrchestrator) ListLoggingWorkflows

func (o *ConcurrentTridentOrchestrator) ListLoggingWorkflows(ctx context.Context) ([]string, error)

func (*ConcurrentTridentOrchestrator) ListNodes

func (o *ConcurrentTridentOrchestrator) ListNodes(
	ctx context.Context,
) (nodes []*models.NodeExternal, err error)

func (*ConcurrentTridentOrchestrator) ListSnapshots

func (o *ConcurrentTridentOrchestrator) ListSnapshots(
	ctx context.Context,
) (externalSnapshots []*storage.SnapshotExternal, err error)

func (*ConcurrentTridentOrchestrator) ListSnapshotsByName

func (o *ConcurrentTridentOrchestrator) ListSnapshotsByName(
	ctx context.Context, snapshotName string,
) (externalSnapshots []*storage.SnapshotExternal, err error)

func (*ConcurrentTridentOrchestrator) ListSnapshotsForGroup

func (o *ConcurrentTridentOrchestrator) ListSnapshotsForGroup(
	ctx context.Context, groupName string,
) (externalSnapshots []*storage.SnapshotExternal, err error)

ListSnapshotsForGroup returns all constituent snapshots that belong to the named group snapshot. Constituent snapshots are independent snapshot resources tagged with the group name, so they are resolved by filtering the snapshot cache rather than by reading the group snapshot record. This also gracefully handles pre-provisioned grouped snapshots imported before the group snapshot reference.

func (*ConcurrentTridentOrchestrator) ListSnapshotsForVolume

func (o *ConcurrentTridentOrchestrator) ListSnapshotsForVolume(
	ctx context.Context, volumeName string,
) (externalSnapshots []*storage.SnapshotExternal, err error)

func (*ConcurrentTridentOrchestrator) ListStorageClasses

func (o *ConcurrentTridentOrchestrator) ListStorageClasses(ctx context.Context) (
	scExternals []*storageclass.External, err error,
)

func (*ConcurrentTridentOrchestrator) ListSubordinateVolumes

func (o *ConcurrentTridentOrchestrator) ListSubordinateVolumes(
	ctx context.Context, sourceVolumeName string,
) (volumesExt []*storage.VolumeExternal, err error)

ListSubordinateVolumes returns all subordinate volumes for all source volumes, or all subordinate volumes for a single source volume.

func (*ConcurrentTridentOrchestrator) ListVolumePublications

func (o *ConcurrentTridentOrchestrator) ListVolumePublications(
	ctx context.Context,
) (publications []*models.VolumePublicationExternal, err error)

ListVolumePublications returns a list of all volume publications.

func (*ConcurrentTridentOrchestrator) ListVolumePublicationsForNode

func (o *ConcurrentTridentOrchestrator) ListVolumePublicationsForNode(
	ctx context.Context, nodeName string,
) (publications []*models.VolumePublicationExternal, err error)

ListVolumePublicationsForNode returns a list of all volume publications for a given node.

func (*ConcurrentTridentOrchestrator) ListVolumePublicationsForVolume

func (o *ConcurrentTridentOrchestrator) ListVolumePublicationsForVolume(
	ctx context.Context, volumeName string,
) (publications []*models.VolumePublicationExternal, err error)

ListVolumePublicationsForVolume returns a list of all volume publications for a given volume.

func (*ConcurrentTridentOrchestrator) ListVolumes

func (o *ConcurrentTridentOrchestrator) ListVolumes(
	ctx context.Context,
) (volumeExternals []*storage.VolumeExternal, err error)

func (*ConcurrentTridentOrchestrator) MoveVolume

func (o *ConcurrentTridentOrchestrator) MoveVolume(
	ctx context.Context, volumeMoveInfo *models.VolumeMoveInfo,
) (err error)

func (*ConcurrentTridentOrchestrator) PeriodicallyReconcileBackendState

func (o *ConcurrentTridentOrchestrator) PeriodicallyReconcileBackendState(pollInterval time.Duration)

func (*ConcurrentTridentOrchestrator) PeriodicallyReconcileNodeAccessOnBackends

func (o *ConcurrentTridentOrchestrator) PeriodicallyReconcileNodeAccessOnBackends()

func (*ConcurrentTridentOrchestrator) PromoteMirror

func (o *ConcurrentTridentOrchestrator) PromoteMirror(
	ctx context.Context, backendUUID, volumeName, localInternalVolumeName, remoteVolumeHandle, snapshotHandle string,
) (bool, error)

func (*ConcurrentTridentOrchestrator) PublishVolume

func (o *ConcurrentTridentOrchestrator) PublishVolume(ctx context.Context, volumeName string,
	publishInfo *models.VolumePublishInfo,
) (err error)

func (*ConcurrentTridentOrchestrator) ReadSnapshotsForVolume

func (o *ConcurrentTridentOrchestrator) ReadSnapshotsForVolume(
	ctx context.Context, volumeName string,
) (externalSnapshots []*storage.SnapshotExternal, err error)

func (*ConcurrentTridentOrchestrator) RebuildStorageClassPoolMap

func (o *ConcurrentTridentOrchestrator) RebuildStorageClassPoolMap(ctx context.Context)

GetStorageClassPoolMap returns a deep copy of the storage class to pool mapping for each backend. RebuildStorageClassPoolMap rebuilds the storage class to pool mapping for each backend. TODO (cknight): automate this when the pool map is moved into the cache layer.

func (*ConcurrentTridentOrchestrator) ReconcileVolumeMove

func (o *ConcurrentTridentOrchestrator) ReconcileVolumeMove(ctx context.Context, volumeName string, volumeMoveInfo *models.VolumeMoveInfo) (err error)

func (*ConcurrentTridentOrchestrator) ReconcileVolumePublications

func (o *ConcurrentTridentOrchestrator) ReconcileVolumePublications(
	ctx context.Context, attachedLegacyVolumes []*models.VolumePublicationExternal,
) (reconcileErr error)

func (*ConcurrentTridentOrchestrator) ReestablishMirror

func (o *ConcurrentTridentOrchestrator) ReestablishMirror(
	ctx context.Context, backendUUID, volumeName, localInternalVolumeName, remoteVolumeHandle, replicationPolicy,
	replicationSchedule string,
) error

func (*ConcurrentTridentOrchestrator) ReleaseMirror

func (o *ConcurrentTridentOrchestrator) ReleaseMirror(
	ctx context.Context, backendUUID, volumeName, localInternalVolumeName string,
) error

func (*ConcurrentTridentOrchestrator) ReloadVolumes

func (o *ConcurrentTridentOrchestrator) ReloadVolumes(ctx context.Context) error

func (*ConcurrentTridentOrchestrator) RemoveBackendConfigRef

func (o *ConcurrentTridentOrchestrator) RemoveBackendConfigRef(
	ctx context.Context, backendUUID, configRef string,
) (err error)

func (*ConcurrentTridentOrchestrator) ResizeVolume

func (o *ConcurrentTridentOrchestrator) ResizeVolume(ctx context.Context, volumeName, newSize string) (err error)

func (*ConcurrentTridentOrchestrator) RestoreSnapshot

func (o *ConcurrentTridentOrchestrator) RestoreSnapshot(
	ctx context.Context, volumeName, snapshotName string,
) (err error)

RestoreSnapshot restores a volume to the specified snapshot. The caller is responsible for ensuring this is the newest snapshot known to the container orchestrator. Any other snapshots that are newer than the specified one that are not known to the container orchestrator may be lost.

func (*ConcurrentTridentOrchestrator) SetLogLayers

func (o *ConcurrentTridentOrchestrator) SetLogLayers(ctx context.Context, layers string) error

func (*ConcurrentTridentOrchestrator) SetLogLevel

func (o *ConcurrentTridentOrchestrator) SetLogLevel(ctx context.Context, level string) error

func (*ConcurrentTridentOrchestrator) SetLoggingWorkflows

func (o *ConcurrentTridentOrchestrator) SetLoggingWorkflows(ctx context.Context, flows string) error

func (*ConcurrentTridentOrchestrator) StageVolumeMove

func (o *ConcurrentTridentOrchestrator) StageVolumeMove(
	ctx context.Context, volumeMoveInfo *models.VolumeMoveInfo,
) (err error)

func (*ConcurrentTridentOrchestrator) Stop

Stop stops the orchestrator core; this is expected to be called during shutdown, and new cache locks will block forever.

func (*ConcurrentTridentOrchestrator) SyncVolumePublications

func (o *ConcurrentTridentOrchestrator) SyncVolumePublications(
	ctx context.Context, vpsToBeSynced []*models.VolumePublication,
)

SyncVolumePublications asynchronously persists VP fields to the store with rate limiting. The VPs are already updated in cache; this method only persists them to the store.

Used by:

  • Bootstrap: Syncing/migrating all VPs (labels, AGP, legacy fields)
  • UpdateVolumeAutogrowPolicy: Propagating AGP changes to RWX/RO volume's VPs

func (*ConcurrentTridentOrchestrator) UnpublishVolume

func (o *ConcurrentTridentOrchestrator) UnpublishVolume(ctx context.Context, volumeName, nodeName string) (err error)

func (*ConcurrentTridentOrchestrator) UnstageVolumeMove

func (o *ConcurrentTridentOrchestrator) UnstageVolumeMove(
	ctx context.Context, volumeMoveInfo *models.VolumeMoveInfo,
) (err error)

func (*ConcurrentTridentOrchestrator) UpdateAutogrowPolicy

UpdateAutogrowPolicy updates an existing Autogrow policy with new configuration values. Volumes already associated with the policy will use the updated settings. This method updates the policy configuration but does not re-associate existing volumes.

func (*ConcurrentTridentOrchestrator) UpdateBackend

func (o *ConcurrentTridentOrchestrator) UpdateBackend(
	ctx context.Context, backendName, configJSON, configRef string,
) (backendExternal *storage.BackendExternal, err error)

UpdateBackend updates an existing backend.

func (*ConcurrentTridentOrchestrator) UpdateBackendByBackendUUID

func (o *ConcurrentTridentOrchestrator) UpdateBackendByBackendUUID(
	ctx context.Context, backendName, configJSON, backendUUID, configRef string,
) (backendExternal *storage.BackendExternal, err error)

UpdateBackendByBackendUUID updates an existing backend.

func (*ConcurrentTridentOrchestrator) UpdateBackendState

func (o *ConcurrentTridentOrchestrator) UpdateBackendState(
	ctx context.Context, backendName, backendState, userBackendState string,
) (storageBackendExternal *storage.BackendExternal, err error)

func (*ConcurrentTridentOrchestrator) UpdateMirror

func (o *ConcurrentTridentOrchestrator) UpdateMirror(ctx context.Context, volumeName, snapshotName string) error

func (*ConcurrentTridentOrchestrator) UpdateNode

func (o *ConcurrentTridentOrchestrator) UpdateNode(
	ctx context.Context, nodeName string, flags *models.NodePublicationStateFlags,
) (err error)

UpdateNode updates the publication state of a node. It does not create a new node if it does not exist.

func (*ConcurrentTridentOrchestrator) UpdateStorageClass

func (o *ConcurrentTridentOrchestrator) UpdateStorageClass(
	ctx context.Context, scConfig *storageclass.Config,
) (scExternal *storageclass.External, err error)

func (*ConcurrentTridentOrchestrator) UpdateVolume

func (o *ConcurrentTridentOrchestrator) UpdateVolume(
	ctx context.Context, volumeName string, volumeUpdateInfo *models.VolumeUpdateInfo,
) (err error)

UpdateVolume updates the allowed fields of a volume in the backend, persistent store and cache.

func (*ConcurrentTridentOrchestrator) UpdateVolumeAutogrowPolicy

func (o *ConcurrentTridentOrchestrator) UpdateVolumeAutogrowPolicy(
	ctx context.Context, volumeName, requestedAutogrowPolicy string,
) error

UpdateVolumeAutogrowPolicy updates a volume when its autogrow policy changes. This resolves the new effective policy, validates it exists, and updates associations. Returns AutogrowPolicyNotFoundError or AutogrowPolicyNotUsableError for event recording.

func (*ConcurrentTridentOrchestrator) UpdateVolumeAutogrowStatus

func (o *ConcurrentTridentOrchestrator) UpdateVolumeAutogrowStatus(
	ctx context.Context, volumeName string, status *models.VolumeAutogrowStatus,
) (err error)

UpdateVolumeAutogrowStatus updates the volume's AutogrowStatus in the in-memory cache and in the persistent store (TridentVolume CR).

We do inconsistent reads first (volume and subordinate volume) so we know exactly which lock to take, then take the appropriate write lock.

func (*ConcurrentTridentOrchestrator) UpdateVolumeLUKSPassphraseNames

func (o *ConcurrentTridentOrchestrator) UpdateVolumeLUKSPassphraseNames(
	ctx context.Context, volumeName string, passphraseNames *[]string,
) (err error)

UpdateVolumeLUKSPassphraseNames updates the LUKS passphrase names stored on a volume in the cache and persistent store.

type NodeEventCallback

type NodeEventCallback func(eventType, reason, message string)

type Orchestrator

type Orchestrator interface {
	Bootstrap(monitorTransactions bool) error
	AddFrontend(ctx context.Context, f frontend.Plugin)
	GetFrontend(ctx context.Context, name string) (frontend.Plugin, error)
	GetVersion(ctx context.Context) (string, error)

	AddBackend(ctx context.Context, configJSON, configRef string) (*storage.BackendExternal, error)
	DeleteBackend(ctx context.Context, backend string) error
	DeleteBackendByBackendUUID(ctx context.Context, backendName, backendUUID string) error
	GetBackend(ctx context.Context, backend string) (*storage.BackendExternal, error)
	GetBackendByBackendUUID(ctx context.Context, backendUUID string) (*storage.BackendExternal, error)
	GetResizeDeltaForBackend(ctx context.Context, backendUUID string) (deltaBytes int64, err error)
	ListBackends(ctx context.Context) ([]*storage.BackendExternal, error)
	UpdateBackend(
		ctx context.Context, backendName, configJSON, configRef string,
	) (storageBackendExternal *storage.BackendExternal, err error)
	UpdateBackendByBackendUUID(
		ctx context.Context, backendName, configJSON, backendUUID, configRef string,
	) (storageBackendExternal *storage.BackendExternal, err error)
	UpdateBackendState(
		ctx context.Context, backendName, backendState, userBackendState string,
	) (storageBackendExternal *storage.BackendExternal, err error)
	RemoveBackendConfigRef(ctx context.Context, backendUUID, configRef string) (err error)

	AddVolume(ctx context.Context, volumeConfig *storage.VolumeConfig) (*storage.VolumeExternal, error)
	UpdateVolume(ctx context.Context, volume string, volumeUpdateInfo *models.VolumeUpdateInfo) error
	UpdateVolumeLUKSPassphraseNames(ctx context.Context, volume string, passphraseNames *[]string) error
	AttachVolume(ctx context.Context, volumeName, mountpoint string, publishInfo *models.VolumePublishInfo) error
	CloneVolume(ctx context.Context, volumeConfig *storage.VolumeConfig) (*storage.VolumeExternal, error)
	DetachVolume(ctx context.Context, volumeName, mountpoint string) error
	DeleteVolume(ctx context.Context, volume string) error
	GetVolume(ctx context.Context, volumeName string) (*storage.VolumeExternal, error)
	GetVolumeByInternalName(ctx context.Context, volumeInternal string) (volume string, err error)
	GetVolumeForImport(ctx context.Context, volumeID, backendName string) (*storage.VolumeExternal, error)
	ImportVolume(ctx context.Context, volumeConfig *storage.VolumeConfig) (*storage.VolumeExternal, error)
	ListVolumes(ctx context.Context) ([]*storage.VolumeExternal, error)
	PublishVolume(ctx context.Context, volumeName string, publishInfo *models.VolumePublishInfo) error
	UnpublishVolume(ctx context.Context, volumeName, nodeName string) error
	ResizeVolume(ctx context.Context, volumeName, newSize string) error
	ReloadVolumes(ctx context.Context) error

	ReconcileVolumeMove(ctx context.Context, volumeName string, volumeMoveInfo *models.VolumeMoveInfo) error
	StageVolumeMove(ctx context.Context, volumeMoveInfo *models.VolumeMoveInfo) error
	MoveVolume(ctx context.Context, volumeMoveInfo *models.VolumeMoveInfo) error
	UnstageVolumeMove(ctx context.Context, volumeMoveInfo *models.VolumeMoveInfo) error

	ListSubordinateVolumes(ctx context.Context, sourceVolumeName string) ([]*storage.VolumeExternal, error)
	GetSubordinateSourceVolume(ctx context.Context, subordinateVolumeName string) (*storage.VolumeExternal, error)

	CreateSnapshot(ctx context.Context, snapshotConfig *storage.SnapshotConfig) (*storage.SnapshotExternal, error)
	ImportSnapshot(
		ctx context.Context, snapshotConfig *storage.SnapshotConfig,
	) (*storage.SnapshotExternal, error)
	GetSnapshot(ctx context.Context, volumeName, snapshotName string) (*storage.SnapshotExternal, error)
	ListSnapshots(ctx context.Context) ([]*storage.SnapshotExternal, error)
	ListSnapshotsByName(ctx context.Context, snapshotName string) ([]*storage.SnapshotExternal, error)
	ListSnapshotsForGroup(ctx context.Context, groupName string) ([]*storage.SnapshotExternal, error)
	ListSnapshotsForVolume(ctx context.Context, volumeName string) ([]*storage.SnapshotExternal, error)
	ReadSnapshotsForVolume(ctx context.Context, volumeName string) ([]*storage.SnapshotExternal, error)
	RestoreSnapshot(ctx context.Context, volumeName, snapshotName string) error
	DeleteSnapshot(ctx context.Context, volumeName, snapshotName string) error

	CreateGroupSnapshot(ctx context.Context, config *storage.GroupSnapshotConfig) (*storage.GroupSnapshotExternal, error)
	DeleteGroupSnapshot(ctx context.Context, groupName string) error
	GetGroupSnapshot(ctx context.Context, groupName string) (*storage.GroupSnapshotExternal, error)
	ListGroupSnapshots(ctx context.Context) ([]*storage.GroupSnapshotExternal, error)

	AddStorageClass(ctx context.Context, scConfig *storageclass.Config) (*storageclass.External, error)
	UpdateStorageClass(ctx context.Context, scConfig *storageclass.Config) (*storageclass.External, error)
	DeleteStorageClass(ctx context.Context, scName string) error
	GetStorageClass(ctx context.Context, scName string) (*storageclass.External, error)
	ListStorageClasses(ctx context.Context) ([]*storageclass.External, error)

	AddNode(ctx context.Context, node *models.Node, nodeEventCallback NodeEventCallback) error
	UpdateNode(ctx context.Context, nodeName string, flags *models.NodePublicationStateFlags) error
	GetNode(ctx context.Context, nodeName string) (*models.NodeExternal, error)
	ListNodes(ctx context.Context) ([]*models.NodeExternal, error)
	DeleteNode(ctx context.Context, nodeName string) error
	PeriodicallyReconcileNodeAccessOnBackends()
	PeriodicallyReconcileBackendState(pollInterval time.Duration)

	ReconcileVolumePublications(ctx context.Context, attachedLegacyVolumes []*models.VolumePublicationExternal) error
	GetVolumePublication(ctx context.Context, volumeName, nodeName string) (*models.VolumePublication, error)
	ListVolumePublications(ctx context.Context) ([]*models.VolumePublicationExternal, error)
	ListVolumePublicationsForVolume(
		ctx context.Context, volumeName string,
	) (publications []*models.VolumePublicationExternal, err error)
	ListVolumePublicationsForNode(
		ctx context.Context, nodeName string,
	) (publications []*models.VolumePublicationExternal, err error)
	SyncVolumePublications(ctx context.Context, vpsToBeSynced []*models.VolumePublication)

	AddVolumeTransaction(ctx context.Context, volTxn *storage.VolumeTransaction) error
	GetVolumeTransaction(ctx context.Context, volTxn *storage.VolumeTransaction) (*storage.VolumeTransaction, error)
	DeleteVolumeTransaction(ctx context.Context, volTxn *storage.VolumeTransaction) error

	AddAutogrowPolicy(ctx context.Context, config *storage.AutogrowPolicyConfig) (*storage.AutogrowPolicyExternal, error)
	UpdateAutogrowPolicy(ctx context.Context, config *storage.AutogrowPolicyConfig) (*storage.AutogrowPolicyExternal, error)
	DeleteAutogrowPolicy(ctx context.Context, agPolicyName string) error
	GetAutogrowPolicy(ctx context.Context, agPolicyName string) (*storage.AutogrowPolicyExternal, error)
	ListAutogrowPolicies(ctx context.Context) ([]*storage.AutogrowPolicyExternal, error)

	UpdateVolumeAutogrowPolicy(ctx context.Context, volumeName, requestedAutogrowPolicy string) error
	UpdateVolumeAutogrowStatus(ctx context.Context, volumeName string, status *models.VolumeAutogrowStatus) error

	EstablishMirror(ctx context.Context, backendUUID, volumeName, localInternalVolumeName, remoteVolumeHandle, replicationPolicy,
		replicationSchedule string) error
	ReestablishMirror(ctx context.Context, backendUUID, volumeName, localInternalVolumeName, remoteVolumeHandle,
		replicationPolicy, replicationSchedule string) error
	PromoteMirror(ctx context.Context, backendUUID, volumeName, localInternalVolumeName, remoteVolumeHandle,
		snapshotHandle string) (bool, error)
	GetMirrorStatus(ctx context.Context, backendUUID, localInternalVolumeName, remoteVolumeHandle string) (string, error)
	CanBackendMirror(ctx context.Context, backendUUID string) (bool, error)
	ReleaseMirror(ctx context.Context, backendUUID, volumeName, localInternalVolumeName string) error
	GetReplicationDetails(ctx context.Context, backendUUID, localInternalVolumeName, remoteVolumeHandle string) (string, string, string, error)
	UpdateMirror(ctx context.Context, volumeName, snapshotName string) error
	CheckMirrorTransferState(ctx context.Context, volumeName string) (*time.Time, error)
	GetMirrorTransferTime(ctx context.Context, volumeName string) (*time.Time, error)

	GetCHAP(ctx context.Context, volumeName, nodeName string) (*models.IscsiChapInfo, error)

	GetLogLevel(ctx context.Context) (string, error)
	SetLogLevel(ctx context.Context, level string) error
	GetSelectedLoggingWorkflows(ctx context.Context) (string, error)
	ListLoggingWorkflows(ctx context.Context) ([]string, error)
	SetLoggingWorkflows(ctx context.Context, workflows string) error
	GetSelectedLogLayers(ctx context.Context) (string, error)
	ListLogLayers(ctx context.Context) ([]string, error)
	SetLogLayers(ctx context.Context, workflows string) error

	Stop()
}

func NewConcurrentTridentOrchestrator

func NewConcurrentTridentOrchestrator(client persistentstore.Client) (Orchestrator, error)

type TridentOrchestrator

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

func NewTridentOrchestrator

func NewTridentOrchestrator(client persistentstore.Client) (*TridentOrchestrator, error)

NewTridentOrchestrator returns a storage orchestrator instance

func (*TridentOrchestrator) AddAutogrowPolicy

AddAutogrowPolicy creates a new Autogrow policy in the orchestrator. The policy can be referenced by volumes directly or as a default in StorageClass.

func (*TridentOrchestrator) AddBackend

func (o *TridentOrchestrator) AddBackend(
	ctx context.Context, configJSON, configRef string,
) (backendExternal *storage.BackendExternal, err error)

AddBackend handles creation of a new storage backend

func (*TridentOrchestrator) AddFrontend

func (o *TridentOrchestrator) AddFrontend(ctx context.Context, f frontend.Plugin)

func (*TridentOrchestrator) AddNode

func (o *TridentOrchestrator) AddNode(
	ctx context.Context, node *models.Node, nodeEventCallback NodeEventCallback,
) (err error)

func (*TridentOrchestrator) AddStorageClass

func (o *TridentOrchestrator) AddStorageClass(
	ctx context.Context, scConfig *storageclass.Config,
) (scExternal *storageclass.External, err error)

func (*TridentOrchestrator) AddVolume

func (o *TridentOrchestrator) AddVolume(
	ctx context.Context, volumeConfig *storage.VolumeConfig,
) (externalVol *storage.VolumeExternal, err error)

func (*TridentOrchestrator) AddVolumeTransaction

func (o *TridentOrchestrator) AddVolumeTransaction(ctx context.Context, volTxn *storage.VolumeTransaction) error

AddVolumeTransaction is called from the volume create, clone, and resize methods to save a record of the operation in case it fails and must be cleaned up later.

func (*TridentOrchestrator) AttachVolume

func (o *TridentOrchestrator) AttachVolume(
	ctx context.Context, volumeName, mountpoint string, publishInfo *models.VolumePublishInfo,
) (err error)

AttachVolume mounts a volume to the local host. This method is currently only used by Docker, and it should be able to accomplish its task using only the data passed in; it should not need to use the storage controller API. It may be assumed that this method always runs on the host to which the volume will be attached.

func (*TridentOrchestrator) Bootstrap

func (o *TridentOrchestrator) Bootstrap(monitorTransactions bool) error

func (*TridentOrchestrator) CanBackendMirror

func (o *TridentOrchestrator) CanBackendMirror(ctx context.Context, backendUUID string) (capable bool, err error)

func (*TridentOrchestrator) CheckMirrorTransferState

func (o *TridentOrchestrator) CheckMirrorTransferState(
	ctx context.Context, volumeName string,
) (endTime *time.Time, err error)

CheckMirrorTransferState returns the last completed transfer time and an error if mirror relationship transfer is failed or in progress

func (*TridentOrchestrator) CloneVolume

func (o *TridentOrchestrator) CloneVolume(
	ctx context.Context, volumeConfig *storage.VolumeConfig,
) (externalVol *storage.VolumeExternal, err error)

func (*TridentOrchestrator) CreateGroupSnapshot

func (o *TridentOrchestrator) CreateGroupSnapshot(
	ctx context.Context, config *storage.GroupSnapshotConfig,
) (externalGroupSnapshot *storage.GroupSnapshotExternal, err error)

CreateGroupSnapshot creates a snapshot of a volume group

func (*TridentOrchestrator) CreateSnapshot

func (o *TridentOrchestrator) CreateSnapshot(
	ctx context.Context, snapshotConfig *storage.SnapshotConfig,
) (externalSnapshot *storage.SnapshotExternal, err error)

CreateSnapshot creates a snapshot of the given volume

func (*TridentOrchestrator) DeleteAutogrowPolicy

func (o *TridentOrchestrator) DeleteAutogrowPolicy(ctx context.Context, agPolicyName string) error

DeleteAutogrowPolicy removes an Autogrow policy from the orchestrator.

Behavior:

  • If policy has no volumes: Immediately deletes from memory (hard delete)
  • If policy has volumes: Sets state to Deleting (soft delete), returns nil
  • Soft-deleted policies are automatically cleaned up when the last volume is disassociated

This matches the backend deletion pattern for consistency.

func (*TridentOrchestrator) DeleteBackend

func (o *TridentOrchestrator) DeleteBackend(ctx context.Context, backendName string) (err error)

func (*TridentOrchestrator) DeleteBackendByBackendUUID

func (o *TridentOrchestrator) DeleteBackendByBackendUUID(
	ctx context.Context, backendName, backendUUID string,
) (err error)

func (*TridentOrchestrator) DeleteGroupSnapshot

func (o *TridentOrchestrator) DeleteGroupSnapshot(ctx context.Context, groupName string) (err error)

func (*TridentOrchestrator) DeleteNode

func (o *TridentOrchestrator) DeleteNode(ctx context.Context, nodeName string) (err error)

func (*TridentOrchestrator) DeleteSnapshot

func (o *TridentOrchestrator) DeleteSnapshot(ctx context.Context, volumeName, snapshotName string) (err error)

DeleteSnapshot deletes a snapshot of the given volume

func (*TridentOrchestrator) DeleteStorageClass

func (o *TridentOrchestrator) DeleteStorageClass(ctx context.Context, scName string) (err error)

func (*TridentOrchestrator) DeleteVolume

func (o *TridentOrchestrator) DeleteVolume(ctx context.Context, volumeName string) (err error)

DeleteVolume does the necessary set up to delete a volume during the course of normal operation, verifying that the volume is present in Trident and creating a transaction to ensure that the delete eventually completes.

func (*TridentOrchestrator) DeleteVolumeTransaction

func (o *TridentOrchestrator) DeleteVolumeTransaction(ctx context.Context, volTxn *storage.VolumeTransaction) error

DeleteVolumeTransaction deletes a volume transaction created by addVolumeTransaction.

func (*TridentOrchestrator) DetachVolume

func (o *TridentOrchestrator) DetachVolume(ctx context.Context, volumeName, mountpoint string) (err error)

DetachVolume unmounts a volume from the local host. This method is currently only used by Docker, and it should be able to accomplish its task using only the data passed in; it should not need to use the storage controller API. It may be assumed that this method always runs on the host to which the volume will be attached. It ensures the volume is already mounted, and it attempts to delete the mount point.

func (*TridentOrchestrator) EstablishMirror

func (o *TridentOrchestrator) EstablishMirror(
	ctx context.Context, backendUUID, volumeName, localInternalVolumeName, remoteVolumeHandle, replicationPolicy,
	replicationSchedule string,
) (err error)

EstablishMirror creates a net-new replication mirror relationship between 2 volumes on a backend

func (*TridentOrchestrator) GetAutogrowPolicy

func (o *TridentOrchestrator) GetAutogrowPolicy(ctx context.Context, agPolicyName string) (*storage.AutogrowPolicyExternal, error)

GetAutogrowPolicy retrieves a single Autogrow policy by name. The returned external representation includes the policy configuration and a list of all volumes currently using the policy.

func (*TridentOrchestrator) GetBackend

func (o *TridentOrchestrator) GetBackend(
	ctx context.Context, backendName string,
) (backendExternal *storage.BackendExternal, err error)

func (*TridentOrchestrator) GetBackendByBackendUUID

func (o *TridentOrchestrator) GetBackendByBackendUUID(
	ctx context.Context, backendUUID string,
) (backendExternal *storage.BackendExternal, err error)

func (*TridentOrchestrator) GetCHAP

func (o *TridentOrchestrator) GetCHAP(
	ctx context.Context, volumeName, nodeName string,
) (chapInfo *models.IscsiChapInfo, err error)

func (*TridentOrchestrator) GetFrontend

func (o *TridentOrchestrator) GetFrontend(ctx context.Context, name string) (frontend.Plugin, error)

func (*TridentOrchestrator) GetGroupSnapshot

func (o *TridentOrchestrator) GetGroupSnapshot(
	ctx context.Context, groupSnapshotID string,
) (groupSnapshotExternal *storage.GroupSnapshotExternal, err error)

func (*TridentOrchestrator) GetLogLevel

func (o *TridentOrchestrator) GetLogLevel(ctx context.Context) (string, error)

func (*TridentOrchestrator) GetMirrorStatus

func (o *TridentOrchestrator) GetMirrorStatus(
	ctx context.Context, backendUUID, localInternalVolumeName, remoteVolumeHandle string,
) (status string, err error)

GetMirrorStatus returns the current status of the mirror relationship

func (*TridentOrchestrator) GetMirrorTransferTime

func (o *TridentOrchestrator) GetMirrorTransferTime(
	ctx context.Context, volumeName string,
) (endTime *time.Time, err error)

GetMirrorTransferTime returns the last completed transfer time

func (*TridentOrchestrator) GetNode

func (o *TridentOrchestrator) GetNode(ctx context.Context, nodeName string) (node *models.NodeExternal, err error)

func (*TridentOrchestrator) GetReplicationDetails

func (o *TridentOrchestrator) GetReplicationDetails(
	ctx context.Context, backendUUID, localInternalVolumeName, remoteVolumeHandle string,
) (policy, schedule, SVMName string, err error)

GetReplicationDetails returns the current replication policy and schedule of a relationship and the SVM name and UUID

func (*TridentOrchestrator) GetResizeDeltaForBackend

func (o *TridentOrchestrator) GetResizeDeltaForBackend(ctx context.Context, backendUUID string) (int64, error)

GetResizeDeltaForBackend returns the resize delta (bytes) for the backend. Returns (0, err) when the orchestrator is not ready (e.g. bootstrap error).

func (*TridentOrchestrator) GetSelectedLogLayers

func (o *TridentOrchestrator) GetSelectedLogLayers(ctx context.Context) (string, error)

func (*TridentOrchestrator) GetSelectedLoggingWorkflows

func (o *TridentOrchestrator) GetSelectedLoggingWorkflows(ctx context.Context) (string, error)

func (*TridentOrchestrator) GetSnapshot

func (o *TridentOrchestrator) GetSnapshot(
	ctx context.Context, volumeName, snapshotName string,
) (snapshotExternal *storage.SnapshotExternal, err error)

func (*TridentOrchestrator) GetStorageClass

func (o *TridentOrchestrator) GetStorageClass(
	ctx context.Context, scName string,
) (scExternal *storageclass.External, err error)

func (*TridentOrchestrator) GetSubordinateSourceVolume

func (o *TridentOrchestrator) GetSubordinateSourceVolume(
	ctx context.Context, subordinateVolumeName string,
) (volume *storage.VolumeExternal, err error)

GetSubordinateSourceVolume returns the parent volume for a given subordinate volume.

func (*TridentOrchestrator) GetVersion

func (o *TridentOrchestrator) GetVersion(_ context.Context) (string, error)

func (*TridentOrchestrator) GetVolume

func (o *TridentOrchestrator) GetVolume(
	ctx context.Context, volumeName string,
) (volExternal *storage.VolumeExternal, err error)

func (*TridentOrchestrator) GetVolumeByInternalName

func (o *TridentOrchestrator) GetVolumeByInternalName(
	ctx context.Context, volumeInternal string,
) (volume string, err error)

GetVolumeByInternalName returns a volume by the given internal name

func (*TridentOrchestrator) GetVolumeCreatingTransaction

func (o *TridentOrchestrator) GetVolumeCreatingTransaction(
	ctx context.Context, config *storage.VolumeConfig,
) (*storage.VolumeTransaction, error)

func (*TridentOrchestrator) GetVolumeForImport

func (o *TridentOrchestrator) GetVolumeForImport(
	ctx context.Context, volumeID, backendName string,
) (volExternal *storage.VolumeExternal, err error)

GetVolumeForImport is used by volume import so it doesn't check core's o.volumes to see if the volume exists or not. Instead it asks the driver if the volume exists before requesting the volume size. Accepts a backend-specific string that a driver may use to find a volume. Returns the VolumeExternal representation of the volume.

func (*TridentOrchestrator) GetVolumePublication

func (o *TridentOrchestrator) GetVolumePublication(
	ctx context.Context, volumeName, nodeName string,
) (publication *models.VolumePublication, err error)

GetVolumePublication returns the volume publication for a given volume/node pair

func (*TridentOrchestrator) GetVolumeTransaction

func (o *TridentOrchestrator) GetVolumeTransaction(
	ctx context.Context, volTxn *storage.VolumeTransaction,
) (*storage.VolumeTransaction, error)

func (*TridentOrchestrator) ImportSnapshot

func (o *TridentOrchestrator) ImportSnapshot(
	ctx context.Context, snapshotConfig *storage.SnapshotConfig,
) (externalSnapshot *storage.SnapshotExternal, err error)

ImportSnapshot will retrieve the snapshot from the backend and persist the snapshot information.

func (*TridentOrchestrator) ImportVolume

func (o *TridentOrchestrator) ImportVolume(
	ctx context.Context, volumeConfig *storage.VolumeConfig,
) (externalVol *storage.VolumeExternal, err error)

func (*TridentOrchestrator) ListAutogrowPolicies

func (o *TridentOrchestrator) ListAutogrowPolicies(ctx context.Context) ([]*storage.AutogrowPolicyExternal, error)

ListAutogrowPolicies returns all Autogrow policies currently registered in the orchestrator. Each policy includes its configuration and the list of volumes using it.

func (*TridentOrchestrator) ListBackends

func (o *TridentOrchestrator) ListBackends(
	ctx context.Context,
) (backendExternals []*storage.BackendExternal, err error)

func (*TridentOrchestrator) ListGroupSnapshots

func (o *TridentOrchestrator) ListGroupSnapshots(
	ctx context.Context,
) (groupSnapshots []*storage.GroupSnapshotExternal, err error)

func (*TridentOrchestrator) ListLogLayers

func (o *TridentOrchestrator) ListLogLayers(ctx context.Context) ([]string, error)

func (*TridentOrchestrator) ListLoggingWorkflows

func (o *TridentOrchestrator) ListLoggingWorkflows(ctx context.Context) ([]string, error)

func (*TridentOrchestrator) ListNodes

func (o *TridentOrchestrator) ListNodes(ctx context.Context) (nodes []*models.NodeExternal, err error)

func (*TridentOrchestrator) ListSnapshots

func (o *TridentOrchestrator) ListSnapshots(ctx context.Context) (snapshots []*storage.SnapshotExternal, err error)

func (*TridentOrchestrator) ListSnapshotsByName

func (o *TridentOrchestrator) ListSnapshotsByName(
	ctx context.Context, snapshotName string,
) (snapshots []*storage.SnapshotExternal, err error)

func (*TridentOrchestrator) ListSnapshotsForGroup

func (o *TridentOrchestrator) ListSnapshotsForGroup(
	ctx context.Context, groupName string,
) (snapshots []*storage.SnapshotExternal, err error)

func (*TridentOrchestrator) ListSnapshotsForVolume

func (o *TridentOrchestrator) ListSnapshotsForVolume(
	ctx context.Context, volumeName string,
) (snapshots []*storage.SnapshotExternal, err error)

func (*TridentOrchestrator) ListStorageClasses

func (o *TridentOrchestrator) ListStorageClasses(ctx context.Context) (
	scExternals []*storageclass.External, err error,
)

func (*TridentOrchestrator) ListSubordinateVolumes

func (o *TridentOrchestrator) ListSubordinateVolumes(
	ctx context.Context, sourceVolumeName string,
) (volumes []*storage.VolumeExternal, err error)

ListSubordinateVolumes returns all subordinate volumes for all source volumes, or all subordinate volumes for a single source volume.

func (*TridentOrchestrator) ListVolumePublications

func (o *TridentOrchestrator) ListVolumePublications(
	ctx context.Context,
) (publications []*models.VolumePublicationExternal, err error)

ListVolumePublications returns a list of all volume publications.

func (*TridentOrchestrator) ListVolumePublicationsForNode

func (o *TridentOrchestrator) ListVolumePublicationsForNode(
	ctx context.Context, nodeName string,
) (publications []*models.VolumePublicationExternal, err error)

ListVolumePublicationsForNode returns a list of all volume publications for a given node.

func (*TridentOrchestrator) ListVolumePublicationsForVolume

func (o *TridentOrchestrator) ListVolumePublicationsForVolume(
	ctx context.Context, volumeName string,
) (publications []*models.VolumePublicationExternal, err error)

ListVolumePublicationsForVolume returns a list of all volume publications for a given volume.

func (*TridentOrchestrator) ListVolumes

func (o *TridentOrchestrator) ListVolumes(ctx context.Context) (volumes []*storage.VolumeExternal, err error)

func (*TridentOrchestrator) MoveVolume

func (o *TridentOrchestrator) MoveVolume(ctx context.Context, volumeMoveInfo *models.VolumeMoveInfo) (err error)

func (*TridentOrchestrator) PeriodicallyReconcileBackendState

func (o *TridentOrchestrator) PeriodicallyReconcileBackendState(pollInterval time.Duration)

PeriodicallyReconcileBackendState is intended to be run as a goroutine and will periodically run reconcileBackendState for each backend in the orchestrator.

func (*TridentOrchestrator) PeriodicallyReconcileNodeAccessOnBackends

func (o *TridentOrchestrator) PeriodicallyReconcileNodeAccessOnBackends()

PeriodicallyReconcileNodeAccessOnBackends is intended to be run as a goroutine and will periodically run safeReconcileNodeAccessOnBackend for each backend in the orchestrator

func (*TridentOrchestrator) PromoteMirror

func (o *TridentOrchestrator) PromoteMirror(
	ctx context.Context, backendUUID, volumeName, localInternalVolumeName, remoteVolumeHandle, snapshotHandle string,
) (waitingForSnapshot bool, err error)

PromoteMirror makes the local volume the primary

func (*TridentOrchestrator) PublishVolume

func (o *TridentOrchestrator) PublishVolume(
	ctx context.Context, volumeName string, publishInfo *models.VolumePublishInfo,
) (err error)

func (*TridentOrchestrator) ReadSnapshotsForVolume

func (o *TridentOrchestrator) ReadSnapshotsForVolume(
	ctx context.Context, volumeName string,
) (externalSnapshots []*storage.SnapshotExternal, err error)

func (*TridentOrchestrator) ReconcileVolumeMove

func (o *TridentOrchestrator) ReconcileVolumeMove(
	ctx context.Context, volumeName string, volumeMoveInfo *models.VolumeMoveInfo,
) (err error)

func (*TridentOrchestrator) ReconcileVolumePublications

func (o *TridentOrchestrator) ReconcileVolumePublications(
	ctx context.Context, attachedLegacyVolumes []*models.VolumePublicationExternal,
) (reconcileErr error)

ReconcileVolumePublications takes a set of attached legacy volumes (as external volume publications) and reconciles them with Trident volumes and publication records.

Pre-conditions:
1. CO helpers are alive and have an up-to-date record of attached volumes.
2. Bootstrapping has bootstrapped all Trident volumes and known publications from CO persistence.
3. [0,n] legacy volumes are supplied.

func (*TridentOrchestrator) ReestablishMirror

func (o *TridentOrchestrator) ReestablishMirror(
	ctx context.Context, backendUUID, volumeName, localInternalVolumeName, remoteVolumeHandle, replicationPolicy,
	replicationSchedule string,
) (err error)

ReestablishMirror recreates a previously existing replication mirror relationship between 2 volumes on a backend

func (*TridentOrchestrator) ReleaseMirror

func (o *TridentOrchestrator) ReleaseMirror(
	ctx context.Context, backendUUID, volumeName, localInternalVolumeName string,
) (err error)

ReleaseMirror removes snapmirror relationship infromation and snapshots for a source volume in ONTAP

func (*TridentOrchestrator) ReloadVolumes

func (o *TridentOrchestrator) ReloadVolumes(ctx context.Context) (err error)

func (*TridentOrchestrator) RemoveBackendConfigRef

func (o *TridentOrchestrator) RemoveBackendConfigRef(ctx context.Context, backendUUID, configRef string) (err error)

RemoveBackendConfigRef sets backend configRef to empty and updates it.

func (*TridentOrchestrator) ResizeVolume

func (o *TridentOrchestrator) ResizeVolume(ctx context.Context, volumeName, newSize string) (err error)

ResizeVolume resizes a volume to the new size.

func (*TridentOrchestrator) RestoreSnapshot

func (o *TridentOrchestrator) RestoreSnapshot(ctx context.Context, volumeName, snapshotName string) (err error)

RestoreSnapshot restores a volume to the specified snapshot. The caller is responsible for ensuring this is the newest snapshot known to the container orchestrator. Any other snapshots that are newer than the specified one that are not known to the container orchestrator may be lost.

func (*TridentOrchestrator) SetLogLayers

func (o *TridentOrchestrator) SetLogLayers(ctx context.Context, layers string) error

func (*TridentOrchestrator) SetLogLevel

func (o *TridentOrchestrator) SetLogLevel(ctx context.Context, level string) error

func (*TridentOrchestrator) SetLoggingWorkflows

func (o *TridentOrchestrator) SetLoggingWorkflows(ctx context.Context, flows string) error

func (*TridentOrchestrator) StageVolumeMove

func (o *TridentOrchestrator) StageVolumeMove(
	ctx context.Context, volumeMoveInfo *models.VolumeMoveInfo,
) (err error)

func (*TridentOrchestrator) StartTransactionMonitor

func (o *TridentOrchestrator) StartTransactionMonitor(
	ctx context.Context, txnPeriod, txnMaxAge time.Duration,
)

StartTransactionMonitor starts the thread that reaps abandoned long-running transactions.

func (*TridentOrchestrator) Stop

func (o *TridentOrchestrator) Stop()

Stop stops the orchestrator core.

func (*TridentOrchestrator) StopTransactionMonitor

func (o *TridentOrchestrator) StopTransactionMonitor()

StopTransactionMonitor stops the thread that reaps abandoned long-running transactions.

func (*TridentOrchestrator) SyncVolumePublications

func (o *TridentOrchestrator) SyncVolumePublications(
	ctx context.Context, vpsToBeSynced []*models.VolumePublication,
)

SyncVolumePublications asynchronously persists a batch of VolumePublications to the store.

The cache has already been updated synchronously by the caller (bootstrap or update operation). This function rate-limits and persists each VP's current cached state to the persistent store.

Each VP is processed independently with rate limiting to avoid overwhelming the API server. If a VP is deleted from cache before persistence, it is safely skipped.

On persistence failures, retries with exponential backoff without holding the mutex lock, allowing other operations to proceed during retry delays.

Used by:

  • Bootstrap: Syncing/migrating all VPs (labels, AGP, legacy fields)
  • UpdateVolumeAutogrowPolicy: Propagating AGP changes to RWX/RO volume's VPs

func (*TridentOrchestrator) UnpublishVolume

func (o *TridentOrchestrator) UnpublishVolume(ctx context.Context, volumeName, nodeName string) (err error)

func (*TridentOrchestrator) UnstageVolumeMove

func (o *TridentOrchestrator) UnstageVolumeMove(
	ctx context.Context, volumeMoveInfo *models.VolumeMoveInfo,
) (err error)

func (*TridentOrchestrator) UpdateAutogrowPolicy

UpdateAutogrowPolicy updates an existing Autogrow policy with new configuration values. Volumes already associated with the policy will use the updated settings. When the policy state changes (Success <-> Failed/Deleting), volumes are automatically re-evaluated:

  • Success → Failed/Deleting: Existing associations are invalidated
  • Failed/Deleting → Success: All volumes are re-evaluated for potential association

This ensures volume associations remain consistent with policy state transitions.

func (*TridentOrchestrator) UpdateBackend

func (o *TridentOrchestrator) UpdateBackend(
	ctx context.Context, backendName, configJSON, configRef string,
) (backendExternal *storage.BackendExternal, err error)

UpdateBackend updates an existing backend.

func (*TridentOrchestrator) UpdateBackendByBackendUUID

func (o *TridentOrchestrator) UpdateBackendByBackendUUID(
	ctx context.Context, backendName, configJSON, backendUUID, configRef string,
) (backend *storage.BackendExternal, err error)

UpdateBackendByBackendUUID updates an existing backend.

func (*TridentOrchestrator) UpdateBackendState

func (o *TridentOrchestrator) UpdateBackendState(
	ctx context.Context, backendName, backendState, userBackendState string,
) (backendExternal *storage.BackendExternal, err error)

UpdateBackendState updates an existing backend's state.

func (*TridentOrchestrator) UpdateMirror

func (o *TridentOrchestrator) UpdateMirror(ctx context.Context, volumeName, snapshotName string) (err error)

UpdateMirror ensures the specified snapshot is copied to the destination, if specified. If snapshot name is empty, the current state of the source is sent instead.

func (*TridentOrchestrator) UpdateNode

func (o *TridentOrchestrator) UpdateNode(
	ctx context.Context, nodeName string, flags *models.NodePublicationStateFlags,
) (err error)

func (*TridentOrchestrator) UpdateStorageClass

func (o *TridentOrchestrator) UpdateStorageClass(
	ctx context.Context, scConfig *storageclass.Config,
) (scExternal *storageclass.External, err error)

func (*TridentOrchestrator) UpdateVolume

func (o *TridentOrchestrator) UpdateVolume(
	ctx context.Context, volumeName string,
	volumeUpdateInfo *models.VolumeUpdateInfo,
) error

UpdateVolume updates the allowed fields of a volume in the backend, persistent store and cache.

func (*TridentOrchestrator) UpdateVolumeAutogrowPolicy

func (o *TridentOrchestrator) UpdateVolumeAutogrowPolicy(
	ctx context.Context, volumeName, requestedAutogrowPolicy string,
) error

UpdateVolumeAutogrowPolicy updates a volume when its autogrow policy changes. This resolves the new effective policy, validates it exists, and updates associations. Returns NotFoundError or AutogrowPolicyNotUsableError for event recording.

func (*TridentOrchestrator) UpdateVolumeAutogrowStatus

func (o *TridentOrchestrator) UpdateVolumeAutogrowStatus(
	ctx context.Context, volumeName string, status *models.VolumeAutogrowStatus,
) error

UpdateVolumeAutogrowStatus updates the volume's AutogrowStatus in the in-memory cache and in the persistent store.

func (*TridentOrchestrator) UpdateVolumeLUKSPassphraseNames

func (o *TridentOrchestrator) UpdateVolumeLUKSPassphraseNames(
	ctx context.Context, volume string, passphraseNames *[]string,
) error

UpdateVolumeLUKSPassphraseNames updates the LUKS passphrase names stored on a volume in the cache and persistent store.

type VolumeCallback

type VolumeCallback func(*storage.VolumeExternal, string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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