Skip to content

Commit 889d52c

Browse files
committed
Clarify the corner cases for priority
Signed-off-by: Surya Seetharaman <[email protected]>
1 parent a5744a5 commit 889d52c

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

apis/v1alpha1/adminnetworkpolicy_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ type AdminNetworkPolicySpec struct {
5151
// higher precedence, and are checked before rules with higher priority values.
5252
// All AdminNetworkPolicy rules have higher precedence than NetworkPolicy or
5353
// BaselineAdminNetworkPolicy rules
54+
// The relative precedence of the rules within a single ANP object (all of
55+
// which share the priority) will be determined by the order in which the rule
56+
// is written. Thus, a rule that appears at the top of the ingress/egress rules
57+
// would take the highest precedence. If ingress rules are defined before egress
58+
// rules in the same ANP object then ingress would take precedence and vice versa.
59+
// The behavior is undefined if two ANP objects have same priority.
5460
// +kubebuilder:validation:Minimum=0
5561
// +kubebuilder:validation:Maximum=1000
5662
Priority int32 `json:"priority"`

config/crd/bases/policy.networking.k8s.io_adminnetworkpolicies.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,13 @@ spec:
748748
priority values have higher precedence, and are checked before rules
749749
with higher priority values. All AdminNetworkPolicy rules have higher
750750
precedence than NetworkPolicy or BaselineAdminNetworkPolicy rules
751+
The relative precedence of the rules within a single ANP object
752+
(all of which share the priority) will be determined by the order
753+
in which the rule is written. Thus, a rule that appears at the top
754+
of the ingress/egress rules would take the highest precedence. If
755+
ingress rules are defined before egress rules in the same ANP object
756+
then ingress would take precedence and vice versa. The behavior
757+
is undefined if two ANP objects have same priority.
751758
format: int32
752759
maximum: 1000
753760
minimum: 0

0 commit comments

Comments
 (0)