persistentstore

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: 45

Documentation

Index

Constants

View Source
const (
	KeyNotFoundErr = "Unable to find key"
	NotSupported   = "Unsupported operation"
)
View Source
const (
	BackendSecretSource = "tridentbackends.trident.netapp.io"
)

Variables

This section is empty.

Functions

func IsAlreadyExistsError

func IsAlreadyExistsError(err error) bool

func IsStatusNotFoundError

func IsStatusNotFoundError(err error) bool

func MatchKeyNotFoundErr

func MatchKeyNotFoundErr(err error) bool

Types

type AlreadyExistsError

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

func NewAlreadyExistsError

func NewAlreadyExistsError(resourceType, resourceName string) *AlreadyExistsError

func (*AlreadyExistsError) Error

func (ae *AlreadyExistsError) Error() string

type CRDClient

type CRDClient interface {
	Client
	HasBackends(ctx context.Context) (bool, error)
	HasStorageClasses(ctx context.Context) (bool, error)
	HasVolumes(ctx context.Context) (bool, error)
	HasVolumeTransactions(ctx context.Context) (bool, error)
}

type CRDClientV1

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

CRDClientV1 stores persistent state in CRD objects in Kubernetes

func NewCRDClientV1

func NewCRDClientV1(masterURL, kubeConfigPath string) (*CRDClientV1, error)

func (*CRDClientV1) AddBackend

func (k *CRDClientV1) AddBackend(ctx context.Context, backend storage.Backend) error

AddBackend accepts a Backend object and persists it in a custom resource with all of its sensitive data redacted and written to a corresponding K8S Secret.

func (*CRDClientV1) AddGroupSnapshot

func (k *CRDClientV1) AddGroupSnapshot(ctx context.Context, groupSnapshot *storage.GroupSnapshot) error

func (*CRDClientV1) AddOrUpdateNode

func (k *CRDClientV1) AddOrUpdateNode(ctx context.Context, node *models.Node) error

func (*CRDClientV1) AddSnapshot

func (k *CRDClientV1) AddSnapshot(ctx context.Context, snapshot *storage.Snapshot) error

AddSnapshot accepts a snapshot, converts it to its persistent form, and writes it to the database. Note that if a record already exists for this snapshot, it is replaced. Therefore, this method should be called after creating a new snapshot with the expectation that the result is a record that matches what was just created. It is the caller's responsibility to ensure that replacement is appropriate.

func (*CRDClientV1) AddStorageClass

func (k *CRDClientV1) AddStorageClass(ctx context.Context, sc *storageclass.StorageClass) error

func (*CRDClientV1) AddVolume

func (k *CRDClientV1) AddVolume(ctx context.Context, volume *storage.Volume) (err error)

AddVolume accepts a volume, converts it to its persistent form, and writes it to the database. Note that if a record already exists for this volume, it is replaced. Therefore, this method should be called after creating a new volume with the expectation that the result is a record that matches what was just created. It is the caller's responsibility to ensure that replacement is appropriate.

func (*CRDClientV1) AddVolumePublication

func (k *CRDClientV1) AddVolumePublication(ctx context.Context, publication *models.VolumePublication) error

func (*CRDClientV1) AddVolumeTransaction

func (k *CRDClientV1) AddVolumeTransaction(ctx context.Context, txn *storage.VolumeTransaction) (err error)

func (*CRDClientV1) DeleteBackend

func (k *CRDClientV1) DeleteBackend(ctx context.Context, b storage.Backend) (err error)

DeleteBackend accepts a Backend object and deletes the custom resource from Kubernetes along with its corresponding secret.

func (*CRDClientV1) DeleteBackends

func (k *CRDClientV1) DeleteBackends(ctx context.Context) error

DeleteBackends deletes all backend custom resources from Kubernetes along with their corresponding secrets.

func (*CRDClientV1) DeleteGroupSnapshot

func (k *CRDClientV1) DeleteGroupSnapshot(ctx context.Context, groupSnapshot *storage.GroupSnapshot) error

func (*CRDClientV1) DeleteGroupSnapshots

func (k *CRDClientV1) DeleteGroupSnapshots(ctx context.Context) error

func (*CRDClientV1) DeleteNode

func (k *CRDClientV1) DeleteNode(ctx context.Context, n *models.Node) error

func (*CRDClientV1) DeleteSnapshot

func (k *CRDClientV1) DeleteSnapshot(ctx context.Context, snapshot *storage.Snapshot) error

func (*CRDClientV1) DeleteSnapshots

func (k *CRDClientV1) DeleteSnapshots(ctx context.Context) error

func (*CRDClientV1) DeleteStorageClass

func (k *CRDClientV1) DeleteStorageClass(ctx context.Context, sc *storageclass.StorageClass) error

func (*CRDClientV1) DeleteVolume

func (k *CRDClientV1) DeleteVolume(ctx context.Context, volume *storage.Volume) (err error)

func (*CRDClientV1) DeleteVolumePublication

func (k *CRDClientV1) DeleteVolumePublication(ctx context.Context, vp *models.VolumePublication) error

func (*CRDClientV1) DeleteVolumeTransaction

func (k *CRDClientV1) DeleteVolumeTransaction(ctx context.Context, volTxn *storage.VolumeTransaction) error

func (*CRDClientV1) DeleteVolumes

func (k *CRDClientV1) DeleteVolumes(ctx context.Context) error

func (*CRDClientV1) GetAutogrowPolicies

func (k *CRDClientV1) GetAutogrowPolicies(ctx context.Context) ([]*storage.AutogrowPolicyPersistent, error)

func (*CRDClientV1) GetAutogrowPolicy

func (k *CRDClientV1) GetAutogrowPolicy(ctx context.Context, agPolicyName string) (*storage.AutogrowPolicyPersistent, error)

func (*CRDClientV1) GetBackend

func (k *CRDClientV1) GetBackend(ctx context.Context, backendName string) (*storage.BackendPersistent, error)

GetBackend retrieves the list of backends persisted as custom resources, finds the one with the specified backend name, and returns the BackendPersistent form of the object with all of its sensitive fields filled in from the corresponding K8S secret.

func (*CRDClientV1) GetBackendSecret

func (k *CRDClientV1) GetBackendSecret(ctx context.Context, secretName string) (map[string]string, error)

GetBackendSecret accepts a secret name and retrieves the corresponding secret containing any sensitive data.

func (*CRDClientV1) GetBackends

func (k *CRDClientV1) GetBackends(ctx context.Context) ([]*storage.BackendPersistent, error)

GetBackends retrieves the list of backends persisted as custom resources and returns them as BackendPersistent objects with all of their sensitive fields filled in from their corresponding K8S secrets.

func (*CRDClientV1) GetConfig

func (k *CRDClientV1) GetConfig() *ClientConfig

func (*CRDClientV1) GetGroupSnapshot

func (k *CRDClientV1) GetGroupSnapshot(ctx context.Context, groupSnapshotName string) (*storage.GroupSnapshotPersistent, error)

func (*CRDClientV1) GetGroupSnapshots

func (k *CRDClientV1) GetGroupSnapshots(ctx context.Context) ([]*storage.GroupSnapshotPersistent, error)

func (*CRDClientV1) GetNode

func (k *CRDClientV1) GetNode(ctx context.Context, nName string) (*models.Node, error)

func (*CRDClientV1) GetNodes

func (k *CRDClientV1) GetNodes(ctx context.Context) ([]*models.Node, error)

func (*CRDClientV1) GetSnapshot

func (k *CRDClientV1) GetSnapshot(ctx context.Context, volumeName, snapshotName string) (
	*storage.SnapshotPersistent, error,
)

func (*CRDClientV1) GetSnapshots

func (k *CRDClientV1) GetSnapshots(ctx context.Context) ([]*storage.SnapshotPersistent, error)

func (*CRDClientV1) GetStorageClass

func (k *CRDClientV1) GetStorageClass(ctx context.Context, scName string) (*storageclass.Persistent, error)

func (*CRDClientV1) GetStorageClasses

func (k *CRDClientV1) GetStorageClasses(ctx context.Context) ([]*storageclass.Persistent, error)

func (*CRDClientV1) GetTridentUUID

func (k *CRDClientV1) GetTridentUUID(ctx context.Context) (string, error)

func (*CRDClientV1) GetType

func (k *CRDClientV1) GetType() StoreType

func (*CRDClientV1) GetVersion

func (*CRDClientV1) GetVolume

func (k *CRDClientV1) GetVolume(
	ctx context.Context, volName string,
) (persistentVolume *storage.VolumeExternal, err error)

func (*CRDClientV1) GetVolumeMoves

func (k *CRDClientV1) GetVolumeMoves(ctx context.Context) (vols []*storage.VolumeMoveExternal, err error)

func (*CRDClientV1) GetVolumePublication

func (k *CRDClientV1) GetVolumePublication(ctx context.Context, nName string) (*models.VolumePublication, error)

func (*CRDClientV1) GetVolumePublications

func (k *CRDClientV1) GetVolumePublications(ctx context.Context) ([]*models.VolumePublication, error)

func (*CRDClientV1) GetVolumeTransaction

func (k *CRDClientV1) GetVolumeTransaction(
	ctx context.Context, volTxn *storage.VolumeTransaction,
) (pTxn *storage.VolumeTransaction, err error)

func (*CRDClientV1) GetVolumeTransactions

func (k *CRDClientV1) GetVolumeTransactions(ctx context.Context) (txns []*storage.VolumeTransaction, err error)

func (*CRDClientV1) GetVolumes

func (k *CRDClientV1) GetVolumes(ctx context.Context) (vols []*storage.VolumeExternal, err error)

func (*CRDClientV1) HasBackends

func (k *CRDClientV1) HasBackends(ctx context.Context) (bool, error)

HasBackends returns true if any backend objects have been persisted as custom resources in the current namespace.

func (*CRDClientV1) HasStorageClasses

func (k *CRDClientV1) HasStorageClasses(ctx context.Context) (bool, error)

func (*CRDClientV1) HasVolumeTransactions

func (k *CRDClientV1) HasVolumeTransactions(ctx context.Context) (hasTxns bool, err error)

func (*CRDClientV1) HasVolumes

func (k *CRDClientV1) HasVolumes(ctx context.Context) (hasVols bool, err error)

func (*CRDClientV1) IsBackendDeleting

func (k *CRDClientV1) IsBackendDeleting(ctx context.Context, b storage.Backend) bool

IsBackendDeleting identifies if the backend is a deleting or not based on CR's deletionTimestamp

func (*CRDClientV1) ReplaceBackendAndUpdateVolumes

func (k *CRDClientV1) ReplaceBackendAndUpdateVolumes(
	ctx context.Context, origBackend, newBackend storage.Backend,
) error

ReplaceBackendAndUpdateVolumes accepts two backend objects (origBackend and newBackend) and uses the new backend object to replace the original one.

func (*CRDClientV1) SetVersion

func (k *CRDClientV1) SetVersion(ctx context.Context, version *config.PersistentStateVersion) error

func (*CRDClientV1) Stop

func (k *CRDClientV1) Stop() error

func (*CRDClientV1) UpdateBackend

func (k *CRDClientV1) UpdateBackend(ctx context.Context, update storage.Backend) error

UpdateBackend uses a Backend object to update a backend's persistent state

func (*CRDClientV1) UpdateGroupSnapshot

func (k *CRDClientV1) UpdateGroupSnapshot(ctx context.Context, groupSnapshot *storage.GroupSnapshot) error

func (*CRDClientV1) UpdateSnapshot

func (k *CRDClientV1) UpdateSnapshot(ctx context.Context, update *storage.Snapshot) error

func (*CRDClientV1) UpdateStorageClass

func (k *CRDClientV1) UpdateStorageClass(ctx context.Context, update *storageclass.StorageClass) error

func (*CRDClientV1) UpdateVolume

func (k *CRDClientV1) UpdateVolume(ctx context.Context, update *storage.Volume) (err error)

func (*CRDClientV1) UpdateVolumePublication

func (k *CRDClientV1) UpdateVolumePublication(ctx context.Context, publication *models.VolumePublication) error

func (*CRDClientV1) UpdateVolumeTransaction

func (k *CRDClientV1) UpdateVolumeTransaction(ctx context.Context, update *storage.VolumeTransaction) (err error)

type Client

type Client interface {
	GetTridentUUID(ctx context.Context) (string, error)
	GetVersion(ctx context.Context) (*config.PersistentStateVersion, error)
	SetVersion(ctx context.Context, version *config.PersistentStateVersion) error
	GetConfig() *ClientConfig
	GetType() StoreType
	Stop() error

	AddBackend(ctx context.Context, b storage.Backend) error
	GetBackend(ctx context.Context, backendName string) (*storage.BackendPersistent, error)
	UpdateBackend(ctx context.Context, b storage.Backend) error
	DeleteBackend(ctx context.Context, backend storage.Backend) error
	IsBackendDeleting(ctx context.Context, backend storage.Backend) bool
	GetBackends(ctx context.Context) ([]*storage.BackendPersistent, error)
	DeleteBackends(ctx context.Context) error
	ReplaceBackendAndUpdateVolumes(ctx context.Context, origBackend, newBackend storage.Backend) error
	GetBackendSecret(ctx context.Context, secretName string) (map[string]string, error)

	AddVolume(ctx context.Context, vol *storage.Volume) error
	GetVolume(ctx context.Context, volName string) (*storage.VolumeExternal, error)
	GetVolumes(ctx context.Context) ([]*storage.VolumeExternal, error)
	UpdateVolume(ctx context.Context, vol *storage.Volume) error
	DeleteVolume(ctx context.Context, vol *storage.Volume) error
	DeleteVolumes(ctx context.Context) error

	GetVolumeMoves(ctx context.Context) ([]*storage.VolumeMoveExternal, error)

	AddVolumeTransaction(ctx context.Context, volTxn *storage.VolumeTransaction) error
	GetVolumeTransaction(ctx context.Context, volTxn *storage.VolumeTransaction) (*storage.VolumeTransaction, error)
	GetVolumeTransactions(ctx context.Context) ([]*storage.VolumeTransaction, error)
	UpdateVolumeTransaction(ctx context.Context, volTxn *storage.VolumeTransaction) error
	DeleteVolumeTransaction(ctx context.Context, volTxn *storage.VolumeTransaction) error

	AddStorageClass(ctx context.Context, sc *storageclass.StorageClass) error
	UpdateStorageClass(ctx context.Context, sc *storageclass.StorageClass) error
	GetStorageClass(ctx context.Context, scName string) (*storageclass.Persistent, error)
	GetStorageClasses(ctx context.Context) ([]*storageclass.Persistent, error)
	DeleteStorageClass(ctx context.Context, sc *storageclass.StorageClass) error

	AddOrUpdateNode(ctx context.Context, n *models.Node) error
	GetNode(ctx context.Context, nName string) (*models.Node, error)
	GetNodes(ctx context.Context) ([]*models.Node, error)
	DeleteNode(ctx context.Context, n *models.Node) error

	AddVolumePublication(ctx context.Context, vp *models.VolumePublication) error
	UpdateVolumePublication(ctx context.Context, vp *models.VolumePublication) error
	GetVolumePublication(ctx context.Context, vpName string) (*models.VolumePublication, error)
	GetVolumePublications(ctx context.Context) ([]*models.VolumePublication, error)
	DeleteVolumePublication(ctx context.Context, vp *models.VolumePublication) error

	AddSnapshot(ctx context.Context, snapshot *storage.Snapshot) error
	GetSnapshot(ctx context.Context, volumeName, snapshotName string) (*storage.SnapshotPersistent, error)
	GetSnapshots(ctx context.Context) ([]*storage.SnapshotPersistent, error)
	UpdateSnapshot(ctx context.Context, snapshot *storage.Snapshot) error
	DeleteSnapshot(ctx context.Context, snapshot *storage.Snapshot) error
	DeleteSnapshots(ctx context.Context) error

	AddGroupSnapshot(ctx context.Context, groupSnapshot *storage.GroupSnapshot) error
	GetGroupSnapshot(ctx context.Context, groupSnapshotName string) (*storage.GroupSnapshotPersistent, error)
	GetGroupSnapshots(ctx context.Context) ([]*storage.GroupSnapshotPersistent, error)
	UpdateGroupSnapshot(ctx context.Context, groupSnapshot *storage.GroupSnapshot) error
	DeleteGroupSnapshot(ctx context.Context, groupSnapshot *storage.GroupSnapshot) error
	DeleteGroupSnapshots(ctx context.Context) error

	GetAutogrowPolicy(ctx context.Context, agPolicyName string) (*storage.AutogrowPolicyPersistent, error)
	GetAutogrowPolicies(ctx context.Context) ([]*storage.AutogrowPolicyPersistent, error)
}

type ClientConfig

type ClientConfig struct {
	TLSConfig *tls.Config
	// contains filtered or unexported fields
}

type DataMigrator

type DataMigrator struct {
	SourceClient Client
	DestClient   Client
	// contains filtered or unexported fields
}

func NewDataMigrator

func NewDataMigrator(SourceClient, DestClient Client, dryRun bool) *DataMigrator

func (*DataMigrator) Run

func (m *DataMigrator) Run() error

type Error

type Error struct {
	Message string
	Key     string
}

func NewPersistentStoreError

func NewPersistentStoreError(message, key string) *Error

func (*Error) Error

func (e *Error) Error() string

type InMemoryClient

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

func NewInMemoryClient

func NewInMemoryClient() *InMemoryClient

func (*InMemoryClient) AddBackend

func (c *InMemoryClient) AddBackend(ctx context.Context, b storage.Backend) error

func (*InMemoryClient) AddGroupSnapshot

func (c *InMemoryClient) AddGroupSnapshot(_ context.Context, groupSnapshot *storage.GroupSnapshot) error

func (*InMemoryClient) AddOrUpdateNode

func (c *InMemoryClient) AddOrUpdateNode(_ context.Context, n *models.Node) error

func (*InMemoryClient) AddSnapshot

func (c *InMemoryClient) AddSnapshot(_ context.Context, snapshot *storage.Snapshot) error

func (*InMemoryClient) AddStorageClass

func (c *InMemoryClient) AddStorageClass(_ context.Context, s *sc.StorageClass) error

func (*InMemoryClient) AddVolume

func (c *InMemoryClient) AddVolume(_ context.Context, vol *storage.Volume) error

func (*InMemoryClient) AddVolumePublication

func (c *InMemoryClient) AddVolumePublication(_ context.Context, vp *models.VolumePublication) error

func (*InMemoryClient) AddVolumeTransaction

func (c *InMemoryClient) AddVolumeTransaction(_ context.Context, volTxn *storage.VolumeTransaction) error

func (*InMemoryClient) DeleteBackend

func (c *InMemoryClient) DeleteBackend(ctx context.Context, b storage.Backend) error

func (*InMemoryClient) DeleteBackends

func (c *InMemoryClient) DeleteBackends(context.Context) error

func (*InMemoryClient) DeleteGroupSnapshot

func (c *InMemoryClient) DeleteGroupSnapshot(_ context.Context, groupSnapshot *storage.GroupSnapshot) error

func (*InMemoryClient) DeleteGroupSnapshots

func (c *InMemoryClient) DeleteGroupSnapshots(_ context.Context) error

DeleteGroupSnapshots deletes all group snapshots

func (*InMemoryClient) DeleteNode

func (c *InMemoryClient) DeleteNode(_ context.Context, n *models.Node) error

func (*InMemoryClient) DeleteSnapshot

func (c *InMemoryClient) DeleteSnapshot(_ context.Context, snapshot *storage.Snapshot) error

DeleteSnapshot deletes a snapshot from the persistent store

func (*InMemoryClient) DeleteSnapshots

func (c *InMemoryClient) DeleteSnapshots(context.Context) error

DeleteSnapshots deletes all snapshots

func (*InMemoryClient) DeleteStorageClass

func (c *InMemoryClient) DeleteStorageClass(_ context.Context, s *sc.StorageClass) error

func (*InMemoryClient) DeleteVolume

func (c *InMemoryClient) DeleteVolume(_ context.Context, vol *storage.Volume) error

func (*InMemoryClient) DeleteVolumePublication

func (c *InMemoryClient) DeleteVolumePublication(_ context.Context, vp *models.VolumePublication) error

func (*InMemoryClient) DeleteVolumeTransaction

func (c *InMemoryClient) DeleteVolumeTransaction(_ context.Context, volTxn *storage.VolumeTransaction) error

func (*InMemoryClient) DeleteVolumes

func (c *InMemoryClient) DeleteVolumes(context.Context) error

func (*InMemoryClient) GetAutogrowPolicies

func (c *InMemoryClient) GetAutogrowPolicies(_ context.Context) ([]*storage.AutogrowPolicyPersistent, error)

func (*InMemoryClient) GetAutogrowPolicy

func (c *InMemoryClient) GetAutogrowPolicy(_ context.Context, agPolicyName string) (*storage.AutogrowPolicyPersistent, error)

func (*InMemoryClient) GetBackend

func (c *InMemoryClient) GetBackend(_ context.Context, backendName string) (*storage.BackendPersistent, error)

func (*InMemoryClient) GetBackendSecret

func (c *InMemoryClient) GetBackendSecret(_ context.Context, _ string) (map[string]string, error)

func (*InMemoryClient) GetBackends

func (*InMemoryClient) GetConfig

func (c *InMemoryClient) GetConfig() *ClientConfig

func (*InMemoryClient) GetGroupSnapshot

func (c *InMemoryClient) GetGroupSnapshot(_ context.Context, groupSnapshotName string) (*storage.GroupSnapshotPersistent, error)

func (*InMemoryClient) GetGroupSnapshots

func (c *InMemoryClient) GetGroupSnapshots(_ context.Context) ([]*storage.GroupSnapshotPersistent, error)

func (*InMemoryClient) GetNode

func (c *InMemoryClient) GetNode(_ context.Context, nName string) (*models.Node, error)

func (*InMemoryClient) GetNodes

func (c *InMemoryClient) GetNodes(context.Context) ([]*models.Node, error)

func (*InMemoryClient) GetSnapshot

func (c *InMemoryClient) GetSnapshot(_ context.Context, volumeName, snapshotName string) (
	*storage.SnapshotPersistent, error,
)

GetSnapshot retrieves a snapshot state from the persistent store

func (*InMemoryClient) GetSnapshots

GetSnapshots retrieves all snapshots for all volumes

func (*InMemoryClient) GetStorageClass

func (c *InMemoryClient) GetStorageClass(_ context.Context, scName string) (*sc.Persistent, error)

func (*InMemoryClient) GetStorageClasses

func (c *InMemoryClient) GetStorageClasses(context.Context) ([]*sc.Persistent, error)

func (*InMemoryClient) GetTridentUUID

func (c *InMemoryClient) GetTridentUUID(_ context.Context) (string, error)

func (*InMemoryClient) GetType

func (c *InMemoryClient) GetType() StoreType

func (*InMemoryClient) GetVersion

func (*InMemoryClient) GetVolume

func (c *InMemoryClient) GetVolume(_ context.Context, volumeName string) (*storage.VolumeExternal, error)

func (*InMemoryClient) GetVolumeMoves

func (c *InMemoryClient) GetVolumeMoves(_ context.Context) ([]*storage.VolumeMoveExternal, error)

func (*InMemoryClient) GetVolumePublication

func (c *InMemoryClient) GetVolumePublication(_ context.Context, vpName string) (*models.VolumePublication, error)

func (*InMemoryClient) GetVolumePublications

func (c *InMemoryClient) GetVolumePublications(context.Context) ([]*models.VolumePublication, error)

func (*InMemoryClient) GetVolumeTransaction

func (c *InMemoryClient) GetVolumeTransaction(
	_ context.Context, volTxn *storage.VolumeTransaction,
) (*storage.VolumeTransaction, error)

func (*InMemoryClient) GetVolumeTransactions

func (c *InMemoryClient) GetVolumeTransactions(context.Context) ([]*storage.VolumeTransaction, error)

func (*InMemoryClient) GetVolumes

func (*InMemoryClient) IsBackendDeleting

func (c *InMemoryClient) IsBackendDeleting(ctx context.Context, backend storage.Backend) bool

func (*InMemoryClient) ReplaceBackendAndUpdateVolumes

func (c *InMemoryClient) ReplaceBackendAndUpdateVolumes(
	context.Context, storage.Backend, storage.Backend,
) error

ReplaceBackendAndUpdateVolumes renames a backend and updates all volumes to reflect the new backend name

func (*InMemoryClient) SetVersion

func (*InMemoryClient) Stop

func (c *InMemoryClient) Stop() error

func (*InMemoryClient) UpdateBackend

func (c *InMemoryClient) UpdateBackend(ctx context.Context, b storage.Backend) error

func (*InMemoryClient) UpdateGroupSnapshot

func (c *InMemoryClient) UpdateGroupSnapshot(_ context.Context, groupSnapshot *storage.GroupSnapshot) error

func (*InMemoryClient) UpdateSnapshot

func (c *InMemoryClient) UpdateSnapshot(_ context.Context, snapshot *storage.Snapshot) error

func (*InMemoryClient) UpdateStorageClass

func (c *InMemoryClient) UpdateStorageClass(_ context.Context, sc *sc.StorageClass) error

func (*InMemoryClient) UpdateVolume

func (c *InMemoryClient) UpdateVolume(_ context.Context, vol *storage.Volume) error

func (*InMemoryClient) UpdateVolumePublication

func (c *InMemoryClient) UpdateVolumePublication(_ context.Context, vp *models.VolumePublication) error

func (*InMemoryClient) UpdateVolumeTransaction

func (c *InMemoryClient) UpdateVolumeTransaction(_ context.Context, volTxn *storage.VolumeTransaction) error

type PassthroughClient

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

func NewPassthroughClient

func NewPassthroughClient(configPath string) (*PassthroughClient, error)

NewPassthroughClient returns a client that satisfies the persistent_store.Client interface, which is used by the orchestrator during bootstrapping. The passthrough store uses the storage as the source of truth, so it doesn't actually store anything. Instead, the store is pre-populated with backend objects from one or more backend config files prior to bootstrapping. The volume info is then read directly from the storage controllers during the bootstrapping process. The passthrough store does not need to persist any objects, including transactions and storage classes, once the orchestrator has started. The passthrough store is primarily useful for the Docker Volume Plugin use case, which doesn't easily support a separate persistence layer and has no support for storage classes.

func (*PassthroughClient) AddBackend

func (c *PassthroughClient) AddBackend(ctx context.Context, backend storage.Backend) error

func (*PassthroughClient) AddGroupSnapshot

func (*PassthroughClient) AddOrUpdateNode

func (c *PassthroughClient) AddOrUpdateNode(context.Context, *models.Node) error

func (*PassthroughClient) AddSnapshot

func (*PassthroughClient) AddStorageClass

func (c *PassthroughClient) AddStorageClass(context.Context, *sc.StorageClass) error

func (*PassthroughClient) AddVolume

func (*PassthroughClient) AddVolumePublication

func (c *PassthroughClient) AddVolumePublication(context.Context, *models.VolumePublication) error

func (*PassthroughClient) AddVolumeTransaction

func (c *PassthroughClient) AddVolumeTransaction(context.Context, *storage.VolumeTransaction) error

func (*PassthroughClient) DeleteBackend

func (c *PassthroughClient) DeleteBackend(_ context.Context, backend storage.Backend) error

func (*PassthroughClient) DeleteBackends

func (c *PassthroughClient) DeleteBackends(context.Context) error

func (*PassthroughClient) DeleteGroupSnapshot

func (c *PassthroughClient) DeleteGroupSnapshot(context.Context, *storage.GroupSnapshot) error

func (*PassthroughClient) DeleteGroupSnapshots

func (c *PassthroughClient) DeleteGroupSnapshots(context.Context) error

func (*PassthroughClient) DeleteNode

func (c *PassthroughClient) DeleteNode(context.Context, *models.Node) error

func (*PassthroughClient) DeleteSnapshot

func (c *PassthroughClient) DeleteSnapshot(context.Context, *storage.Snapshot) error

func (*PassthroughClient) DeleteSnapshots

func (c *PassthroughClient) DeleteSnapshots(context.Context) error

func (*PassthroughClient) DeleteStorageClass

func (c *PassthroughClient) DeleteStorageClass(context.Context, *sc.StorageClass) error

func (*PassthroughClient) DeleteVolume

func (c *PassthroughClient) DeleteVolume(context.Context, *storage.Volume) error

func (*PassthroughClient) DeleteVolumePublication

func (c *PassthroughClient) DeleteVolumePublication(context.Context, *models.VolumePublication) error

func (*PassthroughClient) DeleteVolumeTransaction

func (c *PassthroughClient) DeleteVolumeTransaction(context.Context, *storage.VolumeTransaction) error

func (*PassthroughClient) DeleteVolumes

func (c *PassthroughClient) DeleteVolumes(context.Context) error

func (*PassthroughClient) GetAutogrowPolicies

func (*PassthroughClient) GetAutogrowPolicy

func (*PassthroughClient) GetBackend

func (c *PassthroughClient) GetBackend(ctx context.Context, backendName string) (*storage.BackendPersistent, error)

func (*PassthroughClient) GetBackendSecret

func (c *PassthroughClient) GetBackendSecret(_ context.Context, _ string) (map[string]string, error)

func (*PassthroughClient) GetBackends

GetBackends is called by the orchestrator during bootstrapping, so the passthrough store returns the persistent backend objects it read from config files.

func (*PassthroughClient) GetConfig

func (c *PassthroughClient) GetConfig() *ClientConfig

func (*PassthroughClient) GetGroupSnapshot

func (*PassthroughClient) GetGroupSnapshots

func (*PassthroughClient) GetNode

func (c *PassthroughClient) GetNode(_ context.Context, nName string) (*models.Node, error)

func (*PassthroughClient) GetNodes

func (c *PassthroughClient) GetNodes(context.Context) ([]*models.Node, error)

func (*PassthroughClient) GetSnapshot

func (c *PassthroughClient) GetSnapshot(
	_ context.Context, _, snapshotName string,
) (*storage.SnapshotPersistent, error)

func (*PassthroughClient) GetSnapshots

GetSnapshots retrieves all snapshots

func (*PassthroughClient) GetStorageClass

func (c *PassthroughClient) GetStorageClass(_ context.Context, scName string) (*sc.Persistent, error)

func (*PassthroughClient) GetStorageClasses

func (c *PassthroughClient) GetStorageClasses(context.Context) ([]*sc.Persistent, error)

func (*PassthroughClient) GetTridentUUID

func (c *PassthroughClient) GetTridentUUID(_ context.Context) (string, error)

func (*PassthroughClient) GetType

func (c *PassthroughClient) GetType() StoreType

func (*PassthroughClient) GetVersion

func (*PassthroughClient) GetVolume

func (c *PassthroughClient) GetVolume(_ context.Context, volName string) (*storage.VolumeExternal, error)

GetVolume is not called by the orchestrator, which caches all volumes in memory after bootstrapping. So this method need not do anything.

func (*PassthroughClient) GetVolumeMoves

func (c *PassthroughClient) GetVolumeMoves(_ context.Context) ([]*storage.VolumeMoveExternal, error)

func (*PassthroughClient) GetVolumePublication

func (c *PassthroughClient) GetVolumePublication(_ context.Context, vpName string) (*models.VolumePublication, error)

func (*PassthroughClient) GetVolumePublications

func (c *PassthroughClient) GetVolumePublications(context.Context) ([]*models.VolumePublication, error)

func (*PassthroughClient) GetVolumeTransaction

func (*PassthroughClient) GetVolumeTransactions

func (c *PassthroughClient) GetVolumeTransactions(context.Context) ([]*storage.VolumeTransaction, error)

func (*PassthroughClient) GetVolumes

func (c *PassthroughClient) GetVolumes(ctx context.Context) ([]*storage.VolumeExternal, error)

GetVolumes gets up-to-date volume info from each storage backend. To increase efficiency, it contacts each backend in a separate goroutine. Because multiple backends may be managed by the orchestrator, the passthrough layer should remain as responsive as possible even if a backend is unavailable or returns an error during volume discovery.

func (*PassthroughClient) IsBackendDeleting

func (c *PassthroughClient) IsBackendDeleting(context.Context, storage.Backend) bool

func (*PassthroughClient) ReplaceBackendAndUpdateVolumes

func (c *PassthroughClient) ReplaceBackendAndUpdateVolumes(
	context.Context, storage.Backend, storage.Backend,
) error

ReplaceBackendAndUpdateVolumes renames a backend and updates all volumes to reflect the new backend name

func (*PassthroughClient) SetVersion

func (*PassthroughClient) Stop

func (c *PassthroughClient) Stop() error

func (*PassthroughClient) UpdateBackend

func (c *PassthroughClient) UpdateBackend(ctx context.Context, backend storage.Backend) error

func (*PassthroughClient) UpdateGroupSnapshot

func (c *PassthroughClient) UpdateGroupSnapshot(context.Context, *storage.GroupSnapshot) error

func (*PassthroughClient) UpdateSnapshot

func (c *PassthroughClient) UpdateSnapshot(context.Context, *storage.Snapshot) error

func (*PassthroughClient) UpdateStorageClass

func (c *PassthroughClient) UpdateStorageClass(context.Context, *sc.StorageClass) error

func (*PassthroughClient) UpdateVolume

func (c *PassthroughClient) UpdateVolume(context.Context, *storage.Volume) error

func (*PassthroughClient) UpdateVolumePublication

func (c *PassthroughClient) UpdateVolumePublication(context.Context, *models.VolumePublication) error

func (*PassthroughClient) UpdateVolumeTransaction

func (c *PassthroughClient) UpdateVolumeTransaction(context.Context, *storage.VolumeTransaction) error

type StoreType

type StoreType string
const (
	MemoryStore      StoreType = "memory"
	PassthroughStore StoreType = "passthrough"
	CRDV1Store       StoreType = "crdv1"
)

Directories

Path Synopsis
crd
apis/netapp/v1
This package has the automatically generated clientset.
This package has the automatically generated clientset.
client/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
client/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
client/clientset/versioned/typed/netapp/v1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
client/clientset/versioned/typed/netapp/v1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.

Jump to

Keyboard shortcuts

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