fix cronjob sort bug, daemonsets status bug, add ingress to v1alpha3 (#2541)
Signed-off-by: Jeff <zw0948@gmail.com>
This commit is contained in:
@@ -106,12 +106,16 @@ func (c *cronJobSearcher) Search(namespace string, conditions *params.Conditions
|
||||
}
|
||||
}
|
||||
sort.Slice(result, func(i, j int) bool {
|
||||
return c.compare(result[i], result[j], orderBy) && !reverse
|
||||
if reverse {
|
||||
return !c.compare(result[i], result[j], orderBy)
|
||||
} else {
|
||||
return c.compare(result[i], result[j], orderBy)
|
||||
}
|
||||
})
|
||||
|
||||
r := make([]interface{}, 0)
|
||||
for _, i := range result {
|
||||
r = append(r, i)
|
||||
for i := range result {
|
||||
r = append(r, result[i])
|
||||
}
|
||||
return r, nil
|
||||
}
|
||||
|
||||
@@ -140,8 +140,11 @@ func FuzzyMatch(m map[string]string, key, value string) bool {
|
||||
func ObjectMetaCompare(left, right metav1.ObjectMeta, compareField string) bool {
|
||||
switch compareField {
|
||||
case CreateTime:
|
||||
if left.CreationTimestamp.Equal(&right.CreationTimestamp) {
|
||||
return strings.Compare(left.Name, right.Name) <= 0
|
||||
if left.CreationTimestamp.Time.Equal(right.CreationTimestamp.Time) {
|
||||
if left.Namespace == right.Namespace {
|
||||
return strings.Compare(left.Name, right.Name) < 0
|
||||
}
|
||||
return strings.Compare(left.Namespace, right.Namespace) < 0
|
||||
}
|
||||
return left.CreationTimestamp.Time.Before(right.CreationTimestamp.Time)
|
||||
case Name:
|
||||
|
||||
Reference in New Issue
Block a user