@@ -396,6 +396,7 @@ var _ = Describe("Users", func() {
396396 When ("providing user limits" , func () {
397397 const username = "limits-user"
398398 var credentialSecret corev1.Secret
399+ var connections , channels int32
399400 BeforeEach (func () {
400401 credentialSecret = corev1.Secret {
401402 ObjectMeta : metav1.ObjectMeta {
@@ -409,6 +410,8 @@ var _ = Describe("Users", func() {
409410 }
410411 Expect (k8sClient .Create (ctx , & credentialSecret , & client.CreateOptions {})).To (Succeed ())
411412
413+ connections = 4
414+ channels = 6
412415 user = & topology.User {
413416 ObjectMeta : metav1.ObjectMeta {
414417 Name : username ,
@@ -421,9 +424,9 @@ var _ = Describe("Users", func() {
421424 ImportCredentialsSecret : & corev1.LocalObjectReference {
422425 Name : credentialSecret .Name ,
423426 },
424- UserLimits : topology.UserLimits {
425- Connections : 4 ,
426- Channels : 6 ,
427+ UserLimits : & topology.UserLimits {
428+ Connections : & connections ,
429+ Channels : & channels ,
427430 },
428431 },
429432 }
@@ -446,12 +449,8 @@ var _ = Describe("Users", func() {
446449 }, 30 , 2 ).Should (BeNil ())
447450 Expect (userLimitsInfo ).To (HaveLen (1 ))
448451 Expect (userLimitsInfo [0 ].User ).To (Equal (username ))
449- connectionLimit , ok := userLimitsInfo [0 ].Value ["max-connections" ]
450- Expect (ok ).To (BeTrue ())
451- Expect (connectionLimit ).To (Equal (4 ))
452- channelLimit , ok := userLimitsInfo [0 ].Value ["max-channels" ]
453- Expect (ok ).To (BeTrue ())
454- Expect (channelLimit ).To (Equal (6 ))
452+ Expect (userLimitsInfo [0 ].Value ).To (HaveKeyWithValue ("max-connections" , int (connections )))
453+ Expect (userLimitsInfo [0 ].Value ).To (HaveKeyWithValue ("max-channels" , int (channels )))
455454
456455 By ("deleting user" )
457456 Expect (k8sClient .Delete (ctx , user )).To (Succeed ())
0 commit comments