cloud

package
v1.7.7 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AccessDeniedException    = "AccessDeniedException"
	AccessPointAlreadyExists = "AccessPointAlreadyExists"
	PvcNameTagKey            = "pvcName"
	AccessPointPerFsLimit    = 1000
)

Variables

View Source
var (
	ErrNotFound      = errors.New("Resource was not found")
	ErrAlreadyExists = errors.New("Resource already exists")
	ErrAccessDenied  = errors.New("Access denied")
)
View Source
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
}

Functions

This section is empty.

Types

type AccessPoint added in v1.2.0

type AccessPoint struct {
	AccessPointId      string
	FileSystemId       string
	AccessPointRootDir string
	// Capacity is used for testing purpose only
	// EFS does not consider capacity while provisioning new file systems or access points
	CapacityGiB int64
	PosixUser   *PosixUser
}

type AccessPointOptions added in v1.2.0

type AccessPointOptions struct {
	// Capacity is used for testing purpose only.
	// EFS does not consider capacity while provisioning new file systems or access points
	// Capacity is used to satisfy this test: https://github.com/kubernetes-csi/csi-test/blob/v3.1.1/pkg/sanity/controller.go#L559
	CapacityGiB    int64
	FileSystemId   string
	Uid            int64
	Gid            int64
	DirectoryPerms string
	DirectoryPath  string
	Tags           map[string]string
}

type Cloud

type Cloud interface {
	GetMetadata() MetadataService
	CreateAccessPoint(ctx context.Context, clientToken string, accessPointOpts *AccessPointOptions, reuseAccessPoint bool) (accessPoint *AccessPoint, err error)
	DeleteAccessPoint(ctx context.Context, accessPointId string) (err error)
	DescribeAccessPoint(ctx context.Context, accessPointId string) (accessPoint *AccessPoint, err error)
	ListAccessPoints(ctx context.Context, fileSystemId string) (accessPoints []*AccessPoint, err error)
	DescribeFileSystem(ctx context.Context, fileSystemId string) (fs *FileSystem, err error)
	DescribeMountTargets(ctx context.Context, fileSystemId, az string) (fs *MountTarget, err error)
}

func NewCloud

func NewCloud() (Cloud, error)

NewCloud returns a new instance of AWS cloud It panics if session is invalid

func NewCloudWithRole added in v1.3.0

func NewCloudWithRole(awsRoleArn string) (Cloud, error)

NewCloudWithRole returns a new instance of AWS cloud after assuming an aws role It panics if driver does not have permissions to assume role.

type EC2Metadata

type EC2Metadata interface {
	Available() bool
	GetInstanceIdentityDocument() (ec2metadata.EC2InstanceIdentityDocument, error)
}

type Efs added in v1.2.0

type Efs interface {
	CreateAccessPointWithContext(aws.Context, *efs.CreateAccessPointInput, ...request.Option) (*efs.CreateAccessPointOutput, error)
	DeleteAccessPointWithContext(aws.Context, *efs.DeleteAccessPointInput, ...request.Option) (*efs.DeleteAccessPointOutput, error)
	DescribeAccessPointsWithContext(aws.Context, *efs.DescribeAccessPointsInput, ...request.Option) (*efs.DescribeAccessPointsOutput, error)
	DescribeFileSystemsWithContext(aws.Context, *efs.DescribeFileSystemsInput, ...request.Option) (*efs.DescribeFileSystemsOutput, error)
	DescribeMountTargetsWithContext(aws.Context, *efs.DescribeMountTargetsInput, ...request.Option) (*efs.DescribeMountTargetsOutput, error)
}

Efs abstracts efs client(https://docs.aws.amazon.com/sdk-for-go/api/service/efs/)

type FakeCloudProvider added in v1.2.0

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

func NewFakeCloudProvider added in v1.2.0

func NewFakeCloudProvider() *FakeCloudProvider

func (*FakeCloudProvider) CreateAccessPoint added in v1.2.0

func (c *FakeCloudProvider) CreateAccessPoint(ctx context.Context, clientToken string, accessPointOpts *AccessPointOptions, usePvcName bool) (accessPoint *AccessPoint, err error)

func (*FakeCloudProvider) DeleteAccessPoint added in v1.2.0

func (c *FakeCloudProvider) DeleteAccessPoint(ctx context.Context, accessPointId string) (err error)

func (*FakeCloudProvider) DescribeAccessPoint added in v1.2.0

func (c *FakeCloudProvider) DescribeAccessPoint(ctx context.Context, accessPointId string) (accessPoint *AccessPoint, err error)

func (*FakeCloudProvider) DescribeFileSystem added in v1.2.0

func (c *FakeCloudProvider) DescribeFileSystem(ctx context.Context, fileSystemId string) (fileSystem *FileSystem, err error)

CreateVolume calls DescribeFileSystem and then CreateAccessPoint. Add file system into the map here to allow CreateVolume sanity tests to succeed.

func (*FakeCloudProvider) DescribeMountTargets added in v1.3.0

func (c *FakeCloudProvider) DescribeMountTargets(ctx context.Context, fileSystemId, az string) (mountTarget *MountTarget, err error)

func (*FakeCloudProvider) GetMetadata added in v1.2.0

func (c *FakeCloudProvider) GetMetadata() MetadataService

func (*FakeCloudProvider) ListAccessPoints added in v1.7.0

func (c *FakeCloudProvider) ListAccessPoints(ctx context.Context, fileSystemId string) ([]*AccessPoint, error)

type FileSystem added in v1.2.0

type FileSystem struct {
	FileSystemId string
}

type KubernetesAPIClient added in v1.7.2

type KubernetesAPIClient func() (kubernetes.Interface, error)

type MetadataProvider added in v1.4.0

type MetadataProvider interface {
	// contains filtered or unexported methods
}

func GetNewMetadataProvider added in v1.4.0

func GetNewMetadataProvider(svc EC2Metadata, clientset kubernetes.Interface) (MetadataProvider, error)

GetNewMetadataProvider returns a MetadataProvider on which can be invoked getMetadata() to extract the metadata.

type MetadataService

type MetadataService interface {
	GetInstanceID() string
	GetRegion() string
	GetAvailabilityZone() string
}

MetadataService represents AWS metadata service.

type MountTarget added in v1.3.0

type MountTarget struct {
	AZName        string
	AZId          string
	MountTargetId string
	IPAddress     string
}

type PosixUser added in v1.7.0

type PosixUser struct {
	Gid int64
	Uid int64
}

type TMDSV4Response added in v1.3.0

type TMDSV4Response struct {
	Cluster          string `json:"Cluster"`
	TaskARN          string `json:"TaskARN"`
	AvailabilityZone string `json:"AvailabilityZone"`
}

type TaskMetadataService added in v1.3.0

type TaskMetadataService interface {
	GetTMDSV4Response() ([]byte, error)
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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