Repository navigation
feat(placement): accept the RGW object in the policy and keep its secrets out - #888
Open
johnramsden wants to merge 1 commit into
Open
johnramsden wants to merge 1 commit into
johnramsden wants to merge 1 commit into
Conversation
johnramsden
added this pull request to stack #894
September 23, 2026 04:20
This was referenced Sep 23, 2026
This was referenced Sep 23, 2026
johnramsden
marked this pull request as ready for review
September 23, 2026 04:30
johnramsden
marked this pull request as draft
September 23, 2026 06:23
johnramsden
marked this pull request as ready for review
September 23, 2026 06:24
johnramsden
force-pushed
the
rgw-stack/08-policy-object
branch
from
September 23, 2026 18:19
996d01f to
2dbf0df
Compare
johnramsden
force-pushed
the
rgw-stack/08-policy-object
branch
2 times, most recently
from
September 29, 2026 18:43
69daf9c to
031bc8c
Compare
johnramsden
force-pushed
the
rgw-stack/08-policy-object
branch
from
September 29, 2026 19:50
031bc8c to
d01d456
Compare
hillpd
suggested changes
Oct 1, 2026
hillpd
left a comment
There was a problem hiding this comment.
Merging #887 and then #888 conflicts in rgw_test.go and services_placement_rgw_test.go (git merge-tree --write-tree pr887 pr888). Tracing it back, this PR is based on an stale version of #885 and carries its own copies of #886 and #887 (2b8c12e, 3c82483). Since then #885 gained e935718 and 38c72c3 and #887 gained 0d9089a, none of which are present here. Could you rebase onto the current #887 head and drop the two copied commits? That resolves the conflict and brings the PEM block-skip fix into #889 to #893, which currently inherit the bug.
johnramsden
force-pushed
the
rgw-stack/08-policy-object
branch
from
October 1, 2026 22:23
d01d456 to
38b2943
Compare
…rets out MemberPlacement.Rgw in api/types/placement.go changes from *bool to *RgwPlacement, the object added earlier in this series. A bare rgw boolean no longer decodes: encoding/json cannot unmarshal true into a struct field, so a pre-branch client's request now fails at decode time with a 400 instead of silently doing the wrong thing. cmdPlacementPut also now rejects any JSON after the policy object, closing a framing gap where a client confused about its own payload had the extra bytes silently discarded. In ceph/placement.go, ApplyPlacementPolicy calls the new normalizePlacement first, before validation, storage or reconciliation. It runs RgwPlacement.Normalized on every member's rgw entry and returns ErrRgwFrontendInvalid, which isClientSidePlacementError in api/placement.go now maps to 400, so a malformed entry is rejected before it can replace the stored policy or reach a member. This is live from this commit: a PUT with a bad rgw entry is rejected today, even though nothing yet dispatches a good one. The certificate and key must never reach the database or a GET, and that guard is live too, not deferred. placementPolicyJSON is now the only encoder storePlacementPolicy uses, and it always encodes policyForStorage(policy), a copy with ssl_certificate and ssl_private_key blanked; the apply itself keeps the original, material-bearing policy for reconciliation to use once it exists. As defense in depth, GetPlacementStatus also calls redactStoredPolicy on whatever it reads back, in case a future code path ever stores the raw policy by accident. GetPlacementStatus also reads rgw_frontends, the table added inert in "feat(db): add a table for each member's last applied RGW frontend", through its first production reader, populateRGWFrontends. It attaches an RgwObservedFrontend (port, ssl_port, ssl) to a member only when that member is separately observed running RGW; a member with no row keeps no rgw_frontend field at all, so "unknown" is never reported as a plaintext default. Nothing yet acts on the object's contents: reconcilePlacement's RGW handling does not exist, so a PUT is accepted, validated and stored, but no gateway is started, stopped or reconfigured from it, exactly as nothing acted on the old boolean. "feat(placement): reconcile RGW across the cluster" is the first commit to read policy.Members[name].Rgw's actual contents, in the new applyRgwPlacement, and the first to advertise the placement-rgw capability. Known and accepted: a policy stored while rgw was still a boolean no longer decodes, so GET /1.0/placement returns 500 until the next PUT or DELETE replaces it. Co-authored-by: Peter Sabaini <peter.sabaini@canonical.com> Assisted-by: claude-code:claude-fable-5-1 Assisted-by: pi:gpt-6-astra Signed-off-by: John Ramsden <john.ramsden@canonical.com>
johnramsden
force-pushed
the
rgw-stack/08-policy-object
branch
from
October 6, 2026 00:47
38b2943 to
8ab011c
Compare
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
MemberPlacement.Rgwchanges from*boolto*RgwPlacement, the object added earlier in this series. A barergwboolean no longer decodes:encoding/jsoncannot unmarshaltrueinto a struct field, so a pre-branch client's request now fails at decode time with a 400 instead of silently doing the wrong thing.cmdPlacementPutalso now rejects any JSON after the policy object, closing a framing gap where a client confused about its own payload had the extra bytes silently discarded.ApplyPlacementPolicycalls the newnormalizePlacementfirst, before validation, storage or reconciliation. It runsRgwPlacement.Normalizedon every member'srgwentry and returnsErrRgwFrontendInvalid, now mapped to 400, so a malformed entry is rejected before it can replace the stored policy or reach a member. This is live from this commit: aPUTwith a badrgwentry is rejected today, even though nothing yet dispatches a good one.The certificate and key must never reach the database or a
GET, and that guard is live too.placementPolicyJSONis now the only encoderstorePlacementPolicyuses, and it always encodespolicyForStorage(policy), a copy with the certificate and key blanked; the apply itself keeps the original, material-bearing policy for reconciliation to use once it exists. As defense in depth,GetPlacementStatusalso callsredactStoredPolicyon whatever it reads back, in case a future code path ever stores the raw policy by accident.GetPlacementStatusalso readsrgw_frontendsthrough its first production reader,populateRGWFrontends. It attaches anRgwObservedFrontend(port, ssl_port, ssl) to a member only when that member is separately observed running RGW; a member with no row keeps norgw_frontendfield at all, so "unknown" is never reported as a plaintext default.Stack: PR 8 of 13. Merge in order. Each PR is one logical change on top of the one before it.
Reviewer note: nothing yet acts on the object's contents —
reconcilePlacement's RGW handling does not exist, so aPUTis accepted, validated and stored, but no gateway is started, stopped or reconfigured from it.09-reconcileis the first commit to read the field's actual contents.Known and accepted: a policy stored while
rgwwas still a boolean no longer decodes, soGET /1.0/placementreturns 500 until the nextPUTorDELETEreplaces it.Type of change
rgwpolicy field changes from a boolean to an objectHow has this been tested?
Contributor checklist
Please check that you have: