mirror of https://github.com/fluxcd/cli-utils.git
Merge pull request #543 from karlkfi/karl-unsort
chore: Remove redundant object sorting
This commit is contained in:
commit
69f42a927d
|
|
@ -6,7 +6,6 @@ package apply
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"sort"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"k8s.io/apimachinery/pkg/api/meta"
|
"k8s.io/apimachinery/pkg/api/meta"
|
||||||
|
|
@ -28,7 +27,6 @@ import (
|
||||||
"sigs.k8s.io/cli-utils/pkg/inventory"
|
"sigs.k8s.io/cli-utils/pkg/inventory"
|
||||||
"sigs.k8s.io/cli-utils/pkg/object"
|
"sigs.k8s.io/cli-utils/pkg/object"
|
||||||
"sigs.k8s.io/cli-utils/pkg/object/validation"
|
"sigs.k8s.io/cli-utils/pkg/object/validation"
|
||||||
"sigs.k8s.io/cli-utils/pkg/ordering"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const defaultPollInterval = 2 * time.Second
|
const defaultPollInterval = 2 * time.Second
|
||||||
|
|
@ -93,7 +91,6 @@ func (a *Applier) prepareObjects(localInv inventory.InventoryInfo, localObjs obj
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
sort.Sort(ordering.SortableUnstructureds(localObjs))
|
|
||||||
return localObjs, pruneObjs, nil
|
return localObjs, pruneObjs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ package prune
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"sort"
|
|
||||||
|
|
||||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||||
"k8s.io/apimachinery/pkg/api/meta"
|
"k8s.io/apimachinery/pkg/api/meta"
|
||||||
|
|
@ -27,7 +26,6 @@ import (
|
||||||
"sigs.k8s.io/cli-utils/pkg/common"
|
"sigs.k8s.io/cli-utils/pkg/common"
|
||||||
"sigs.k8s.io/cli-utils/pkg/inventory"
|
"sigs.k8s.io/cli-utils/pkg/inventory"
|
||||||
"sigs.k8s.io/cli-utils/pkg/object"
|
"sigs.k8s.io/cli-utils/pkg/object"
|
||||||
"sigs.k8s.io/cli-utils/pkg/ordering"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Pruner implements GetPruneObjs to calculate which objects to prune and Prune
|
// Pruner implements GetPruneObjs to calculate which objects to prune and Prune
|
||||||
|
|
@ -233,7 +231,6 @@ func (p *Pruner) GetPruneObjs(
|
||||||
}
|
}
|
||||||
objs = append(objs, pruneObj)
|
objs = append(objs, pruneObj)
|
||||||
}
|
}
|
||||||
sort.Sort(sort.Reverse(ordering.SortableUnstructureds(objs)))
|
|
||||||
return objs, nil
|
return objs, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue