github-vet / github-vet/rangeloop-pointer-findings
pearsontechnology/environment-operator: pkg/reaper/reaper.go; 19 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [pearsontechnology/environment-operator](https://www.github.com/pearsontechnology/environment-operator) at [pkg/reaper/reaper.go](https://github.com/pearsontechnology/environment-operator/blob/e527a2c4ba4d27b6337593ef18351bcc2c4a69da/pkg/reaper/reaper.go#L33-L51)
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 service at line 48 may start a goroutine
[Click here to see the code in its original context.](https://github.com/pearsontechnology/environment-operator/blob/e527a2c4ba4d27b6337593ef18351bcc2c4a69da/pkg/reaper/reaper.go#L33-L51)
Click here to show the 19 line(s) of Go which triggered the analyzer.
```go
for _, service := range current.Services {
configService := cfg.Services.FindByName(service.Name)
if configService == nil {
log.Infof("REAPER: found orphan service %s, deleting.", service.Name)
if err := r.deleteService(service); err != nil {
log.Errorf("REAPER: delete orphan service %s failed with %s", service.Name, err.Error())
}
} else if configService.IsBlueGreenParentDeployment() {
if err := r.destroyDeployment(service.Name); err != nil {
log.Errorf("REAPER: delete orphan deployment %s failed with %s", service.Name, err.Error())
}
}
// delete ingresses that were removed from the service config
r.CleanupIngress(cfg.Services.FindByName(service.Name), &service)
// delete HPA objects that were removed from the service config
r.CleanupHPA(cfg.Services.FindByName(service.Name), &service)
}
```
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: e527a2c4ba4d27b6337593ef18351bcc2c4a69da
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.