@@ -396,6 +396,7 @@ var _ = Describe("Users", func() {
396396When ("providing user limits" , func () {
397397const username = "limits-user"
398398var credentialSecret corev1.Secret
399+ var connections , channels int32
399400BeforeEach (func () {
400401credentialSecret = corev1.Secret {
401402ObjectMeta : metav1.ObjectMeta {
@@ -409,6 +410,8 @@ var _ = Describe("Users", func() {
409410}
410411Expect (k8sClient .Create (ctx , & credentialSecret , & client.CreateOptions {})).To (Succeed ())
411412
413+ connections = 4
414+ channels = 6
412415user = & topology.User {
413416ObjectMeta : metav1.ObjectMeta {
414417Name : username ,
@@ -421,9 +424,9 @@ var _ = Describe("Users", func() {
421424ImportCredentialsSecret : & corev1.LocalObjectReference {
422425Name : 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 ())
447450Expect (userLimitsInfo ).To (HaveLen (1 ))
448451Expect (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
456455By ("deleting user" )
457456Expect (k8sClient .Delete (ctx , user )).To (Succeed ())
0 commit comments