github-vet / github-vet/rangeloop-pointer-findings
fission/fission-workflows: pkg/controller/workflow.go; 35 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [fission/fission-workflows](https://www.github.com/fission/fission-workflows) at [pkg/controller/workflow.go](https://github.com/fission/fission-workflows/blob/98ba59979ca7dd6d7600e43a258932bcae8786ba/pkg/controller/workflow.go#L214-L248)
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 aggregate was used in a composite literal at line 244
[Click here to see the code in its original context.](https://github.com/fission/fission-workflows/blob/98ba59979ca7dd6d7600e43a258932bcae8786ba/pkg/controller/workflow.go#L214-L248)
Click here to show the 35 line(s) of Go which triggered the analyzer.
```go
for _, aggregate := range s.workflows.List() {
// Ignore non-workflow entities in workflow store
if aggregate.Type != types.TypeWorkflow {
log.Warnf("Non-workflow entity in workflows store: %v", aggregate)
continue
}
// Get actual workflow
wf, err := s.workflows.GetWorkflow(aggregate.GetId())
if err != nil {
log.Warnf("Could not retrieve entity from workflows store: %v", aggregate)
continue
}
// Check if the status is not in a terminal state
switch wf.GetStatus().GetStatus() {
case types.WorkflowStatus_DELETED, types.WorkflowStatus_READY:
continue
default:
// nop
}
// Submit evaluation for the workflow
// The workqueue within in the control system ensures that workflows that are already queued for execution
// will be ignored.
evalQueue.Submit(&ctrl.Event{
Old: wf,
Updated: wf,
Event: &fes.Event{
Type: EventRefresh,
Aggregate: &aggregate,
Timestamp: ptypes.TimestampNow(),
},
})
}
```
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: 98ba59979ca7dd6d7600e43a258932bcae8786ba
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.