From 9782d5e2b4d2782fd51ea7321a75a73c474f19e1 Mon Sep 17 00:00:00 2001 From: Tanmay Jain Date: Fri, 29 Mar 2024 10:56:09 +0530 Subject: [PATCH] Fixing role quotas update in server --- controllers/access_control.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/controllers/access_control.go b/controllers/access_control.go index 33378ed3c..926821880 100644 --- a/controllers/access_control.go +++ b/controllers/access_control.go @@ -576,6 +576,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) recorder.Eventf( aeroCluster, corev1.EventTypeNormal, "RoleUpdated",