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

aws/aws-app-mesh-controller-for-k8s: pkg/virtualrouter/enqueue_requests_for_virtualnode_events.go; 3 LoC

Open
#15,812 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 [aws/aws-app-mesh-controller-for-k8s](https://www.github.com/aws/aws-app-mesh-controller-for-k8s) at [pkg/virtualrouter/enqueue_requests_for_virtualnode_events.go](https://github.com/aws/aws-app-mesh-controller-for-k8s/blob/c94935b82442b7d4afccf3fc32ee12649fb549b6/pkg/virtualrouter/enqueue_requests_for_virtualnode_events.go#L65-L67)

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.

> reference to vr was used in a composite literal at line 66

[Click here to see the code in its original context.](https://github.com/aws/aws-app-mesh-controller-for-k8s/blob/c94935b82442b7d4afccf3fc32ee12649fb549b6/pkg/virtualrouter/enqueue_requests_for_virtualnode_events.go#L65-L67)

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

```go
for _, vr := range vrList.Items {
queue.Add(ctrl.Request{NamespacedName: k8s.NamespacedName(&vr)})
}

```

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Read pkg/virtualrouter/enqueue_requests_for_virtualnode_events.go at lines 65-67 and inspect how the range variable vr is referenced in the queue request. Determine whether the analyzer's reported reference can produce incorrect requests, then classify the finding as Bug, Mitigated, or Desirable Behavior as requested by the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, go, kubernetes
Domain
devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.