diff --git a/pkg/release/util/kind_sorter.go b/pkg/release/util/kind_sorter.go index 27b44cc36..bc074340f 100644 --- a/pkg/release/util/kind_sorter.go +++ b/pkg/release/util/kind_sorter.go @@ -64,18 +64,19 @@ var InstallOrder KindSortOrder = []string{ "CronJob", "IngressClass", "Ingress", + "APIService", "MutatingWebhookConfiguration", "ValidatingWebhookConfiguration", - "APIService", } // UninstallOrder is the order in which manifests should be uninstalled (by Kind). // // Those occurring earlier in the list get uninstalled before those occurring later in the list. var UninstallOrder KindSortOrder = []string{ - "APIService", + // For uninstall, we remove validation before mutation to ensure webhooks don't block removal "ValidatingWebhookConfiguration", "MutatingWebhookConfiguration", + "APIService", "Ingress", "IngressClass", "Service", diff --git a/pkg/release/util/kind_sorter_test.go b/pkg/release/util/kind_sorter_test.go index 2a607ddd8..919de24e5 100644 --- a/pkg/release/util/kind_sorter_test.go +++ b/pkg/release/util/kind_sorter_test.go @@ -188,8 +188,8 @@ func TestKindSorter(t *testing.T) { order KindSortOrder expected string }{ - {"install", InstallOrder, "FaAbcC3deEf1gh2iIjJkKlLmnopqrxstuUvMVw!"}, - {"uninstall", UninstallOrder, "wVMvUmutsxrqponLlKkJjIi2hg1fEed3CcbAaF!"}, + {"install", InstallOrder, "FaAbcC3deEf1gh2iIjJkKlLmnopqrxstuUvwMV!"}, + {"uninstall", UninstallOrder, "VMwvUmutsxrqponLlKkJjIi2hg1fEed3CcbAaF!"}, } { var buf bytes.Buffer t.Run(test.description, func(t *testing.T) {