@@ -92,19 +92,20 @@ const (
92
92
type FailurePolicyType string
93
93
94
94
const (
95
- // Ignore means that an error calling the webhook is ignored.
95
+ // Ignore means that an error calling the admission webhook or admission policy is ignored.
96
96
Ignore FailurePolicyType = "Ignore"
97
- // Fail means that an error calling the webhook causes the admission to fail.
97
+ // Fail means that an error calling the admission webhook or admission policy causes resource admission to fail.
98
98
Fail FailurePolicyType = "Fail"
99
99
)
100
100
101
101
// MatchPolicyType specifies the type of match policy
102
102
type MatchPolicyType string
103
103
104
104
const (
105
- // Exact means requests should only be sent to the webhook if they exactly match a given rule
105
+ // Exact means requests should only be sent to the admission webhook or admission policy if they exactly match a given rule.
106
106
Exact MatchPolicyType = "Exact"
107
- // Equivalent means requests should be sent to the webhook if they modify a resource listed in rules via another API group or version.
107
+ // Equivalent means requests should be sent to the admission webhook or admission policy if they modify a resource listed
108
+ // in rules via another API group or version.
108
109
Equivalent MatchPolicyType = "Equivalent"
109
110
)
110
111
@@ -617,9 +618,9 @@ type MatchResources struct {
617
618
// Default to the empty LabelSelector, which matches everything.
618
619
// +optional
619
620
NamespaceSelector * metav1.LabelSelector
620
- // ObjectSelector decides whether to run the validation based on if the
621
+ // ObjectSelector decides whether to run the policy based on if the
621
622
// object has matching labels. objectSelector is evaluated against both
622
- // the oldObject and newObject that would be sent to the cel validation , and
623
+ // the oldObject and newObject that would be sent to the cel policy , and
623
624
// is considered to match if either object matches the selector. A null
624
625
// object (oldObject in the case of create, or newObject in the case of
625
626
// delete) or an object that cannot have labels (like a
@@ -630,12 +631,14 @@ type MatchResources struct {
630
631
// Default to the empty LabelSelector, which matches everything.
631
632
// +optional
632
633
ObjectSelector * metav1.LabelSelector
633
- // ResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy matches.
634
+ // ResourceRules describes what operations on what resources/subresources the policy matches.
634
635
// The policy cares about an operation if it matches _any_ Rule.
636
+ // +listType=atomic
635
637
// +optional
636
638
ResourceRules []NamedRuleWithOperations
637
- // ExcludeResourceRules describes what operations on what resources/subresources the ValidatingAdmissionPolicy should not care about.
639
+ // ExcludeResourceRules describes what operations on what resources/subresources the policy should not care about.
638
640
// The exclude rules take precedence over include rules (if a resource matches both, it is excluded)
641
+ // +listType=atomic
639
642
// +optional
640
643
ExcludeResourceRules []NamedRuleWithOperations
641
644
// matchPolicy defines how the "MatchResources" list is used to match incoming requests.
@@ -644,12 +647,12 @@ type MatchResources struct {
644
647
// - Exact: match a request only if it exactly matches a specified rule.
645
648
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
646
649
// but "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
647
- // a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the ValidatingAdmissionPolicy .
650
+ // a request to apps/v1beta1 or extensions/v1beta1 would not be sent to the policy .
648
651
//
649
652
// - Equivalent: match a request if modifies a resource listed in rules, even via another API group or version.
650
653
// For example, if deployments can be modified via apps/v1, apps/v1beta1, and extensions/v1beta1,
651
654
// and "rules" only included `apiGroups:["apps"], apiVersions:["v1"], resources: ["deployments"]`,
652
- // a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the ValidatingAdmissionPolicy .
655
+ // a request to apps/v1beta1 or extensions/v1beta1 would be converted to apps/v1 and sent to the policy .
653
656
//
654
657
// Defaults to "Equivalent"
655
658
// +optional
0 commit comments