ebs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsFiltered

func IsFiltered(vol *ec2.Volume, filterFuncs []func(t *ec2.Tag) bool) bool

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

func IsVolumeNotFound

func IsVolumeNotFound(err error) bool

IsVolumeNotFound asserts volume not found error from upstream's API code.

func NewDockerVolumeFilter

func NewDockerVolumeFilter(customObject v1alpha1.AWSConfig) func(t *ec2.Tag) bool

func NewEtcdVolumeFilter

func NewEtcdVolumeFilter(customObject v1alpha1.AWSConfig) func(t *ec2.Tag) bool

func NewPersistentVolumeFilter

func NewPersistentVolumeFilter(customObject v1alpha1.AWSConfig) func(t *ec2.Tag) bool

Types

type Config

type Config struct {
	Client EC2Client
	Logger micrologger.Logger
}

type EBS

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

func New

func New(config Config) (*EBS, error)

func (*EBS) DeleteVolume

func (e *EBS) DeleteVolume(ctx context.Context, volumeID string) error

DeleteVolume deletes an EBS volume with retry logic.

func (*EBS) DetachVolume

func (e *EBS) DetachVolume(ctx context.Context, volumeID string, attachment VolumeAttachment, force bool, shutdown bool, wait bool) error

DetachVolume detaches an EBS volume. If force is specified data loss may occur. If shutdown is specified the instance will be stopped first.

func (*EBS) ListVolumes

func (e *EBS) ListVolumes(customObject v1alpha1.AWSConfig, filterFuncs ...func(t *ec2.Tag) bool) ([]Volume, error)

ListVolumes lists EBS volumes for a guest cluster. If etcdVolume is true the Etcd volume for the master instance will be returned. If persistentVolume is set then any Persistent Volumes associated with the cluster will be returned.

type EC2Client

type EC2Client interface {
	DeleteVolume(*ec2.DeleteVolumeInput) (*ec2.DeleteVolumeOutput, error)
	DescribeVolumes(*ec2.DescribeVolumesInput) (*ec2.DescribeVolumesOutput, error)
	DetachVolume(*ec2.DetachVolumeInput) (*ec2.VolumeAttachment, error)
	StopInstances(*ec2.StopInstancesInput) (*ec2.StopInstancesOutput, error)
	WaitUntilInstanceStopped(*ec2.DescribeInstancesInput) error
}

EC2Client describes the methods required to be implemented by an EC2 AWS client.

type Interface

type Interface interface {
	// DeleteVolume deletes an EBS volume with retry logic.
	DeleteVolume(ctx context.Context, volumeID string) error
	// DetachVolume detaches an EBS volume. If force is specified data loss may
	// occur. If shutdown is specified the instance will be stopped first.
	DetachVolume(ctx context.Context, volumeID string, attachment VolumeAttachment, force bool, shutdown bool, wait bool) error
	// ListVolumes lists EBS volumes for a guest cluster. If etcdVolume is true
	// the Etcd volume for the master instance will be returned. If
	// persistentVolume is true then any Persistent Volumes associated with the
	// cluster will be returned.
	ListVolumes(customObject v1alpha1.AWSConfig, filterFuncs ...func(t *ec2.Tag) bool) ([]Volume, error)
}

Interface describes the methods provided by the helm client.

type Volume

type Volume struct {
	VolumeID    string
	Attachments []VolumeAttachment
}

Volume is an EBS volume and its attachments.

type VolumeAttachment

type VolumeAttachment struct {
	Device     string
	InstanceID string
}

VolumeAttachment is an EBS volume attached to an EC2 instance.

Jump to

Keyboard shortcuts

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