github-vet / github-vet/rangeloop-pointer-findings
pdgetrf/in-place-vpa: cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubectl/rolling_updater.go; 15 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [pdgetrf/in-place-vpa](https://www.github.com/pdgetrf/in-place-vpa) at [cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubectl/rolling_updater.go](https://github.com/pdgetrf/in-place-vpa/blob/1931dda55b089bd3833ae6f5b8829b02583adeda/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubectl/rolling_updater.go#L441-L455)
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 v1Pod at line 446 may start a goroutine
[Click here to see the code in its original context.](https://github.com/pdgetrf/in-place-vpa/blob/1931dda55b089bd3833ae6f5b8829b02583adeda/cluster-autoscaler/vendor/k8s.io/kubernetes/pkg/kubectl/rolling_updater.go#L441-L455)
Click here to show the 15 line(s) of Go which triggered the analyzer.
```go
for _, v1Pod := range pods.Items {
// Do not count deleted pods as ready
if v1Pod.DeletionTimestamp != nil {
continue
}
if !podutil.IsPodAvailable(&v1Pod, minReadySeconds, r.nowFn()) {
continue
}
switch controller.Name {
case oldRc.Name:
oldReady++
case newRc.Name:
newReady++
}
}
```
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 {
"(dial, 1)" -> {"(dialWithoutProxy, 2)";}
"(addCertRotation, 6)" -> {}
"(CreateAndInitKubelet, 31)" -> {"(NewMainKubelet, 31)";}
"(New, 1)" -> {"(Run, 1)";"(enableCSM, 4)";"(get, 1)";"(newClient, 1)";"(Start, 1)";}
"(Start, 1)" -> {"(SendRequest, 3)";"(Run, 1)";}
"(SetTransportDefaults, 1)" -> {"(ConfigureTransport, 1)";}
"(dial, 2)" -> {"(Write, 1)";"(DialURL, 3)";}
"(writeJSON, 4)" -> {"(Write, 1)";}
"(dialWithoutProxy, 2)" -> {"(Dial, 3)";}
"(NewSchemaValidator, 4)" -> {"(ExpandSchema, 3)";}
"(Resolve, 3)" -> {"(resolveRef, 3)";}
"(Register, 2)" -> {"(addEndpoint, 1)";}
"(List, 2)" -> {"(Accept, 2)";"(List, 3)";"(Validate, 1)";}
"(Copy, 2)" -> {"(ServeHTTP, 2)";}
"(configureTransport, 1)" -> {"(addConnIfNeeded, 3)";}
"(resolveRef, 3)" -> {"(load, 1)";}
"(add, 1)" -> {"(Update, 1)";"(Get, 1)";}
"(newClientTransport, 6)" -> {}
"(expandSchema, 4)" -> {"(Resolve, 3)";}
"(awaitOpenSlotForRequest, 1)" -> {}
"(Validate, 1)" -> {"(NewSchemaValidator, 4)";"(validatePatternProperty, 3)";}
"(IsPodAvailable, 3)" -> {"(Duration, 1)";"(Add, 1)";}
"(RunKubelet, 3)" -> {"(startKubelet, 5)";"(CreateAndInitKubelet, 31)";}
"(WrapRequest, 1)" -> {"(RoundTrip, 1)";}
"(NewMainKubelet, 31)" -> {}
"(parsePackageFiles, 2)" -> {"(parseFiles, 6)";}
"(Write, 1)" -> {"(Copy, 2)";}
"(Delete, 1)" -> {"(drainRespBody, 1)";"(Delete, 2)";}
"(List, 3)" -> {"(Accept, 2)";}
"(Dial, 3)" -> {"(NewClientConn, 3)";}
"(SendRequest, 3)" -> {"(Do, 3)";}
"(Get, 1)" -> {"(Get, 2)";}
"(ServeHTTP, 2)" -> {"(tryUpgrade, 2)";}
"(ExpandSchema, 3)" -> {"(ExpandSchemaWithBasePath, 3)";}
"(NewClientConn, 3)" -> {"(clientHandshake, 2)";}
"(Run, 1)" -> {"(Register, 2)";}
"(Search, 2)" -> {"(List, 1)";}
"(Accept, 2)" -> {}
"(get, 1)" -> {"(SetTransportDefaults, 1)";"(Get, 1)";}
"(newClient, 1)" -> {"(dial, 2)";"(grpcHealthCheck, 2)";}
"(validateDuration, 1)" -> {"(New, 1)";}
"(Has, 1)" -> {"(Get, 1)";}
"(callRemoteBalancer, 2)" -> {}
"(DialURL, 3)" -> {"(Dial, 3)";}
"(startKubelet, 5)" -> {}
"(enableCSM, 4)" -> {"(Start, 2)";}
"(Add, 2)" -> {"(Write, 3)";}
"(UpdateTransport, 4)" -> {"(updateTransport, 5)";}
"(List, 1)" -> {"(List, 2)";}
"(drainRespBody, 1)" -> {"(Copy, 2)";}
"(addConnIfNeeded, 3)" -> {"(run, 3)";}
"(ConfigureTransport, 1)" -> {"(configureTransport, 1)";}
"(delete, 1)" -> {"(Delete, 1)";}
"(DialForUpgrade, 1)" -> {"(WrapRequest, 1)";}
"(run, 3)" -> {"(RunKubelet, 3)";"(UpdateTransport, 4)";}
"(clientHandshake, 2)" -> {"(newClientTransport, 6)";}
"(grpcHealthCheck, 2)" -> {"(dial, 1)";}
"(ExpandSchemaWithBasePath, 3)" -> {"(expandSchema, 4)";}
"(Add, 1)" -> {"(delete, 1)";"(Has, 1)";"(copy, 2)";"(New, 1)";"(Search, 2)";"(Add, 2)";"(add, 1)";"(get, 1)";}
"(addEndpoint, 1)" -> {}
"(Write, 3)" -> {"(Write, 1)";"(writeXML, 4)";"(writeJSON, 4)";}
"(Get, 2)" -> {"(Accept, 2)";"(Validate, 1)";}
"(load, 1)" -> {"(parsePackageFiles, 2)";}
"(validatePatternProperty, 3)" -> {"(NewSchemaValidator, 4)";}
"(Do, 3)" -> {"(Copy, 2)";}
"(Delete, 2)" -> {"(Accept, 2)";"(Validate, 1)";}
"(parseFiles, 6)" -> {}
"(writeXML, 4)" -> {"(Write, 1)";}
"(tryUpgrade, 2)" -> {"(DialForUpgrade, 1)";}
"(RoundTrip, 1)" -> {"(awaitOpenSlotForRequest, 1)";}
"(updateTransport, 5)" -> {"(addCertRotation, 6)";}
"(Duration, 1)" -> {"(validateDuration, 1)";}
"(Start, 2)" -> {"(callRemoteBalancer, 2)";}
"(Update, 1)" -> {"(drainRespBody, 1)";"(Get, 2)";}
"(copy, 2)" -> {"(get, 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: 1931dda55b089bd3833ae6f5b8829b02583adeda
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.