Merge pull request #30701 from zanuka/30617-request-for-helm-install-order-doc-update

updates mutate and validate web hook configs
pull/30751/head
Scott Rigby 5 months ago committed by GitHub
commit 9a670ae920
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -65,12 +65,17 @@ var InstallOrder KindSortOrder = []string{
"IngressClass", "IngressClass",
"Ingress", "Ingress",
"APIService", "APIService",
"MutatingWebhookConfiguration",
"ValidatingWebhookConfiguration",
} }
// UninstallOrder is the order in which manifests should be uninstalled (by Kind). // 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. // Those occurring earlier in the list get uninstalled before those occurring later in the list.
var UninstallOrder KindSortOrder = []string{ var UninstallOrder KindSortOrder = []string{
// For uninstall, we remove validation before mutation to ensure webhooks don't block removal
"ValidatingWebhookConfiguration",
"MutatingWebhookConfiguration",
"APIService", "APIService",
"Ingress", "Ingress",
"IngressClass", "IngressClass",

@ -173,6 +173,14 @@ func TestKindSorter(t *testing.T) {
Name: "F", Name: "F",
Head: &SimpleHead{Kind: "PriorityClass"}, Head: &SimpleHead{Kind: "PriorityClass"},
}, },
{
Name: "M",
Head: &SimpleHead{Kind: "MutatingWebhookConfiguration"},
},
{
Name: "V",
Head: &SimpleHead{Kind: "ValidatingWebhookConfiguration"},
},
} }
for _, test := range []struct { for _, test := range []struct {
@ -180,8 +188,8 @@ func TestKindSorter(t *testing.T) {
order KindSortOrder order KindSortOrder
expected string expected string
}{ }{
{"install", InstallOrder, "FaAbcC3deEf1gh2iIjJkKlLmnopqrxstuUvw!"}, {"install", InstallOrder, "FaAbcC3deEf1gh2iIjJkKlLmnopqrxstuUvwMV!"},
{"uninstall", UninstallOrder, "wvUmutsxrqponLlKkJjIi2hg1fEed3CcbAaF!"}, {"uninstall", UninstallOrder, "VMwvUmutsxrqponLlKkJjIi2hg1fEed3CcbAaF!"},
} { } {
var buf bytes.Buffer var buf bytes.Buffer
t.Run(test.description, func(t *testing.T) { t.Run(test.description, func(t *testing.T) {

Loading…
Cancel
Save