s3

package
v0.0.0-...-37308a2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockBucketPublicAccess

func BlockBucketPublicAccess(s3Client Client, bucketName string) error

BlockBucketPublicAccess blocks public access to the bucket's contents.

func ClearBucketTags

func ClearBucketTags(s3Client Client, bucketName string) (err error)

ClearBucketTags wipes all existing tags from a bucket so that velero-specific tags can be applied to the bucket instead.

func CreateBucket

func CreateBucket(s3Client Client, bucketName string) error

CreateBucket creates a new S3 bucket.

func CreateBucketTaggingInput

func CreateBucketTaggingInput(bucketname string, tags map[string]string) *s3.PutBucketTaggingInput

CreateBucketTaggingInput creates an S3 PutBucketTaggingInput object, which is used to associate a list of tags with a bucket.

func DoesBucketExist

func DoesBucketExist(s3Client Client, bucketName string) (bool, error)

DoesBucketExist checks that the bucket exists, and that we have access to it.

func EncryptBucket

func EncryptBucket(s3Client Client, bucketName string) error

EncryptBucket sets the encryption configuration for the bucket.

func FindMatchingTags

func FindMatchingTags(buckets map[string][]*s3.Tag, infraName string) string

FindMatchingTags looks through the TagSets for all AWS buckets and determines if any of the buckets are tagged for velero updates for the cluster. If matching tags are found, the bucket name is returned.

func ListBucketTags

func ListBucketTags(s3Client Client, buckets []*s3.Bucket) (map[string][]*s3.Tag, error)

ListBucketTags returns a list of s3.GetBucketTagging objects, one for each bucket. If the bucket is not readable, or has no tags, the bucket name is omitted from the taglist. So taglist only contains the list of buckets that have tags.

func ListBuckets

func ListBuckets(s3Client Client) (*s3.ListBucketsOutput, error)

ListBuckets lists all buckets in the AWS account.

func ListBucketsInRegion

func ListBucketsInRegion(s3Client Client, region string) (*s3.ListBucketsOutput, error)

ListBucketsInRegion lists buckets in the AWS account in the given region.

func NewDriver

func NewDriver(ctx context.Context, cfg *configv1.InfrastructureStatus, clnt client.Client) *driver

NewDriver creates a new s3 storage driver Used during bootstrapping

func SetBucketLifecycle

func SetBucketLifecycle(s3Client Client, bucketName string) error

SetBucketLifecycle sets a lifecycle on the specified bucket.

func TagBucket

func TagBucket(s3Client Client, bucketName string, backUpLocation string, infraName string) error

TagBucket adds tags to an S3 bucket. The tags are used to indicate that velero backups are stored in the bucket, and to identify the associated cluster.

Types

type Client

Client is a wrapper object for the actual AWS SDK client to allow for easier testing.

func NewS3Client

func NewS3Client(kubeClient client.Client, region string) (Client, error)

NewS3Client reads the aws secrets in the operator's namespace and uses them to create a new client for accessing the S3 API.

type S3

type S3 struct {
	Region    string
	InfraName string
}

Jump to

Keyboard shortcuts

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