github-vet / github-vet/rangeloop-pointer-findings
RaSerge/configmap-operator: pkg/controllers/configmapmake_controller.go; 15 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [RaSerge/configmap-operator](https://www.github.com/RaSerge/configmap-operator) at [pkg/controllers/configmapmake_controller.go](https://github.com/RaSerge/configmap-operator/blob/05e077634877814cb3b1a0c41c2060d9a66d6bca/pkg/controllers/configmapmake_controller.go#L288-L302)
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.
> function call which takes a reference to ref at line 296 may start a goroutine
[Click here to see the code in its original context.](https://github.com/RaSerge/configmap-operator/blob/05e077634877814cb3b1a0c41c2060d9a66d6bca/pkg/controllers/configmapmake_controller.go#L288-L302)
Click here to show the 15 line(s) of Go which triggered the analyzer.
```go
for i, ref := range config.OwnerReferences {
if ref.Controller == nil || !*ref.Controller {
continue
}
if ref.UID != cmm.UID {
log.Error(err, "Config has a different owner", "owner", ref)
return false, &controllerutil.AlreadyOwnedError{Object: cmm, Owner: ref}
}
if !reflect.DeepEqual(&ref, owner) { // e.g. apiVersion changed
log.Info("Updating ownership of Config")
config.OwnerReferences[i] = *owner
return true, nil
}
return false, nil
}
```
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: 05e077634877814cb3b1a0c41c2060d9a66d6bca
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.