github-vet / github-vet/rangeloop-pointer-findings

integr8ly/keycloak-operator: pkg/keycloak/keycloak.go; 7 LoC

Open
#14,803 0 comments 0 reactions 0 assignees View on GitHub
fresh tiny
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [integr8ly/keycloak-operator](https://www.github.com/integr8ly/keycloak-operator) at [pkg/keycloak/keycloak.go](https://github.com/integr8ly/keycloak-operator/blob/dddcd54da7fa8ff1ce826f60fc636d40a08af255/pkg/keycloak/keycloak.go#L109-L115)

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 realm at line 113 may start a goroutine

[Click here to see the code in its original context.](https://github.com/integr8ly/keycloak-operator/blob/dddcd54da7fa8ff1ce826f60fc636d40a08af255/pkg/keycloak/keycloak.go#L109-L115)

Click here to show the 7 line(s) of Go which triggered the analyzer.

```go
for _, realm := range list.Items {
if realm.Status.KeycloakName == kc.Name {
realm.Status.Phase = v1alpha1.PhaseInstanceDeprovisioned
realm.Status.Message = "The owner keycloak instance has been deprovisioned, this realm will no longer be reconciled"
h.sdkCrud.Update(&realm)
}
}

```

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 {
"(ConfigureTransport, 1)" -> {"(configureTransport, 1)";}
"(configureTransport, 1)" -> {"(addConnIfNeeded, 3)";}
"(addConnIfNeeded, 3)" -> {}
"(Update, 1)" -> {"(Add, 1)";}
"(Add, 1)" -> {"(New, 1)";}
"(New, 1)" -> {"(get, 1)";}
"(get, 1)" -> {"(SetTransportDefaults, 1)";}
"(SetTransportDefaults, 1)" -> {"(ConfigureTransport, 1)";}
}

```

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: dddcd54da7fa8ff1ce826f60fc636d40a08af255

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.