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

spikkie/geneesplaats.nl: kompose_production_ver1/git/kubernetes-ingress/internal/k8s/controller.go; 49 LoC

Open
#7,575 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 [spikkie/geneesplaats.nl](https://www.github.com/spikkie/geneesplaats.nl) at [kompose_production_ver1/git/kubernetes-ingress/internal/k8s/controller.go](https://github.com/spikkie/geneesplaats.nl/blob/4d576bc3fba22b1f1406038966400609b9981530/kompose_production_ver1/git/kubernetes-ingress/internal/k8s/controller.go#L1814-L1862)

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 at line 1819 may store a reference to ing

[Click here to see the code in its original context.](https://github.com/spikkie/geneesplaats.nl/blob/4d576bc3fba22b1f1406038966400609b9981530/kompose_production_ver1/git/kubernetes-ingress/internal/k8s/controller.go#L1814-L1862)

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

```go
for _, ing := range allIngs.Items {
if ing.Namespace != secretNamespace {
continue
}

if !lbc.HasCorrectIngressClass(&ing) {
continue
}

if !isMinion(&ing) {
if !lbc.configurator.HasIngress(&ing) {
continue
}
for _, tls := range ing.Spec.TLS {
if tls.SecretName == secretName {
ings = append(ings, ing)
continue items
}
}
if lbc.isNginxPlus {
if jwtKey, exists := ing.Annotations[configs.JWTKeyAnnotation]; exists {
if jwtKey == secretName {
ings = append(ings, ing)
}
}
}
continue
}

// we're dealing with a minion
// minions can only have JWT secrets
if lbc.isNginxPlus {
master, err := lbc.FindMasterForMinion(&ing)
if err != nil {
glog.Infof("Ignoring Ingress %v(Minion): %v", ing.Name, err)
continue
}

if !lbc.configurator.HasMinion(master, &ing) {
continue
}

if jwtKey, exists := ing.Annotations[configs.JWTKeyAnnotation]; exists {
if jwtKey == secretName {
ings = append(ings, ing)
}
}
}
}

```

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: 4d576bc3fba22b1f1406038966400609b9981530

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.