mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
Relative Order of Mutating/Validating WebhookConfigs
MutatingWebhookConfig may have similar dependencies as the ValidatingWebhookConfig. eg. a k8s cluster service. Therefore, it should be ordered last as well. This PR preserves the implicit ordering between CustomResources and the webhook while introducing a relative order between the two webhooks. i.e. MutatingWebhook should be created prior to the ValidatingWebhook The change is an enhancement of #1104
This commit is contained in:
@@ -84,7 +84,6 @@ var orderFirst = []string{
|
||||
"ResourceQuota",
|
||||
"StorageClass",
|
||||
"CustomResourceDefinition",
|
||||
"MutatingWebhookConfiguration",
|
||||
"ServiceAccount",
|
||||
"PodSecurityPolicy",
|
||||
"Role",
|
||||
@@ -102,6 +101,7 @@ var orderFirst = []string{
|
||||
"PodDisruptionBudget",
|
||||
}
|
||||
var orderLast = []string{
|
||||
"MutatingWebhookConfiguration",
|
||||
"ValidatingWebhookConfiguration",
|
||||
}
|
||||
var typeOrders = func() map[string]int {
|
||||
|
||||
@@ -68,6 +68,10 @@ var lessThanTests = []struct {
|
||||
Gvk{Group: "a", Version: "b", Kind: orderLast[0]}},
|
||||
{Gvk{Group: "a", Version: "b", Kind: "CustomKindA"},
|
||||
Gvk{Group: "a", Version: "b", Kind: "CustomKindB"}},
|
||||
{Gvk{Group: "a", Version: "b", Kind: "CustomKindX"},
|
||||
Gvk{Group: "a", Version: "b", Kind: "MutatingWebhookConfiguration"}},
|
||||
{Gvk{Group: "a", Version: "b", Kind: "MutatingWebhookConfiguration"},
|
||||
Gvk{Group: "a", Version: "b", Kind: "ValidatingWebhookConfiguration"}},
|
||||
{Gvk{Group: "a", Version: "b", Kind: "CustomKindX"},
|
||||
Gvk{Group: "a", Version: "b", Kind: "ValidatingWebhookConfiguration"}},
|
||||
{Gvk{Group: "a", Version: "b", Kind: "APIService"},
|
||||
|
||||
Reference in New Issue
Block a user