Documentation ¶
Index ¶
- func GetFakeInternalName(name string) string
- func IsBootstrapError(err error) bool
- func IsNotFoundError(err error) bool
- func IsNotReadyError(err error) bool
- type BootstrapError
- type MockOrchestrator
- func (m *MockOrchestrator) AddBackend(configJSON string) (*storage.BackendExternal, error)
- func (m *MockOrchestrator) AddFrontend(f frontend.Plugin)
- func (m *MockOrchestrator) AddMockONTAPNFSBackend(name, lif string) *storage.BackendExternal
- func (m *MockOrchestrator) AddStorageClass(scConfig *storageclass.Config) (*storageclass.External, error)
- func (m *MockOrchestrator) AddVolume(volumeConfig *storage.VolumeConfig) (*storage.VolumeExternal, error)
- func (m *MockOrchestrator) AttachVolume(volumeName, mountpoint string, publishInfo *utils.VolumePublishInfo) error
- func (m *MockOrchestrator) Bootstrap() error
- func (m *MockOrchestrator) CloneVolume(volumeConfig *storage.VolumeConfig) (*storage.VolumeExternal, error)
- func (m *MockOrchestrator) DeleteStorageClass(scName string) error
- func (m *MockOrchestrator) DeleteVolume(volumeName string) error
- func (m *MockOrchestrator) DetachVolume(volumeName, mountpoint string) error
- func (m *MockOrchestrator) GetBackend(backend string) (*storage.BackendExternal, error)
- func (m *MockOrchestrator) GetDriverTypeForVolume(vol *storage.VolumeExternal) (string, error)
- func (m *MockOrchestrator) GetStorageClass(scName string) (*storageclass.External, error)
- func (m *MockOrchestrator) GetVersion() (string, error)
- func (m *MockOrchestrator) GetVolume(volume string) (*storage.VolumeExternal, error)
- func (m *MockOrchestrator) GetVolumeType(vol *storage.VolumeExternal) (config.VolumeType, error)
- func (m *MockOrchestrator) ListBackends() ([]*storage.BackendExternal, error)
- func (m *MockOrchestrator) ListStorageClasses() ([]*storageclass.External, error)
- func (m *MockOrchestrator) ListVolumeSnapshots(volumeName string) ([]*storage.SnapshotExternal, error)
- func (m *MockOrchestrator) ListVolumes() ([]*storage.VolumeExternal, error)
- func (m *MockOrchestrator) ListVolumesByPlugin(pluginName string) ([]*storage.VolumeExternal, error)
- func (m *MockOrchestrator) OfflineBackend(backend string) error
- func (m *MockOrchestrator) PublishVolume(volumeName string, publishInfo *utils.VolumePublishInfo) error
- func (m *MockOrchestrator) ReloadVolumes() error
- func (m *MockOrchestrator) ResizeVolume(volumeName, newSize string) error
- func (m *MockOrchestrator) UpdateBackend(backendName, configJSON string) (storageBackendExternal *storage.BackendExternal, err error)
- func (m *MockOrchestrator) ValidateVolumes(t *testing.T, expectedConfigs []*storage.VolumeConfig) bool
- type NotFoundError
- type NotReadyError
- type Orchestrator
- type TridentOrchestrator
- func (o *TridentOrchestrator) AddBackend(configJSON string) (*storage.BackendExternal, error)
- func (o *TridentOrchestrator) AddFrontend(f frontend.Plugin)
- func (o *TridentOrchestrator) AddStorageClass(scConfig *storageclass.Config) (*storageclass.External, error)
- func (o *TridentOrchestrator) AddVolume(volumeConfig *storage.VolumeConfig) (externalVol *storage.VolumeExternal, err error)
- func (o *TridentOrchestrator) AttachVolume(volumeName, mountpoint string, publishInfo *utils.VolumePublishInfo) error
- func (o *TridentOrchestrator) Bootstrap() error
- func (o *TridentOrchestrator) CloneVolume(volumeConfig *storage.VolumeConfig) (externalVol *storage.VolumeExternal, err error)
- func (o *TridentOrchestrator) DeleteStorageClass(scName string) error
- func (o *TridentOrchestrator) DeleteVolume(volumeName string) (err error)
- func (o *TridentOrchestrator) DetachVolume(volumeName, mountpoint string) error
- func (o *TridentOrchestrator) GetBackend(backendName string) (*storage.BackendExternal, error)
- func (o *TridentOrchestrator) GetDriverTypeForVolume(vol *storage.VolumeExternal) (string, error)
- func (o *TridentOrchestrator) GetStorageClass(scName string) (*storageclass.External, error)
- func (o *TridentOrchestrator) GetVersion() (string, error)
- func (o *TridentOrchestrator) GetVolume(volume string) (*storage.VolumeExternal, error)
- func (o *TridentOrchestrator) GetVolumeType(vol *storage.VolumeExternal) (volumeType config.VolumeType, err error)
- func (o *TridentOrchestrator) ListBackends() ([]*storage.BackendExternal, error)
- func (o *TridentOrchestrator) ListStorageClasses() ([]*storageclass.External, error)
- func (o *TridentOrchestrator) ListVolumeSnapshots(volumeName string) ([]*storage.SnapshotExternal, error)
- func (o *TridentOrchestrator) ListVolumes() ([]*storage.VolumeExternal, error)
- func (o *TridentOrchestrator) ListVolumesByPlugin(pluginName string) ([]*storage.VolumeExternal, error)
- func (o *TridentOrchestrator) OfflineBackend(backendName string) error
- func (o *TridentOrchestrator) PublishVolume(volumeName string, publishInfo *utils.VolumePublishInfo) error
- func (o *TridentOrchestrator) ReloadVolumes() error
- func (o *TridentOrchestrator) ResizeVolume(volumeName, newSize string) (err error)
- func (o *TridentOrchestrator) UpdateBackend(backendName, configJSON string) (backendExternal *storage.BackendExternal, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFakeInternalName ¶
func IsBootstrapError ¶
func IsNotFoundError ¶
func IsNotReadyError ¶
Types ¶
type BootstrapError ¶
type BootstrapError struct {
// contains filtered or unexported fields
}
func (*BootstrapError) Error ¶
func (e *BootstrapError) Error() string
type MockOrchestrator ¶
type MockOrchestrator struct {
// contains filtered or unexported fields
}
MockOrchestrator is a struct that implements the Orchestrator interface for use in testing frontends. Although it retains the appearance of correct functionality for this purpose, all functions are effectively nops. Note: Many of the getter methods are copied verbatim from TridentOrchestrator, since their functionality is not inherently interesting or testable.
func NewMockOrchestrator ¶
func NewMockOrchestrator() *MockOrchestrator
func (*MockOrchestrator) AddBackend ¶
func (m *MockOrchestrator) AddBackend(configJSON string) (*storage.BackendExternal, error)
TODO: Add extra methods to add backends without needing to provide a valid, stringified JSON config.
func (*MockOrchestrator) AddFrontend ¶
func (m *MockOrchestrator) AddFrontend(f frontend.Plugin)
func (*MockOrchestrator) AddMockONTAPNFSBackend ¶
func (m *MockOrchestrator) AddMockONTAPNFSBackend(name, lif string) *storage.BackendExternal
func (*MockOrchestrator) AddStorageClass ¶
func (m *MockOrchestrator) AddStorageClass( scConfig *storageclass.Config, ) (*storageclass.External, error)
func (*MockOrchestrator) AddVolume ¶
func (m *MockOrchestrator) AddVolume(volumeConfig *storage.VolumeConfig) (*storage.VolumeExternal, error)
func (*MockOrchestrator) AttachVolume ¶
func (m *MockOrchestrator) AttachVolume(volumeName, mountpoint string, publishInfo *utils.VolumePublishInfo) error
func (*MockOrchestrator) Bootstrap ¶
func (m *MockOrchestrator) Bootstrap() error
func (*MockOrchestrator) CloneVolume ¶
func (m *MockOrchestrator) CloneVolume(volumeConfig *storage.VolumeConfig) (*storage.VolumeExternal, error)
func (*MockOrchestrator) DeleteStorageClass ¶
func (m *MockOrchestrator) DeleteStorageClass(scName string) error
func (*MockOrchestrator) DeleteVolume ¶
func (m *MockOrchestrator) DeleteVolume(volumeName string) error
func (*MockOrchestrator) DetachVolume ¶
func (m *MockOrchestrator) DetachVolume(volumeName, mountpoint string) error
func (*MockOrchestrator) GetBackend ¶
func (m *MockOrchestrator) GetBackend(backend string) (*storage.BackendExternal, error)
func (*MockOrchestrator) GetDriverTypeForVolume ¶
func (m *MockOrchestrator) GetDriverTypeForVolume( vol *storage.VolumeExternal, ) (string, error)
Copied verbatim from TridentOrchestrator
func (*MockOrchestrator) GetStorageClass ¶
func (m *MockOrchestrator) GetStorageClass(scName string) (*storageclass.External, error)
func (*MockOrchestrator) GetVersion ¶
func (m *MockOrchestrator) GetVersion() (string, error)
func (*MockOrchestrator) GetVolume ¶
func (m *MockOrchestrator) GetVolume(volume string) (*storage.VolumeExternal, error)
func (*MockOrchestrator) GetVolumeType ¶
func (m *MockOrchestrator) GetVolumeType(vol *storage.VolumeExternal) (config.VolumeType, error)
Copied verbatim from TridentOrchestrator
func (*MockOrchestrator) ListBackends ¶
func (m *MockOrchestrator) ListBackends() ([]*storage.BackendExternal, error)
func (*MockOrchestrator) ListStorageClasses ¶
func (m *MockOrchestrator) ListStorageClasses() ([]*storageclass.External, error)
func (*MockOrchestrator) ListVolumeSnapshots ¶
func (m *MockOrchestrator) ListVolumeSnapshots(volumeName string) ([]*storage.SnapshotExternal, error)
func (*MockOrchestrator) ListVolumes ¶
func (m *MockOrchestrator) ListVolumes() ([]*storage.VolumeExternal, error)
func (*MockOrchestrator) ListVolumesByPlugin ¶
func (m *MockOrchestrator) ListVolumesByPlugin(pluginName string) ([]*storage.VolumeExternal, error)
func (*MockOrchestrator) OfflineBackend ¶
func (m *MockOrchestrator) OfflineBackend(backend string) error
func (*MockOrchestrator) PublishVolume ¶
func (m *MockOrchestrator) PublishVolume( volumeName string, publishInfo *utils.VolumePublishInfo) error
func (*MockOrchestrator) ReloadVolumes ¶
func (m *MockOrchestrator) ReloadVolumes() error
func (*MockOrchestrator) ResizeVolume ¶
func (m *MockOrchestrator) ResizeVolume(volumeName, newSize string) error
func (*MockOrchestrator) UpdateBackend ¶
func (m *MockOrchestrator) UpdateBackend(backendName, configJSON string) ( storageBackendExternal *storage.BackendExternal, err error)
UpdateBackend updates an existing backend
func (*MockOrchestrator) ValidateVolumes ¶
func (m *MockOrchestrator) ValidateVolumes( t *testing.T, expectedConfigs []*storage.VolumeConfig, ) bool
type NotFoundError ¶
type NotFoundError struct {
// contains filtered or unexported fields
}
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
type NotReadyError ¶
type NotReadyError struct {
// contains filtered or unexported fields
}
func (*NotReadyError) Error ¶
func (e *NotReadyError) Error() string
type Orchestrator ¶
type Orchestrator interface { Bootstrap() error AddFrontend(f frontend.Plugin) GetVersion() (string, error) AddBackend(configJSON string) (*storage.BackendExternal, error) UpdateBackend(backendName, configJSON string) (storageBackendExternal *storage.BackendExternal, err error) GetBackend(backend string) (*storage.BackendExternal, error) ListBackends() ([]*storage.BackendExternal, error) OfflineBackend(backend string) error AddVolume(volumeConfig *storage.VolumeConfig) (*storage.VolumeExternal, error) CloneVolume(volumeConfig *storage.VolumeConfig) (*storage.VolumeExternal, error) GetVolume(volume string) (*storage.VolumeExternal, error) GetDriverTypeForVolume(vol *storage.VolumeExternal) (string, error) GetVolumeType(vol *storage.VolumeExternal) (config.VolumeType, error) ListVolumes() ([]*storage.VolumeExternal, error) DeleteVolume(volume string) error ListVolumesByPlugin(pluginName string) ([]*storage.VolumeExternal, error) PublishVolume(volumeName string, publishInfo *utils.VolumePublishInfo) error AttachVolume(volumeName, mountpoint string, publishInfo *utils.VolumePublishInfo) error DetachVolume(volumeName, mountpoint string) error ListVolumeSnapshots(volumeName string) ([]*storage.SnapshotExternal, error) ReloadVolumes() error ResizeVolume(volumeName, newSize string) error AddStorageClass(scConfig *storageclass.Config) (*storageclass.External, error) GetStorageClass(scName string) (*storageclass.External, error) ListStorageClasses() ([]*storageclass.External, error) DeleteStorageClass(scName string) error }
type TridentOrchestrator ¶
type TridentOrchestrator struct {
// contains filtered or unexported fields
}
func NewTridentOrchestrator ¶
func NewTridentOrchestrator(client persistentstore.Client) *TridentOrchestrator
NewTridentOrchestrator returns a storage orchestrator instance
func (*TridentOrchestrator) AddBackend ¶
func (o *TridentOrchestrator) AddBackend(configJSON string) (*storage.BackendExternal, error)
AddBackend handles creation of a new storage backend
func (*TridentOrchestrator) AddFrontend ¶
func (o *TridentOrchestrator) AddFrontend(f frontend.Plugin)
func (*TridentOrchestrator) AddStorageClass ¶
func (o *TridentOrchestrator) AddStorageClass(scConfig *storageclass.Config) (*storageclass.External, error)
func (*TridentOrchestrator) AddVolume ¶
func (o *TridentOrchestrator) AddVolume(volumeConfig *storage.VolumeConfig) ( externalVol *storage.VolumeExternal, err error)
func (*TridentOrchestrator) AttachVolume ¶
func (o *TridentOrchestrator) AttachVolume( volumeName, mountpoint string, publishInfo *utils.VolumePublishInfo, ) error
AttachVolume mounts a volume to the local host. This method is currently only used by Docker, and it should be able to accomplish its task using only the data passed in; it should not need to use the storage controller API. It may be assumed that this method always runs on the host to which the volume will be attached.
func (*TridentOrchestrator) Bootstrap ¶
func (o *TridentOrchestrator) Bootstrap() error
func (*TridentOrchestrator) CloneVolume ¶
func (o *TridentOrchestrator) CloneVolume(volumeConfig *storage.VolumeConfig) ( externalVol *storage.VolumeExternal, err error)
func (*TridentOrchestrator) DeleteStorageClass ¶
func (o *TridentOrchestrator) DeleteStorageClass(scName string) error
func (*TridentOrchestrator) DeleteVolume ¶
func (o *TridentOrchestrator) DeleteVolume(volumeName string) (err error)
DeleteVolume does the necessary set up to delete a volume during the course of normal operation, verifying that the volume is present in Trident and creating a transaction to ensure that the delete eventually completes.
func (*TridentOrchestrator) DetachVolume ¶
func (o *TridentOrchestrator) DetachVolume(volumeName, mountpoint string) error
DetachVolume unmounts a volume from the local host. This method is currently only used by Docker, and it should be able to accomplish its task using only the data passed in; it should not need to use the storage controller API. It may be assumed that this method always runs on the host to which the volume will be attached. It ensures the volume is already mounted, and it attempts to delete the mount point.
func (*TridentOrchestrator) GetBackend ¶
func (o *TridentOrchestrator) GetBackend(backendName string) (*storage.BackendExternal, error)
func (*TridentOrchestrator) GetDriverTypeForVolume ¶
func (o *TridentOrchestrator) GetDriverTypeForVolume(vol *storage.VolumeExternal) (string, error)
func (*TridentOrchestrator) GetStorageClass ¶
func (o *TridentOrchestrator) GetStorageClass(scName string) (*storageclass.External, error)
func (*TridentOrchestrator) GetVersion ¶
func (o *TridentOrchestrator) GetVersion() (string, error)
func (*TridentOrchestrator) GetVolume ¶
func (o *TridentOrchestrator) GetVolume(volume string) (*storage.VolumeExternal, error)
func (*TridentOrchestrator) GetVolumeType ¶
func (o *TridentOrchestrator) GetVolumeType(vol *storage.VolumeExternal) ( volumeType config.VolumeType, err error, )
func (*TridentOrchestrator) ListBackends ¶
func (o *TridentOrchestrator) ListBackends() ([]*storage.BackendExternal, error)
func (*TridentOrchestrator) ListStorageClasses ¶
func (o *TridentOrchestrator) ListStorageClasses() ([]*storageclass.External, error)
func (*TridentOrchestrator) ListVolumeSnapshots ¶
func (o *TridentOrchestrator) ListVolumeSnapshots(volumeName string) ([]*storage.SnapshotExternal, error)
func (*TridentOrchestrator) ListVolumes ¶
func (o *TridentOrchestrator) ListVolumes() ([]*storage.VolumeExternal, error)
func (*TridentOrchestrator) ListVolumesByPlugin ¶
func (o *TridentOrchestrator) ListVolumesByPlugin(pluginName string) ([]*storage.VolumeExternal, error)
func (*TridentOrchestrator) OfflineBackend ¶
func (o *TridentOrchestrator) OfflineBackend(backendName string) error
func (*TridentOrchestrator) PublishVolume ¶
func (o *TridentOrchestrator) PublishVolume( volumeName string, publishInfo *utils.VolumePublishInfo, ) error
func (*TridentOrchestrator) ReloadVolumes ¶
func (o *TridentOrchestrator) ReloadVolumes() error
func (*TridentOrchestrator) ResizeVolume ¶
func (o *TridentOrchestrator) ResizeVolume(volumeName, newSize string) (err error)
ResizeVolume resizes a volume to the new size.
func (*TridentOrchestrator) UpdateBackend ¶
func (o *TridentOrchestrator) UpdateBackend(backendName, configJSON string) ( backendExternal *storage.BackendExternal, err error)
UpdateBackend updates an existing backend.