github-vet / github-vet/rangeloop-pointer-findings
eldondevat/cass-operator-old: operator/pkg/reconciliation/reconcile_racks.go; 15 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [eldondevat/cass-operator-old](https://www.github.com/eldondevat/cass-operator-old) at [operator/pkg/reconciliation/reconcile_racks.go](https://github.com/eldondevat/cass-operator-old/blob/715200416000a2cc6599d822ac94177e1fc7ee2d/operator/pkg/reconciliation/reconcile_racks.go#L306-L320)
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 pod is reassigned at line 307
[Click here to see the code in its original context.](https://github.com/eldondevat/cass-operator-old/blob/715200416000a2cc6599d822ac94177e1fc7ee2d/operator/pkg/reconciliation/reconcile_racks.go#L306-L320)
Click here to show the 15 line(s) of Go which triggered the analyzer.
```go
for _, pod := range podList.Items {
podPtr := &pod
if isMgmtApiRunning(podPtr) {
nodesDrained++
err := rc.NodeMgmtClient.CallDrainEndpoint(&pod)
// if we got an error during drain, just log it and count it
// and then keep going, because we don't want to try restarting
// the server just to bring it down
if err != nil {
logger.Error(err, "error during node drain",
"pod", pod.Name)
nodeDrainErrors++
}
}
}
```
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: 715200416000a2cc6599d822ac94177e1fc7ee2d
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with operator/pkg/reconciliation/reconcile_racks.go at lines 306-320 and review the range-loop pointer usage reported by the analyzer. Compare the finding with the surrounding reconciliation logic, then classify it as a Bug, Mitigated, or Desirable Behavior using the linked classification guidance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100