From b9ad0dfa41e339d1982a31a44f1231abda1b998f Mon Sep 17 00:00:00 2001 From: John Murret Date: Fri, 22 Dec 2023 09:32:40 -0700 Subject: [PATCH] NET-7025 - ci: test-integrations failures in compatibility tests. panics occuring in selectionTracker.TrackIDForSelection (#20040) * ci: test-integrations failures in compatibility tests. panics occuring in selectionTracker.TrackIDForSelection * Update selection_tracker.go --- .../resource/mappers/selectiontracker/selection_tracker.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/resource/mappers/selectiontracker/selection_tracker.go b/internal/resource/mappers/selectiontracker/selection_tracker.go index 5b60680bb546..5f10e410b980 100644 --- a/internal/resource/mappers/selectiontracker/selection_tracker.go +++ b/internal/resource/mappers/selectiontracker/selection_tracker.go @@ -72,6 +72,10 @@ func (t *WorkloadSelectionTracker) GetIDsForWorkload(id *pbresource.ID) []*pbres // TrackIDForSelector will associate workloads matching the specified workload // selector with the given resource id. func (t *WorkloadSelectionTracker) TrackIDForSelector(id *pbresource.ID, selector *pbcatalog.WorkloadSelector) { + if selector == nil { + return + } + t.lock.Lock() defer t.lock.Unlock()