Documentation ¶
Index ¶
- Constants
- type Origin
- type Persistency
- type Volume
- func (v Volume) GetCacheSize() uint
- func (v Volume) GetDeviceMode() api.DeviceMode
- func (v Volume) GetEraseAfter() bool
- func (v Volume) GetKataContainers() bool
- func (v Volume) GetName() string
- func (v Volume) GetPersistency() Persistency
- func (v Volume) GetSize() int64
- func (v Volume) GetVolumeID() string
- func (v Volume) ToContext() VolumeContext
- type VolumeContext
Constants ¶
const ( CacheSize = "cacheSize" EraseAfter = "eraseafter" KataContainers = "kataContainers" Name = "name" PersistencyModel = "persistencyModel" VolumeID = "_id" Size = "size" DeviceMode = "deviceMode" // Kubernetes v1.16+ adds this key to NodePublishRequest.VolumeContext // while provisioning ephemeral volume. Ephemeral = "csi.storage.k8s.io/ephemeral" // Additional, unknown parameters that are okay. PodInfoPrefix = "csi.storage.k8s.io/" // Added by https://github.com/kubernetes-csi/external-provisioner/blob/feb67766f5e6af7db5c03ac0f0b16255f696c350/pkg/controller/controller.go#L584 ProvisionerID = "storage.kubernetes.io/csiProvisionerIdentity" PersistencyNormal Persistency = "normal" // In releases <= 0.6.x this was called "none", but not documented. PersistencyCache Persistency = "cache" PersistencyEphemeral Persistency = "ephemeral" // only used internally //CreateVolumeOrigin is for parameters from the storage class in controller CreateVolume. CreateVolumeOrigin Origin = iota // CreateVolumeInternalOrigin is for the node CreateVolume parameters. CreateVolumeInternalOrigin // EphemeralVolumeOrigin represents parameters for an ephemeral volume in NodePublishVolume. EphemeralVolumeOrigin // PersistentVolumeOrigin represents parameters for a persistent volume in NodePublishVolume. PersistentVolumeOrigin // NodeVolumeOrigin is for the parameters stored in node volume list. NodeVolumeOrigin )
Beware of API and backwards-compatibility breaking when changing these string constants!
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Persistency ¶
type Persistency string
type Volume ¶
type Volume struct { CacheSize *uint EraseAfter *bool KataContainers *bool Name *string Persistency *Persistency Size *int64 VolumeID *string DeviceMode *api.DeviceMode }
Volume represents all settings for a volume. Values can be unset or set explicitly to some value. The accessor functions always return a value, if unset the default.
func Parse ¶
Parse converts the string map that PMEM-CSI is given in CreateVolume (master and node) and NodePublishVolume. Depending on the origin of the string map, different keys are valid. An error is returned for invalid keys and values and invalid combinations of parameters.
func (Volume) GetCacheSize ¶
func (Volume) GetDeviceMode ¶
func (v Volume) GetDeviceMode() api.DeviceMode
func (Volume) GetEraseAfter ¶
func (Volume) GetKataContainers ¶
func (Volume) GetPersistency ¶
func (v Volume) GetPersistency() Persistency
func (Volume) GetVolumeID ¶
func (Volume) ToContext ¶
func (v Volume) ToContext() VolumeContext
ToContext converts back to a string map for use in CreateVolumeResponse.Volume.VolumeContext and for storing in the node's volume list.
Both the volume context and the volume list are persisted outside of PMEM-CSI (one in etcd, the other on disk), so beware when making backwards incompatible changes!
type VolumeContext ¶
VolumeContext represents the same settings as a string map.