You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation for filtering invalid RunResult objects in the r slice removes items by replacing them with the last element and truncating the slice. This approach changes the order of the slice, which may not be desirable in scenarios where order is significant.
pkg/termination/parse.go
funcParseMessage(logger*zap.SugaredLogger, msgstring) ([]result.RunResult, error) {
// ...fori, rr:=ranger {
ifrr== (result.RunResult{}) {
// Erase incorrect resultr[i] =r[len(r)-1] // change the order of the slicer=r[:len(r)-1]
logger.Errorf("termination message contains non taskrun or pipelineresource result keys")
}
}
// ...
}
Thank you @zou2699 for reporting this issue. Since you've done a deep analysis into the code already, would you be interested in contributing a fix as well?
Thank you @zou2699 for reporting this issue. Since you've done a deep analysis into the code already, would you be interested in contributing a fix as well?
The current implementation for filtering invalid RunResult objects in the r slice removes items by replacing them with the last element and truncating the slice. This approach changes the order of the slice, which may not be desirable in scenarios where order is significant.
pkg/termination/parse.go
Expected Behavior
Implement a method to remove empty results while maintaining the order of elements in the slice.
Actual Behavior
change the order of the slice
Additional Info
Kubernetes version:
Output of
kubectl version
:Tekton Pipeline version:
Output of
tkn version
orkubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'
The text was updated successfully, but these errors were encountered: