[Backport release-1.5] fix(backups): request S3 checksum only when required for barman-cloud (non-AWS S3 / Ceph RGW) - #3882
Merged
Conversation
Author
|
Please cherry-pick the changes locally and resolve any conflicts. git fetch origin backport-3417-to-release-1.5
git worktree add --checkout .worktree/backport-3417-to-release-1.5 backport-3417-to-release-1.5
cd .worktree/backport-3417-to-release-1.5
git reset --hard HEAD^
git cherry-pick -x 0c586b9d72d3c3d05c25d4ed74a5039482472589 b574e2176f099305c97e5a8e4a456f463cb7aef1 80a03b1e09bac7e34b49f5016c405df913302dbb
git push --force-with-lease |
Merged
11 tasks
Since botocore ~1.36 (early 2025) the default RequestChecksumCalculation is when_supported, so barman-cloud's boto3 attaches a flexible checksum to every PutObject. AWS S3 accepts it, but non-AWS S3-compatible backends - Ceph RADOS Gateway, the platform's own SeaweedFS system bucket, some MinIO / Cloudflare R2 builds - reject it with "InvalidArgument: x-amz-content-sha256 must be UNSIGNED-PAYLOAD, ...", which fails every backup and WAL-archive upload. Set AWS_REQUEST_CHECKSUM_CALCULATION=when_required through the CNPG Cluster's spec.env, which reaches the instance pods and therefore the barman-cloud subprocess the instance manager execs. This is a release-1.5-native equivalent of #3417 rather than a cherry-pick of it. That change sets spec.instanceSidecarConfiguration.env on barmancloud.cnpg.io ObjectStore objects, and release-1.5 has no barman-cloud plugin: there is no ObjectStore CRD on the branch and the rendered Cluster carries no spec.plugins, so those objects would template cleanly and then fail to apply, referenced by nothing. release-1.5 still uses CNPG's native in-tree spec.backup.barmanObjectStore, which shells out to the same barman-cloud client, so the bug is reachable here - the plugin is the packaging difference, not the cause. One spec.env covers all three paths on this branch at once: the chart-rendered legacy barmanObjectStore, the same field SSA-patched by the CNPG backup driver in the useSystemBucket flow, and externalClusters recovery. No Go change is needed - the driver's patch type carries only spec.backup and spec.bootstrap, so it cannot express or remove the Helm-owned spec.env. keycloak is out of scope on this branch. Its chart renders a CNPG Cluster but configures no backup at all - no backup key in values, no backup template - so it has no barman-cloud path to fix, and the upstream hunk for it references values that do not exist here. Verified against CNPG 1.27.3: spec.env is accepted by the webhook and stored unmodified, appears in the instance manager's own environment, and botocore inside the instance image then resolves request_checksum_calculation as when_required instead of its when_supported default. Adding the field to an already-running Cluster converges back to healthy after CNPG recreates the instance pod, which is the in-place upgrade path for existing releases with backups enabled. Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
myasnikovdaniil
force-pushed
the
backport-3417-to-release-1.5
branch
from
August 17, 2026 15:29
d1f592c to
d316cef
Compare
myasnikovdaniil
marked this pull request as ready for review
August 17, 2026 16:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Backport of #3417 to
release-1.5.