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

pdgetrf/in-place-vpa: vertical-pod-autoscaler/vendor/k8s.io/kubernetes/test/e2e/framework/util.go; 24 LoC

Open
#9,544 0 comments 0 reactions 0 assignees View on GitHub
fresh small
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 [vertical-pod-autoscaler/vendor/k8s.io/kubernetes/test/e2e/framework/util.go](https://github.com/pdgetrf/in-place-vpa/blob/1931dda55b089bd3833ae6f5b8829b02583adeda/vertical-pod-autoscaler/vendor/k8s.io/kubernetes/test/e2e/framework/util.go#L697-L720)

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.

>

[Click here to see the code in its original context.](https://github.com/pdgetrf/in-place-vpa/blob/1931dda55b089bd3833ae6f5b8829b02583adeda/vertical-pod-autoscaler/vendor/k8s.io/kubernetes/test/e2e/framework/util.go#L697-L720)

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

```go
for _, pod := range podList.Items {
if len(ignoreLabels) != 0 && ignoreSelector.Matches(labels.Set(pod.Labels)) {
continue
}
res, err := testutils.PodRunningReady(&pod)
switch {
case res && err == nil:
nOk++
case pod.Status.Phase == v1.PodSucceeded:
Logf("The status of Pod %s is Succeeded, skipping waiting", pod.ObjectMeta.Name)
// it doesn't make sense to wait for this pod
continue
case pod.Status.Phase != v1.PodFailed:
Logf("The status of Pod %s is %s (Ready = false), waiting for it to be either Running (with Ready = true) or Failed", pod.ObjectMeta.Name, pod.Status.Phase)
notReady++
badPods = append(badPods, pod)
default:
if metav1.GetControllerOf(&pod) == nil {
Logf("Pod %s is Failed, but it's not controlled by a controller", pod.ObjectMeta.Name)
badPods = append(badPods, pod)
}
//ignore failed pods that are controlled by some controller
}
}

```

Click here to show extra information the analyzer produced.

```
No path was found through the callgraph that could lead to a function which writes a pointer argument.

No path was found through the callgraph that could lead to a function which passes a pointer to third-party code.

root signature {GetControllerOf 1} was not found in the callgraph; reference was passed directly to third-party code
```

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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.