feat: add Azure Blob Storage support for backups - #137
Conversation
b7af9cb to
23e7c29
Compare
|
Squashed into one commit and force-pushed for conventional-commit compliance. Also rebased onto latest main so the branch keeps upstream CreateStanza changes alongside the Azure work, the earlier squash had accidentally dropped those. Should be good for review now. |
Adds Azure Blob Storage as a backup destination alongside existing S3 support. Introduces azureCredentials configuration, command-builder flags, credential env injection, RBAC for Azure secrets, and Azurite e2e tests. Existing S3 configurations are unaffected. Signed-off-by: Samarth Verma <verma.samarth05@gmail.com>
23e7c29 to
7a7141e
Compare
Agalin
left a comment
There was a problem hiding this comment.
Really nice work! Hardly anything I can comment on. 🙂
| // don't inject conflicting env vars for the same repo. | ||
| if repo.HasConflictingCloudProviders() { | ||
| return nil, fmt.Errorf( | ||
| "repository \"repo%d\" has both s3Credentials and azureCredentials set; "+ |
There was a problem hiding this comment.
I'd word it has multiple storage credentials set if we don't return which specific pair conflicts - I strongly believe GCS support will arrive sooner or later.
| // TODO: Enforce values via Enum like iin compression. | ||
| // +optional | ||
| // +kubebuilder:validation:Enum=host;path | ||
| URIStyle string `json:"uriStyle,omitempty"` |
There was a problem hiding this comment.
Can we convert it to a proper enum, like proposed in #77? I only now noticed what that PR does (as it's a slightly different thing than referenced issue).
|
Nice to see Azure land, and thanks again for the e2e on #121. Went through it, three small things. The endpoint via env deserves its reason in the comment. I checked pgBackRest's option table and the workaround is right, but it reads as inconsistent next to The conflict check lives in three places, with the message copy-pasted twice.
Nit: the |
feat: add Azure Blob Storage support for backups
Adds Azure Blob Storage as a backup destination alongside the existing S3 support. The Azure path mirrors S3 end to end and existing S3 configurations are unaffected.
Changes
api/config.go): newazureCredentialsblock (account, key, key typeshared/sas,uriStyle); credential-presence check recognizes Azure.command/commandbuilder.go): emits Azure flags (type=azure, container, path, path-style addressing).credentials/credentials.go): reads the Azure account/key from the secret and exports them as env vars (never on the command line).operator/specs/secrets.go): allows the plugin to read the Azure secret.azureCredentials.Testing
go test ./internal/pgbackrest/{command,credentials,api}/).task e2e-external-kind).Compatibility
Additive only. Azure activates when
azureCredentialsis set; the S3 workflow is unchanged.