azure

package
v4.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StorageKeyEnvVar is the name of the environment variable that contains the Azure storage account access key that
	// can authenticate vCluster's requests to the storage account
	StorageKeyEnvVar = "AZURE_STORAGE_KEY"

	// StorageBlobSASEnvVar is the name of the environment variable that contains the Azure storage blob SAS token that
	// can be used to authenticate vCluster's requests to the storage blob.
	StorageBlobSASEnvVar = "AZURE_STORAGE_BLOB_SAS"

	// TenantIDEnvVar is the name of the environment variable that contains the Azure tenant ID
	TenantIDEnvVar = "AZURE_TENANT_ID"

	// ClientIDEnvVar is the name of the environment variable that contains the Azure client ID
	ClientIDEnvVar = "AZURE_CLIENT_ID"

	// ClientSecretEnvVar is the name of the environment variable that contains the Azure client secret
	ClientSecretEnvVar = "AZURE_CLIENT_SECRET"
)

Variables

View Source
var (
	// ErrSubscriptionIDNotSet is returned when the Azure subscription ID is not set
	ErrSubscriptionIDNotSet = fmt.Errorf("the Azure subscription ID is required, set AzureOptions.SubscriptionID or the AZURE_SUBSCRIPTION_ID environment variable")

	// ErrResourceGroupNotSet is returned when the Azure resource group is not set
	ErrResourceGroupNotSet = fmt.Errorf("the Azure resource group is required, set AzureOptions.ResourceGroup or the AZURE_RESOURCE_GROUP environment variable")
)

Functions

func ContainsSAS

func ContainsSAS(o *snapshotapi.AzureOptions) bool

func FillCredentials

func FillCredentials(ctx context.Context, o *snapshotapi.AzureOptions, tryToCreateSAS bool) error

func GetBlobURLWithSAS

func GetBlobURLWithSAS(o *snapshotapi.AzureOptions) string

GetBlobURLWithSAS returns the blob URL with SAS token appended

func GetClientID

func GetClientID(o *snapshotapi.AzureOptions) string

func GetClientSecret

func GetClientSecret(o *snapshotapi.AzureOptions) string

func GetResourceGroup

func GetResourceGroup(o *snapshotapi.AzureOptions) string

func GetStorageKey

func GetStorageKey(o *snapshotapi.AzureOptions) string

func GetSubscriptionID

func GetSubscriptionID(o *snapshotapi.AzureOptions) string

func GetTenantID

func GetTenantID(o *snapshotapi.AzureOptions) string

func HasServicePrincipal

func HasServicePrincipal(o *snapshotapi.AzureOptions) bool

func IsAzureFlagNotSetError

func IsAzureFlagNotSetError(err error) bool

IsAzureFlagNotSetError returns true if the error is caused by a missing Azure flag

Types

type BlobInfo

type BlobInfo struct {
	ContainerName string
	BlobName      string
	AccountName   string
}

type ObjectStore

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

func NewStore

func NewStore(ctx context.Context, options *snapshotapi.AzureOptions, logger logr.Logger) (*ObjectStore, error)

func (*ObjectStore) Delete

func (o *ObjectStore) Delete(ctx context.Context) error

func (*ObjectStore) GetObject

func (o *ObjectStore) GetObject(ctx context.Context) (io.ReadCloser, error)

func (*ObjectStore) List

func (*ObjectStore) PutObject

func (o *ObjectStore) PutObject(ctx context.Context, body io.Reader) error

func (*ObjectStore) Target

func (o *ObjectStore) Target() string

Jump to

Keyboard shortcuts

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