github-vet / github-vet/rangeloop-pointer-findings
giantswarm/azure-operator: service/controller/resource/clusterreleaseversion/checkupgradeprogress.go; 36 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [giantswarm/azure-operator](https://www.github.com/giantswarm/azure-operator) at [service/controller/resource/clusterreleaseversion/checkupgradeprogress.go](https://github.com/giantswarm/azure-operator/blob/79d3d026dcfa167e3a3621fbf4e11ad25dd700cc/service/controller/resource/clusterreleaseversion/checkupgradeprogress.go#L60-L95)
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/giantswarm/azure-operator/blob/79d3d026dcfa167e3a3621fbf4e11ad25dd700cc/service/controller/resource/clusterreleaseversion/checkupgradeprogress.go#L60-L95)
Click here to show the 36 line(s) of Go which triggered the analyzer.
```go
for _, machinePool := range machinePools.Items {
if conditions.IsCreatingTrue(&machinePool) {
// A node pool is being created, this is the case for first upgrade
// to node pools release, as cluster upgrade will trigger first node
// pool creation.
allNodePoolsUpgraded = false
break
}
if conditions.IsUpgradingTrue(&machinePool) {
// A node pool is being upgraded.
allNodePoolsUpgraded = false
break
}
desiredMachinePoolReleaseVersion := key.ReleaseVersion(&machinePool)
if desiredMachinePoolReleaseVersion != desiredClusterReleaseVersion {
// A node pool upgrade has not been started yet.
allNodePoolsUpgraded = false
break
}
machinePoolLastDeployedReleaseVersion, machinePoolLastDeployedReleaseVersionSet := machinePool.Annotations[annotation.LastDeployedReleaseVersion]
if !machinePoolLastDeployedReleaseVersionSet {
// A node pool is still not created. This should be caught above in
// Creating check, but let's err on the side of caution here.
allNodePoolsUpgraded = false
break
}
if machinePoolLastDeployedReleaseVersion != desiredClusterReleaseVersion {
// A node pool has not yet been upgraded to the desired release version.
allNodePoolsUpgraded = false
break
}
}
```
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 {IsCreatingTrue 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: 79d3d026dcfa167e3a3621fbf4e11ad25dd700cc
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.