github-vet / github-vet/rangeloop-pointer-findings
arangodb/kube-arangodb: pkg/deployment/access_package.go; 21 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [arangodb/kube-arangodb](https://www.github.com/arangodb/kube-arangodb) at [pkg/deployment/access_package.go](https://github.com/arangodb/kube-arangodb/blob/9cbbec404f34463db55e29ebb7f5dbb8aa35d984/pkg/deployment/access_package.go#L71-L91)
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/arangodb/kube-arangodb/blob/9cbbec404f34463db55e29ebb7f5dbb8aa35d984/pkg/deployment/access_package.go#L71-L91)
Click here to show the 21 line(s) of Go which triggered the analyzer.
```go
for _, secret := range secretList.Items {
if d.isOwnerOf(&secret) {
if _, found := secret.Data[constants.SecretAccessPackageYaml]; found {
// Secret is an access package
if _, wanted := apNameMap[secret.GetName()]; !wanted {
// We found an obsolete access package secret. Remove it.
if err := secrets.Delete(secret.GetName(), &metav1.DeleteOptions{
Preconditions: &metav1.Preconditions{UID: &secret.UID},
}); err != nil && !k8sutil.IsNotFound(err) {
// Not serious enough to stop everything now, just log and create an event
log.Warn().Err(err).Msg("Failed to remove obsolete access package secret")
d.CreateEvent(k8sutil.NewErrorEvent("Access Package cleanup failed", err, d.apiObject))
} else {
// Access package removed, notify user
log.Info().Str("secret-name", secret.GetName()).Msg("Removed access package Secret")
d.CreateEvent(k8sutil.NewAccessPackageDeletedEvent(d.apiObject, secret.GetName()))
}
}
}
}
}
```
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 {isOwnerOf 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: 9cbbec404f34463db55e29ebb7f5dbb8aa35d984
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.