Skip to content

Commit

Permalink
user: fix typo preventing creation of users caps (#13)
Browse files Browse the repository at this point in the history
Issue introduced by f91e794

But fixed before submission to upstream
https://github.com/rook/rook/pull/12460/files

Co-authored-by: Peter Goron <[email protected]>
  • Loading branch information
pgoron and Peter Goron authored Aug 18, 2023
1 parent fe36239 commit a70bca3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/operator/ceph/object/user/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ func generateUserConfig(user *cephv1.CephObjectStoreUser) admin.User {
userConfig.UserCaps += fmt.Sprintf("users=%s;", user.Spec.Capabilities.User)
}
if user.Spec.Capabilities.Users != "" {
userConfig.UserCaps += fmt.Sprintf("users=%s;", user.Spec.Capabilities.User)
userConfig.UserCaps += fmt.Sprintf("users=%s;", user.Spec.Capabilities.Users)
}
if user.Spec.Capabilities.Buckets != "" {
userConfig.UserCaps += fmt.Sprintf("buckets=%s;", user.Spec.Capabilities.Buckets)
Expand Down
4 changes: 2 additions & 2 deletions pkg/operator/ceph/object/user/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ func TestCreateOrUpdateCephUser(t *testing.T) {
t.Run("setting Capabilities for the user", func(t *testing.T) {
objectUser.Spec.Quotas = nil
objectUser.Spec.Capabilities = &cephv1.ObjectUserCapSpec{
User: "read",
Users: "read",
Buckets: "read",
}
userConfig = generateUserConfig(objectUser)
Expand Down Expand Up @@ -510,7 +510,7 @@ func TestCreateOrUpdateCephUser(t *testing.T) {

t.Run("setting both Quotas and Capabilities for the user", func(t *testing.T) {
objectUser.Spec.Capabilities = &cephv1.ObjectUserCapSpec{
User: "read",
Users: "read",
Buckets: "read",
}
objectUser.Spec.Quotas = &cephv1.ObjectUserQuotaSpec{MaxBuckets: &maxbucket, MaxObjects: &maxobject, MaxSize: &maxsize}
Expand Down

0 comments on commit a70bca3

Please sign in to comment.