Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pkg/reconciler/pipelinerun/pipelinerun.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"path/filepath"
"reflect"
"regexp"
"sort"
"strings"

"k8s.io/apimachinery/pkg/util/wait"
Expand Down Expand Up @@ -1905,6 +1906,18 @@ func updatePipelineRunStatusFromChildRefs(logger *zap.SugaredLogger, pr *v1.Pipe
for k := range childRefByName {
newChildRefs = append(newChildRefs, *childRefByName[k])
}

// sorting childRef in a specific order can greatly avoid
// meaningless updates of status caused by unordered arrays.
sort.Slice(newChildRefs, func(i, j int) bool {
if newChildRefs[i].PipelineTaskName == newChildRefs[j].PipelineTaskName {
if newChildRefs[i].Name == newChildRefs[j].Name {
return newChildRefs[i].Kind < newChildRefs[j].Kind
}
return newChildRefs[i].Name < newChildRefs[j].Name
}
return newChildRefs[i].PipelineTaskName < newChildRefs[j].PipelineTaskName
})
pr.Status.ChildReferences = newChildRefs
}

Expand Down