diff --git a/operator-integration/tenant_test.go b/operator-integration/tenant_test.go index 02bc8b2e7..548020ede 100644 --- a/operator-integration/tenant_test.go +++ b/operator-integration/tenant_test.go @@ -635,7 +635,10 @@ func TestListTenantsByNameSpace(t *testing.T) { log.Println(err) assert.Nil(err) } - TenantName := &result.Tenants[0].Name // The array has to be empty, no index accessible + if len(result.Tenants) == 0 { + assert.Fail("FAIL: There are no tenants in the array") + } + TenantName := &result.Tenants[0].Name fmt.Println(*TenantName) assert.Equal("new-tenant", *TenantName, *TenantName) }