sort ingress by namespace and name when ingress.CreationTimestamp identical
This commit is contained in:
parent
041a8457aa
commit
70614f4622
1 changed files with 6 additions and 0 deletions
|
@ -778,6 +778,12 @@ func (s *k8sStore) ListIngresses(filter IngressFilterFunc) []*ingress.Ingress {
|
||||||
sort.SliceStable(ingresses, func(i, j int) bool {
|
sort.SliceStable(ingresses, func(i, j int) bool {
|
||||||
ir := ingresses[i].CreationTimestamp
|
ir := ingresses[i].CreationTimestamp
|
||||||
jr := ingresses[j].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)
|
return ir.Before(&jr)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue