github-vet / github-vet/rangeloop-pointer-findings
turbonomic/kubeturbo: pkg/discovery/worker/compliance/affinity_helper.go; 10 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [turbonomic/kubeturbo](https://www.github.com/turbonomic/kubeturbo) at [pkg/discovery/worker/compliance/affinity_helper.go](https://github.com/turbonomic/kubeturbo/blob/f15fa66e8cb268f7b295d81b870cbc965bc59a79/pkg/discovery/worker/compliance/affinity_helper.go#L122-L131)
Below is the message reported by the analyzer for this snippet of code. Beware that the analyzer only reports the first
issue it finds, so please do not limit your consideration to the contents of the below message.
> reference to term was used in a composite literal at line 129
[Click here to see the code in its original context.](https://github.com/turbonomic/kubeturbo/blob/f15fa66e8cb268f7b295d81b870cbc965bc59a79/pkg/discovery/worker/compliance/affinity_helper.go#L122-L131)
Click here to show the 10 line(s) of Go which triggered the analyzer.
```go
for _, term := range getPodAntiAffinityTerms(affinity.PodAntiAffinity) {
namespaces := getNamespacesFromPodAffinityTerm(existingPod, &term)
selector, err := metav1.LabelSelectorAsSelector(term.LabelSelector)
if err != nil {
return nil, err
}
if podMatchesTermsNamespaceAndSelector(pod, namespaces, selector) {
result = append(result, matchingPodAntiAffinityTerm{term: &term, node: existingPodNode})
}
}
```
Leave a reaction on this issue to contribute to the project by classifying this instance as a **Bug** :-1:, **Mitigated** :+1:, or **Desirable Behavior** :rocket:
See the descriptions of the classifications [here](https://github.com/github-vet/rangeclosure-findings#how-can-i-help) for more information.
commit ID: f15fa66e8cb268f7b295d81b870cbc965bc59a79
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.