Skip to content

Conversation

@thejoeejoee
Copy link
Contributor

Checklist

  • Added tests for features and functional changes
  • Public functions and types are documented
  • Standard formatting is applied to Go code
  • Is this a new API? Added a new file that begins with //go:build ceph_preview
  • Ran make api-update to record new APIs

New or infrequent contributors may want to review the go-ceph Developer's Guide including the section on how we track API Status and the API Stability Plan.

The go-ceph project uses mergify. View the mergify command guide for information on how to interact with mergify. Add a comment with @Mergifyio rebase to rebase your PR when github indicates that the PR is out of date with the base branch.

@anoopcs9
Copy link
Collaborator

@thejoeejoee Is there a reason why you have kept this is in draft state?

@anoopcs9
Copy link
Collaborator

@Mergifyio rebase

@mergify
Copy link

mergify bot commented Jul 18, 2025

rebase

✅ Branch has been successfully rebased

@anoopcs9 anoopcs9 force-pushed the feat-user-placement branch from f3cfc0b to 3adc34f Compare July 18, 2025 06:11
@anoopcs9
Copy link
Collaborator

@thejoeejoee Are you planning to take this further?

@anoopcs9
Copy link
Collaborator

anoopcs9 commented Aug 7, 2025

@thejoeejoee We would like to consider the change but the commit message lacks the Signed-off-by: tag. Can you please update?

@thejoeejoee thejoeejoee force-pushed the feat-user-placement branch 3 times, most recently from a37f734 to c2aadd7 Compare August 7, 2025 10:40
@thejoeejoee thejoeejoee marked this pull request as ready for review August 7, 2025 10:41
@anoopcs9
Copy link
Collaborator

anoopcs9 commented Aug 7, 2025

@Mergifyio rebase

@mergify
Copy link

mergify bot commented Aug 7, 2025

rebase

✅ Branch has been successfully rebased

@anoopcs9 anoopcs9 force-pushed the feat-user-placement branch from c2aadd7 to fe94903 Compare August 7, 2025 17:25
Copy link
Collaborator

@anoopcs9 anoopcs9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's even more that we could do to test default-placement other than the MockClient.

index 452fbba..82ef701 100644
--- a/rgw/admin/user.go
+++ b/rgw/admin/user.go
@@ -19,7 +19,7 @@ type User struct {
        SwiftKeys           []SwiftKeySpec `json:"swift_keys" url:"-"`
        Caps                []UserCapSpec  `json:"caps"`
        OpMask              string         `json:"op_mask" url:"op-mask"`
-       DefaultPlacement    string         `json:"default_placement"`
+       DefaultPlacement    string         `json:"default_placement" url:"default-placement"`
        DefaultStorageClass string         `json:"default_storage_class"`
        PlacementTags       []interface{}  `json:"placement_tags"`
        BucketQuota         QuotaSpec      `json:"bucket_quota"`
diff --git a/rgw/admin/user_test.go b/rgw/admin/user_test.go
index adc4f1f..7f2deab 100644
--- a/rgw/admin/user_test.go
+++ b/rgw/admin/user_test.go
@@ -107,7 +107,7 @@ func (suite *RadosGWTestSuite) TestUser() {
 
        suite.T().Run("user creation success", func(_ *testing.T) {
                usercaps := "users=read"
-               user, err := co.CreateUser(context.Background(), User{ID: "leseb", DisplayName: "This is leseb", Email: "leseb@example.com", UserCaps: usercaps, OpMask: "delete"})
+               user, err := co.CreateUser(context.Background(), User{ID: "leseb", DisplayName: "This is leseb", Email: "leseb@example.com", UserCaps: usercaps, OpMask: "delete", DefaultPlacement: "default-placement"})
                assert.NoError(suite.T(), err)
                assert.Equal(suite.T(), "leseb@example.com", user.Email)
        })
@@ -119,6 +119,7 @@ func (suite *RadosGWTestSuite) TestUser() {
                assert.Equal(suite.T(), "users", user.Caps[0].Type)
                assert.Equal(suite.T(), "read", user.Caps[0].Perm)
                assert.Equal(suite.T(), "delete", user.OpMask)
+               assert.Equal(suite.T(), "default-placement", user.DefaultPlacement)
                os.Setenv("LESEB_ACCESS_KEY", user.Keys[0].AccessKey)
        })

@thejoeejoee What do you think?

@anoopcs9
Copy link
Collaborator

@thejoeejoee What do you think?

Would you mind including the additional change from #1133 (review)?

Signed-off-by: Josef Kolář <josef.kolar@firma.seznam.cz>
@anoopcs9 anoopcs9 force-pushed the feat-user-placement branch from 5467a06 to 372f7ec Compare August 27, 2025 11:20
Copy link
Collaborator

@anoopcs9 anoopcs9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks.

@anoopcs9 anoopcs9 added the API This PR includes a change to the public API of a go-ceph package label Aug 28, 2025
Copy link
Collaborator

@phlogistonjohn phlogistonjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems OK, but RGW is my weak area with regards to go-ceph. I will approve if requested but for now I'll hold off so that there's a chance @thotz will take a look. @anoopcs9 if we don't get a 2nd review soon enough, just ping me and I can approve instead.

@mergify mergify bot merged commit 1cfede9 into ceph:master Aug 28, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API This PR includes a change to the public API of a go-ceph package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants