mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-01-12 05:33:11 +01:00
Compare commits
2 Commits
6d2d3eb925
...
2cb76ef622
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2cb76ef622 | ||
|
|
cdb893a70d |
@ -105,8 +105,8 @@ func BuildCertificateFilePath(objectStoreName string) string {
|
||||
// ContextWithProviderOptions enriches the context with cloud service provider specific options
|
||||
// based on the ObjectStore resource
|
||||
func ContextWithProviderOptions(ctx context.Context, objectStore apiv1.ObjectStore) context.Context {
|
||||
if objectStore.GetAnnotations()[pluginmetadata.UseDefaultAzureCredentialsAnnotationName] ==
|
||||
pluginmetadata.UseDefaultAzureCredentialsTrueValue {
|
||||
if objectStore.GetAnnotations()[pluginmetadata.UseDefaultAzureCredentialAnnotationName] ==
|
||||
pluginmetadata.UseDefaultAzureCredentialTrueValue {
|
||||
return command.ContextWithDefaultAzureCredentials(ctx, true)
|
||||
}
|
||||
|
||||
|
||||
@ -4,12 +4,12 @@ package metadata
|
||||
const MetadataNamespace = "barmancloud.cnpg.io"
|
||||
|
||||
const (
|
||||
// UseDefaultAzureCredentialsAnnotationName is an annotation that can be set
|
||||
// on an ObjectStore resource to enable the use DefaultAzureCredentials
|
||||
// to authenticate to Azure. This is meant to be used with inheritFromAzureAD enabled.
|
||||
UseDefaultAzureCredentialsAnnotationName = MetadataNamespace + "/useDefaultAzureCredentials"
|
||||
// UseDefaultAzureCredentialAnnotationName is an annotation that can be set
|
||||
// on an ObjectStore resource to enable the authentication to Azure via DefaultAzureCredential.
|
||||
// This is meant to be used with inheritFromAzureAD enabled.
|
||||
UseDefaultAzureCredentialAnnotationName = MetadataNamespace + "/useDefaultAzureCredential"
|
||||
|
||||
// UseDefaultAzureCredentialsTrueValue is the value for the annotation
|
||||
// barmancloud.cnpg.io/useDefaultAzureCredentials to enable the use of DefaultAzureCredentials
|
||||
UseDefaultAzureCredentialsTrueValue = "true"
|
||||
// UseDefaultAzureCredentialTrueValue is the value for the annotation
|
||||
// barmancloud.cnpg.io/useDefaultAzureCredential to enable the DefaultAzureCredentials auth mechanism.
|
||||
UseDefaultAzureCredentialTrueValue = "true"
|
||||
)
|
||||
|
||||
@ -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 + [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 Default Credentials](https://learn.microsoft.com/en-us/azure/developer/go/sdk/authentication/credential-chains#defaultazurecredential-overview)
|
||||
- [DefaultAzureCredential](https://learn.microsoft.com/en-us/azure/developer/go/sdk/authentication/credential-chains#defaultazurecredential-overview)
|
||||
|
||||
### Azure AD Workload Identity
|
||||
|
||||
@ -253,10 +253,11 @@ spec:
|
||||
[...]
|
||||
```
|
||||
|
||||
### Azure Default Credentials
|
||||
### DefaultAzureCredential
|
||||
|
||||
To authenticate using Azure Default Credentials, set the annotation
|
||||
`barmancloud.cnpg.io/useDefaultAzureCredentials="true"` on the ObjectStore:
|
||||
To authenticate using `DefaultAzureCredential`, set the annotation
|
||||
`barmancloud.cnpg.io/useDefaultAzureCredential="true"` on the ObjectStore in
|
||||
conjunction with the `.spec.configuration.inheritFromAzureAD` option:
|
||||
|
||||
```yaml
|
||||
apiVersion: barmancloud.cnpg.io/v1
|
||||
@ -264,7 +265,7 @@ kind: ObjectStore
|
||||
metadata:
|
||||
name: azure-store
|
||||
annotations:
|
||||
barmancloud.cnpg.io/useDefaultAzureCredentials: "true"
|
||||
barmancloud.cnpg.io/useDefaultAzureCredential: "true"
|
||||
spec:
|
||||
configuration:
|
||||
destinationPath: "<destination path here>"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user