types

package
v0.0.0-...-bc5839e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// OptionRef defines the reference of containers.
	OptionRef = "ref"

	// DefaultBackend defines the default volume backend.
	DefaultBackend = "local"
)

Functions

This section is empty.

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 Option

type Option struct {
	Value string
	Desc  string
}

Option represents volume option struct.

type Volume

type Volume struct {
	meta.ObjectMeta `json:",inline"`
	Spec            *VolumeSpec   `json:"Spec,omitempty"`
	Status          *VolumeStatus `json:"Status,omitempty"`
}

Volume defined volume struct.

func NewVolumeFromContext

func NewVolumeFromContext(mountPath, size string, id VolumeContext) *Volume

NewVolumeFromContext will create an Volume using mountPath, size and VolumeContext.

func (*Volume) CreateTime

func (v *Volume) CreateTime() string

CreateTime returns the volume's create time.

func (*Volume) Driver

func (v *Volume) Driver() string

Driver return driver's name of the volume.

func (*Volume) FileSystem

func (v *Volume) FileSystem() []string

FileSystem returns volume's file system.

func (*Volume) Key

func (v *Volume) Key() string

Key returns the volume's name

func (*Volume) Label

func (v *Volume) Label(label string) string

Label returns volume's label.

func (*Volume) MountOption

func (v *Volume) MountOption() []string

MountOption returns volume's mount options.

func (*Volume) Option

func (v *Volume) Option(name string) string

Option use to get the common options or module's options by name.

func (*Volume) Options

func (v *Volume) Options() map[string]string

Options returns all the options of volume.

func (*Volume) Path

func (v *Volume) Path() string

Path return the volume's path on host.

func (*Volume) SetLabel

func (v *Volume) SetLabel(label, value string)

SetLabel use to set label to volume.

func (*Volume) SetOption

func (v *Volume) SetOption(name, value string)

SetOption use to set the common options or module's options by name.

func (*Volume) SetPath

func (v *Volume) SetPath(p string)

SetPath save the volume's path on host into volume meta data.

func (*Volume) Size

func (v *Volume) Size() string

Size returns volume's size(bytes).

func (*Volume) VolumeContext

func (v *Volume) VolumeContext() VolumeContext

VolumeContext return volume's context.

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 VolumeContext

type VolumeContext struct {
	Name    string
	Driver  string
	Options map[string]string
	Labels  map[string]string
}

VolumeContext use to define the volume's identity.

func NewVolumeContext

func NewVolumeContext(name, driver string, options, labels map[string]string) VolumeContext

NewVolumeContext returns VolumeContext instance.

func (VolumeContext) Equal

func (v VolumeContext) Equal(v1 VolumeContext) bool

Equal check VolumeContext is equal or not.

func (VolumeContext) Invalid

func (v VolumeContext) Invalid() bool

Invalid is used to check VolumeContext's name is valid or not.

func (VolumeContext) String

func (v VolumeContext) String() string

String return VolumeContext with string.

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"`
	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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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