Talk to radosgw directly via go-ceph + aws-sdk-go-v2 #3

Merged
benvin merged 1 commits from benvin/go-ceph-native-client into main 2026-07-24 22:43:18 +10:00
Owner

Why

The operator drove the Ceph manager dashboard REST API to manage RGW users, buckets and policies, coupling it to a dashboard login, the dashboard's RGW wiring, and the dashboard's bucket API surface. This rebuilds the Ceph integration to talk directly to radosgw the way the CLI does, using native Go libraries, while keeping every operator capability identical.

The exported API of internal/ceph is kept stable, so the three controllers and cmd/operator are untouched (bar the CEPH_RGW_* config plumbing already in flight for the radosgw move).

Changes

  • replace internal/ceph client internals with github.com/ceph/go-ceph/rgw/admin (Admin Ops API) for users, keys, quotas and bucket info/removal
  • add github.com/aws/aws-sdk-go-v2 S3 client for bucket create, versioning, policy, tagging and object lock, signed as the bucket owner
  • map go-ceph admin.ErrNoSuch*/ErrUserExists and smithy APIError codes into IsNotFound/IsConflict so controller create-vs-update branching is preserved
  • set S3 path-style addressing and WhenRequired checksum modes (older RGW rejects the SDK's default CRC32/aws-chunked integrity headers)
  • delete the hand-rolled SigV4 signer, canonical-query builder and XML marshaling
  • keep policy.go (BuildBucketPolicy/BuildTagJSON) as pure builders
  • replace the SigV4 signer tests with NewClient validation and error-classifier tests
  • keep CGO_ENABLED=0 distroless — only go-ceph's pure-Go rgw/admin is imported (no librados/cgo)
  • rewrite README.md and docs/ceph-setup.md for the single RGW admin user (caps users=*;buckets=*) and CEPH_RGW_* credential Secret

Verification

gofmt, go vet, go build ./..., go test -race ./... pass; CGO_ENABLED=0 operator binary builds; go mod verify clean.

https://claude.ai/code/session_016CEncETbf8cvy1PhsHfFHM

## Why The operator drove the **Ceph manager dashboard REST API** to manage RGW users, buckets and policies, coupling it to a dashboard login, the dashboard's RGW wiring, and the dashboard's bucket API surface. This rebuilds the Ceph integration to talk **directly to radosgw the way the CLI does**, using native Go libraries, while keeping every operator capability identical. The exported API of `internal/ceph` is kept stable, so the three controllers and `cmd/operator` are untouched (bar the `CEPH_RGW_*` config plumbing already in flight for the radosgw move). ## Changes - replace `internal/ceph` client internals with `github.com/ceph/go-ceph/rgw/admin` (Admin Ops API) for users, keys, quotas and bucket info/removal - add `github.com/aws/aws-sdk-go-v2` S3 client for bucket create, versioning, policy, tagging and object lock, signed **as the bucket owner** - map go-ceph `admin.ErrNoSuch*`/`ErrUserExists` and smithy `APIError` codes into `IsNotFound`/`IsConflict` so controller create-vs-update branching is preserved - set S3 path-style addressing and `WhenRequired` checksum modes (older RGW rejects the SDK's default CRC32/aws-chunked integrity headers) - delete the hand-rolled SigV4 signer, canonical-query builder and XML marshaling - keep `policy.go` (`BuildBucketPolicy`/`BuildTagJSON`) as pure builders - replace the SigV4 signer tests with `NewClient` validation and error-classifier tests - keep `CGO_ENABLED=0` distroless — only go-ceph's pure-Go `rgw/admin` is imported (no librados/cgo) - rewrite `README.md` and `docs/ceph-setup.md` for the single RGW admin user (caps `users=*;buckets=*`) and `CEPH_RGW_*` credential Secret ## Verification `gofmt`, `go vet`, `go build ./...`, `go test -race ./...` pass; `CGO_ENABLED=0` operator binary builds; `go mod verify` clean. https://claude.ai/code/session_016CEncETbf8cvy1PhsHfFHM
unkinben added 1 commit 2026-07-24 22:36:11 +10:00
Talk to radosgw directly via go-ceph + aws-sdk-go-v2
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
466514063a
The operator drove the Ceph manager dashboard REST API to manage RGW users,
buckets and policies. That coupled it to a dashboard login, the dashboard's RGW
wiring, and the dashboard's bucket API surface. Rebuild the Ceph integration to
talk directly to radosgw the way the CLI does, using native Go libraries, while
keeping every operator capability identical.

The exported surface of internal/ceph is unchanged, so the three controllers
and cmd/operator's structure are untouched (bar the CEPH_RGW_* config plumbing).

- replace the internal/ceph client internals with github.com/ceph/go-ceph
  rgw/admin (Admin Ops API) for users, keys, quotas and bucket info/removal
- add github.com/aws/aws-sdk-go-v2 S3 client for bucket create, versioning,
  policy, tagging and object lock, signed as the bucket owner
- map go-ceph admin.ErrNoSuch*/ErrUserExists and smithy APIError codes into
  IsNotFound/IsConflict so controller create-vs-update branching is preserved
- set S3 path-style addressing and WhenRequired checksum modes for RGW
- delete the hand-rolled dashboard client, token auth and JSON plumbing
- keep policy.go/BuildBucketPolicy/BuildTagJSON as pure builders
- replace the client tests with NewClient validation and error-classifier tests
- keep CGO_ENABLED=0 distroless: only go-ceph's pure-Go rgw/admin is imported
- switch env/config to CEPH_RGW_* (endpoint, admin endpoint, access/secret key,
  region, CA, insecure) and update the deployment manifest
- rewrite README and docs/ceph-setup.md for the single RGW admin user
  (caps users=*;buckets=*), keeping Vault/VSO as the primary credential source

Claude-Session: https://claude.ai/code/session_016CEncETbf8cvy1PhsHfFHM
unkinben force-pushed benvin/go-ceph-native-client from 2c6f63a86f to 466514063a 2026-07-24 22:36:11 +10:00 Compare
benvin merged commit 253105f914 into main 2026-07-24 22:43:18 +10:00
benvin deleted branch benvin/go-ceph-native-client 2026-07-24 22:43:18 +10:00
Sign in to join this conversation.