object: call generateUserCaps after AdminOpsClient calls

This prevents overwriting the user-specified capabilities
and correctly copies the Capabilities into UserCapabilities
after the AdminOpsClient calls.

Signed-off-by: hjk068 <hello.hyunjin@gmail.com>
This commit is contained in:
hjk068 authored and Hyunjin Kim committed 2026-04-01 19:54:39 -04:00
1 parent 24053d04d3
commit b113e37dae
1 file changed
+1 -1
+1 -1
View File
@@ -427,6 +427,7 @@ func (r *ReconcileObjectStoreUser) createOrUpdateCephUser(u *cephv1.CephObjectSt
logCreateOrUpdate = fmt.Sprintf("updated ceph object user %q", u.Name)
}
liveUser.UserCaps = generateUserCaps(&liveUser)
// Update caps, if necessary
log.NamedTrace(nsName, logger, "user capabilities(id: %s, caps: %#v, user caps: %s, op mask: %s)",
liveUser.ID, liveUser.Caps, liveUser.UserCaps, liveUser.OpMask)
@@ -646,7 +647,6 @@ func generateUserConfig(user *cephv1.CephObjectStoreUser) (*admin.User, error) {
}
userConfig.OpMask = opMask
userConfig.UserCaps = generateUserCaps(userConfig)
return userConfig, nil
}