persistentstore

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

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 IsStatusNotFoundError

func IsStatusNotFoundError(err error) bool

func MatchKeyNotFoundErr

func MatchKeyNotFoundErr(err error) bool

Types

type CRDClient

type CRDClient interface {
	Client
	HasBackends(ctx context.Context) (bool, error)
	AddStorageClassPersistent(ctx context.Context, b *storageclass.Persistent) 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) AddBackendPersistent

func (k *CRDClientV1) AddBackendPersistent(ctx context.Context, backendPersistent *storage.BackendPersistent) error

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

func (*CRDClientV1) AddOrUpdateNode

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

func (*CRDClientV1) AddSnapshot

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

func (*CRDClientV1) AddStorageClass

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

func (*CRDClientV1) AddStorageClassPersistent

func (k *CRDClientV1) AddStorageClassPersistent(ctx context.Context, scp *storageclass.Persistent) error

func (*CRDClientV1) AddVolume

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

func (*CRDClientV1) AddVolumePersistent

func (k *CRDClientV1) AddVolumePersistent(ctx context.Context, volume *storage.VolumeExternal) error

AddVolumePersistent saves a volume's persistent state to the persistent store

func (*CRDClientV1) AddVolumePublication

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

func (*CRDClientV1) AddVolumeTransaction

func (k *CRDClientV1) AddVolumeTransaction(ctx context.Context, txn *storage.VolumeTransaction) 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) DeleteNode

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

func (*CRDClientV1) DeleteSnapshot

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

func (*CRDClientV1) DeleteSnapshotIgnoreNotFound

func (k *CRDClientV1) DeleteSnapshotIgnoreNotFound(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) error

func (*CRDClientV1) DeleteVolumeIgnoreNotFound

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

func (*CRDClientV1) DeleteVolumePublication

func (k *CRDClientV1) DeleteVolumePublication(ctx context.Context, vp *utils.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) 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) GetExistingVolumeTransaction

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

func (*CRDClientV1) GetNode

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

func (*CRDClientV1) GetNodes

func (k *CRDClientV1) GetNodes(ctx context.Context) ([]*utils.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) (*storage.VolumeExternal, error)

func (*CRDClientV1) GetVolumePublication

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

func (*CRDClientV1) GetVolumePublications

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

func (*CRDClientV1) GetVolumeTransactions

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

func (*CRDClientV1) GetVolumes

func (k *CRDClientV1) GetVolumes(ctx context.Context) ([]*storage.VolumeExternal, 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) (bool, error)

func (*CRDClientV1) HasVolumes

func (k *CRDClientV1) HasVolumes(ctx context.Context) (bool, 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) UpdateBackendPersistent

func (k *CRDClientV1) UpdateBackendPersistent(ctx context.Context, update *storage.BackendPersistent) error

UpdateBackendPersistent uses a BackendPersistent object to update a backend's persistent state

func (*CRDClientV1) UpdateSnapshot

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

func (*CRDClientV1) UpdateVolume

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

func (*CRDClientV1) UpdateVolumePersistent

func (k *CRDClientV1) UpdateVolumePersistent(ctx context.Context, update *storage.VolumeExternal) error

UpdateVolumePersistent updates a volume's persistent state

func (*CRDClientV1) UpdateVolumePublication

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

func (*CRDClientV1) UpdateVolumeTransaction

func (k *CRDClientV1) UpdateVolumeTransaction(ctx context.Context, update *storage.VolumeTransaction) 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
	AddBackendPersistent(ctx context.Context, b *storage.BackendPersistent) error
	GetBackend(ctx context.Context, backendName string) (*storage.BackendPersistent, error)
	UpdateBackend(ctx context.Context, b storage.Backend) error
	UpdateBackendPersistent(ctx context.Context, b *storage.BackendPersistent) 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
	AddVolumePersistent(ctx context.Context, vol *storage.VolumeExternal) error
	GetVolume(ctx context.Context, volName string) (*storage.VolumeExternal, error)
	UpdateVolume(ctx context.Context, vol *storage.Volume) error
	UpdateVolumePersistent(ctx context.Context, vol *storage.VolumeExternal) error
	DeleteVolume(ctx context.Context, vol *storage.Volume) error
	DeleteVolumeIgnoreNotFound(ctx context.Context, vol *storage.Volume) error
	GetVolumes(ctx context.Context) ([]*storage.VolumeExternal, error)
	DeleteVolumes(ctx context.Context) error

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

	AddStorageClass(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 *utils.Node) error
	GetNode(ctx context.Context, nName string) (*utils.Node, error)
	GetNodes(ctx context.Context) ([]*utils.Node, error)
	DeleteNode(ctx context.Context, n *utils.Node) error

	AddVolumePublication(ctx context.Context, vp *utils.VolumePublication) error
	UpdateVolumePublication(ctx context.Context, vp *utils.VolumePublication) error
	GetVolumePublication(ctx context.Context, vpName string) (*utils.VolumePublication, error)
	GetVolumePublications(ctx context.Context) ([]*utils.VolumePublication, error)
	DeleteVolumePublication(ctx context.Context, vp *utils.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
	DeleteSnapshotIgnoreNotFound(ctx context.Context, snapshot *storage.Snapshot) error
	DeleteSnapshots(ctx context.Context) 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) AddBackendPersistent

func (c *InMemoryClient) AddBackendPersistent(_ context.Context, backend *storage.BackendPersistent) error

func (*InMemoryClient) AddOrUpdateNode

func (c *InMemoryClient) AddOrUpdateNode(_ context.Context, n *utils.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) AddVolumePersistent

func (c *InMemoryClient) AddVolumePersistent(_ context.Context, volume *storage.VolumeExternal) error

AddVolumePersistent saves a volume's persistent state to the persistent store

func (*InMemoryClient) AddVolumePublication

func (c *InMemoryClient) AddVolumePublication(_ context.Context, vp *utils.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) DeleteNode

func (c *InMemoryClient) DeleteNode(_ context.Context, n *utils.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) DeleteSnapshotIgnoreNotFound

func (c *InMemoryClient) DeleteSnapshotIgnoreNotFound(ctx context.Context, snapshot *storage.Snapshot) error

DeleteSnapshotIgnoreNotFound deletes a snapshot from the persistent store, returning no error if the record does not exist.

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) DeleteVolumeIgnoreNotFound

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

func (*InMemoryClient) DeleteVolumePublication

func (c *InMemoryClient) DeleteVolumePublication(_ context.Context, vp *utils.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) 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) GetExistingVolumeTransaction

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

func (*InMemoryClient) GetNode

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

func (*InMemoryClient) GetNodes

func (c *InMemoryClient) GetNodes(context.Context) ([]*utils.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) GetVolumePublication

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

func (*InMemoryClient) GetVolumePublications

func (c *InMemoryClient) GetVolumePublications(context.Context) ([]*utils.VolumePublication, 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) UpdateBackendPersistent

func (c *InMemoryClient) UpdateBackendPersistent(_ context.Context, update *storage.BackendPersistent) error

UpdateBackendPersistent updates a backend's persistent state

func (*InMemoryClient) UpdateSnapshot

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

func (*InMemoryClient) UpdateVolume

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

func (*InMemoryClient) UpdateVolumePersistent

func (c *InMemoryClient) UpdateVolumePersistent(_ context.Context, volume *storage.VolumeExternal) error

UpdateVolumePersistent updates a volume's persistent state

func (*InMemoryClient) UpdateVolumePublication

func (c *InMemoryClient) UpdateVolumePublication(_ context.Context, vp *utils.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) AddBackendPersistent

func (c *PassthroughClient) AddBackendPersistent(context.Context, *storage.BackendPersistent) error

func (*PassthroughClient) AddOrUpdateNode

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

func (*PassthroughClient) AddSnapshot

func (*PassthroughClient) AddStorageClass

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

func (*PassthroughClient) AddVolume

func (*PassthroughClient) AddVolumePersistent

func (c *PassthroughClient) AddVolumePersistent(context.Context, *storage.VolumeExternal) error

AddVolumePersistent saves a volume's persistent state to the persistent store

func (*PassthroughClient) AddVolumePublication

func (c *PassthroughClient) AddVolumePublication(context.Context, *utils.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) DeleteNode

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

func (*PassthroughClient) DeleteSnapshot

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

func (*PassthroughClient) DeleteSnapshotIgnoreNotFound

func (c *PassthroughClient) DeleteSnapshotIgnoreNotFound(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) DeleteVolumeIgnoreNotFound

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

func (*PassthroughClient) DeleteVolumePublication

func (c *PassthroughClient) DeleteVolumePublication(context.Context, *utils.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) 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) GetExistingVolumeTransaction

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

func (*PassthroughClient) GetNode

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

func (*PassthroughClient) GetNodes

func (c *PassthroughClient) GetNodes(context.Context) ([]*utils.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) GetVolumePublication

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

func (*PassthroughClient) GetVolumePublications

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

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) UpdateBackendPersistent

func (c *PassthroughClient) UpdateBackendPersistent(context.Context, *storage.BackendPersistent) error

UpdateBackendPersistent updates a backend's persistent state

func (*PassthroughClient) UpdateSnapshot

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

func (*PassthroughClient) UpdateVolume

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

func (*PassthroughClient) UpdateVolumePersistent

func (c *PassthroughClient) UpdateVolumePersistent(context.Context, *storage.VolumeExternal) error

UpdateVolumePersistent updates a volume's persistent state

func (*PassthroughClient) UpdateVolumePublication

func (c *PassthroughClient) UpdateVolumePublication(context.Context, *utils.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