@@ -56,9 +56,9 @@ const (
56
56
type FailurePolicyType string
57
57
58
58
const (
59
- // Ignore means that an error calling the webhook is ignored.
59
+ // Ignore means that an error calling the admission webhook or admission policy is ignored.
60
60
Ignore FailurePolicyType = "Ignore"
61
- // Fail means that an error calling the webhook causes the admission to fail.
61
+ // Fail means that an error calling the admission webhook or admission policy causes resource admission to fail.
62
62
Fail FailurePolicyType = "Fail"
63
63
)
64
64
@@ -67,9 +67,11 @@ const (
67
67
type MatchPolicyType string
68
68
69
69
const (
70
- // Exact means requests should only be sent to the webhook if they exactly match a given rule.
70
+ // Exact means requests should only be sent to the admission webhook or admission policy if they exactly match a given rule.
71
71
Exact MatchPolicyType = "Exact"
72
- // Equivalent means requests should be sent to the webhook if they modify a resource listed in rules via another API group or version.
72
+ // Equivalent means requests should be sent to the admission webhook or admission policy if they modify a resource listed
73
+ // in rules via an equivalent API group or version. For example, `autoscaling/v1` and `autoscaling/v2`
74
+ // HorizontalPodAutoscalers are equivalent: the same set of resources appear via both APIs.
73
75
Equivalent MatchPolicyType = "Equivalent"
74
76
)
75
77
@@ -577,9 +579,9 @@ type MatchResources struct {
577
579
// Default to the empty LabelSelector, which matches everything.
578
580
// +optional
579
581
NamespaceSelector * metav1.LabelSelector `json:"namespaceSelector,omitempty" protobuf:"bytes,1,opt,name=namespaceSelector"`
580
- // ObjectSelector decides whether to run the validation based on if the
582
+ // ObjectSelector decides whether to run the policy based on if the
581
583
// object has matching labels. objectSelector is evaluated against both
582
- // the oldObject and newObject that would be sent to the cel validation , and
584
+ // the oldObject and newObject that would be sent to the policy's expression (CEL) , and
583
585
// is considered to match if either object matches the selector. A null
584
586
// object (oldObject in the case of create, or newObject in the case of
585
587
// delete) or an object that cannot have labels (like a
@@ -590,12 +592,12 @@ type MatchResources struct {
590
592
// Default to the empty LabelSelector, which matches everything.
591
593
// +optional
592
594
ObjectSelector * metav1.LabelSelector `json:"objectSelector,omitempty" protobuf:"bytes,2,opt,name=objectSelector"`
593
- // ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches.
595
+ // ResourceRules describes what operations on what resources/subresources the admission policy matches.
594
596
// The policy cares about an operation if it matches _any_ Rule.
595
597
// +listType=atomic
596
598
// +optional
597
599
ResourceRules []NamedRuleWithOperations `json:"resourceRules,omitempty" protobuf:"bytes,3,rep,name=resourceRules"`
598
- // ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about.
600
+ // ExcludeResourceRules describes what operations on what resources/subresources the policy should not care about.
599
601
// The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
600
602
// +listType=atomic
601
603
// +optional
@@ -606,12 +608,13 @@ type MatchResources struct {
606
608
// - Exact: match a request only if it exactly matches a specified rule.
607
609
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
608
610
// but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
609
- // a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy .
611
+ // the admission policy does not consider requests to apps/v1beta1 or extensions/v1beta1 API groups .
610
612
//
611
613
// - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version.
612
614
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
613
615
// and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
614
- // a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy.
616
+ // the admission policy **does** consider requests made to apps/v1beta1 or extensions/v1beta1
617
+ // API groups. The API server translates the request to a matched resource API if necessary.
615
618
//
616
619
// Defaults to "Equivalent"
617
620
// +optional
0 commit comments