From 10b385feb3f6abf6bb7657d3a10e993d5f2b4cd9 Mon Sep 17 00:00:00 2001 From: Tanmay Jain Date: Mon, 26 Aug 2024 11:58:10 +0530 Subject: [PATCH] BugFix: Updating read and write quotas in cluster. --- accesscontrol/access_control.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/accesscontrol/access_control.go b/accesscontrol/access_control.go index aca612d..4075a66 100644 --- a/accesscontrol/access_control.go +++ b/accesscontrol/access_control.go @@ -314,6 +314,16 @@ func (roleCreate AerospikeRoleCreateUpdate) UpdateRole( } } + if role.ReadQuota != roleCreate.ReadQuota || role.WriteQuota != roleCreate.WriteQuota { + if err := client.SetQuotas( + adminPolicy, roleCreate.Name, roleCreate.ReadQuota, roleCreate.WriteQuota, + ); err != nil { + return fmt.Errorf( + "error setting quotas for role %s: %v", roleCreate.Name, err, + ) + } + } + logger.Info("Updated role", "role name", roleCreate.Name) return nil