Documentation ¶
Index ¶
- Variables
- func ExtractOptionsFromVolume(v *Volume) map[string]string
- func ListCommonOptions() map[string]Option
- type ConditionStatus
- type Option
- type Selector
- type SelectorRequirement
- type Volume
- func (v *Volume) CreateTime() string
- func (v *Volume) Driver() string
- func (v *Volume) FileSystem() []string
- func (v *Volume) Key() string
- func (v *Volume) Label(label string) string
- func (v *Volume) MountOption() []string
- func (v *Volume) Option(name string) string
- func (v *Volume) Options() map[string]string
- func (v *Volume) Path() string
- func (v *Volume) SetLabel(label, value string)
- func (v *Volume) SetOption(name, value string)
- func (v *Volume) SetPath(p string)
- func (v *Volume) Size() string
- func (v *Volume) VolumeID() VolumeID
- type VolumeCondition
- type VolumeConditionType
- type VolumeConfig
- type VolumeID
- type VolumeList
- type VolumePhase
- type VolumeSpec
- type VolumeStatus
Constants ¶
This section is empty.
Variables ¶
var ( // APIVersion defines control server api version. APIVersion = "/api/v1" // OptionRef defines the reference of containers. OptionRef = "ref" // DefaultBackend defines the default volume backend. DefaultBackend = "local" )
Functions ¶
func ExtractOptionsFromVolume ¶
ExtractOptionsFromVolume extracts options from a volume.
func ListCommonOptions ¶
ListCommonOptions returns common options.
Types ¶
type ConditionStatus ¶
type ConditionStatus string
ConditionStatus string enum.
const ( // ConditionTrue NodeConditionType is true. ConditionTrue ConditionStatus = "True" // ConditionFalse NodeConditionType is false. ConditionFalse ConditionStatus = "False" // ConditionUnknown NodeConditionType is Unknown. ConditionUnknown ConditionStatus = "Unknown" )
type Selector ¶
type Selector []SelectorRequirement
Selector defines SelectorRequirement slice type.
func (*Selector) AsRequirement ¶
func (n *Selector) AsRequirement() []labels.Requirement
AsRequirement returns requirement.
func (*Selector) AsSelector ¶
AsSelector returns selector.
type SelectorRequirement ¶
type SelectorRequirement struct { // The label key that the selector applies to. Key string `json:"key"` // Represents a key's relationship to a set of values. // Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt. Operator selection.Operator `json:"operator"` // An array of string values. If the operator is In or NotIn, // the values array must be non-empty. If the operator is Exists or DoesNotExist, // the values array must be empty. If the operator is Gt or Lt, the values // array must have a single element. Values []string `json:"values,omitempty"` }
SelectorRequirement is a selector that contains values, a key, and an operator that relates the key and values.
type Volume ¶
type Volume struct { meta.ObjectMeta `json:",inline"` Spec *VolumeSpec `json:"Spec,omitempty"` Status *VolumeStatus `json:"Status,omitempty"` }
Volume defined volume struct.
func NewVolumeFromID ¶
NewVolumeFromID will create an Volume using mountPath, size and VolumeID.
func (*Volume) CreateTime ¶
CreateTime returns the volume's create time.
func (*Volume) FileSystem ¶
FileSystem returns volume's file system.
func (*Volume) MountOption ¶
MountOption returns volume's mount options.
type VolumeCondition ¶
type VolumeCondition struct { Type VolumeConditionType `json:"type"` Status ConditionStatus `json:"status"` LastProbeTime *time.Time `json:"lastProbeTime,omitempty"` LastTransitionTime *time.Time `json:"lastTransitionTime,omitempty"` Reason string `json:"reason,omitempty"` Message string `json:"message,omitempty"` Retry int `json:"retry,omitempty"` }
VolumeCondition represents volume condition struct.
type VolumeConditionType ¶
type VolumeConditionType string
VolumeConditionType defines volume condition type.
const ( // VolumeScheduledrepresents status of the scheduling process for this Volume. VolumeScheduled VolumeConditionType = "Scheduled" // VolumeInitialized means that all init containers in the Volume have started successfully. VolumeInitialized VolumeConditionType = "Initialized" // VolumeStopped means that all init containers in the Volume have stopped successfully. VolumeStopped VolumeConditionType = "Stopped" // VolumeStarted means that all init containers in the Volume have started successfully. VolumeStarted VolumeConditionType = "Started" // VolumeRestarted means that all init containers in the Volume have restarted successfully VolumeRestarted VolumeConditionType = "Restarted" // VolumeUpdated means that all init containers in the Volume have updated successfully VolumeUpdated VolumeConditionType = "Updated" // VolumeDeleted means that all init containers in the Volume have deleted successfully VolumeDeleted VolumeConditionType = "Deleted" )
These are valid conditions of pod.
type VolumeConfig ¶
type VolumeConfig struct { Size string `json:"size"` FileSystem string `json:"filesystem"` MountOpt string `json:"mountopt"` WriteBPS int64 `json:"wbps"` ReadBPS int64 `json:"rbps"` WriteIOPS int64 `json:"wiops"` ReadIOPS int64 `json:"riops"` TotalIOPS int64 `json:"iops"` }
VolumeConfig represents volume config.
type VolumeID ¶
type VolumeID struct { Name string Driver string Options map[string]string Labels map[string]string Selectors map[string]string }
VolumeID use to define the volume's identity.
func NewVolumeID ¶
NewVolumeID returns VolumeID instance.
type VolumeList ¶
type VolumeList struct { meta.ListMeta `json:",inline,omitempty"` Items []Volume `json:"Items,omitempty"` }
VolumeList represents volume list.
type VolumePhase ¶
type VolumePhase string
VolumePhase defines volume phase's status.
var ( // VolumePhasePending represents volume pending status. VolumePhasePending VolumePhase = "Pending" // VolumePhaseReady represents volume ready status. VolumePhaseReady VolumePhase = "Ready" // VolumePhaseUnknown represents volume unknown status. VolumePhaseUnknown VolumePhase = "Unknown" // VolumePhaseFailed represents volume failed status. VolumePhaseFailed VolumePhase = "Failed" )
type VolumeSpec ¶
type VolumeSpec struct { ClusterID string `json:"clusterid"` Selector Selector `json:"selector"` Operable bool `json:"operable"` Backend string `json:"backend,omitempty"` MountMode string `json:"mountMode,omitempty"` *VolumeConfig `json:"config,inline"` Extra map[string]string `json:"extra"` }
VolumeSpec represents volume spec.
type VolumeStatus ¶
type VolumeStatus struct { Phase VolumePhase `json:"phase"` StartTimestamp *time.Time `json:"startTimestamp"` LastUpdateTimestamp *time.Time `json:"lastUpdateTime"` Conditions []VolumeCondition `json:"Conditions,omitempty"` HostIP string `json:"hostip,omitempty"` MountPoint string `json:"mountpath,omitempty"` Reason string `json:"reason"` Message string `json:"message"` }
VolumeStatus represent volume status.