Documentation ¶
Index ¶
- Constants
- type Backend
- func (b *Backend) AddStoragePool(pool *Pool)
- func (b *Backend) AddVolume(volConfig *VolumeConfig, storagePool *Pool, ...) (*Volume, error)
- func (b *Backend) CloneVolume(volConfig *VolumeConfig) (*Volume, error)
- func (b *Backend) ConstructExternal() *BackendExternal
- func (b *Backend) ConstructPersistent() *BackendPersistent
- func (b *Backend) GetDriverName() string
- func (b *Backend) GetProtocol() tridentconfig.Protocol
- func (b *Backend) GetUpdateType(origBackend *Backend) *roaring.Bitmap
- func (b *Backend) HasVolumes() bool
- func (b *Backend) RemoveVolume(vol *Volume) error
- func (b *Backend) ResizeVolume(volName, newSize string) error
- func (b *Backend) Terminate()
- type BackendExternal
- type BackendPersistent
- type Driver
- type PersistentStorageBackendConfig
- type Pool
- type PoolExternal
- type Snapshot
- type SnapshotExternal
- type Volume
- type VolumeConfig
- type VolumeExternal
- type VolumeExternalWrapper
Constants ¶
View Source
const ( BackendRename = iota VolumeAccessInfoChange InvalidUpdate )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct { Driver Driver Name string Online bool Storage map[string]*Pool Volumes map[string]*Volume }
func NewStorageBackend ¶
func (*Backend) AddStoragePool ¶
func (*Backend) CloneVolume ¶
func (b *Backend) CloneVolume(volConfig *VolumeConfig) (*Volume, error)
func (*Backend) ConstructExternal ¶
func (b *Backend) ConstructExternal() *BackendExternal
func (*Backend) ConstructPersistent ¶
func (b *Backend) ConstructPersistent() *BackendPersistent
func (*Backend) GetDriverName ¶
func (*Backend) GetProtocol ¶
func (b *Backend) GetProtocol() tridentconfig.Protocol
func (*Backend) GetUpdateType ¶
func (*Backend) HasVolumes ¶
HasVolumes returns true if the Backend has one or more volumes provisioned on it.
func (*Backend) RemoveVolume ¶
func (*Backend) ResizeVolume ¶
type BackendExternal ¶
type BackendExternal struct { Name string `json:"name"` Protocol tridentconfig.Protocol `json:"protocol"` Config interface{} `json:"config"` Storage map[string]*PoolExternal `json:"storage"` Online bool `json:"online"` Volumes []string `json:"volumes"` }
type BackendPersistent ¶
type BackendPersistent struct { Version string `json:"version"` Config PersistentStorageBackendConfig `json:"config"` Name string `json:"name"` Online bool `json:"online"` }
func (*BackendPersistent) MarshalConfig ¶
func (p *BackendPersistent) MarshalConfig() (string, error)
Unfortunately, this method appears to be necessary to avoid arbitrary values ending up in the json.RawMessage fields of CommonStorageDriverConfig. Ideally, BackendPersistent would just store a serialized config, but doing so appears to cause problems with the json.RawMessage fields.
type Driver ¶
type Driver interface { Name() string Initialize(tridentconfig.DriverContext, string, *drivers.CommonStorageDriverConfig) error Initialized() bool // Terminate tells the driver to clean up, as it won't be called again. Terminate() Create(name string, sizeBytes uint64, opts map[string]string) error CreateClone(name, source, snapshot string, opts map[string]string) error Destroy(name string) error Publish(name string, publishInfo *utils.VolumePublishInfo) error SnapshotList(name string) ([]Snapshot, error) Get(name string) error Resize(name string, sizeBytes uint64) error CreatePrepare(volConfig *VolumeConfig) bool // CreateFollowup adds necessary information for accessing the volume to VolumeConfig. CreateFollowup(volConfig *VolumeConfig) error // GetInternalVolumeName will return a name that satisfies any character // constraints present on the backend and that will be unique to Trident. // The latter requirement should generally be done by prepending the // value of CommonStorageDriver.SnapshotPrefix to the name. GetInternalVolumeName(name string) string GetStorageBackendSpecs(backend *Backend) error GetVolumeOpts( volConfig *VolumeConfig, pool *Pool, requests map[string]storageattribute.Request, ) (map[string]string, error) GetProtocol() tridentconfig.Protocol StoreConfig(b *PersistentStorageBackendConfig) // GetExternalConfig returns a version of the driver configuration that // lacks confidential information, such as usernames and passwords. GetExternalConfig() interface{} GetVolumeExternal(name string) (*VolumeExternal, error) GetVolumeExternalWrappers(chan *VolumeExternalWrapper) GetUpdateType(driver Driver) *roaring.Bitmap }
Driver provides a common interface for storage related operations
type PersistentStorageBackendConfig ¶
type PersistentStorageBackendConfig struct { OntapConfig *drivers.OntapStorageDriverConfig `json:"ontap_config,omitempty"` SolidfireConfig *drivers.SolidfireStorageDriverConfig `json:"solidfire_config,omitempty"` EseriesConfig *drivers.ESeriesStorageDriverConfig `json:"eseries_config,omitempty"` FakeStorageDriverConfig *drivers.FakeStorageDriverConfig `json:"fake_config,omitempty"` }
type Pool ¶
type Pool struct { Name string // A Trident storage pool can potentially satisfy more than one storage // class. StorageClasses []string Backend *Backend Attributes map[string]sa.Offer }
func NewStoragePool ¶
func (*Pool) AddStorageClass ¶
func (*Pool) ConstructExternal ¶
func (pool *Pool) ConstructExternal() *PoolExternal
func (*Pool) RemoveStorageClass ¶
type PoolExternal ¶
type Snapshot ¶
type Snapshot struct { Name string // The snapshot name or other identifier you would use to reference it Created string // The UTC time that the snapshot was created, in RFC3339 format }
Snapshot contains the normalized volume snapshot format we report to Docker
func (*Snapshot) ConstructExternal ¶
func (s *Snapshot) ConstructExternal() *SnapshotExternal
type SnapshotExternal ¶
type SnapshotExternal struct {
Snapshot
}
type Volume ¶
type Volume struct { Config *VolumeConfig Backend string // Name of the storage backend Pool string // Name of the pool on which this volume was first provisioned Orphaned bool // An Orphaned volume isn't currently tracked by the storage backend }
func NewVolume ¶
func NewVolume(conf *VolumeConfig, backend string, pool string, orphaned bool) *Volume
func (*Volume) ConstructExternal ¶
func (v *Volume) ConstructExternal() *VolumeExternal
type VolumeConfig ¶
type VolumeConfig struct { Version string `json:"version"` Name string `json:"name"` InternalName string `json:"internalName"` Size string `json:"size"` Protocol config.Protocol `json:"protocol"` SpaceReserve string `json:"spaceReserve"` SecurityStyle string `json:"securityStyle"` SnapshotPolicy string `json:"snapshotPolicy,omitempty"` SnapshotReserve string `json:"snapshotReserve,omitempty"` SnapshotDir string `json:"snapshotDirectory,omitempty"` ExportPolicy string `json:"exportPolicy,omitempty"` UnixPermissions string `json:"unixPermissions,omitempty"` StorageClass string `json:"storageClass,omitempty"` AccessMode config.AccessMode `json:"accessMode,omitempty"` AccessInfo utils.VolumeAccessInfo `json:"accessInformation"` BlockSize string `json:"blockSize"` FileSystem string `json:"fileSystem"` Encryption string `json:"encryption"` CloneSourceVolume string `json:"cloneSourceVolume"` CloneSourceVolumeInternal string `json:"cloneSourceVolumeInternal"` CloneSourceSnapshot string `json:"cloneSourceSnapshot"` SplitOnClone string `json:"splitOnClone"` QoS string `json:"qos,omitempty"` QoSType string `json:"type,omitempty"` }
func (*VolumeConfig) ConstructClone ¶
func (c *VolumeConfig) ConstructClone() *VolumeConfig
func (*VolumeConfig) Validate ¶
func (c *VolumeConfig) Validate() error
type VolumeExternal ¶
type VolumeExternal struct { Config *VolumeConfig Backend string `json:"backend"` Pool string `json:"pool"` Orphaned bool `json:"orphaned"` }
func (*VolumeExternal) GetCHAPSecretName ¶
func (v *VolumeExternal) GetCHAPSecretName() string
type VolumeExternalWrapper ¶
type VolumeExternalWrapper struct { Volume *VolumeExternal Error error }
VolumeExternalWrapper is used to return volumes and errors via channels between goroutines
Click to show internal directories.
Click to hide internal directories.