layer

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DisabledWarning = ""
)
View Source
const (
	// The % threshold at which to resize a physical volume
	// -------------------------------------------------------
	// If the (physical volume / device size) * 100 falls
	// under this threshold then we perform a resize operation
	// -------------------------------------------------------
	// The smallest gp3 EBS volume you can create is 1GiB (1073741824 bytes).
	// The default size of the extent of a PV is 4 MiB (4194304 bytes).
	// Typically, the first extent of a PV is reserved for metadata. This
	// produces a PV of size 1069547520 bytes (Usage=99.6093%). We ensure
	// that we set the resize threshold to 99.6% to ensure that a 1 GiB EBS
	// volume won't be always resized
	// -------------------------------------------------------
	// Why not just look for a difference of 4194304 bytes?
	//	- The size of the extent can be changed by the user
	//	- Therefore we may not always see a difference of 4194304 bytes between
	//	  the block device and physical volume size
	ResizeThreshold = float64(99.6)
)
View Source
const (
	// The % tolerance to expect the logical volume size to be within
	// -------------------------------------------------------
	// If the (logical volume / volume group size) * 100 is less than
	// (lvmConsumption% - tolerance%) then we perform a resize operation
	// -------------------------------------------------------
	// If the (logical volume / volume group size) * 100 is greater than
	// (lvmConsumption% + tolerance%) then the user is attempting a downsize
	// operation. We outright deny this as downsizing can be a destructive
	// operation
	// -------------------------------------------------------
	// Why implement a tolernace-based policy for resizing?
	// 	- When creating a Logical Volume, `ebs-bootstrap` issues a command like
	// 		`lvcreate -l 20%VG -n lv_name vg_name`
	// 	- When we calculate how much percentage of the volume group has been
	// 		consumed by the logical volume, the value would look like 20.0052096...
	// 	- A tolerance establishes a window of acceptable values for avoiding a
	// 		resizing operation
	ResizeTolerance = float64(0.1)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivateLogicalVolumeLayer added in v1.1.0

type ActivateLogicalVolumeLayer struct {
	// contains filtered or unexported fields
}

func NewActivateLogicalVolumeLayer added in v1.1.0

func NewActivateLogicalVolumeLayer(lb backend.LvmBackend) *ActivateLogicalVolumeLayer

func (*ActivateLogicalVolumeLayer) From added in v1.1.0

func (*ActivateLogicalVolumeLayer) Modify added in v1.1.0

func (*ActivateLogicalVolumeLayer) ShouldProcess added in v1.1.0

func (cvgl *ActivateLogicalVolumeLayer) ShouldProcess(c *config.Config) bool

func (*ActivateLogicalVolumeLayer) Validate added in v1.1.0

func (cvgl *ActivateLogicalVolumeLayer) Validate(c *config.Config) error

func (*ActivateLogicalVolumeLayer) Warning added in v1.1.0

func (cvgl *ActivateLogicalVolumeLayer) Warning() string

type ChangeOwnerLayer

type ChangeOwnerLayer struct {
	// contains filtered or unexported fields
}

func (*ChangeOwnerLayer) From

func (fdl *ChangeOwnerLayer) From(c *config.Config) error

func (*ChangeOwnerLayer) Modify

func (fdl *ChangeOwnerLayer) Modify(c *config.Config) ([]action.Action, error)

func (*ChangeOwnerLayer) ShouldProcess added in v1.1.0

func (fdl *ChangeOwnerLayer) ShouldProcess(c *config.Config) bool

func (*ChangeOwnerLayer) Validate

func (fdl *ChangeOwnerLayer) Validate(c *config.Config) error

func (*ChangeOwnerLayer) Warning

func (fdl *ChangeOwnerLayer) Warning() string

type ChangePermissionsLayer

type ChangePermissionsLayer struct {
	// contains filtered or unexported fields
}

func NewChangePermissionsLayer

func NewChangePermissionsLayer(fb backend.FileBackend) *ChangePermissionsLayer

func (*ChangePermissionsLayer) From

func (fdl *ChangePermissionsLayer) From(c *config.Config) error

func (*ChangePermissionsLayer) Modify

func (fdl *ChangePermissionsLayer) Modify(c *config.Config) ([]action.Action, error)

func (*ChangePermissionsLayer) ShouldProcess added in v1.1.0

func (fdl *ChangePermissionsLayer) ShouldProcess(c *config.Config) bool

func (*ChangePermissionsLayer) Validate

func (fdl *ChangePermissionsLayer) Validate(c *config.Config) error

func (*ChangePermissionsLayer) Warning

func (fdl *ChangePermissionsLayer) Warning() string

type CreateDirectoryLayer

type CreateDirectoryLayer struct {
	// contains filtered or unexported fields
}

func NewCreateDirectoryLayer

func NewCreateDirectoryLayer(fb backend.FileBackend) *CreateDirectoryLayer

func (*CreateDirectoryLayer) From

func (fdl *CreateDirectoryLayer) From(c *config.Config) error

func (*CreateDirectoryLayer) Modify

func (fdl *CreateDirectoryLayer) Modify(c *config.Config) ([]action.Action, error)

func (*CreateDirectoryLayer) ShouldProcess added in v1.1.0

func (fdl *CreateDirectoryLayer) ShouldProcess(c *config.Config) bool

func (*CreateDirectoryLayer) Validate

func (fdl *CreateDirectoryLayer) Validate(c *config.Config) error

func (*CreateDirectoryLayer) Warning

func (fdl *CreateDirectoryLayer) Warning() string

type CreateLogicalVolumeLayer added in v1.1.0

type CreateLogicalVolumeLayer struct {
	// contains filtered or unexported fields
}

func NewCreateLogicalVolumeLayer added in v1.1.0

func NewCreateLogicalVolumeLayer(lb backend.LvmBackend) *CreateLogicalVolumeLayer

func (*CreateLogicalVolumeLayer) From added in v1.1.0

func (*CreateLogicalVolumeLayer) Modify added in v1.1.0

func (cvgl *CreateLogicalVolumeLayer) Modify(c *config.Config) ([]action.Action, error)

func (*CreateLogicalVolumeLayer) ShouldProcess added in v1.1.0

func (cvgl *CreateLogicalVolumeLayer) ShouldProcess(c *config.Config) bool

func (*CreateLogicalVolumeLayer) Validate added in v1.1.0

func (cvgl *CreateLogicalVolumeLayer) Validate(c *config.Config) error

func (*CreateLogicalVolumeLayer) Warning added in v1.1.0

func (cvgl *CreateLogicalVolumeLayer) Warning() string

type CreatePhysicalVolumeLayer added in v1.1.0

type CreatePhysicalVolumeLayer struct {
	// contains filtered or unexported fields
}

func NewCreatePhysicalVolumeLayer added in v1.1.0

func NewCreatePhysicalVolumeLayer(db backend.DeviceBackend, lb backend.LvmBackend) *CreatePhysicalVolumeLayer

func (*CreatePhysicalVolumeLayer) From added in v1.1.0

func (*CreatePhysicalVolumeLayer) Modify added in v1.1.0

func (cpvl *CreatePhysicalVolumeLayer) Modify(c *config.Config) ([]action.Action, error)

func (*CreatePhysicalVolumeLayer) ShouldProcess added in v1.1.0

func (cpvl *CreatePhysicalVolumeLayer) ShouldProcess(c *config.Config) bool

func (*CreatePhysicalVolumeLayer) Validate added in v1.1.0

func (cpvl *CreatePhysicalVolumeLayer) Validate(c *config.Config) error

func (*CreatePhysicalVolumeLayer) Warning added in v1.1.0

func (cpvl *CreatePhysicalVolumeLayer) Warning() string

type CreateVolumeGroupLayer added in v1.1.0

type CreateVolumeGroupLayer struct {
	// contains filtered or unexported fields
}

func NewCreateVolumeGroupLayer added in v1.1.0

func NewCreateVolumeGroupLayer(lb backend.LvmBackend) *CreateVolumeGroupLayer

func (*CreateVolumeGroupLayer) From added in v1.1.0

func (cvgl *CreateVolumeGroupLayer) From(c *config.Config) error

func (*CreateVolumeGroupLayer) Modify added in v1.1.0

func (cvgl *CreateVolumeGroupLayer) Modify(c *config.Config) ([]action.Action, error)

func (*CreateVolumeGroupLayer) ShouldProcess added in v1.1.0

func (cvgl *CreateVolumeGroupLayer) ShouldProcess(c *config.Config) bool

func (*CreateVolumeGroupLayer) Validate added in v1.1.0

func (cvgl *CreateVolumeGroupLayer) Validate(c *config.Config) error

func (*CreateVolumeGroupLayer) Warning added in v1.1.0

func (cvgl *CreateVolumeGroupLayer) Warning() string

type ExponentialBackoffLayerExecutor

type ExponentialBackoffLayerExecutor struct {
	// contains filtered or unexported fields
}

func (*ExponentialBackoffLayerExecutor) Execute

func (le *ExponentialBackoffLayerExecutor) Execute(layers []Layer) error

type ExponentialBackoffParameters

type ExponentialBackoffParameters struct {
	InitialInterval time.Duration
	Multiplier      uint32
	MaxRetries      uint32
}

func DefaultExponentialBackoffParameters

func DefaultExponentialBackoffParameters() *ExponentialBackoffParameters

type FormatDeviceLayer

type FormatDeviceLayer struct {
	// contains filtered or unexported fields
}

func NewFormatDeviceLayer

func NewFormatDeviceLayer(db backend.DeviceBackend) *FormatDeviceLayer

func (*FormatDeviceLayer) From

func (fdl *FormatDeviceLayer) From(c *config.Config) error

func (*FormatDeviceLayer) Modify

func (fdl *FormatDeviceLayer) Modify(c *config.Config) ([]action.Action, error)

func (*FormatDeviceLayer) ShouldProcess added in v1.1.0

func (fdl *FormatDeviceLayer) ShouldProcess(c *config.Config) bool

func (*FormatDeviceLayer) Validate

func (fdl *FormatDeviceLayer) Validate(c *config.Config) error

func (*FormatDeviceLayer) Warning

func (fdl *FormatDeviceLayer) Warning() string

type LabelDeviceLayer

type LabelDeviceLayer struct {
	// contains filtered or unexported fields
}

func NewLabelDeviceLayer

func NewLabelDeviceLayer(db backend.DeviceBackend) *LabelDeviceLayer

func (*LabelDeviceLayer) From

func (fdl *LabelDeviceLayer) From(c *config.Config) error

func (*LabelDeviceLayer) Modify

func (fdl *LabelDeviceLayer) Modify(c *config.Config) ([]action.Action, error)

func (*LabelDeviceLayer) ShouldProcess added in v1.1.0

func (fdl *LabelDeviceLayer) ShouldProcess(c *config.Config) bool

func (*LabelDeviceLayer) Validate

func (fdl *LabelDeviceLayer) Validate(c *config.Config) error

func (*LabelDeviceLayer) Warning

func (fdl *LabelDeviceLayer) Warning() string

type Layer

type Layer interface {
	From(config *config.Config) error
	Modify(c *config.Config) ([]action.Action, error)
	Validate(config *config.Config) error
	Warning() string
	ShouldProcess(config *config.Config) bool
}

type LayerExecutor

type LayerExecutor interface {
	Execute(layers []Layer) error
}

type MountDeviceLayer

type MountDeviceLayer struct {
	// contains filtered or unexported fields
}

func (*MountDeviceLayer) From

func (fdl *MountDeviceLayer) From(c *config.Config) error

func (*MountDeviceLayer) Modify

func (fdl *MountDeviceLayer) Modify(c *config.Config) ([]action.Action, error)

func (*MountDeviceLayer) ShouldProcess added in v1.1.0

func (fdl *MountDeviceLayer) ShouldProcess(c *config.Config) bool

func (*MountDeviceLayer) Validate

func (fdl *MountDeviceLayer) Validate(c *config.Config) error

func (*MountDeviceLayer) Warning

func (fdl *MountDeviceLayer) Warning() string

type ResizeDeviceLayer

type ResizeDeviceLayer struct {
	// contains filtered or unexported fields
}

func (*ResizeDeviceLayer) From

func (fdl *ResizeDeviceLayer) From(c *config.Config) error

func (*ResizeDeviceLayer) Modify

func (fdl *ResizeDeviceLayer) Modify(c *config.Config) ([]action.Action, error)

func (*ResizeDeviceLayer) ShouldProcess added in v1.1.0

func (fdl *ResizeDeviceLayer) ShouldProcess(c *config.Config) bool

func (*ResizeDeviceLayer) Validate

func (fdl *ResizeDeviceLayer) Validate(c *config.Config) error

func (*ResizeDeviceLayer) Warning

func (fdl *ResizeDeviceLayer) Warning() string

type ResizeLogicalVolumeLayer added in v1.1.3

type ResizeLogicalVolumeLayer struct {
	// contains filtered or unexported fields
}

func NewResizeLogicalVolumeLayer added in v1.1.3

func NewResizeLogicalVolumeLayer(lb backend.LvmBackend) *ResizeLogicalVolumeLayer

func (*ResizeLogicalVolumeLayer) From added in v1.1.3

func (*ResizeLogicalVolumeLayer) Modify added in v1.1.3

func (rpvl *ResizeLogicalVolumeLayer) Modify(c *config.Config) ([]action.Action, error)

func (*ResizeLogicalVolumeLayer) ShouldProcess added in v1.1.3

func (rpvl *ResizeLogicalVolumeLayer) ShouldProcess(c *config.Config) bool

func (*ResizeLogicalVolumeLayer) Validate added in v1.1.3

func (rpvl *ResizeLogicalVolumeLayer) Validate(c *config.Config) error

func (*ResizeLogicalVolumeLayer) Warning added in v1.1.3

func (rpvl *ResizeLogicalVolumeLayer) Warning() string

type ResizePhysicalVolumeLayer added in v1.1.2

type ResizePhysicalVolumeLayer struct {
	// contains filtered or unexported fields
}

func NewResizePhysicalVolumeLayer added in v1.1.2

func NewResizePhysicalVolumeLayer(lb backend.LvmBackend) *ResizePhysicalVolumeLayer

func (*ResizePhysicalVolumeLayer) From added in v1.1.2

func (*ResizePhysicalVolumeLayer) Modify added in v1.1.2

func (rpvl *ResizePhysicalVolumeLayer) Modify(c *config.Config) ([]action.Action, error)

func (*ResizePhysicalVolumeLayer) ShouldProcess added in v1.1.2

func (rpvl *ResizePhysicalVolumeLayer) ShouldProcess(c *config.Config) bool

func (*ResizePhysicalVolumeLayer) Validate added in v1.1.2

func (rpvl *ResizePhysicalVolumeLayer) Validate(c *config.Config) error

func (*ResizePhysicalVolumeLayer) Warning added in v1.1.2

func (rpvl *ResizePhysicalVolumeLayer) Warning() string

Jump to

Keyboard shortcuts

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