Documentation ¶
Index ¶
- func IsFiltered(vol *ec2.Volume, filterFuncs []func(t *ec2.Tag) bool) bool
- func IsInvalidConfig(err error) bool
- func IsVolumeAttached(err error) bool
- func IsVolumeNotFound(err error) bool
- func NewDockerVolumeFilter(cr infrastructurev1alpha3.AWSCluster) func(t *ec2.Tag) bool
- func NewEtcdVolumeFilter(cr infrastructurev1alpha3.AWSCluster) func(t *ec2.Tag) bool
- func NewPersistentVolumeFilter(cr infrastructurev1alpha3.AWSCluster) func(t *ec2.Tag) bool
- type Config
- type EBS
- type EC2Client
- type Interface
- type Volume
- type VolumeAttachment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsInvalidConfig ¶
IsInvalidConfig asserts invalidConfigError.
func IsVolumeAttached ¶
IsVolumeAttached asserts volumeAttachedError.
func IsVolumeNotFound ¶
IsVolumeNotFound asserts volume not found error from upstream's API code.
func NewDockerVolumeFilter ¶
func NewDockerVolumeFilter(cr infrastructurev1alpha3.AWSCluster) func(t *ec2.Tag) bool
func NewEtcdVolumeFilter ¶
func NewEtcdVolumeFilter(cr infrastructurev1alpha3.AWSCluster) func(t *ec2.Tag) bool
func NewPersistentVolumeFilter ¶
func NewPersistentVolumeFilter(cr infrastructurev1alpha3.AWSCluster) 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 (*EBS) DeleteVolume ¶
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. Note that the long term plan for the interface and functionality is to remove the EC2 instance management so the EBS service implementation here only manages EBS volumes.
func (*EBS) ListVolumes ¶
func (e *EBS) ListVolumes(ctx context.Context, cr infrastructurev1alpha3.AWSCluster, 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) DescribeInstances(*ec2.DescribeInstancesInput) (*ec2.DescribeInstancesOutput, 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(ctx context.Context, customObject infrastructurev1alpha3.AWSCluster, 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 ¶
VolumeAttachment is an EBS volume attached to an EC2 instance.