Signed-off-by: Lyndon Shi <shilyndon@outlook.com>
pull/12495/head
Lyndon Shi 2 years ago
parent 438e333edc
commit 8ef4488d32

@ -114,13 +114,6 @@ type hookByWeight []*release.Hook
func (x hookByWeight) Len() int { return len(x) }
func (x hookByWeight) Swap(i, j int) { x[i], x[j] = x[j], x[i] }
func (x hookByWeight) Less(i, j int) bool {
if x[i].Weight == x[j].Weight {
return x[i].Name < x[j].Name
}
return x[i].Weight < x[j].Weight
}
func (x hookByWeight) LessFixed(i, j int) bool {
if x[i].Weight == x[j].Weight {
ordering := make(map[string]int, len(releaseutil.InstallOrder))
for v, k := range releaseutil.InstallOrder {

@ -43,7 +43,7 @@ func Test_hookByWeight(t *testing.T) {
{Weight: 0, Kind: "Job", Name: "Job"},
{Weight: 1, Kind: "ServiceAccount", Name: "ServiceAccountA"},
{Weight: 1, Kind: "ServiceAccount", Name: "ServiceAccountB"},
{Weight: 1, Kind: "Pod", Name: "podA"},
{Weight: 1, Kind: "Pod", Name: "PodA"},
}
for i, hook := range hooks {

Loading…
Cancel
Save