Compare commits

..

1 Commits

Author SHA1 Message Date
Gabriele Fedi
27ab06ba70
Merge 6d2d3eb925 into 316828cc73 2025-11-17 09:45:45 +00:00
3 changed files with 14 additions and 15 deletions

View File

@ -105,8 +105,8 @@ func BuildCertificateFilePath(objectStoreName string) string {
// ContextWithProviderOptions enriches the context with cloud service provider specific options // ContextWithProviderOptions enriches the context with cloud service provider specific options
// based on the ObjectStore resource // based on the ObjectStore resource
func ContextWithProviderOptions(ctx context.Context, objectStore apiv1.ObjectStore) context.Context { func ContextWithProviderOptions(ctx context.Context, objectStore apiv1.ObjectStore) context.Context {
if objectStore.GetAnnotations()[pluginmetadata.UseDefaultAzureCredentialAnnotationName] == if objectStore.GetAnnotations()[pluginmetadata.UseDefaultAzureCredentialsAnnotationName] ==
pluginmetadata.UseDefaultAzureCredentialTrueValue { pluginmetadata.UseDefaultAzureCredentialsTrueValue {
return command.ContextWithDefaultAzureCredentials(ctx, true) return command.ContextWithDefaultAzureCredentials(ctx, true)
} }

View File

@ -4,12 +4,12 @@ package metadata
const MetadataNamespace = "barmancloud.cnpg.io" const MetadataNamespace = "barmancloud.cnpg.io"
const ( const (
// UseDefaultAzureCredentialAnnotationName is an annotation that can be set // UseDefaultAzureCredentialsAnnotationName is an annotation that can be set
// on an ObjectStore resource to enable the authentication to Azure via DefaultAzureCredential. // on an ObjectStore resource to enable the use DefaultAzureCredentials
// This is meant to be used with inheritFromAzureAD enabled. // to authenticate to Azure. This is meant to be used with inheritFromAzureAD enabled.
UseDefaultAzureCredentialAnnotationName = MetadataNamespace + "/useDefaultAzureCredential" UseDefaultAzureCredentialsAnnotationName = MetadataNamespace + "/useDefaultAzureCredentials"
// UseDefaultAzureCredentialTrueValue is the value for the annotation // UseDefaultAzureCredentialsTrueValue is the value for the annotation
// barmancloud.cnpg.io/useDefaultAzureCredential to enable the DefaultAzureCredentials auth mechanism. // barmancloud.cnpg.io/useDefaultAzureCredentials to enable the use of DefaultAzureCredentials
UseDefaultAzureCredentialTrueValue = "true" UseDefaultAzureCredentialsTrueValue = "true"
) )

View File

@ -233,7 +233,7 @@ Barman Cloud supports the following authentication methods:
- Storage Account Name + [Access Key](https://learn.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage) - Storage Account Name + [Access Key](https://learn.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage)
- Storage Account Name + [SAS Token](https://learn.microsoft.com/en-us/azure/storage/blobs/sas-service-create) - Storage Account Name + [SAS Token](https://learn.microsoft.com/en-us/azure/storage/blobs/sas-service-create)
- [Azure AD Workload Identity](https://azure.github.io/azure-workload-identity/docs/introduction.html) - [Azure AD Workload Identity](https://azure.github.io/azure-workload-identity/docs/introduction.html)
- [DefaultAzureCredential](https://learn.microsoft.com/en-us/azure/developer/go/sdk/authentication/credential-chains#defaultazurecredential-overview) - [Azure Default Credentials](https://learn.microsoft.com/en-us/azure/developer/go/sdk/authentication/credential-chains#defaultazurecredential-overview)
### Azure AD Workload Identity ### Azure AD Workload Identity
@ -253,11 +253,10 @@ spec:
[...] [...]
``` ```
### DefaultAzureCredential ### Azure Default Credentials
To authenticate using `DefaultAzureCredential`, set the annotation To authenticate using Azure Default Credentials, set the annotation
`barmancloud.cnpg.io/useDefaultAzureCredential="true"` on the ObjectStore in `barmancloud.cnpg.io/useDefaultAzureCredentials="true"` on the ObjectStore:
conjunction with the `.spec.configuration.inheritFromAzureAD` option:
```yaml ```yaml
apiVersion: barmancloud.cnpg.io/v1 apiVersion: barmancloud.cnpg.io/v1
@ -265,7 +264,7 @@ kind: ObjectStore
metadata: metadata:
name: azure-store name: azure-store
annotations: annotations:
barmancloud.cnpg.io/useDefaultAzureCredential: "true" barmancloud.cnpg.io/useDefaultAzureCredentials: "true"
spec: spec:
configuration: configuration:
destinationPath: "<destination path here>" destinationPath: "<destination path here>"