Compare commits

..

3 Commits

Author SHA1 Message Date
renovate[bot]
5300d846bc
fix(deps): update all non-major go dependencies to 8e1642e
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-06-04 07:30:08 +00:00
renovate[bot]
de2181479f
chore(deps): lock file maintenance (#931)
This PR contains the following updates:

| Update | Change |
|---|---|
| lockFileMaintenance | All locks refreshed |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/7) for more information.

🔧 This Pull Request updates lock files to use the latest dependency
versions.

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - "before 4am on monday"
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Never, or you tick the rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/cloudnative-pg/plugin-barman-cloud).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMDIuMSIsInVwZGF0ZWRJblZlciI6IjQzLjIwMi4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJhdXRvbWF0ZWQiLCJuby1pc3N1ZSJdfQ==-->

Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
2026-06-04 09:18:37 +02:00
Armando Ruocco
c5f149b86a
feat: pass additionalCommandArgs to barman-cloud-restore (#914)
Some checks failed
Deploy Docusaurus to GitHub Pages / build (push) Failing after 5s
Deploy Docusaurus to GitHub Pages / deploy (push) Has been skipped
release-please / release-please (push) Failing after 3s
An `ObjectStore` already lets users tack extra command-line flags onto
three of the four `barman-cloud-*` invocations: `barman-cloud-backup`
via
`data.additionalCommandArgs`, `barman-cloud-wal-archive` via
`wal.archiveAdditionalCommandArgs`, and `barman-cloud-wal-restore` via
`wal.restoreAdditionalCommandArgs`. The fourth — `barman-cloud-restore`,
the actual data-restore step in PITR and recovery-from-object-store —
has had no
equivalent, which is exactly the gap reported in #821 (the asker wanted
a longer `--read-timeout` for slow restores from S3).

This PR fills that gap by adding
`spec.configuration.data.restoreAdditionalCommandArgs` and wiring it
into the recovery job hook. In `restoreDataDir`,
the user-supplied flags are appended after the cloud-provider options
and `--endpoint-url` but before the positional `(destinationPath,
serverName,
backupID, pgdata)` arguments — same shape as the other three knobs. The
library's existing append/dedup logic still wins on conflicts, so users
can't
accidentally override flags the plugin already sets (`--cloud-provider`,
`--endpoint-url`, etc.).

Closes #821

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Signed-off-by: Leonardo Cecchi <leonardo.cecchi@gmail.com>
Co-authored-by: Leonardo Cecchi <leonardo.cecchi@gmail.com>
2026-06-03 14:17:12 +02:00
5 changed files with 892 additions and 860 deletions

2
go.mod
View File

@ -5,7 +5,7 @@ go 1.26.3
require ( require (
github.com/cert-manager/cert-manager v1.20.2 github.com/cert-manager/cert-manager v1.20.2
github.com/cloudnative-pg/api v1.29.1 github.com/cloudnative-pg/api v1.29.1
github.com/cloudnative-pg/barman-cloud v0.5.2-0.20260603073812-213211ec5e6f github.com/cloudnative-pg/barman-cloud v0.5.2-0.20260604071807-8e1642e2ce0e
github.com/cloudnative-pg/cloudnative-pg v1.29.1 github.com/cloudnative-pg/cloudnative-pg v1.29.1
github.com/cloudnative-pg/cnpg-i v0.5.0 github.com/cloudnative-pg/cnpg-i v0.5.0
github.com/cloudnative-pg/cnpg-i-machinery v0.4.2 github.com/cloudnative-pg/cnpg-i-machinery v0.4.2

4
go.sum
View File

@ -20,8 +20,8 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cloudnative-pg/api v1.29.1 h1:FWr8S7EQeOfdhYXyr2cof8wUXLARZiiQt5Qa6ltED7w= github.com/cloudnative-pg/api v1.29.1 h1:FWr8S7EQeOfdhYXyr2cof8wUXLARZiiQt5Qa6ltED7w=
github.com/cloudnative-pg/api v1.29.1/go.mod h1:QtWF3yzSvIfORMHaSkPAk/o3bhCJwEHJgN3riyRiz3o= github.com/cloudnative-pg/api v1.29.1/go.mod h1:QtWF3yzSvIfORMHaSkPAk/o3bhCJwEHJgN3riyRiz3o=
github.com/cloudnative-pg/barman-cloud v0.5.2-0.20260603073812-213211ec5e6f h1:37XPQQ7PY1tffCXS4QuRK7eSDIzn6oeF8h3cIteN2SE= github.com/cloudnative-pg/barman-cloud v0.5.2-0.20260604071807-8e1642e2ce0e h1:s79/J9WrvhBnbcDk6/p1KcRdZzXhjAoASSgA4Ik6YSw=
github.com/cloudnative-pg/barman-cloud v0.5.2-0.20260603073812-213211ec5e6f/go.mod h1:jCaMsQwJJ0f/49TIdSad1Ayjv52IoJXMZBhozqilY/g= github.com/cloudnative-pg/barman-cloud v0.5.2-0.20260604071807-8e1642e2ce0e/go.mod h1:jCaMsQwJJ0f/49TIdSad1Ayjv52IoJXMZBhozqilY/g=
github.com/cloudnative-pg/cloudnative-pg v1.29.1 h1:ZNEt1TMlnQKXI1kho2UqQuqdfvIvjGln4kN7C1lsmGA= github.com/cloudnative-pg/cloudnative-pg v1.29.1 h1:ZNEt1TMlnQKXI1kho2UqQuqdfvIvjGln4kN7C1lsmGA=
github.com/cloudnative-pg/cloudnative-pg v1.29.1/go.mod h1:Sbgx9jVmkle4/gR2U5JHrzDd74sRPOBHDtPkvncg5v8= github.com/cloudnative-pg/cloudnative-pg v1.29.1/go.mod h1:Sbgx9jVmkle4/gR2U5JHrzDd74sRPOBHDtPkvncg5v8=
github.com/cloudnative-pg/cnpg-i v0.5.0 h1:/TOzpNT6cwNgrpftTtrnLKdoHgMwd+88vZgXjlVgXeE= github.com/cloudnative-pg/cnpg-i v0.5.0 h1:/TOzpNT6cwNgrpftTtrnLKdoHgMwd+88vZgXjlVgXeE=

View File

@ -181,6 +181,9 @@ func (impl JobHookImpl) restoreDataDir(
if backup.Status.EndpointURL != "" { if backup.Status.EndpointURL != "" {
options = append(options, "--endpoint-url", backup.Status.EndpointURL) options = append(options, "--endpoint-url", backup.Status.EndpointURL)
} }
options = barmanConfiguration.Data.AppendRestoreAdditionalCommandArgs(options)
options = append(options, backup.Status.DestinationPath) options = append(options, backup.Status.DestinationPath)
options = append(options, backup.Status.ServerName) options = append(options, backup.Status.ServerName)
options = append(options, backup.Status.BackupID) options = append(options, backup.Status.BackupID)

View File

@ -32,17 +32,20 @@ spec:
[...] [...]
``` ```
## Extra Options for Backup and WAL Archiving ## Extra Options for Backup, WAL Archiving, and Restore
You can pass additional command-line arguments to `barman-cloud-backup` and You can pass additional command-line arguments to the underlying
`barman-cloud-wal-archive` using the `additionalCommandArgs` field in the `barman-cloud-*` commands using the corresponding fields in the `ObjectStore`
`ObjectStore` configuration. configuration.
- `.spec.configuration.data.additionalCommandArgs`: for `barman-cloud-backup` - `.spec.configuration.data.additionalCommandArgs`: for `barman-cloud-backup`
- `.spec.configuration.data.restoreAdditionalCommandArgs`: for `barman-cloud-restore`
- `.spec.configuration.wal.archiveAdditionalCommandArgs`: for `barman-cloud-wal-archive` - `.spec.configuration.wal.archiveAdditionalCommandArgs`: for `barman-cloud-wal-archive`
- `.spec.configuration.wal.restoreAdditionalCommandArgs`: for `barman-cloud-wal-restore`
Each field accepts a list of string arguments. If an argument is already Each field accepts a list of string arguments. If an argument conflicts with
configured elsewhere in the plugin, the duplicate will be ignored. one already set by the plugin, the user-provided value will be ignored. These
fields are intended to pass options the plugin does not configure automatically.
### Example: Extra Backup Options ### Example: Extra Backup Options
@ -58,6 +61,19 @@ spec:
- "--read-timeout=60" - "--read-timeout=60"
``` ```
### Example: Extra Restore Options
```yaml
kind: ObjectStore
metadata:
name: my-store
spec:
configuration:
data:
restoreAdditionalCommandArgs:
- "--read-timeout=900"
```
### Example: Extra WAL Archive Options ### Example: Extra WAL Archive Options
```yaml ```yaml
@ -72,6 +88,19 @@ spec:
- "--read-timeout=60" - "--read-timeout=60"
``` ```
### Example: Extra WAL Restore Options
```yaml
kind: ObjectStore
metadata:
name: my-store
spec:
configuration:
wal:
restoreAdditionalCommandArgs:
- "--read-timeout=60"
```
For a complete list of supported options, refer to the For a complete list of supported options, refer to the
[official Barman Cloud documentation](https://docs.pgbarman.org/release/latest/). [official Barman Cloud documentation](https://docs.pgbarman.org/release/latest/).

File diff suppressed because it is too large Load Diff