You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was on v0.7.1. The issue is with concurrent appends to a list:
var result []*unstructured.Unstructured
var wg sync.WaitGroup
wg.Add(len(resourceInterfaces))
for i := range resourceInterfaces {
client := resourceInterfaces[i]
go func() {
defer wg.Done()
list, err := client.List(metav1.ListOptions{
LabelSelector: fmt.Sprintf("%s=%s", labelName, labelValue),
})
if err != nil {
asyncErr = err
return
}
// apply client side filtering since not every kubernetes API supports label filtering
for i := range list.(*unstructured.UnstructuredList).Items {
item := list.(*unstructured.UnstructuredList).Items[i]
labels := item.GetLabels()
if labels != nil {
if value, ok := labels[labelName]; ok && value == labelValue {
result = append(result, &item) <<<<< this append is not thread safe
}
}
}
}()
}
Noticed that an application controller had exited with the following error:
The text was updated successfully, but these errors were encountered: