Skip to content

Commit

Permalink
mock: lock when clearing between tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SaaldjorMike committed Aug 29, 2024
1 parent 53ce954 commit e9a92d2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/humio/client_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,9 @@ func (h *MockClientConfig) GetHumioClient(config *humioapi.Config, req ctrl.Requ
}

func (h *MockClientConfig) ClearHumioClientConnections(repoNameToKeep string) {
humioClientMu.Lock()
defer humioClientMu.Unlock()

for k := range h.apiClient.Repository {
if k.resourceName != repoNameToKeep {
delete(h.apiClient.Repository, k)
Expand Down

0 comments on commit e9a92d2

Please sign in to comment.