cloudprovider

package
v0.0.0-...-25f5b1c Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AwsAccessKeyId          = "aws-access-key-id"
	AwsSecretAccessKey      = "aws-secret-access-key"
	AwsCloudSecretName      = "cloud-credentials"
	AwsCloudCredentialsPath = "credentials/cloud"
)

Credentials Secret.

View Source
const (
	AzureCredentials          = "azure-credentials"
	AzureCloudSecretName      = "cloud-credentials-azure"
	AzureCloudCredentialsPath = "credentials-azure/cloud"
)

Credentials secret.

View Source
const (
	GcpCredentials          = "gcp-credentials"
	GcpCloudSecretName      = "cloud-credentials-gcp"
	GcpCloudCredentialsPath = "credentials-gcp/cloud"
)

Credentials secret.

View Source
const (
	AWS   = "aws"
	Azure = "azure"
	GCP   = "gcp"
)

Providers.

View Source
const (
	BackupStorage  = "BackupStorage"
	VolumeSnapshot = "VolumeSnapshot"
)

Roles

View Source
const (
	AwsS3DefaultRegion = "us-east-1"
)

S3 constants

Variables

View Source
var AwsCloudCredentialsTemplate = `
[default]
aws_access_key_id=%s
aws_secret_access_key=%s
`

Velero cloud-secret.

View Source
var Settings = &settings.Settings

Functions

This section is empty.

Types

type AWSProvider

type AWSProvider struct {
	BaseProvider
	Bucket                  string
	Region                  string
	S3URL                   string
	PublicURL               string
	KMSKeyId                string
	SignatureVersion        string
	S3ForcePathStyle        bool
	CustomCABundle          []byte
	SnapshotCreationTimeout string
	Insecure                bool
}

func (*AWSProvider) GetCloudCredentialsPath

func (p *AWSProvider) GetCloudCredentialsPath() string

func (*AWSProvider) GetCloudSecretName

func (p *AWSProvider) GetCloudSecretName() string

func (*AWSProvider) GetDisableSSL

func (p *AWSProvider) GetDisableSSL() bool

Check the scheme on the configured URL. If a URL is not specified, return false

func (*AWSProvider) GetForcePathStyle

func (p *AWSProvider) GetForcePathStyle() bool

This function returns a boolean determining whether we are talking to an S3 endpoint that requires path style formatting. Since all S3 APIs support path style, the safe approach is to default to path style if the user has specified an S3 API URL. This should be updated to perform some smarter interpretation of the URL.

func (*AWSProvider) GetRegion

func (p *AWSProvider) GetRegion() string

Returns `us-east-1` if no region is specified

func (*AWSProvider) GetURL

func (p *AWSProvider) GetURL() string

func (*AWSProvider) Test

func (p *AWSProvider) Test(secret *kapi.Secret) error

func (*AWSProvider) UpdateBSL

func (p *AWSProvider) UpdateBSL(bsl *velero.BackupStorageLocation)

func (*AWSProvider) UpdateCloudSecret

func (p *AWSProvider) UpdateCloudSecret(secret, cloudSecret *kapi.Secret) error

func (*AWSProvider) UpdateRegistryDeployment

func (p *AWSProvider) UpdateRegistryDeployment(deployment *appsv1.Deployment, name, dirName string)

func (*AWSProvider) UpdateRegistrySecret

func (p *AWSProvider) UpdateRegistrySecret(secret, registrySecret *kapi.Secret) error

func (*AWSProvider) UpdateVSL

func (p *AWSProvider) UpdateVSL(vsl *velero.VolumeSnapshotLocation)

func (*AWSProvider) Validate

func (p *AWSProvider) Validate(secret *kapi.Secret) []string

type AzureBlobTest

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

func (*AzureBlobTest) Run

func (r *AzureBlobTest) Run() error

type AzureProvider

type AzureProvider struct {
	BaseProvider
	StorageAccount          string
	StorageContainer        string
	ResourceGroup           string
	ClusterResourceGroup    string
	APITimeout              string
	SnapshotCreationTimeout string
}

func (*AzureProvider) GetCloudCredentialsPath

func (p *AzureProvider) GetCloudCredentialsPath() string

func (*AzureProvider) GetCloudSecretName

func (p *AzureProvider) GetCloudSecretName() string

func (*AzureProvider) Test

func (p *AzureProvider) Test(secret *kapi.Secret) error

func (*AzureProvider) UpdateBSL

func (p *AzureProvider) UpdateBSL(bsl *velero.BackupStorageLocation)

func (*AzureProvider) UpdateCloudSecret

func (p *AzureProvider) UpdateCloudSecret(secret, cloudSecret *kapi.Secret) error

func (*AzureProvider) UpdateRegistryDeployment

func (p *AzureProvider) UpdateRegistryDeployment(deployment *appsv1.Deployment, name, dirName string)

func (*AzureProvider) UpdateRegistrySecret

func (p *AzureProvider) UpdateRegistrySecret(secret, registrySecret *kapi.Secret) error

func (*AzureProvider) UpdateVSL

func (p *AzureProvider) UpdateVSL(vsl *velero.VolumeSnapshotLocation)

func (*AzureProvider) Validate

func (p *AzureProvider) Validate(secret *kapi.Secret) []string

type BaseProvider

type BaseProvider struct {
	Name string
	Role string
}

func (*BaseProvider) GetName

func (p *BaseProvider) GetName() string

func (*BaseProvider) SetRole

func (p *BaseProvider) SetRole(role string)

type Ec2Test

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

func (*Ec2Test) Run

func (r *Ec2Test) Run() error

type GCPProvider

type GCPProvider struct {
	BaseProvider
	Bucket                  string
	KMSKeyId                string
	SnapshotCreationTimeout string
}

func (*GCPProvider) GetCloudCredentialsPath

func (p *GCPProvider) GetCloudCredentialsPath() string

func (*GCPProvider) GetCloudSecretName

func (p *GCPProvider) GetCloudSecretName() string

func (*GCPProvider) Test

func (p *GCPProvider) Test(secret *kapi.Secret) error

func (*GCPProvider) UpdateBSL

func (p *GCPProvider) UpdateBSL(bsl *velero.BackupStorageLocation)

func (*GCPProvider) UpdateCloudSecret

func (p *GCPProvider) UpdateCloudSecret(secret, cloudSecret *kapi.Secret) error

func (*GCPProvider) UpdateRegistryDeployment

func (p *GCPProvider) UpdateRegistryDeployment(deployment *appsv1.Deployment, name, dirName string)

func (*GCPProvider) UpdateRegistrySecret

func (p *GCPProvider) UpdateRegistrySecret(secret, registrySecret *kapi.Secret) error

func (*GCPProvider) UpdateVSL

func (p *GCPProvider) UpdateVSL(vsl *velero.VolumeSnapshotLocation)

func (*GCPProvider) Validate

func (p *GCPProvider) Validate(secret *kapi.Secret) []string

type GcsTest

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

func (*GcsTest) Run

func (r *GcsTest) Run() error

type Provider

type Provider interface {
	GetName() string
	GetCloudSecretName() string
	GetCloudCredentialsPath() string
	SetRole(role string)
	UpdateBSL(location *velero.BackupStorageLocation)
	UpdateVSL(location *velero.VolumeSnapshotLocation)
	UpdateCloudSecret(secret, cloudSecret *kapi.Secret) error
	UpdateRegistrySecret(secret, registrySecret *kapi.Secret) error
	UpdateRegistryDeployment(deployment *appsv1.Deployment, name, dirName string)
	Validate(secret *kapi.Secret) []string
	Test(secret *kapi.Secret) error
}

type S3Test

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

func (*S3Test) Run

func (r *S3Test) Run() error

Jump to

Keyboard shortcuts

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