Documentation ¶
Overview ¶
Package block provides block device and volume configuration documents.
Index ¶
- Constants
- func GetFileDoc() *encoder.FileDoc
- type ByteSize
- type DiskSelector
- type ProvisioningSpec
- type VolumeConfigV1Alpha1
- func (s *VolumeConfigV1Alpha1) Clone() config.Document
- func (o *VolumeConfigV1Alpha1) DeepCopy() *VolumeConfigV1Alpha1
- func (VolumeConfigV1Alpha1) Doc() *encoder.Doc
- func (s *VolumeConfigV1Alpha1) Name() string
- func (s *VolumeConfigV1Alpha1) Provisioning() config.VolumeProvisioningConfig
- func (s *VolumeConfigV1Alpha1) Validate(validation.RuntimeMode, ...validation.Option) ([]string, error)
Constants ¶
const VolumeConfigKind = "VolumeConfig"
VolumeConfigKind is a config document kind.
Variables ¶
This section is empty.
Functions ¶
func GetFileDoc ¶
GetFileDoc returns documentation for the file block_doc.go.
Types ¶
type ByteSize ¶
type ByteSize struct {
// contains filtered or unexported fields
}
ByteSize is a byte size which can be convienintly represented as a human readable string with IEC sizes, e.g. 100MB.
func MustByteSize ¶
MustByteSize returns a new ByteSize with the given value.
It panics if the value is invalid.
func (ByteSize) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*ByteSize) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.
type DiskSelector ¶
type DiskSelector struct { // description: | // The Common Expression Language (CEL) expression to match the disk. // schema: // type: string // examples: // - value: > // exampleDiskSelector1() // name: match disks with size between 120GB and 1TB // - value: > // exampleDiskSelector2() // name: match SATA disks that are not rotational and not system disks Match cel.Expression `yaml:"match,omitempty"` }
DiskSelector selects a disk for the volume.
func (DiskSelector) Doc ¶
func (DiskSelector) Doc() *encoder.Doc
type ProvisioningSpec ¶
type ProvisioningSpec struct { // description: | // The disk selector expression. DiskSelectorSpec DiskSelector `yaml:"diskSelector,omitempty"` // description: | // Should the volume grow to the size of the disk (if possible). ProvisioningGrow *bool `yaml:"grow,omitempty"` // description: | // The minimum size of the volume. // // Size is specified in bytes, but can be expressed in human readable format, e.g. 100MB. // examples: // - value: > // "2.5GiB" // schema: // type: string ProvisioningMinSize ByteSize `yaml:"minSize,omitempty"` // description: | // The maximum size of the volume, if not specified the volume can grow to the size of the // disk. // // Size is specified in bytes, but can be expressed in human readable format, e.g. 100MB. // examples: // - value: > // "50GiB" // schema: // type: string ProvisioningMaxSize ByteSize `yaml:"maxSize,omitempty"` }
ProvisioningSpec describes how the volume is provisioned.
func (ProvisioningSpec) DiskSelector ¶
func (s ProvisioningSpec) DiskSelector() optional.Optional[cel.Expression]
DiskSelector implements config.VolumeProvisioningConfig interface.
func (ProvisioningSpec) Doc ¶
func (ProvisioningSpec) Doc() *encoder.Doc
func (ProvisioningSpec) Grow ¶
func (s ProvisioningSpec) Grow() optional.Optional[bool]
Grow implements config.VolumeProvisioningConfig interface.
type VolumeConfigV1Alpha1 ¶
type VolumeConfigV1Alpha1 struct { meta.Meta `yaml:",inline"` // description: | // Name of the volume. MetaName string `yaml:"name"` // description: | // The provisioning describes how the volume is provisioned. ProvisioningSpec ProvisioningSpec `yaml:"provisioning,omitempty"` }
VolumeConfigV1Alpha1 is a volume configuration document.
Note: at the moment, only EPHEMERAL volumes are supported.
examples: - value: exampleVolumeConfigEphemeralV1Alpha1() alias: VolumeConfig schemaRoot: true schemaMeta: v1alpha1/VolumeConfig
func NewVolumeConfigV1Alpha1 ¶
func NewVolumeConfigV1Alpha1() *VolumeConfigV1Alpha1
NewVolumeConfigV1Alpha1 creates a new volume config document.
func (*VolumeConfigV1Alpha1) Clone ¶
func (s *VolumeConfigV1Alpha1) Clone() config.Document
Clone implements config.Document interface.
func (*VolumeConfigV1Alpha1) DeepCopy ¶
func (o *VolumeConfigV1Alpha1) DeepCopy() *VolumeConfigV1Alpha1
DeepCopy generates a deep copy of *VolumeConfigV1Alpha1.
func (VolumeConfigV1Alpha1) Doc ¶
func (VolumeConfigV1Alpha1) Doc() *encoder.Doc
func (*VolumeConfigV1Alpha1) Name ¶
func (s *VolumeConfigV1Alpha1) Name() string
Name implements config.NamedDocument interface.
func (*VolumeConfigV1Alpha1) Provisioning ¶
func (s *VolumeConfigV1Alpha1) Provisioning() config.VolumeProvisioningConfig
Provisioning implements config.VolumeConfig interface.
func (*VolumeConfigV1Alpha1) Validate ¶
func (s *VolumeConfigV1Alpha1) Validate(validation.RuntimeMode, ...validation.Option) ([]string, error)
Validate implements config.Validator interface.