Documentation ¶
Index ¶
- Constants
- Variables
- func MatchKeyNotFoundErr(err error) bool
- func MatchUnavailableClusterErr(err error) bool
- type Client
- type ClientConfig
- type DataMigrator
- type Error
- type EtcdClient
- type EtcdClientV2
- func (p *EtcdClientV2) AddBackend(b *storage.Backend) error
- func (p *EtcdClientV2) AddStorageClass(sc *storageclass.StorageClass) error
- func (p *EtcdClientV2) AddVolume(vol *storage.Volume) error
- func (p *EtcdClientV2) AddVolumeTransaction(volTxn *VolumeTransaction) error
- func (p *EtcdClientV2) Create(key, value string) error
- func (p *EtcdClientV2) Delete(key string) error
- func (p *EtcdClientV2) DeleteBackend(backend *storage.Backend) error
- func (p *EtcdClientV2) DeleteBackends() error
- func (p *EtcdClientV2) DeleteKeys(keyPrefix string) error
- func (p *EtcdClientV2) DeleteStorageClass(sc *storageclass.StorageClass) error
- func (p *EtcdClientV2) DeleteVolume(vol *storage.Volume) error
- func (p *EtcdClientV2) DeleteVolumeIgnoreNotFound(vol *storage.Volume) error
- func (p *EtcdClientV2) DeleteVolumeTransaction(volTxn *VolumeTransaction) error
- func (p *EtcdClientV2) DeleteVolumes() error
- func (p *EtcdClientV2) GetBackend(backendName string) (*storage.BackendPersistent, error)
- func (p *EtcdClientV2) GetBackends() ([]*storage.BackendPersistent, error)
- func (p *EtcdClientV2) GetConfig() *ClientConfig
- func (p *EtcdClientV2) GetExistingVolumeTransaction(volTxn *VolumeTransaction) (*VolumeTransaction, error)
- func (p *EtcdClientV2) GetStorageClass(scName string) (*storageclass.Persistent, error)
- func (p *EtcdClientV2) GetStorageClasses() ([]*storageclass.Persistent, error)
- func (p *EtcdClientV2) GetType() StoreType
- func (p *EtcdClientV2) GetVersion() (*PersistentStateVersion, error)
- func (p *EtcdClientV2) GetVolume(volName string) (*storage.VolumeExternal, error)
- func (p *EtcdClientV2) GetVolumeTransactions() ([]*VolumeTransaction, error)
- func (p *EtcdClientV2) GetVolumes() ([]*storage.VolumeExternal, error)
- func (p *EtcdClientV2) Read(key string) (string, error)
- func (p *EtcdClientV2) ReadKeys(keyPrefix string) ([]string, error)
- func (p *EtcdClientV2) ReplaceBackendAndUpdateVolumes(origBackend, newBackend *storage.Backend) error
- func (p *EtcdClientV2) Set(key, value string) error
- func (p *EtcdClientV2) SetVersion(version *PersistentStateVersion) error
- func (p *EtcdClientV2) Stop() error
- func (p *EtcdClientV2) Update(key, value string) error
- func (p *EtcdClientV2) UpdateBackend(b *storage.Backend) error
- func (p *EtcdClientV2) UpdateVolume(vol *storage.Volume) error
- type EtcdClientV3
- func (p *EtcdClientV3) AddBackend(b *storage.Backend) error
- func (p *EtcdClientV3) AddBackendSTM(s conc.STM, b *storage.Backend) error
- func (p *EtcdClientV3) AddStorageClass(sc *storageclass.StorageClass) error
- func (p *EtcdClientV3) AddVolume(vol *storage.Volume) error
- func (p *EtcdClientV3) AddVolumeTransaction(volTxn *VolumeTransaction) error
- func (p *EtcdClientV3) Create(key, value string) error
- func (p *EtcdClientV3) CreateSTM(s conc.STM, key, value string) error
- func (p *EtcdClientV3) Delete(key string) error
- func (p *EtcdClientV3) DeleteBackend(backend *storage.Backend) error
- func (p *EtcdClientV3) DeleteBackendSTM(s conc.STM, backend *storage.Backend) error
- func (p *EtcdClientV3) DeleteBackends() error
- func (p *EtcdClientV3) DeleteKeys(keyPrefix string) error
- func (p *EtcdClientV3) DeleteSTM(s conc.STM, key string) error
- func (p *EtcdClientV3) DeleteStorageClass(sc *storageclass.StorageClass) error
- func (p *EtcdClientV3) DeleteVolume(vol *storage.Volume) error
- func (p *EtcdClientV3) DeleteVolumeIgnoreNotFound(vol *storage.Volume) error
- func (p *EtcdClientV3) DeleteVolumeTransaction(volTxn *VolumeTransaction) error
- func (p *EtcdClientV3) DeleteVolumes() error
- func (p *EtcdClientV3) GetBackend(backendName string) (*storage.BackendPersistent, error)
- func (p *EtcdClientV3) GetBackends() ([]*storage.BackendPersistent, error)
- func (p *EtcdClientV3) GetConfig() *ClientConfig
- func (p *EtcdClientV3) GetExistingVolumeTransaction(volTxn *VolumeTransaction) (*VolumeTransaction, error)
- func (p *EtcdClientV3) GetStorageClass(scName string) (*storageclass.Persistent, error)
- func (p *EtcdClientV3) GetStorageClasses() ([]*storageclass.Persistent, error)
- func (p *EtcdClientV3) GetType() StoreType
- func (p *EtcdClientV3) GetVersion() (*PersistentStateVersion, error)
- func (p *EtcdClientV3) GetVolume(volName string) (*storage.VolumeExternal, error)
- func (p *EtcdClientV3) GetVolumeSTM(s conc.STM, volName string) (*storage.VolumeExternal, error)
- func (p *EtcdClientV3) GetVolumeTransactions() ([]*VolumeTransaction, error)
- func (p *EtcdClientV3) GetVolumes() ([]*storage.VolumeExternal, error)
- func (p *EtcdClientV3) GetVolumesSTM(s conc.STM) ([]*storage.VolumeExternal, error)
- func (p *EtcdClientV3) Read(key string) (string, error)
- func (p *EtcdClientV3) ReadKeys(keyPrefix string) ([]string, error)
- func (p *EtcdClientV3) ReadSTM(s conc.STM, key string) (string, error)
- func (p *EtcdClientV3) ReplaceBackendAndUpdateVolumes(origBackend, newBackend *storage.Backend) error
- func (p *EtcdClientV3) Set(key, value string) error
- func (p *EtcdClientV3) SetSTM(s conc.STM, key, value string) error
- func (p *EtcdClientV3) SetVersion(version *PersistentStateVersion) error
- func (p *EtcdClientV3) Stop() error
- func (p *EtcdClientV3) Update(key, value string) error
- func (p *EtcdClientV3) UpdateBackend(b *storage.Backend) error
- func (p *EtcdClientV3) UpdateSTM(s conc.STM, key, value string) error
- func (p *EtcdClientV3) UpdateVolume(vol *storage.Volume) error
- func (p *EtcdClientV3) UpdateVolumeSTM(s conc.STM, vol *storage.Volume) error
- type EtcdDataMigrator
- type InMemoryClient
- func (c *InMemoryClient) AddBackend(b *storage.Backend) error
- func (c *InMemoryClient) AddStorageClass(s *sc.StorageClass) error
- func (c *InMemoryClient) AddVolume(vol *storage.Volume) error
- func (c *InMemoryClient) AddVolumeTransaction(volTxn *VolumeTransaction) error
- func (c *InMemoryClient) DeleteBackend(b *storage.Backend) error
- func (c *InMemoryClient) DeleteBackends() error
- func (c *InMemoryClient) DeleteStorageClass(s *sc.StorageClass) error
- func (c *InMemoryClient) DeleteVolume(vol *storage.Volume) error
- func (c *InMemoryClient) DeleteVolumeIgnoreNotFound(vol *storage.Volume) error
- func (c *InMemoryClient) DeleteVolumeTransaction(volTxn *VolumeTransaction) error
- func (c *InMemoryClient) DeleteVolumes() error
- func (c *InMemoryClient) GetBackend(backendName string) (*storage.BackendPersistent, error)
- func (c *InMemoryClient) GetBackends() ([]*storage.BackendPersistent, error)
- func (c *InMemoryClient) GetConfig() *ClientConfig
- func (c *InMemoryClient) GetExistingVolumeTransaction(volTxn *VolumeTransaction) (*VolumeTransaction, error)
- func (c *InMemoryClient) GetStorageClass(scName string) (*sc.Persistent, error)
- func (c *InMemoryClient) GetStorageClasses() ([]*sc.Persistent, error)
- func (c *InMemoryClient) GetType() StoreType
- func (c *InMemoryClient) GetVersion() (*PersistentStateVersion, error)
- func (c *InMemoryClient) GetVolume(volumeName string) (*storage.VolumeExternal, error)
- func (c *InMemoryClient) GetVolumeTransactions() ([]*VolumeTransaction, error)
- func (c *InMemoryClient) GetVolumes() ([]*storage.VolumeExternal, error)
- func (c *InMemoryClient) ReplaceBackendAndUpdateVolumes(origBackend, newBackend *storage.Backend) error
- func (c *InMemoryClient) SetVersion(version *PersistentStateVersion) error
- func (c *InMemoryClient) Stop() error
- func (c *InMemoryClient) UpdateBackend(b *storage.Backend) error
- func (c *InMemoryClient) UpdateVolume(vol *storage.Volume) error
- type PassthroughClient
- func (c *PassthroughClient) AddBackend(backend *storage.Backend) error
- func (c *PassthroughClient) AddStorageClass(sc *sc.StorageClass) error
- func (c *PassthroughClient) AddVolume(vol *storage.Volume) error
- func (c *PassthroughClient) AddVolumeTransaction(volTxn *VolumeTransaction) error
- func (c *PassthroughClient) DeleteBackend(backend *storage.Backend) error
- func (c *PassthroughClient) DeleteBackends() error
- func (c *PassthroughClient) DeleteStorageClass(sc *sc.StorageClass) error
- func (c *PassthroughClient) DeleteVolume(vol *storage.Volume) error
- func (c *PassthroughClient) DeleteVolumeIgnoreNotFound(vol *storage.Volume) error
- func (c *PassthroughClient) DeleteVolumeTransaction(volTxn *VolumeTransaction) error
- func (c *PassthroughClient) DeleteVolumes() error
- func (c *PassthroughClient) GetBackend(backendName string) (*storage.BackendPersistent, error)
- func (c *PassthroughClient) GetBackends() ([]*storage.BackendPersistent, error)
- func (c *PassthroughClient) GetConfig() *ClientConfig
- func (c *PassthroughClient) GetExistingVolumeTransaction(volTxn *VolumeTransaction) (*VolumeTransaction, error)
- func (c *PassthroughClient) GetStorageClass(scName string) (*sc.Persistent, error)
- func (c *PassthroughClient) GetStorageClasses() ([]*sc.Persistent, error)
- func (c *PassthroughClient) GetType() StoreType
- func (c *PassthroughClient) GetVersion() (*PersistentStateVersion, error)
- func (c *PassthroughClient) GetVolume(volName string) (*storage.VolumeExternal, error)
- func (c *PassthroughClient) GetVolumeTransactions() ([]*VolumeTransaction, error)
- func (c *PassthroughClient) GetVolumes() ([]*storage.VolumeExternal, error)
- func (c *PassthroughClient) ReplaceBackendAndUpdateVolumes(origBackend, newBackend *storage.Backend) error
- func (c *PassthroughClient) SetVersion(version *PersistentStateVersion) error
- func (c *PassthroughClient) Stop() error
- func (c *PassthroughClient) UpdateBackend(backend *storage.Backend) error
- func (c *PassthroughClient) UpdateVolume(vol *storage.Volume) error
- type PersistentStateVersion
- type StoreType
- type VolumeOperation
- type VolumeTransaction
Constants ¶
const ( KeyNotFoundErr = "Unable to find key" KeyExistsErr = "Key already exists" NotSupported = "Unsupported operation" )
Variables ¶
var ( //TODO: Change for the later versions of etcd (etcd v3.1.5 doesn't return any error unfound keys but later versions do) ErrKeyNotFound = errors.New("etcdserver: key not found") )
Functions ¶
func MatchKeyNotFoundErr ¶
Types ¶
type Client ¶
type Client interface { GetVersion() (*PersistentStateVersion, error) SetVersion(version *PersistentStateVersion) error GetConfig() *ClientConfig GetType() StoreType Stop() error AddBackend(b *storage.Backend) error GetBackend(backendName string) (*storage.BackendPersistent, error) UpdateBackend(b *storage.Backend) error DeleteBackend(backend *storage.Backend) error GetBackends() ([]*storage.BackendPersistent, error) DeleteBackends() error ReplaceBackendAndUpdateVolumes(origBackend, newBackend *storage.Backend) error AddVolume(vol *storage.Volume) error GetVolume(volName string) (*storage.VolumeExternal, error) UpdateVolume(vol *storage.Volume) error DeleteVolume(vol *storage.Volume) error DeleteVolumeIgnoreNotFound(vol *storage.Volume) error GetVolumes() ([]*storage.VolumeExternal, error) DeleteVolumes() error AddVolumeTransaction(volTxn *VolumeTransaction) error GetVolumeTransactions() ([]*VolumeTransaction, error) GetExistingVolumeTransaction(volTxn *VolumeTransaction) (*VolumeTransaction, error) DeleteVolumeTransaction(volTxn *VolumeTransaction) error AddStorageClass(sc *storageclass.StorageClass) error GetStorageClass(scName string) (*storageclass.Persistent, error) GetStorageClasses() ([]*storageclass.Persistent, error) DeleteStorageClass(sc *storageclass.StorageClass) error }
type ClientConfig ¶
type DataMigrator ¶
func NewDataMigrator ¶
func NewDataMigrator(destClient Client, sourceType StoreType) *DataMigrator
type Error ¶
Error is used to turn etcd errors into something that callers can understand without having to import the client library
func NewPersistentStoreError ¶
type EtcdClient ¶
type EtcdClientV2 ¶
type EtcdClientV2 struct {
// contains filtered or unexported fields
}
func NewEtcdClientV2 ¶
func NewEtcdClientV2(endpoints string) (*EtcdClientV2, error)
func NewEtcdClientV2FromConfig ¶
func NewEtcdClientV2FromConfig(etcdConfig *ClientConfig) (*EtcdClientV2, error)
func (*EtcdClientV2) AddBackend ¶
func (p *EtcdClientV2) AddBackend(b *storage.Backend) error
AddBackend saves the minimally required backend state to the persistent store
func (*EtcdClientV2) AddStorageClass ¶
func (p *EtcdClientV2) AddStorageClass(sc *storageclass.StorageClass) error
func (*EtcdClientV2) AddVolume ¶
func (p *EtcdClientV2) AddVolume(vol *storage.Volume) error
AddVolume saves a volume's state to the persistent store
func (*EtcdClientV2) AddVolumeTransaction ¶
func (p *EtcdClientV2) AddVolumeTransaction(volTxn *VolumeTransaction) error
AddVolumeTransaction logs an AddVolume operation
func (*EtcdClientV2) Create ¶
func (p *EtcdClientV2) Create(key, value string) error
Create is the abstract CRUD interface
func (*EtcdClientV2) Delete ¶
func (p *EtcdClientV2) Delete(key string) error
func (*EtcdClientV2) DeleteBackend ¶
func (p *EtcdClientV2) DeleteBackend(backend *storage.Backend) error
DeleteBackend deletes the backend state on the persistent store
func (*EtcdClientV2) DeleteBackends ¶
func (p *EtcdClientV2) DeleteBackends() error
DeleteBackends deletes all backends
func (*EtcdClientV2) DeleteKeys ¶
func (p *EtcdClientV2) DeleteKeys(keyPrefix string) error
DeleteKeys deletes all the keys with the designated prefix
func (*EtcdClientV2) DeleteStorageClass ¶
func (p *EtcdClientV2) DeleteStorageClass(sc *storageclass.StorageClass) error
DeleteStorageClass deletes a storage class's state from the persistent store
func (*EtcdClientV2) DeleteVolume ¶
func (p *EtcdClientV2) DeleteVolume(vol *storage.Volume) error
DeleteVolume deletes a volume's state from the persistent store
func (*EtcdClientV2) DeleteVolumeIgnoreNotFound ¶
func (p *EtcdClientV2) DeleteVolumeIgnoreNotFound(vol *storage.Volume) error
func (*EtcdClientV2) DeleteVolumeTransaction ¶
func (p *EtcdClientV2) DeleteVolumeTransaction(volTxn *VolumeTransaction) error
DeleteVolumeTransaction deletes an AddVolume log
func (*EtcdClientV2) DeleteVolumes ¶
func (p *EtcdClientV2) DeleteVolumes() error
DeleteVolumes deletes all volumes
func (*EtcdClientV2) GetBackend ¶
func (p *EtcdClientV2) GetBackend(backendName string) (*storage.BackendPersistent, error)
GetBackend retrieves a backend from the persistent store
func (*EtcdClientV2) GetBackends ¶
func (p *EtcdClientV2) GetBackends() ([]*storage.BackendPersistent, error)
GetBackends retrieves all backends
func (*EtcdClientV2) GetConfig ¶
func (p *EtcdClientV2) GetConfig() *ClientConfig
GetConfig returns the configuration for the etcd client
func (*EtcdClientV2) GetExistingVolumeTransaction ¶
func (p *EtcdClientV2) GetExistingVolumeTransaction( volTxn *VolumeTransaction, ) (*VolumeTransaction, error)
GetExistingVolumeTransaction returns an existing version of the current volume transaction, if it exists. If no volume transaction with the same key exists, it returns nil.
func (*EtcdClientV2) GetStorageClass ¶
func (p *EtcdClientV2) GetStorageClass(scName string) (*storageclass.Persistent, error)
func (*EtcdClientV2) GetStorageClasses ¶
func (p *EtcdClientV2) GetStorageClasses() ([]*storageclass.Persistent, error)
func (*EtcdClientV2) GetType ¶
func (p *EtcdClientV2) GetType() StoreType
GetType returns the persistent store type
func (*EtcdClientV2) GetVersion ¶
func (p *EtcdClientV2) GetVersion() (*PersistentStateVersion, error)
GetVersion returns the version of the persistent data
func (*EtcdClientV2) GetVolume ¶
func (p *EtcdClientV2) GetVolume(volName string) (*storage.VolumeExternal, error)
GetVolume retrieves a volume's state from the persistent store
func (*EtcdClientV2) GetVolumeTransactions ¶
func (p *EtcdClientV2) GetVolumeTransactions() ([]*VolumeTransaction, error)
GetVolumeTransactions retrieves AddVolume logs
func (*EtcdClientV2) GetVolumes ¶
func (p *EtcdClientV2) GetVolumes() ([]*storage.VolumeExternal, error)
GetVolumes retrieves all volumes
func (*EtcdClientV2) ReadKeys ¶
func (p *EtcdClientV2) ReadKeys(keyPrefix string) ([]string, error)
ReadKeys returns all the keys with the designated prefix
func (*EtcdClientV2) ReplaceBackendAndUpdateVolumes ¶
func (p *EtcdClientV2) ReplaceBackendAndUpdateVolumes( origBackend, newBackend *storage.Backend) error
ReplaceBackendAndUpdateVolumes renames a backend and updates all volumes to reflect the new backend name
func (*EtcdClientV2) Set ¶
func (p *EtcdClientV2) Set(key, value string) error
func (*EtcdClientV2) SetVersion ¶
func (p *EtcdClientV2) SetVersion(version *PersistentStateVersion) error
SetVersion sets the version of the persistent data
func (*EtcdClientV2) Update ¶
func (p *EtcdClientV2) Update(key, value string) error
func (*EtcdClientV2) UpdateBackend ¶
func (p *EtcdClientV2) UpdateBackend(b *storage.Backend) error
UpdateBackend updates the backend state on the persistent store
func (*EtcdClientV2) UpdateVolume ¶
func (p *EtcdClientV2) UpdateVolume(vol *storage.Volume) error
UpdateVolume updates a volume's state on the persistent store
type EtcdClientV3 ¶
type EtcdClientV3 struct {
// contains filtered or unexported fields
}
func NewEtcdClientV3 ¶
func NewEtcdClientV3(endpoints string) (*EtcdClientV3, error)
func NewEtcdClientV3FromConfig ¶
func NewEtcdClientV3FromConfig(etcdConfig *ClientConfig) (*EtcdClientV3, error)
func NewEtcdClientV3WithTLS ¶
func NewEtcdClientV3WithTLS(endpoints, etcdV3Cert, etcdV3CACert, etcdV3Key string) (*EtcdClientV3, error)
func (*EtcdClientV3) AddBackend ¶
func (p *EtcdClientV3) AddBackend(b *storage.Backend) error
AddBackend saves the minimally required backend state to the persistent store
func (*EtcdClientV3) AddBackendSTM ¶
AddBackendSTM saves the minimally required backend state to the persistent store using STM
func (*EtcdClientV3) AddStorageClass ¶
func (p *EtcdClientV3) AddStorageClass(sc *storageclass.StorageClass) error
func (*EtcdClientV3) AddVolume ¶
func (p *EtcdClientV3) AddVolume(vol *storage.Volume) error
AddVolume saves a volume's state to the persistent store
func (*EtcdClientV3) AddVolumeTransaction ¶
func (p *EtcdClientV3) AddVolumeTransaction(volTxn *VolumeTransaction) error
AddVolumeTransaction logs an AddVolume operation
func (*EtcdClientV3) Create ¶
func (p *EtcdClientV3) Create(key, value string) error
Create creates a key in etcd
func (*EtcdClientV3) CreateSTM ¶
func (p *EtcdClientV3) CreateSTM(s conc.STM, key, value string) error
Create creates a key in etcd using STM
func (*EtcdClientV3) Delete ¶
func (p *EtcdClientV3) Delete(key string) error
func (*EtcdClientV3) DeleteBackend ¶
func (p *EtcdClientV3) DeleteBackend(backend *storage.Backend) error
DeleteBackend deletes the backend state on the persistent store
func (*EtcdClientV3) DeleteBackendSTM ¶
DeleteBackendSTM deletes the backend state on the persistent store using STM
func (*EtcdClientV3) DeleteBackends ¶
func (p *EtcdClientV3) DeleteBackends() error
DeleteBackends deletes all backends
func (*EtcdClientV3) DeleteKeys ¶
func (p *EtcdClientV3) DeleteKeys(keyPrefix string) error
DeleteKeys deletes all the keys with the designated prefix
func (*EtcdClientV3) DeleteStorageClass ¶
func (p *EtcdClientV3) DeleteStorageClass(sc *storageclass.StorageClass) error
DeleteStorageClass deletes a storage class's state from the persistent store
func (*EtcdClientV3) DeleteVolume ¶
func (p *EtcdClientV3) DeleteVolume(vol *storage.Volume) error
DeleteVolume deletes a volume's state from the persistent store
func (*EtcdClientV3) DeleteVolumeIgnoreNotFound ¶
func (p *EtcdClientV3) DeleteVolumeIgnoreNotFound(vol *storage.Volume) error
func (*EtcdClientV3) DeleteVolumeTransaction ¶
func (p *EtcdClientV3) DeleteVolumeTransaction(volTxn *VolumeTransaction) error
DeleteVolumeTransaction deletes an AddVolume log
func (*EtcdClientV3) DeleteVolumes ¶
func (p *EtcdClientV3) DeleteVolumes() error
DeleteVolumes deletes all volumes
func (*EtcdClientV3) GetBackend ¶
func (p *EtcdClientV3) GetBackend(backendName string) (*storage.BackendPersistent, error)
GetBackend retrieves a backend from the persistent store
func (*EtcdClientV3) GetBackends ¶
func (p *EtcdClientV3) GetBackends() ([]*storage.BackendPersistent, error)
GetBackends retrieves all backends
func (*EtcdClientV3) GetConfig ¶
func (p *EtcdClientV3) GetConfig() *ClientConfig
GetConfig returns the configuration for the etcd client
func (*EtcdClientV3) GetExistingVolumeTransaction ¶
func (p *EtcdClientV3) GetExistingVolumeTransaction( volTxn *VolumeTransaction, ) (*VolumeTransaction, error)
GetExistingVolumeTransaction returns an existing version of the current volume transaction, if it exists. If no volume transaction with the same key exists, it returns nil.
func (*EtcdClientV3) GetStorageClass ¶
func (p *EtcdClientV3) GetStorageClass(scName string) (*storageclass.Persistent, error)
func (*EtcdClientV3) GetStorageClasses ¶
func (p *EtcdClientV3) GetStorageClasses() ([]*storageclass.Persistent, error)
func (*EtcdClientV3) GetType ¶
func (p *EtcdClientV3) GetType() StoreType
GetType returns the persistent store type
func (*EtcdClientV3) GetVersion ¶
func (p *EtcdClientV3) GetVersion() (*PersistentStateVersion, error)
GetVersion returns the version of the persistent data
func (*EtcdClientV3) GetVolume ¶
func (p *EtcdClientV3) GetVolume(volName string) (*storage.VolumeExternal, error)
GetVolume retrieves a volume's state from the persistent store
func (*EtcdClientV3) GetVolumeSTM ¶
func (p *EtcdClientV3) GetVolumeSTM(s conc.STM, volName string) (*storage.VolumeExternal, error)
GetVolumeSTM retrieves a volume's state from the persistent store using STM
func (*EtcdClientV3) GetVolumeTransactions ¶
func (p *EtcdClientV3) GetVolumeTransactions() ([]*VolumeTransaction, error)
GetVolumeTransactions retrieves AddVolume logs
func (*EtcdClientV3) GetVolumes ¶
func (p *EtcdClientV3) GetVolumes() ([]*storage.VolumeExternal, error)
GetVolumes retrieves all volumes
func (*EtcdClientV3) GetVolumesSTM ¶
func (p *EtcdClientV3) GetVolumesSTM(s conc.STM) ([]*storage.VolumeExternal, error)
GetVolumesSTM retrieves all volumes using STM
func (*EtcdClientV3) Read ¶
func (p *EtcdClientV3) Read(key string) (string, error)
Read reads a key from etcd
func (*EtcdClientV3) ReadKeys ¶
func (p *EtcdClientV3) ReadKeys(keyPrefix string) ([]string, error)
ReadKeys returns all the keys with the designated prefix
func (*EtcdClientV3) ReplaceBackendAndUpdateVolumes ¶
func (p *EtcdClientV3) ReplaceBackendAndUpdateVolumes(origBackend, newBackend *storage.Backend) error
ReplaceBackendAndUpdateVolumes replaces a backend and updates all volumes to reflect the new backend.
func (*EtcdClientV3) Set ¶
func (p *EtcdClientV3) Set(key, value string) error
func (*EtcdClientV3) SetVersion ¶
func (p *EtcdClientV3) SetVersion(version *PersistentStateVersion) error
SetVersion sets the version of the persistent data
func (*EtcdClientV3) Update ¶
func (p *EtcdClientV3) Update(key, value string) error
func (*EtcdClientV3) UpdateBackend ¶
func (p *EtcdClientV3) UpdateBackend(b *storage.Backend) error
UpdateBackend updates the backend state on the persistent store
func (*EtcdClientV3) UpdateSTM ¶
func (p *EtcdClientV3) UpdateSTM(s conc.STM, key, value string) error
func (*EtcdClientV3) UpdateVolume ¶
func (p *EtcdClientV3) UpdateVolume(vol *storage.Volume) error
UpdateVolume updates a volume's state on the persistent store
func (*EtcdClientV3) UpdateVolumeSTM ¶
UpdateVolumeSTM updates a volume's state on the persistent store using STM
type EtcdDataMigrator ¶
type EtcdDataMigrator struct { SourceClient EtcdClient DestClient EtcdClient }
func NewEtcdDataMigrator ¶
func NewEtcdDataMigrator(SourceClient, DestClient EtcdClient) *EtcdDataMigrator
func (*EtcdDataMigrator) Start ¶
func (m *EtcdDataMigrator) Start(keyPrefix string, deleteSrc bool) error
func (*EtcdDataMigrator) Stop ¶
func (m *EtcdDataMigrator) Stop() error
type InMemoryClient ¶
type InMemoryClient struct {
// contains filtered or unexported fields
}
func NewInMemoryClient ¶
func NewInMemoryClient() *InMemoryClient
func (*InMemoryClient) AddBackend ¶
func (c *InMemoryClient) AddBackend(b *storage.Backend) error
func (*InMemoryClient) AddStorageClass ¶
func (c *InMemoryClient) AddStorageClass(s *sc.StorageClass) error
func (*InMemoryClient) AddVolumeTransaction ¶
func (c *InMemoryClient) AddVolumeTransaction(volTxn *VolumeTransaction) error
func (*InMemoryClient) DeleteBackend ¶
func (c *InMemoryClient) DeleteBackend(b *storage.Backend) error
func (*InMemoryClient) DeleteBackends ¶
func (c *InMemoryClient) DeleteBackends() error
func (*InMemoryClient) DeleteStorageClass ¶
func (c *InMemoryClient) DeleteStorageClass(s *sc.StorageClass) error
func (*InMemoryClient) DeleteVolume ¶
func (c *InMemoryClient) DeleteVolume(vol *storage.Volume) error
func (*InMemoryClient) DeleteVolumeIgnoreNotFound ¶
func (c *InMemoryClient) DeleteVolumeIgnoreNotFound(vol *storage.Volume) error
func (*InMemoryClient) DeleteVolumeTransaction ¶
func (c *InMemoryClient) DeleteVolumeTransaction(volTxn *VolumeTransaction) error
func (*InMemoryClient) DeleteVolumes ¶
func (c *InMemoryClient) DeleteVolumes() error
func (*InMemoryClient) GetBackend ¶
func (c *InMemoryClient) GetBackend(backendName string) (*storage.BackendPersistent, error)
func (*InMemoryClient) GetBackends ¶
func (c *InMemoryClient) GetBackends() ([]*storage.BackendPersistent, error)
func (*InMemoryClient) GetConfig ¶
func (c *InMemoryClient) GetConfig() *ClientConfig
func (*InMemoryClient) GetExistingVolumeTransaction ¶
func (c *InMemoryClient) GetExistingVolumeTransaction( volTxn *VolumeTransaction) (*VolumeTransaction, error, )
func (*InMemoryClient) GetStorageClass ¶
func (c *InMemoryClient) GetStorageClass(scName string) ( *sc.Persistent, error, )
func (*InMemoryClient) GetStorageClasses ¶
func (c *InMemoryClient) GetStorageClasses() ( []*sc.Persistent, error, )
func (*InMemoryClient) GetType ¶
func (c *InMemoryClient) GetType() StoreType
func (*InMemoryClient) GetVersion ¶
func (c *InMemoryClient) GetVersion() (*PersistentStateVersion, error)
func (*InMemoryClient) GetVolume ¶
func (c *InMemoryClient) GetVolume(volumeName string) ( *storage.VolumeExternal, error, )
func (*InMemoryClient) GetVolumeTransactions ¶
func (c *InMemoryClient) GetVolumeTransactions() ([]*VolumeTransaction, error)
func (*InMemoryClient) GetVolumes ¶
func (c *InMemoryClient) GetVolumes() ([]*storage.VolumeExternal, error)
func (*InMemoryClient) ReplaceBackendAndUpdateVolumes ¶
func (c *InMemoryClient) ReplaceBackendAndUpdateVolumes( origBackend, newBackend *storage.Backend) error
ReplaceBackendAndUpdateVolumes renames a backend and updates all volumes to reflect the new backend name
func (*InMemoryClient) SetVersion ¶
func (c *InMemoryClient) SetVersion(version *PersistentStateVersion) error
func (*InMemoryClient) Stop ¶
func (c *InMemoryClient) Stop() error
func (*InMemoryClient) UpdateBackend ¶
func (c *InMemoryClient) UpdateBackend(b *storage.Backend) error
func (*InMemoryClient) UpdateVolume ¶
func (c *InMemoryClient) UpdateVolume(vol *storage.Volume) 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(backend *storage.Backend) error
func (*PassthroughClient) AddStorageClass ¶
func (c *PassthroughClient) AddStorageClass(sc *sc.StorageClass) error
func (*PassthroughClient) AddVolume ¶
func (c *PassthroughClient) AddVolume(vol *storage.Volume) error
func (*PassthroughClient) AddVolumeTransaction ¶
func (c *PassthroughClient) AddVolumeTransaction(volTxn *VolumeTransaction) error
func (*PassthroughClient) DeleteBackend ¶
func (c *PassthroughClient) DeleteBackend(backend *storage.Backend) error
func (*PassthroughClient) DeleteBackends ¶
func (c *PassthroughClient) DeleteBackends() error
func (*PassthroughClient) DeleteStorageClass ¶
func (c *PassthroughClient) DeleteStorageClass(sc *sc.StorageClass) error
func (*PassthroughClient) DeleteVolume ¶
func (c *PassthroughClient) DeleteVolume(vol *storage.Volume) error
func (*PassthroughClient) DeleteVolumeIgnoreNotFound ¶
func (c *PassthroughClient) DeleteVolumeIgnoreNotFound(vol *storage.Volume) error
func (*PassthroughClient) DeleteVolumeTransaction ¶
func (c *PassthroughClient) DeleteVolumeTransaction(volTxn *VolumeTransaction) error
func (*PassthroughClient) DeleteVolumes ¶
func (c *PassthroughClient) DeleteVolumes() error
func (*PassthroughClient) GetBackend ¶
func (c *PassthroughClient) GetBackend(backendName string) (*storage.BackendPersistent, error)
func (*PassthroughClient) GetBackends ¶
func (c *PassthroughClient) GetBackends() ([]*storage.BackendPersistent, error)
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(volTxn *VolumeTransaction) (*VolumeTransaction, error)
func (*PassthroughClient) GetStorageClass ¶
func (c *PassthroughClient) GetStorageClass(scName string) (*sc.Persistent, error)
func (*PassthroughClient) GetStorageClasses ¶
func (c *PassthroughClient) GetStorageClasses() ([]*sc.Persistent, error)
func (*PassthroughClient) GetType ¶
func (c *PassthroughClient) GetType() StoreType
func (*PassthroughClient) GetVersion ¶
func (c *PassthroughClient) GetVersion() (*PersistentStateVersion, error)
func (*PassthroughClient) GetVolume ¶
func (c *PassthroughClient) GetVolume(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) GetVolumeTransactions ¶
func (c *PassthroughClient) GetVolumeTransactions() ([]*VolumeTransaction, error)
func (*PassthroughClient) GetVolumes ¶
func (c *PassthroughClient) GetVolumes() ([]*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) ReplaceBackendAndUpdateVolumes ¶
func (c *PassthroughClient) ReplaceBackendAndUpdateVolumes( origBackend, newBackend *storage.Backend) error
ReplaceBackendAndUpdateVolumes renames a backend and updates all volumes to reflect the new backend name
func (*PassthroughClient) SetVersion ¶
func (c *PassthroughClient) SetVersion(version *PersistentStateVersion) error
func (*PassthroughClient) Stop ¶
func (c *PassthroughClient) Stop() error
func (*PassthroughClient) UpdateBackend ¶
func (c *PassthroughClient) UpdateBackend(backend *storage.Backend) error
func (*PassthroughClient) UpdateVolume ¶
func (c *PassthroughClient) UpdateVolume(vol *storage.Volume) error
type PersistentStateVersion ¶
type VolumeOperation ¶
type VolumeOperation string
const ( AddVolume VolumeOperation = "addVolume" DeleteVolume VolumeOperation = "deleteVolume" ResizeVolume VolumeOperation = "resizeVolume" )
type VolumeTransaction ¶
type VolumeTransaction struct { Config *storage.VolumeConfig Op VolumeOperation }