parameters

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
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 Origin

type Origin int

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

func Parse(origin Origin, stringmap map[string]string) (Volume, error)

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 (v Volume) GetCacheSize() uint

func (Volume) GetDeviceMode

func (v Volume) GetDeviceMode() api.DeviceMode

func (Volume) GetEraseAfter

func (v Volume) GetEraseAfter() bool

func (Volume) GetKataContainers

func (v Volume) GetKataContainers() bool

func (Volume) GetName

func (v Volume) GetName() string

func (Volume) GetPersistency

func (v Volume) GetPersistency() Persistency

func (Volume) GetSize

func (v Volume) GetSize() int64

func (Volume) GetVolumeID

func (v Volume) GetVolumeID() string

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

type VolumeContext map[string]string

VolumeContext represents the same settings as a string map.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL