Skip to content

Commit 912e9b7

Browse files
feat: expose showAdditionalCommandArgs and listAdditionalCommandArgs
An ObjectStore lets users tack extra command-line flags onto four of the six barman-cloud-* invocations the plugin shells out to: barman-cloud-backup (data.additionalCommandArgs), -wal-archive (wal.archiveAdditionalCommandArgs), -wal-restore (wal.restoreAdditionalCommandArgs), and -restore (data.restoreAdditionalCommandArgs, PR #914). The remaining two -- barman-cloud-backup-show (post-write verification) and barman-cloud-backup-list (retention pruning) -- had no equivalent, which is the gap reported in #712. On strictly-vhost S3-compatible endpoints (e.g. some Coreweave cwobject buckets) users need `--addressing-style=virtual` on every cloud command, and currently those two reject the user-provided args, marking otherwise-successful backups as failed and silently disabling retention pruning. The library-side change adds the two new fields and helpers (sister PR in cloudnative-pg/barman-cloud) and threads them through GetBackupList / GetBackupByName. This plugin commit just exposes them via the CRD and documents the new shape. ## Sister PR (must merge first) The CRD field schema is generated from the BarmanObjectStoreConfiguration Go type in cloudnative-pg/barman-cloud. The sister PR there adds: - DataBackupConfiguration.ShowAdditionalCommandArgs []string - DataBackupConfiguration.ListAdditionalCommandArgs []string - AppendShowAdditionalCommandArgs / AppendListAdditionalCommandArgs helpers Once that PR merges and a barman-cloud release is cut, controller-gen here picks up the new fields automatically. Until then a developer running `go test ./...` against this branch needs a local replace directive in go.mod pointing at the barman-cloud branch (omitted from this commit). Closes #712
1 parent bae384f commit 912e9b7

3 files changed

Lines changed: 73 additions & 4 deletions

File tree

config/crd/bases/barmancloud.cnpg.io_objectstores.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,37 @@ spec:
176176
format: int32
177177
minimum: 1
178178
type: integer
179+
listAdditionalCommandArgs:
180+
description: |-
181+
ListAdditionalCommandArgs represents additional arguments that can be appended
182+
to the 'barman-cloud-backup-list' command-line invocation. This command is
183+
used internally for retention-policy enforcement; flags relevant to the
184+
underlying S3 client (e.g. `--addressing-style=virtual` for strictly
185+
virtual-hosted S3-compatible endpoints) generally belong here as well.
186+
187+
Note:
188+
It's essential to ensure that the provided arguments are valid and supported
189+
by the 'barman-cloud-backup-list' command, to avoid potential errors or
190+
unintended behavior during execution.
191+
items:
192+
type: string
193+
type: array
194+
showAdditionalCommandArgs:
195+
description: |-
196+
ShowAdditionalCommandArgs represents additional arguments that can be appended
197+
to the 'barman-cloud-backup-show' command-line invocation. This command is
198+
used after a successful upload to verify and record metadata about the
199+
freshly-written backup, so flags relevant to the underlying S3 client
200+
(e.g. `--addressing-style=virtual` for strictly virtual-hosted S3-compatible
201+
endpoints) generally belong here as well.
202+
203+
Note:
204+
It's essential to ensure that the provided arguments are valid and supported
205+
by the 'barman-cloud-backup-show' command, to avoid potential errors or
206+
unintended behavior during execution.
207+
items:
208+
type: string
209+
type: array
179210
type: object
180211
destinationPath:
181212
description: |-

manifest.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,37 @@ spec:
175175
format: int32
176176
minimum: 1
177177
type: integer
178+
listAdditionalCommandArgs:
179+
description: |-
180+
ListAdditionalCommandArgs represents additional arguments that can be appended
181+
to the 'barman-cloud-backup-list' command-line invocation. This command is
182+
used internally for retention-policy enforcement; flags relevant to the
183+
underlying S3 client (e.g. `--addressing-style=virtual` for strictly
184+
virtual-hosted S3-compatible endpoints) generally belong here as well.
185+
186+
Note:
187+
It's essential to ensure that the provided arguments are valid and supported
188+
by the 'barman-cloud-backup-list' command, to avoid potential errors or
189+
unintended behavior during execution.
190+
items:
191+
type: string
192+
type: array
193+
showAdditionalCommandArgs:
194+
description: |-
195+
ShowAdditionalCommandArgs represents additional arguments that can be appended
196+
to the 'barman-cloud-backup-show' command-line invocation. This command is
197+
used after a successful upload to verify and record metadata about the
198+
freshly-written backup, so flags relevant to the underlying S3 client
199+
(e.g. `--addressing-style=virtual` for strictly virtual-hosted S3-compatible
200+
endpoints) generally belong here as well.
201+
202+
Note:
203+
It's essential to ensure that the provided arguments are valid and supported
204+
by the 'barman-cloud-backup-show' command, to avoid potential errors or
205+
unintended behavior during execution.
206+
items:
207+
type: string
208+
type: array
178209
type: object
179210
destinationPath:
180211
description: |-

web/docs/misc.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,22 @@ spec:
3232
[...]
3333
```
3434

35-
## Extra Options for Backup and WAL Archiving
35+
## Extra Options for Backup, WAL Archiving, Show, and List
3636

37-
You can pass additional command-line arguments to `barman-cloud-backup` and
38-
`barman-cloud-wal-archive` using the `additionalCommandArgs` field in the
39-
`ObjectStore` configuration.
37+
You can pass additional command-line arguments to each barman-cloud
38+
invocation the plugin shells out to, using the matching
39+
`additionalCommandArgs` fields in the `ObjectStore` configuration.
4040

4141
- `.spec.configuration.data.additionalCommandArgs`: for `barman-cloud-backup`
42+
- `.spec.configuration.data.showAdditionalCommandArgs`: for `barman-cloud-backup-show` (post-write verification)
43+
- `.spec.configuration.data.listAdditionalCommandArgs`: for `barman-cloud-backup-list` (retention pruning)
4244
- `.spec.configuration.wal.archiveAdditionalCommandArgs`: for `barman-cloud-wal-archive`
4345

46+
If you need a flag that applies to every cloud command — such as
47+
`--addressing-style=virtual` for an S3-compatible endpoint that only
48+
accepts virtual-hosted-style requests — set it on all of the above so
49+
both writes and the post-write read-back / retention steps honor it.
50+
4451
Each field accepts a list of string arguments. If an argument is already
4552
configured elsewhere in the plugin, the duplicate will be ignored.
4653

0 commit comments

Comments
 (0)