Documentation
¶
Index ¶
- Constants
- Variables
- func ContainsSAS(o *snapshotapi.AzureOptions) bool
- func FillCredentials(ctx context.Context, o *snapshotapi.AzureOptions, tryToCreateSAS bool) error
- func GetBlobURLWithSAS(o *snapshotapi.AzureOptions) string
- func GetClientID(o *snapshotapi.AzureOptions) string
- func GetClientSecret(o *snapshotapi.AzureOptions) string
- func GetResourceGroup(o *snapshotapi.AzureOptions) string
- func GetStorageKey(o *snapshotapi.AzureOptions) string
- func GetSubscriptionID(o *snapshotapi.AzureOptions) string
- func GetTenantID(o *snapshotapi.AzureOptions) string
- func HasServicePrincipal(o *snapshotapi.AzureOptions) bool
- func IsAzureFlagNotSetError(err error) bool
- type BlobInfo
- type ObjectStore
- func (o *ObjectStore) Delete(ctx context.Context) error
- func (o *ObjectStore) GetObject(ctx context.Context) (io.ReadCloser, error)
- func (o *ObjectStore) List(ctx context.Context) ([]snapshotapi.Snapshot, error)
- func (o *ObjectStore) PutObject(ctx context.Context, body io.Reader) error
- func (o *ObjectStore) Target() string
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 ¶
IsAzureFlagNotSetError returns true if the error is caused by a missing Azure flag
Types ¶
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) GetObject ¶
func (o *ObjectStore) GetObject(ctx context.Context) (io.ReadCloser, error)
func (*ObjectStore) List ¶
func (o *ObjectStore) List(ctx context.Context) ([]snapshotapi.Snapshot, error)
func (*ObjectStore) Target ¶
func (o *ObjectStore) Target() string
Click to show internal directories.
Click to hide internal directories.