Skip to content

Commit

Permalink
Merge pull request #4409 from ProNic-QY/master
Browse files Browse the repository at this point in the history
sort ingress by namespace and name when ingress.CreationTimestamp identical
  • Loading branch information
k8s-ci-robot authored Aug 19, 2019
2 parents 75d65bb + 70614f4 commit 6697203
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/ingress/controller/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,12 @@ func (s *k8sStore) ListIngresses(filter IngressFilterFunc) []*ingress.Ingress {
sort.SliceStable(ingresses, func(i, j int) bool {
ir := ingresses[i].CreationTimestamp
jr := ingresses[j].CreationTimestamp
if ir.Equal(&jr) {
in := fmt.Sprintf("%v/%v", ingresses[i].Namespace, ingresses[i].Name)
jn := fmt.Sprintf("%v/%v", ingresses[j].Namespace, ingresses[j].Name)
klog.Warningf("Ingress %v and %v have identical CreationTimestamp", in, jn)
return in > jn
}
return ir.Before(&jr)
})

Expand Down

0 comments on commit 6697203

Please sign in to comment.