mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-19 18:48:32 +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",
|
"ResourceQuota",
|
||||||
"StorageClass",
|
"StorageClass",
|
||||||
"CustomResourceDefinition",
|
"CustomResourceDefinition",
|
||||||
"MutatingWebhookConfiguration",
|
|
||||||
"ServiceAccount",
|
"ServiceAccount",
|
||||||
"PodSecurityPolicy",
|
"PodSecurityPolicy",
|
||||||
"Role",
|
"Role",
|
||||||
@@ -102,6 +101,7 @@ var orderFirst = []string{
|
|||||||
"PodDisruptionBudget",
|
"PodDisruptionBudget",
|
||||||
}
|
}
|
||||||
var orderLast = []string{
|
var orderLast = []string{
|
||||||
|
"MutatingWebhookConfiguration",
|
||||||
"ValidatingWebhookConfiguration",
|
"ValidatingWebhookConfiguration",
|
||||||
}
|
}
|
||||||
var typeOrders = func() map[string]int {
|
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: orderLast[0]}},
|
||||||
{Gvk{Group: "a", Version: "b", Kind: "CustomKindA"},
|
{Gvk{Group: "a", Version: "b", Kind: "CustomKindA"},
|
||||||
Gvk{Group: "a", Version: "b", Kind: "CustomKindB"}},
|
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: "CustomKindX"},
|
||||||
Gvk{Group: "a", Version: "b", Kind: "ValidatingWebhookConfiguration"}},
|
Gvk{Group: "a", Version: "b", Kind: "ValidatingWebhookConfiguration"}},
|
||||||
{Gvk{Group: "a", Version: "b", Kind: "APIService"},
|
{Gvk{Group: "a", Version: "b", Kind: "APIService"},
|
||||||
|
|||||||
Reference in New Issue
Block a user