Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Giles Hutton <[email protected]>
  • Loading branch information
JoukoVirtanen and Stringy committed Nov 16, 2024
1 parent 678fc86 commit f092de4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions integration-tests/pkg/mock_sensor/expect_conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ func (s *MockSensor) ExpectSameElementsConnections(t *testing.T, containerID str
types.SortConnections(expected)

connections := s.SortedConnections(containerID)
success := s.checkIfConnectionsMatchExpected(t, connections, expected)
if success {
if s.checkIfConnectionsMatchExpected(t, connections, expected) {
return true
}

Expand Down
4 changes: 3 additions & 1 deletion integration-tests/pkg/mock_sensor/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ func (m *MockSensor) Connections(containerID string) []types.NetworkInfo {
defer m.networkMutex.Unlock()

if connections, ok := m.connections[containerID]; ok {
return connections
conns := make([]types.NetworkInfo, len(connections))
copy(conns, connections)
return conns
}
return make([]types.NetworkInfo, 0)
}
Expand Down

0 comments on commit f092de4

Please sign in to comment.