github-vet / github-vet/rangeloop-pointer-findings
integr8ly/integreatly-operator: pkg/products/rhssouser/reconciler.go; 10 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [integr8ly/integreatly-operator](https://www.github.com/integr8ly/integreatly-operator) at [pkg/products/rhssouser/reconciler.go](https://github.com/integr8ly/integreatly-operator/blob/a45af1781a47ed80dbedf4392b711a3adb0bb3f7/pkg/products/rhssouser/reconciler.go#L701-L710)
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 kcUser at line 703 may start a goroutine
[Click here to see the code in its original context.](https://github.com/integr8ly/integreatly-operator/blob/a45af1781a47ed80dbedf4392b711a3adb0bb3f7/pkg/products/rhssouser/reconciler.go#L701-L710)
Click here to show the 10 line(s) of Go which triggered the analyzer.
```go
for _, kcUser := range keycloakUsers {
osUser := getOpenShiftUser(kcUser, openshiftUsers)
if osUser != nil && !kcUserInDedicatedAdmins(kcUser, dedicatedAdmins) && hasAdminPrivileges(&kcUser) {
// User in OS and keycloak master realm, represented by a Keycloak CR, but not dedicated-admins group
demoted = append(demoted, kcUser)
} else if osUser == nil {
// User not in OpenShift but is in Keycloak Master Realm, represented by a Keycloak CR
deleted = append(deleted, kcUser)
}
}
```
Click here to show extra information the analyzer produced.
```
The following graphviz dot graph describes paths through the callgraph that could lead to a function calling a goroutine:
digraph G {
"(Check, 1)" -> {"(check, 1)";}
"(configureTransport, 1)" -> {"(addConnIfNeeded, 3)";}
"(New, 1)" -> {"(Store, 2)";}
"(runCmdContext, 2)" -> {}
"(SetTransportDefaults, 1)" -> {"(ConfigureTransport, 1)";}
"(ConfigureTransport, 1)" -> {"(configureTransport, 1)";}
"(stringValue, 3)" -> {"(Get, 1)";}
"(Write, 1)" -> {"(append, 1)";}
"(append, 1)" -> {}
"(check, 1)" -> {}
"(get, 1)" -> {"(SetTransportDefaults, 1)";}
"(Write, 3)" -> {"(Write, 1)";}
"(Store, 2)" -> {"(Write, 1)";}
"(addConnIfNeeded, 3)" -> {"(run, 3)";}
"(hasAdminPrivileges, 1)" -> {"(contains, 2)";}
"(contains, 2)" -> {"(StringValue, 1)";}
"(StringValue, 1)" -> {"(stringValue, 3)";}
"(Get, 2)" -> {"(Write, 1)";"(Check, 1)";"(Get, 3)";}
"(Get, 3)" -> {"(Write, 1)";}
"(Get, 1)" -> {"(Get, 2)";"(Get, 3)";"(get, 1)";"(Add, 2)";"(New, 1)";}
"(Add, 2)" -> {"(Write, 3)";}
"(run, 3)" -> {"(runCmdContext, 2)";}
}
```
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: a45af1781a47ed80dbedf4392b711a3adb0bb3f7
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.