Documentation ¶
Overview ¶
Package cloud is a generated GoMock package.
Package cloud is a generated GoMock package.
Package cloud is a generated GoMock package.
Index ¶
- Constants
- Variables
- func GetEBSLimitForInstanceType(it string) (int, bool)
- func GetMaxAttachments(nitro bool) int
- func GetNVMeInstanceStoreVolumesForInstanceType(it string) int
- func IsNitroInstanceType(it string) bool
- func RecordRequestsHandler(r *request.Request)
- func RecordThrottledRequestsHandler(r *request.Request)
- func RegisterMetrics()
- type Cloud
- type Disk
- type DiskOptions
- type EC2
- type EC2Metadata
- type EC2MetadataClient
- type KubernetesAPIClient
- type ListSnapshotsResponse
- type Metadata
- func (m *Metadata) GetAvailabilityZone() string
- func (m *Metadata) GetInstanceID() string
- func (m *Metadata) GetInstanceType() string
- func (m *Metadata) GetNumAttachedENIs() int
- func (m *Metadata) GetNumBlockDeviceMappings() int
- func (m *Metadata) GetOutpostArn() arn.ARN
- func (m *Metadata) GetRegion() string
- type MetadataService
- type MockCloud
- func (m *MockCloud) AttachDisk(ctx context.Context, volumeID, nodeID string) (string, error)
- func (m *MockCloud) AvailabilityZones(ctx context.Context) (map[string]struct{}, error)
- func (m *MockCloud) CreateDisk(ctx context.Context, volumeName string, diskOptions *DiskOptions) (*Disk, error)
- func (m *MockCloud) CreateSnapshot(ctx context.Context, volumeID string, snapshotOptions *SnapshotOptions) (*Snapshot, error)
- func (m *MockCloud) DeleteDisk(ctx context.Context, volumeID string) (bool, error)
- func (m *MockCloud) DeleteSnapshot(ctx context.Context, snapshotID string) (bool, error)
- func (m *MockCloud) DetachDisk(ctx context.Context, volumeID, nodeID string) error
- func (m *MockCloud) EXPECT() *MockCloudMockRecorder
- func (m *MockCloud) EnableFastSnapshotRestores(ctx context.Context, availabilityZones []string, snapshotID string) (*ec2.EnableFastSnapshotRestoresOutput, error)
- func (m *MockCloud) GetDiskByID(ctx context.Context, volumeID string) (*Disk, error)
- func (m *MockCloud) GetDiskByName(ctx context.Context, name string, capacityBytes int64) (*Disk, error)
- func (m *MockCloud) GetSnapshotByID(ctx context.Context, snapshotID string) (*Snapshot, error)
- func (m *MockCloud) GetSnapshotByName(ctx context.Context, name string) (*Snapshot, error)
- func (m *MockCloud) IsExistInstance(ctx context.Context, nodeID string) bool
- func (m *MockCloud) ListSnapshots(ctx context.Context, volumeID string, maxResults int64, nextToken string) (*ListSnapshotsResponse, error)
- func (m *MockCloud) ResizeDisk(ctx context.Context, volumeID string, reqSize int64) (int64, error)
- func (m *MockCloud) WaitForAttachmentState(ctx context.Context, ...) (*ec2.VolumeAttachment, error)
- type MockCloudMockRecorder
- func (mr *MockCloudMockRecorder) AttachDisk(ctx, volumeID, nodeID interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) AvailabilityZones(ctx interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) CreateDisk(ctx, volumeName, diskOptions interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) CreateSnapshot(ctx, volumeID, snapshotOptions interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) DeleteDisk(ctx, volumeID interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) DeleteSnapshot(ctx, snapshotID interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) DetachDisk(ctx, volumeID, nodeID interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) EnableFastSnapshotRestores(ctx, availabilityZones, snapshotID interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) GetDiskByID(ctx, volumeID interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) GetDiskByName(ctx, name, capacityBytes interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) GetSnapshotByID(ctx, snapshotID interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) GetSnapshotByName(ctx, name interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) IsExistInstance(ctx, nodeID interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) ListSnapshots(ctx, volumeID, maxResults, nextToken interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) ResizeDisk(ctx, volumeID, reqSize interface{}) *gomock.Call
- func (mr *MockCloudMockRecorder) WaitForAttachmentState(...) *gomock.Call
- type MockEC2
- func (m *MockEC2) AttachVolumeWithContext(ctx aws.Context, input *ec2.AttachVolumeInput, opts ...request.Option) (*ec2.VolumeAttachment, error)
- func (m *MockEC2) CreateSnapshotWithContext(ctx aws.Context, input *ec2.CreateSnapshotInput, opts ...request.Option) (*ec2.Snapshot, error)
- func (m *MockEC2) CreateTagsWithContext(ctx aws.Context, input *ec2.CreateTagsInput, opts ...request.Option) (*ec2.CreateTagsOutput, error)
- func (m *MockEC2) CreateVolumeWithContext(ctx aws.Context, input *ec2.CreateVolumeInput, opts ...request.Option) (*ec2.Volume, error)
- func (m *MockEC2) DeleteSnapshotWithContext(ctx aws.Context, input *ec2.DeleteSnapshotInput, opts ...request.Option) (*ec2.DeleteSnapshotOutput, error)
- func (m *MockEC2) DeleteVolumeWithContext(ctx aws.Context, input *ec2.DeleteVolumeInput, opts ...request.Option) (*ec2.DeleteVolumeOutput, error)
- func (m *MockEC2) DescribeAvailabilityZonesWithContext(ctx aws.Context, input *ec2.DescribeAvailabilityZonesInput, ...) (*ec2.DescribeAvailabilityZonesOutput, error)
- func (m *MockEC2) DescribeInstancesWithContext(ctx aws.Context, input *ec2.DescribeInstancesInput, opts ...request.Option) (*ec2.DescribeInstancesOutput, error)
- func (m *MockEC2) DescribeSnapshotsWithContext(ctx aws.Context, input *ec2.DescribeSnapshotsInput, opts ...request.Option) (*ec2.DescribeSnapshotsOutput, error)
- func (m *MockEC2) DescribeVolumesModificationsWithContext(ctx aws.Context, input *ec2.DescribeVolumesModificationsInput, ...) (*ec2.DescribeVolumesModificationsOutput, error)
- func (m *MockEC2) DescribeVolumesWithContext(ctx aws.Context, input *ec2.DescribeVolumesInput, opts ...request.Option) (*ec2.DescribeVolumesOutput, error)
- func (m *MockEC2) DetachVolumeWithContext(ctx aws.Context, input *ec2.DetachVolumeInput, opts ...request.Option) (*ec2.VolumeAttachment, error)
- func (m *MockEC2) EXPECT() *MockEC2MockRecorder
- func (m *MockEC2) EnableFastSnapshotRestoresWithContext(ctx aws.Context, input *ec2.EnableFastSnapshotRestoresInput, ...) (*ec2.EnableFastSnapshotRestoresOutput, error)
- func (m *MockEC2) ModifyVolumeWithContext(ctx aws.Context, input *ec2.ModifyVolumeInput, opts ...request.Option) (*ec2.ModifyVolumeOutput, error)
- type MockEC2Metadata
- type MockEC2MetadataMockRecorder
- type MockEC2MockRecorder
- func (mr *MockEC2MockRecorder) AttachVolumeWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockEC2MockRecorder) CreateSnapshotWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockEC2MockRecorder) CreateTagsWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockEC2MockRecorder) CreateVolumeWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockEC2MockRecorder) DeleteSnapshotWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockEC2MockRecorder) DeleteVolumeWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockEC2MockRecorder) DescribeAvailabilityZonesWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockEC2MockRecorder) DescribeInstancesWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockEC2MockRecorder) DescribeSnapshotsWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockEC2MockRecorder) DescribeVolumesModificationsWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockEC2MockRecorder) DescribeVolumesWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockEC2MockRecorder) DetachVolumeWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockEC2MockRecorder) EnableFastSnapshotRestoresWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockEC2MockRecorder) ModifyVolumeWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
- type MockMetadataService
- func (m *MockMetadataService) EXPECT() *MockMetadataServiceMockRecorder
- func (m *MockMetadataService) GetAvailabilityZone() string
- func (m *MockMetadataService) GetInstanceID() string
- func (m *MockMetadataService) GetInstanceType() string
- func (m *MockMetadataService) GetNumAttachedENIs() int
- func (m *MockMetadataService) GetNumBlockDeviceMappings() int
- func (m *MockMetadataService) GetOutpostArn() arn.ARN
- func (m *MockMetadataService) GetRegion() string
- type MockMetadataServiceMockRecorder
- func (mr *MockMetadataServiceMockRecorder) GetAvailabilityZone() *gomock.Call
- func (mr *MockMetadataServiceMockRecorder) GetInstanceID() *gomock.Call
- func (mr *MockMetadataServiceMockRecorder) GetInstanceType() *gomock.Call
- func (mr *MockMetadataServiceMockRecorder) GetNumAttachedENIs() *gomock.Call
- func (mr *MockMetadataServiceMockRecorder) GetNumBlockDeviceMappings() *gomock.Call
- func (mr *MockMetadataServiceMockRecorder) GetOutpostArn() *gomock.Call
- func (mr *MockMetadataServiceMockRecorder) GetRegion() *gomock.Call
- type Snapshot
- type SnapshotOptions
Constants ¶
const ( // VolumeTypeIO1 represents a provisioned IOPS SSD type of volume. VolumeTypeIO1 = "io1" // VolumeTypeIO2 represents a provisioned IOPS SSD type of volume. VolumeTypeIO2 = "io2" // VolumeTypeGP2 represents a general purpose SSD type of volume. VolumeTypeGP2 = "gp2" // VolumeTypeGP3 represents a general purpose SSD type of volume. VolumeTypeGP3 = "gp3" // VolumeTypeSC1 represents a cold HDD (sc1) type of volume. VolumeTypeSC1 = "sc1" // VolumeTypeST1 represents a throughput-optimized HDD type of volume. VolumeTypeST1 = "st1" // VolumeTypeSBG1 represents a capacity-optimized HDD type of volume. Only for SBE devices. VolumeTypeSBG1 = "sbg1" // VolumeTypeSBP1 represents a performance-optimized SSD type of volume. Only for SBE devices. VolumeTypeSBP1 = "sbp1" // VolumeTypeStandard represents a previous type of volume. VolumeTypeStandard = "standard" )
AWS volume types
const ( // MaxNumTagsPerResource represents the maximum number of tags per AWS resource. MaxNumTagsPerResource = 50 // MinTagKeyLength represents the minimum key length for a tag. MinTagKeyLength = 1 // MaxTagKeyLength represents the maximum key length for a tag. MaxTagKeyLength = 128 // MaxTagValueLength represents the maximum value length for a tag. MaxTagValueLength = 256 )
AWS provisioning limits. Source:
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions
const ( // VolumeNameTagKey is the key value that refers to the volume's name. VolumeNameTagKey = "CSIVolumeName" // SnapshotNameTagKey is the key value that refers to the snapshot's name. SnapshotNameTagKey = "CSIVolumeSnapshotName" // KubernetesTagKeyPrefix is the prefix of the key value that is reserved for Kubernetes. KubernetesTagKeyPrefix = "kubernetes.io" // AWSTagKeyPrefix is the prefix of the key value that is reserved for AWS. AWSTagKeyPrefix = "aws:" //AwsEbsDriverTagKey is the tag to identify if a volume/snapshot is managed by ebs csi driver AwsEbsDriverTagKey = "ebs.csi.aws.com/cluster" )
Tags
const ( // DefaultVolumeSize represents the default volume size. DefaultVolumeSize int64 = 100 * util.GiB )
Defaults
Variables ¶
var ( // ErrMultiDisks is an error that is returned when multiple // disks are found with the same volume name. ErrMultiDisks = errors.New("Multiple disks with same name") // ErrDiskExistsDiffSize is an error that is returned if a disk with a given // name, but different size, is found. ErrDiskExistsDiffSize = errors.New("There is already a disk with same name and different size") // ErrNotFound is returned when a resource is not found. ErrNotFound = errors.New("Resource was not found") // ErrIdempotent is returned when another request with same idempotent token is in-flight. ErrIdempotentParameterMismatch = errors.New("Parameters on this idempotent request are inconsistent with parameters used in previous request(s)") // ErrAlreadyExists is returned when a resource is already existent. ErrAlreadyExists = errors.New("Resource already exists") // ErrVolumeInUse is returned when a volume is already attached to an instance. ErrVolumeInUse = errors.New("Request volume is already attached to an instance") // ErrMultiSnapshots is returned when multiple snapshots are found // with the same ID ErrMultiSnapshots = errors.New("Multiple snapshots with the same name found") // ErrInvalidMaxResults is returned when a MaxResults pagination parameter is between 1 and 4 ErrInvalidMaxResults = errors.New("MaxResults parameter must be 0 or greater than or equal to 5") // VolumeNotBeingModified is returned if volume being described is not being modified VolumeNotBeingModified = fmt.Errorf("volume is not being modified") )
var DefaultEC2MetadataClient = func() (EC2Metadata, error) { sess := session.Must(session.NewSession(&aws.Config{})) svc := ec2metadata.New(sess) return svc, nil }
var DefaultKubernetesAPIClient = func() (kubernetes.Interface, error) { config, err := rest.InClusterConfig() if err != nil { return nil, err } clientset, err := kubernetes.NewForConfig(config) if err != nil { return nil, err } return clientset, nil }
var ( ValidVolumeTypes = []string{ VolumeTypeIO1, VolumeTypeIO2, VolumeTypeGP2, VolumeTypeGP3, VolumeTypeSC1, VolumeTypeST1, VolumeTypeStandard, } )
Functions ¶
func GetEBSLimitForInstanceType ¶ added in v1.6.0
func GetMaxAttachments ¶ added in v1.6.0
func GetNVMeInstanceStoreVolumesForInstanceType ¶ added in v1.6.0
func IsNitroInstanceType ¶ added in v1.6.0
func RecordRequestsHandler ¶ added in v1.0.0
RecordRequestsComplete is added to the Complete chain; called after any request
func RecordThrottledRequestsHandler ¶ added in v1.0.0
RecordThrottlesAfterRetry is added to the AfterRetry chain; called after any error
func RegisterMetrics ¶ added in v1.0.0
func RegisterMetrics()
Types ¶
type Cloud ¶
type Cloud interface { CreateDisk(ctx context.Context, volumeName string, diskOptions *DiskOptions) (disk *Disk, err error) DeleteDisk(ctx context.Context, volumeID string) (success bool, err error) AttachDisk(ctx context.Context, volumeID string, nodeID string) (devicePath string, err error) DetachDisk(ctx context.Context, volumeID string, nodeID string) (err error) ResizeDisk(ctx context.Context, volumeID string, reqSize int64) (newSize int64, err error) WaitForAttachmentState(ctx context.Context, volumeID, expectedState string, expectedInstance string, expectedDevice string, alreadyAssigned bool) (*ec2.VolumeAttachment, error) GetDiskByName(ctx context.Context, name string, capacityBytes int64) (disk *Disk, err error) GetDiskByID(ctx context.Context, volumeID string) (disk *Disk, err error) IsExistInstance(ctx context.Context, nodeID string) (success bool) CreateSnapshot(ctx context.Context, volumeID string, snapshotOptions *SnapshotOptions) (snapshot *Snapshot, err error) DeleteSnapshot(ctx context.Context, snapshotID string) (success bool, err error) GetSnapshotByName(ctx context.Context, name string) (snapshot *Snapshot, err error) GetSnapshotByID(ctx context.Context, snapshotID string) (snapshot *Snapshot, err error) ListSnapshots(ctx context.Context, volumeID string, maxResults int64, nextToken string) (listSnapshotsResponse *ListSnapshotsResponse, err error) EnableFastSnapshotRestores(ctx context.Context, availabilityZones []string, snapshotID string) (*ec2.EnableFastSnapshotRestoresOutput, error) AvailabilityZones(ctx context.Context) (map[string]struct{}, error) }
type Disk ¶
type Disk struct { VolumeID string CapacityGiB int64 AvailabilityZone string SnapshotID string OutpostArn string Attachments []string }
Disk represents a EBS volume
type DiskOptions ¶
type DiskOptions struct { CapacityBytes int64 Tags map[string]string VolumeType string IOPSPerGB int AllowIOPSPerGBIncrease bool IOPS int Throughput int AvailabilityZone string OutpostArn string Encrypted bool BlockExpress bool // KmsKeyID represents a fully qualified resource name to the key to use for encryption. // example: arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef KmsKeyID string SnapshotID string }
DiskOptions represents parameters to create an EBS volume
type EC2 ¶
type EC2 interface { DescribeVolumesWithContext(ctx aws.Context, input *ec2.DescribeVolumesInput, opts ...request.Option) (*ec2.DescribeVolumesOutput, error) CreateVolumeWithContext(ctx aws.Context, input *ec2.CreateVolumeInput, opts ...request.Option) (*ec2.Volume, error) DeleteVolumeWithContext(ctx aws.Context, input *ec2.DeleteVolumeInput, opts ...request.Option) (*ec2.DeleteVolumeOutput, error) DetachVolumeWithContext(ctx aws.Context, input *ec2.DetachVolumeInput, opts ...request.Option) (*ec2.VolumeAttachment, error) AttachVolumeWithContext(ctx aws.Context, input *ec2.AttachVolumeInput, opts ...request.Option) (*ec2.VolumeAttachment, error) DescribeInstancesWithContext(ctx aws.Context, input *ec2.DescribeInstancesInput, opts ...request.Option) (*ec2.DescribeInstancesOutput, error) CreateSnapshotWithContext(ctx aws.Context, input *ec2.CreateSnapshotInput, opts ...request.Option) (*ec2.Snapshot, error) DeleteSnapshotWithContext(ctx aws.Context, input *ec2.DeleteSnapshotInput, opts ...request.Option) (*ec2.DeleteSnapshotOutput, error) DescribeSnapshotsWithContext(ctx aws.Context, input *ec2.DescribeSnapshotsInput, opts ...request.Option) (*ec2.DescribeSnapshotsOutput, error) ModifyVolumeWithContext(ctx aws.Context, input *ec2.ModifyVolumeInput, opts ...request.Option) (*ec2.ModifyVolumeOutput, error) DescribeVolumesModificationsWithContext(ctx aws.Context, input *ec2.DescribeVolumesModificationsInput, opts ...request.Option) (*ec2.DescribeVolumesModificationsOutput, error) DescribeAvailabilityZonesWithContext(ctx aws.Context, input *ec2.DescribeAvailabilityZonesInput, opts ...request.Option) (*ec2.DescribeAvailabilityZonesOutput, error) CreateTagsWithContext(ctx aws.Context, input *ec2.CreateTagsInput, opts ...request.Option) (*ec2.CreateTagsOutput, error) EnableFastSnapshotRestoresWithContext(ctx aws.Context, input *ec2.EnableFastSnapshotRestoresInput, opts ...request.Option) (*ec2.EnableFastSnapshotRestoresOutput, error) }
EC2 abstracts aws.EC2 to facilitate its mocking. See https://docs.aws.amazon.com/sdk-for-go/api/service/ec2/ for details
type EC2Metadata ¶
type EC2Metadata interface { Available() bool // ec2 instance metadata endpoints: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html GetMetadata(string) (string, error) GetInstanceIdentityDocument() (ec2metadata.EC2InstanceIdentityDocument, error) }
type EC2MetadataClient ¶ added in v1.2.0
type EC2MetadataClient func() (EC2Metadata, error)
type KubernetesAPIClient ¶ added in v1.2.0
type KubernetesAPIClient func() (kubernetes.Interface, error)
type ListSnapshotsResponse ¶ added in v0.4.0
ListSnapshotsResponse is the container for our snapshots along with a pagination token to pass back to the caller
type Metadata ¶ added in v0.4.0
type Metadata struct { InstanceID string InstanceType string Region string AvailabilityZone string NumAttachedENIs int NumBlockDeviceMappings int OutpostArn arn.ARN }
Metadata is info about the ec2 instance on which the driver is running
func EC2MetadataInstanceInfo ¶ added in v1.2.0
func EC2MetadataInstanceInfo(svc EC2Metadata, regionFromSession string) (*Metadata, error)
func KubernetesAPIInstanceInfo ¶ added in v1.2.0
func KubernetesAPIInstanceInfo(clientset kubernetes.Interface) (*Metadata, error)
func (*Metadata) GetAvailabilityZone ¶ added in v0.4.0
GetAvailabilityZone returns the Availability Zone which the instance is in.
func (*Metadata) GetInstanceID ¶ added in v0.4.0
GetInstanceID returns the instance identification.
func (*Metadata) GetInstanceType ¶ added in v0.4.0
GetInstanceType returns the instance type.
func (*Metadata) GetNumAttachedENIs ¶ added in v1.6.0
func (*Metadata) GetNumBlockDeviceMappings ¶ added in v1.6.0
func (*Metadata) GetOutpostArn ¶ added in v0.7.0
GetOutpostArn returns outpost arn if instance is running on an outpost. empty otherwise.
type MetadataService ¶
type MetadataService interface { GetInstanceID() string GetInstanceType() string GetRegion() string GetAvailabilityZone() string GetNumAttachedENIs() int GetNumBlockDeviceMappings() int GetOutpostArn() arn.ARN }
MetadataService represents AWS metadata service.
func NewMetadataService ¶
func NewMetadataService(ec2MetadataClient EC2MetadataClient, k8sAPIClient KubernetesAPIClient, region string) (MetadataService, error)
type MockCloud ¶ added in v1.4.0
type MockCloud struct {
// contains filtered or unexported fields
}
MockCloud is a mock of Cloud interface.
func NewMockCloud ¶ added in v1.4.0
func NewMockCloud(ctrl *gomock.Controller) *MockCloud
NewMockCloud creates a new mock instance.
func (*MockCloud) AttachDisk ¶ added in v1.4.0
AttachDisk mocks base method.
func (*MockCloud) AvailabilityZones ¶ added in v1.18.0
AvailabilityZones mocks base method.
func (*MockCloud) CreateDisk ¶ added in v1.4.0
func (m *MockCloud) CreateDisk(ctx context.Context, volumeName string, diskOptions *DiskOptions) (*Disk, error)
CreateDisk mocks base method.
func (*MockCloud) CreateSnapshot ¶ added in v1.4.0
func (m *MockCloud) CreateSnapshot(ctx context.Context, volumeID string, snapshotOptions *SnapshotOptions) (*Snapshot, error)
CreateSnapshot mocks base method.
func (*MockCloud) DeleteDisk ¶ added in v1.4.0
DeleteDisk mocks base method.
func (*MockCloud) DeleteSnapshot ¶ added in v1.4.0
DeleteSnapshot mocks base method.
func (*MockCloud) DetachDisk ¶ added in v1.4.0
DetachDisk mocks base method.
func (*MockCloud) EXPECT ¶ added in v1.4.0
func (m *MockCloud) EXPECT() *MockCloudMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockCloud) EnableFastSnapshotRestores ¶ added in v1.18.0
func (m *MockCloud) EnableFastSnapshotRestores(ctx context.Context, availabilityZones []string, snapshotID string) (*ec2.EnableFastSnapshotRestoresOutput, error)
EnableFastSnapshotRestores mocks base method.
func (*MockCloud) GetDiskByID ¶ added in v1.4.0
GetDiskByID mocks base method.
func (*MockCloud) GetDiskByName ¶ added in v1.4.0
func (m *MockCloud) GetDiskByName(ctx context.Context, name string, capacityBytes int64) (*Disk, error)
GetDiskByName mocks base method.
func (*MockCloud) GetSnapshotByID ¶ added in v1.4.0
GetSnapshotByID mocks base method.
func (*MockCloud) GetSnapshotByName ¶ added in v1.4.0
GetSnapshotByName mocks base method.
func (*MockCloud) IsExistInstance ¶ added in v1.4.0
IsExistInstance mocks base method.
func (*MockCloud) ListSnapshots ¶ added in v1.4.0
func (m *MockCloud) ListSnapshots(ctx context.Context, volumeID string, maxResults int64, nextToken string) (*ListSnapshotsResponse, error)
ListSnapshots mocks base method.
func (*MockCloud) ResizeDisk ¶ added in v1.4.0
ResizeDisk mocks base method.
func (*MockCloud) WaitForAttachmentState ¶ added in v1.4.0
func (m *MockCloud) WaitForAttachmentState(ctx context.Context, volumeID, expectedState, expectedInstance, expectedDevice string, alreadyAssigned bool) (*ec2.VolumeAttachment, error)
WaitForAttachmentState mocks base method.
type MockCloudMockRecorder ¶ added in v1.4.0
type MockCloudMockRecorder struct {
// contains filtered or unexported fields
}
MockCloudMockRecorder is the mock recorder for MockCloud.
func (*MockCloudMockRecorder) AttachDisk ¶ added in v1.4.0
func (mr *MockCloudMockRecorder) AttachDisk(ctx, volumeID, nodeID interface{}) *gomock.Call
AttachDisk indicates an expected call of AttachDisk.
func (*MockCloudMockRecorder) AvailabilityZones ¶ added in v1.18.0
func (mr *MockCloudMockRecorder) AvailabilityZones(ctx interface{}) *gomock.Call
AvailabilityZones indicates an expected call of AvailabilityZones.
func (*MockCloudMockRecorder) CreateDisk ¶ added in v1.4.0
func (mr *MockCloudMockRecorder) CreateDisk(ctx, volumeName, diskOptions interface{}) *gomock.Call
CreateDisk indicates an expected call of CreateDisk.
func (*MockCloudMockRecorder) CreateSnapshot ¶ added in v1.4.0
func (mr *MockCloudMockRecorder) CreateSnapshot(ctx, volumeID, snapshotOptions interface{}) *gomock.Call
CreateSnapshot indicates an expected call of CreateSnapshot.
func (*MockCloudMockRecorder) DeleteDisk ¶ added in v1.4.0
func (mr *MockCloudMockRecorder) DeleteDisk(ctx, volumeID interface{}) *gomock.Call
DeleteDisk indicates an expected call of DeleteDisk.
func (*MockCloudMockRecorder) DeleteSnapshot ¶ added in v1.4.0
func (mr *MockCloudMockRecorder) DeleteSnapshot(ctx, snapshotID interface{}) *gomock.Call
DeleteSnapshot indicates an expected call of DeleteSnapshot.
func (*MockCloudMockRecorder) DetachDisk ¶ added in v1.4.0
func (mr *MockCloudMockRecorder) DetachDisk(ctx, volumeID, nodeID interface{}) *gomock.Call
DetachDisk indicates an expected call of DetachDisk.
func (*MockCloudMockRecorder) EnableFastSnapshotRestores ¶ added in v1.18.0
func (mr *MockCloudMockRecorder) EnableFastSnapshotRestores(ctx, availabilityZones, snapshotID interface{}) *gomock.Call
EnableFastSnapshotRestores indicates an expected call of EnableFastSnapshotRestores.
func (*MockCloudMockRecorder) GetDiskByID ¶ added in v1.4.0
func (mr *MockCloudMockRecorder) GetDiskByID(ctx, volumeID interface{}) *gomock.Call
GetDiskByID indicates an expected call of GetDiskByID.
func (*MockCloudMockRecorder) GetDiskByName ¶ added in v1.4.0
func (mr *MockCloudMockRecorder) GetDiskByName(ctx, name, capacityBytes interface{}) *gomock.Call
GetDiskByName indicates an expected call of GetDiskByName.
func (*MockCloudMockRecorder) GetSnapshotByID ¶ added in v1.4.0
func (mr *MockCloudMockRecorder) GetSnapshotByID(ctx, snapshotID interface{}) *gomock.Call
GetSnapshotByID indicates an expected call of GetSnapshotByID.
func (*MockCloudMockRecorder) GetSnapshotByName ¶ added in v1.4.0
func (mr *MockCloudMockRecorder) GetSnapshotByName(ctx, name interface{}) *gomock.Call
GetSnapshotByName indicates an expected call of GetSnapshotByName.
func (*MockCloudMockRecorder) IsExistInstance ¶ added in v1.4.0
func (mr *MockCloudMockRecorder) IsExistInstance(ctx, nodeID interface{}) *gomock.Call
IsExistInstance indicates an expected call of IsExistInstance.
func (*MockCloudMockRecorder) ListSnapshots ¶ added in v1.4.0
func (mr *MockCloudMockRecorder) ListSnapshots(ctx, volumeID, maxResults, nextToken interface{}) *gomock.Call
ListSnapshots indicates an expected call of ListSnapshots.
func (*MockCloudMockRecorder) ResizeDisk ¶ added in v1.4.0
func (mr *MockCloudMockRecorder) ResizeDisk(ctx, volumeID, reqSize interface{}) *gomock.Call
ResizeDisk indicates an expected call of ResizeDisk.
func (*MockCloudMockRecorder) WaitForAttachmentState ¶ added in v1.4.0
func (mr *MockCloudMockRecorder) WaitForAttachmentState(ctx, volumeID, expectedState, expectedInstance, expectedDevice, alreadyAssigned interface{}) *gomock.Call
WaitForAttachmentState indicates an expected call of WaitForAttachmentState.
type MockEC2 ¶ added in v1.4.0
type MockEC2 struct {
// contains filtered or unexported fields
}
MockEC2 is a mock of EC2 interface.
func NewMockEC2 ¶ added in v1.4.0
func NewMockEC2(ctrl *gomock.Controller) *MockEC2
NewMockEC2 creates a new mock instance.
func (*MockEC2) AttachVolumeWithContext ¶ added in v1.4.0
func (m *MockEC2) AttachVolumeWithContext(ctx aws.Context, input *ec2.AttachVolumeInput, opts ...request.Option) (*ec2.VolumeAttachment, error)
AttachVolumeWithContext mocks base method.
func (*MockEC2) CreateSnapshotWithContext ¶ added in v1.4.0
func (m *MockEC2) CreateSnapshotWithContext(ctx aws.Context, input *ec2.CreateSnapshotInput, opts ...request.Option) (*ec2.Snapshot, error)
CreateSnapshotWithContext mocks base method.
func (*MockEC2) CreateTagsWithContext ¶ added in v1.11.0
func (m *MockEC2) CreateTagsWithContext(ctx aws.Context, input *ec2.CreateTagsInput, opts ...request.Option) (*ec2.CreateTagsOutput, error)
CreateTagsWithContext mocks base method.
func (*MockEC2) CreateVolumeWithContext ¶ added in v1.4.0
func (m *MockEC2) CreateVolumeWithContext(ctx aws.Context, input *ec2.CreateVolumeInput, opts ...request.Option) (*ec2.Volume, error)
CreateVolumeWithContext mocks base method.
func (*MockEC2) DeleteSnapshotWithContext ¶ added in v1.4.0
func (m *MockEC2) DeleteSnapshotWithContext(ctx aws.Context, input *ec2.DeleteSnapshotInput, opts ...request.Option) (*ec2.DeleteSnapshotOutput, error)
DeleteSnapshotWithContext mocks base method.
func (*MockEC2) DeleteVolumeWithContext ¶ added in v1.4.0
func (m *MockEC2) DeleteVolumeWithContext(ctx aws.Context, input *ec2.DeleteVolumeInput, opts ...request.Option) (*ec2.DeleteVolumeOutput, error)
DeleteVolumeWithContext mocks base method.
func (*MockEC2) DescribeAvailabilityZonesWithContext ¶ added in v1.4.0
func (m *MockEC2) DescribeAvailabilityZonesWithContext(ctx aws.Context, input *ec2.DescribeAvailabilityZonesInput, opts ...request.Option) (*ec2.DescribeAvailabilityZonesOutput, error)
DescribeAvailabilityZonesWithContext mocks base method.
func (*MockEC2) DescribeInstancesWithContext ¶ added in v1.4.0
func (m *MockEC2) DescribeInstancesWithContext(ctx aws.Context, input *ec2.DescribeInstancesInput, opts ...request.Option) (*ec2.DescribeInstancesOutput, error)
DescribeInstancesWithContext mocks base method.
func (*MockEC2) DescribeSnapshotsWithContext ¶ added in v1.4.0
func (m *MockEC2) DescribeSnapshotsWithContext(ctx aws.Context, input *ec2.DescribeSnapshotsInput, opts ...request.Option) (*ec2.DescribeSnapshotsOutput, error)
DescribeSnapshotsWithContext mocks base method.
func (*MockEC2) DescribeVolumesModificationsWithContext ¶ added in v1.4.0
func (m *MockEC2) DescribeVolumesModificationsWithContext(ctx aws.Context, input *ec2.DescribeVolumesModificationsInput, opts ...request.Option) (*ec2.DescribeVolumesModificationsOutput, error)
DescribeVolumesModificationsWithContext mocks base method.
func (*MockEC2) DescribeVolumesWithContext ¶ added in v1.4.0
func (m *MockEC2) DescribeVolumesWithContext(ctx aws.Context, input *ec2.DescribeVolumesInput, opts ...request.Option) (*ec2.DescribeVolumesOutput, error)
DescribeVolumesWithContext mocks base method.
func (*MockEC2) DetachVolumeWithContext ¶ added in v1.4.0
func (m *MockEC2) DetachVolumeWithContext(ctx aws.Context, input *ec2.DetachVolumeInput, opts ...request.Option) (*ec2.VolumeAttachment, error)
DetachVolumeWithContext mocks base method.
func (*MockEC2) EXPECT ¶ added in v1.4.0
func (m *MockEC2) EXPECT() *MockEC2MockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockEC2) EnableFastSnapshotRestoresWithContext ¶ added in v1.18.0
func (m *MockEC2) EnableFastSnapshotRestoresWithContext(ctx aws.Context, input *ec2.EnableFastSnapshotRestoresInput, opts ...request.Option) (*ec2.EnableFastSnapshotRestoresOutput, error)
EnableFastSnapshotRestoresWithContext mocks base method.
func (*MockEC2) ModifyVolumeWithContext ¶ added in v1.4.0
func (m *MockEC2) ModifyVolumeWithContext(ctx aws.Context, input *ec2.ModifyVolumeInput, opts ...request.Option) (*ec2.ModifyVolumeOutput, error)
ModifyVolumeWithContext mocks base method.
type MockEC2Metadata ¶ added in v1.4.0
type MockEC2Metadata struct {
// contains filtered or unexported fields
}
MockEC2Metadata is a mock of EC2Metadata interface.
func NewMockEC2Metadata ¶ added in v1.4.0
func NewMockEC2Metadata(ctrl *gomock.Controller) *MockEC2Metadata
NewMockEC2Metadata creates a new mock instance.
func (*MockEC2Metadata) Available ¶ added in v1.4.0
func (m *MockEC2Metadata) Available() bool
Available mocks base method.
func (*MockEC2Metadata) EXPECT ¶ added in v1.4.0
func (m *MockEC2Metadata) EXPECT() *MockEC2MetadataMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockEC2Metadata) GetInstanceIdentityDocument ¶ added in v1.4.0
func (m *MockEC2Metadata) GetInstanceIdentityDocument() (ec2metadata.EC2InstanceIdentityDocument, error)
GetInstanceIdentityDocument mocks base method.
func (*MockEC2Metadata) GetMetadata ¶ added in v1.4.0
func (m *MockEC2Metadata) GetMetadata(arg0 string) (string, error)
GetMetadata mocks base method.
type MockEC2MetadataMockRecorder ¶ added in v1.4.0
type MockEC2MetadataMockRecorder struct {
// contains filtered or unexported fields
}
MockEC2MetadataMockRecorder is the mock recorder for MockEC2Metadata.
func (*MockEC2MetadataMockRecorder) Available ¶ added in v1.4.0
func (mr *MockEC2MetadataMockRecorder) Available() *gomock.Call
Available indicates an expected call of Available.
func (*MockEC2MetadataMockRecorder) GetInstanceIdentityDocument ¶ added in v1.4.0
func (mr *MockEC2MetadataMockRecorder) GetInstanceIdentityDocument() *gomock.Call
GetInstanceIdentityDocument indicates an expected call of GetInstanceIdentityDocument.
func (*MockEC2MetadataMockRecorder) GetMetadata ¶ added in v1.4.0
func (mr *MockEC2MetadataMockRecorder) GetMetadata(arg0 interface{}) *gomock.Call
GetMetadata indicates an expected call of GetMetadata.
type MockEC2MockRecorder ¶ added in v1.4.0
type MockEC2MockRecorder struct {
// contains filtered or unexported fields
}
MockEC2MockRecorder is the mock recorder for MockEC2.
func (*MockEC2MockRecorder) AttachVolumeWithContext ¶ added in v1.4.0
func (mr *MockEC2MockRecorder) AttachVolumeWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
AttachVolumeWithContext indicates an expected call of AttachVolumeWithContext.
func (*MockEC2MockRecorder) CreateSnapshotWithContext ¶ added in v1.4.0
func (mr *MockEC2MockRecorder) CreateSnapshotWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
CreateSnapshotWithContext indicates an expected call of CreateSnapshotWithContext.
func (*MockEC2MockRecorder) CreateTagsWithContext ¶ added in v1.11.0
func (mr *MockEC2MockRecorder) CreateTagsWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
CreateTagsWithContext indicates an expected call of CreateTagsWithContext.
func (*MockEC2MockRecorder) CreateVolumeWithContext ¶ added in v1.4.0
func (mr *MockEC2MockRecorder) CreateVolumeWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
CreateVolumeWithContext indicates an expected call of CreateVolumeWithContext.
func (*MockEC2MockRecorder) DeleteSnapshotWithContext ¶ added in v1.4.0
func (mr *MockEC2MockRecorder) DeleteSnapshotWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
DeleteSnapshotWithContext indicates an expected call of DeleteSnapshotWithContext.
func (*MockEC2MockRecorder) DeleteVolumeWithContext ¶ added in v1.4.0
func (mr *MockEC2MockRecorder) DeleteVolumeWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
DeleteVolumeWithContext indicates an expected call of DeleteVolumeWithContext.
func (*MockEC2MockRecorder) DescribeAvailabilityZonesWithContext ¶ added in v1.4.0
func (mr *MockEC2MockRecorder) DescribeAvailabilityZonesWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
DescribeAvailabilityZonesWithContext indicates an expected call of DescribeAvailabilityZonesWithContext.
func (*MockEC2MockRecorder) DescribeInstancesWithContext ¶ added in v1.4.0
func (mr *MockEC2MockRecorder) DescribeInstancesWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
DescribeInstancesWithContext indicates an expected call of DescribeInstancesWithContext.
func (*MockEC2MockRecorder) DescribeSnapshotsWithContext ¶ added in v1.4.0
func (mr *MockEC2MockRecorder) DescribeSnapshotsWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
DescribeSnapshotsWithContext indicates an expected call of DescribeSnapshotsWithContext.
func (*MockEC2MockRecorder) DescribeVolumesModificationsWithContext ¶ added in v1.4.0
func (mr *MockEC2MockRecorder) DescribeVolumesModificationsWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
DescribeVolumesModificationsWithContext indicates an expected call of DescribeVolumesModificationsWithContext.
func (*MockEC2MockRecorder) DescribeVolumesWithContext ¶ added in v1.4.0
func (mr *MockEC2MockRecorder) DescribeVolumesWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
DescribeVolumesWithContext indicates an expected call of DescribeVolumesWithContext.
func (*MockEC2MockRecorder) DetachVolumeWithContext ¶ added in v1.4.0
func (mr *MockEC2MockRecorder) DetachVolumeWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
DetachVolumeWithContext indicates an expected call of DetachVolumeWithContext.
func (*MockEC2MockRecorder) EnableFastSnapshotRestoresWithContext ¶ added in v1.18.0
func (mr *MockEC2MockRecorder) EnableFastSnapshotRestoresWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
EnableFastSnapshotRestoresWithContext indicates an expected call of EnableFastSnapshotRestoresWithContext.
func (*MockEC2MockRecorder) ModifyVolumeWithContext ¶ added in v1.4.0
func (mr *MockEC2MockRecorder) ModifyVolumeWithContext(ctx, input interface{}, opts ...interface{}) *gomock.Call
ModifyVolumeWithContext indicates an expected call of ModifyVolumeWithContext.
type MockMetadataService ¶ added in v1.4.0
type MockMetadataService struct {
// contains filtered or unexported fields
}
MockMetadataService is a mock of MetadataService interface.
func NewMockMetadataService ¶ added in v1.4.0
func NewMockMetadataService(ctrl *gomock.Controller) *MockMetadataService
NewMockMetadataService creates a new mock instance.
func (*MockMetadataService) EXPECT ¶ added in v1.4.0
func (m *MockMetadataService) EXPECT() *MockMetadataServiceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockMetadataService) GetAvailabilityZone ¶ added in v1.4.0
func (m *MockMetadataService) GetAvailabilityZone() string
GetAvailabilityZone mocks base method.
func (*MockMetadataService) GetInstanceID ¶ added in v1.4.0
func (m *MockMetadataService) GetInstanceID() string
GetInstanceID mocks base method.
func (*MockMetadataService) GetInstanceType ¶ added in v1.4.0
func (m *MockMetadataService) GetInstanceType() string
GetInstanceType mocks base method.
func (*MockMetadataService) GetNumAttachedENIs ¶ added in v1.6.0
func (m *MockMetadataService) GetNumAttachedENIs() int
GetNumAttachedENIs mocks base method.
func (*MockMetadataService) GetNumBlockDeviceMappings ¶ added in v1.6.0
func (m *MockMetadataService) GetNumBlockDeviceMappings() int
GetNumBlockDeviceMappings mocks base method.
func (*MockMetadataService) GetOutpostArn ¶ added in v1.4.0
func (m *MockMetadataService) GetOutpostArn() arn.ARN
GetOutpostArn mocks base method.
func (*MockMetadataService) GetRegion ¶ added in v1.4.0
func (m *MockMetadataService) GetRegion() string
GetRegion mocks base method.
type MockMetadataServiceMockRecorder ¶ added in v1.4.0
type MockMetadataServiceMockRecorder struct {
// contains filtered or unexported fields
}
MockMetadataServiceMockRecorder is the mock recorder for MockMetadataService.
func (*MockMetadataServiceMockRecorder) GetAvailabilityZone ¶ added in v1.4.0
func (mr *MockMetadataServiceMockRecorder) GetAvailabilityZone() *gomock.Call
GetAvailabilityZone indicates an expected call of GetAvailabilityZone.
func (*MockMetadataServiceMockRecorder) GetInstanceID ¶ added in v1.4.0
func (mr *MockMetadataServiceMockRecorder) GetInstanceID() *gomock.Call
GetInstanceID indicates an expected call of GetInstanceID.
func (*MockMetadataServiceMockRecorder) GetInstanceType ¶ added in v1.4.0
func (mr *MockMetadataServiceMockRecorder) GetInstanceType() *gomock.Call
GetInstanceType indicates an expected call of GetInstanceType.
func (*MockMetadataServiceMockRecorder) GetNumAttachedENIs ¶ added in v1.6.0
func (mr *MockMetadataServiceMockRecorder) GetNumAttachedENIs() *gomock.Call
GetNumAttachedENIs indicates an expected call of GetNumAttachedENIs.
func (*MockMetadataServiceMockRecorder) GetNumBlockDeviceMappings ¶ added in v1.6.0
func (mr *MockMetadataServiceMockRecorder) GetNumBlockDeviceMappings() *gomock.Call
GetNumBlockDeviceMappings indicates an expected call of GetNumBlockDeviceMappings.
func (*MockMetadataServiceMockRecorder) GetOutpostArn ¶ added in v1.4.0
func (mr *MockMetadataServiceMockRecorder) GetOutpostArn() *gomock.Call
GetOutpostArn indicates an expected call of GetOutpostArn.
func (*MockMetadataServiceMockRecorder) GetRegion ¶ added in v1.4.0
func (mr *MockMetadataServiceMockRecorder) GetRegion() *gomock.Call
GetRegion indicates an expected call of GetRegion.
type Snapshot ¶ added in v0.3.0
type Snapshot struct { SnapshotID string SourceVolumeID string Size int64 CreationTime time.Time ReadyToUse bool }
Snapshot represents an EBS volume snapshot
type SnapshotOptions ¶ added in v0.3.0
SnapshotOptions represents parameters to create an EBS volume