etcdupload

package
v0.1.75 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AuthTypeClientSecret uses a JSON file with client ID, secret, and tenant ID.
	AuthTypeClientSecret = "client-secret"
	// AuthTypeManagedIdentity uses msi-dataplane with a certificate file mounted
	// via CSI SecretProviderClass (ARO HCP).
	AuthTypeManagedIdentity = "managed-identity"
)

Variables

This section is empty.

Functions

func NewStartCommand

func NewStartCommand() *cobra.Command

Types

type AzureBlobUploadAPI

type AzureBlobUploadAPI interface {
	UploadFile(ctx context.Context, containerName string, blobName string, file *os.File, o *azblob.UploadFileOptions) (azblob.UploadFileResponse, error)
}

AzureBlobUploadAPI defines the Azure Blob client interface used by the uploader.

type AzureBlobUploader

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

AzureBlobUploader uploads etcd snapshots to Azure Blob Storage.

func NewAzureBlobUploader

func NewAzureBlobUploader(ctx context.Context, container, storageAccount, credentialsFile, encryptionScope, authType string) (*AzureBlobUploader, error)

NewAzureBlobUploader creates a new AzureBlobUploader. authType controls how credentials are loaded:

  • "client-secret": reads a JSON file with clientId/clientSecret/tenantId (default)
  • "managed-identity": uses msi-dataplane with a certificate file from CSI mount (ARO HCP)

If credentialsFile is empty, falls back to DefaultAzureCredential regardless of authType.

func (*AzureBlobUploader) Upload

func (u *AzureBlobUploader) Upload(ctx context.Context, snapshotPath string, key string) (*UploadResult, error)

Upload uploads a snapshot file to Azure Blob Storage with conditional write and optional CMK encryption.

type S3TransferAPI

type S3TransferAPI interface {
	UploadObject(ctx context.Context, input *transfermanager.UploadObjectInput, opts ...func(*transfermanager.Options)) (*transfermanager.UploadObjectOutput, error)
}

S3TransferAPI defines the transfer manager interface used by the uploader.

type S3Uploader

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

S3Uploader uploads etcd snapshots to AWS S3 using the transfer manager.

func NewS3Uploader

func NewS3Uploader(ctx context.Context, bucket, region, credentialsFile, kmsKeyARN string) (*S3Uploader, error)

NewS3Uploader creates a new S3Uploader. If credentialsFile is empty, it falls back to the default AWS credential chain (environment variables, shared config, EC2 instance profile, IRSA, etc.).

func (*S3Uploader) Upload

func (u *S3Uploader) Upload(ctx context.Context, snapshotPath string, key string) (*UploadResult, error)

Upload uploads a snapshot file to S3 with optional SSE-KMS encryption. Uses the transfer manager for automatic multipart upload of large files.

type UploadResult

type UploadResult struct {
	// URL is the cloud storage URL of the uploaded snapshot.
	URL string
}

UploadResult contains the result of an upload operation.

type Uploader

type Uploader interface {
	Upload(ctx context.Context, snapshotPath string, key string) (*UploadResult, error)
}

Uploader uploads an etcd snapshot to cloud storage.

Jump to

Keyboard shortcuts

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