Skip to content

Commit 3d0c89f

Browse files
authored
Merge pull request #84 from tssurya/fix-priority-documentation
Fix comments for ingress/egress priority
2 parents f51e7d8 + 2704c8e commit 3d0c89f

File tree

4 files changed

+43
-24
lines changed

4 files changed

+43
-24
lines changed

apis/v1alpha1/adminnetworkpolicy_types.go

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ type AdminNetworkPolicySpec struct {
5757
// higher precedence, and are checked before rules with higher priority values.
5858
// All AdminNetworkPolicy rules have higher precedence than NetworkPolicy or
5959
// BaselineAdminNetworkPolicy rules
60-
// The relative precedence of the rules within a single ANP object (all of
61-
// which share the priority) will be determined by the order in which the rule
62-
// is written. Thus, a rule that appears at the top of the ingress/egress rules
63-
// would take the highest precedence. If ingress rules are defined before egress
64-
// rules in the same ANP object then ingress would take precedence and vice versa.
6560
// The behavior is undefined if two ANP objects have same priority.
6661
// +kubebuilder:validation:Minimum=0
6762
// +kubebuilder:validation:Maximum=1000
@@ -71,15 +66,23 @@ type AdminNetworkPolicySpec struct {
7166
Subject AdminNetworkPolicySubject `json:"subject"`
7267

7368
// Ingress is the list of Ingress rules to be applied to the selected pods.
74-
// A total of 100 rules will be allowed in each ANP instance. ANPs with no
75-
// ingress rules do not affect ingress traffic.
69+
// A total of 100 rules will be allowed in each ANP instance.
70+
// The relative precedence of ingress rules within a single ANP object (all of
71+
// which share the priority) will be determined by the order in which the rule
72+
// is written. Thus, a rule that appears at the top of the ingress rules
73+
// would take the highest precedence.
74+
// ANPs with no ingress rules do not affect ingress traffic.
7675
// +optional
7776
// +kubebuilder:validation:MaxItems=100
7877
Ingress []AdminNetworkPolicyIngressRule `json:"ingress,omitempty"`
7978

8079
// Egress is the list of Egress rules to be applied to the selected pods.
81-
// A total of 100 rules will be allowed in each ANP instance. ANPs with no
82-
// egress rules do not affect egress traffic.
80+
// A total of 100 rules will be allowed in each ANP instance.
81+
// The relative precedence of egress rules within a single ANP object (all of
82+
// which share the priority) will be determined by the order in which the rule
83+
// is written. Thus, a rule that appears at the top of the egress rules
84+
// would take the highest precedence.
85+
// ANPs with no egress rules do not affect egress traffic.
8386
// +optional
8487
// +kubebuilder:validation:MaxItems=100
8588
Egress []AdminNetworkPolicyEgressRule `json:"egress,omitempty"`

apis/v1alpha1/baselineadminnetworkpolicy_types.go

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,23 @@ type BaselineAdminNetworkPolicySpec struct {
5757
// Ingress is the list of Ingress rules to be applied to the selected pods
5858
// if they are not matched by any AdminNetworkPolicy or NetworkPolicy rules.
5959
// A total of 100 Ingress rules will be allowed in each BANP instance.
60+
// The relative precedence of ingress rules within a single BANP object
61+
// will be determined by the order in which the rule is written.
62+
// Thus, a rule that appears at the top of the ingress rules
63+
// would take the highest precedence.
6064
// BANPs with no ingress rules do not affect ingress traffic.
6165
// +optional
6266
// +kubebuilder:validation:MaxItems=100
6367
Ingress []BaselineAdminNetworkPolicyIngressRule `json:"ingress,omitempty"`
6468

6569
// Egress is the list of Egress rules to be applied to the selected pods if
6670
// they are not matched by any AdminNetworkPolicy or NetworkPolicy rules.
67-
// A total of 100 Egress rules will be allowed in each BANP instance. BANPs
68-
// with no egress rules do not affect egress traffic.
71+
// A total of 100 Egress rules will be allowed in each BANP instance.
72+
// The relative precedence of egress rules within a single BANP object
73+
// will be determined by the order in which the rule is written.
74+
// Thus, a rule that appears at the top of the egress rules
75+
// would take the highest precedence.
76+
// BANPs with no egress rules do not affect egress traffic.
6977
// +optional
7078
// +kubebuilder:validation:MaxItems=100
7179
Egress []BaselineAdminNetworkPolicyEgressRule `json:"egress,omitempty"`

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

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ spec:
4949
egress:
5050
description: Egress is the list of Egress rules to be applied to the
5151
selected pods. A total of 100 rules will be allowed in each ANP
52-
instance. ANPs with no egress rules do not affect egress traffic.
52+
instance. The relative precedence of egress rules within a single
53+
ANP object (all of which share the priority) will be determined
54+
by the order in which the rule is written. Thus, a rule that appears
55+
at the top of the egress rules would take the highest precedence.
56+
ANPs with no egress rules do not affect egress traffic.
5357
items:
5458
description: AdminNetworkPolicyEgressRule describes an action to
5559
take on a particular set of traffic originating from pods selected
@@ -403,7 +407,11 @@ spec:
403407
ingress:
404408
description: Ingress is the list of Ingress rules to be applied to
405409
the selected pods. A total of 100 rules will be allowed in each
406-
ANP instance. ANPs with no ingress rules do not affect ingress traffic.
410+
ANP instance. The relative precedence of ingress rules within a
411+
single ANP object (all of which share the priority) will be determined
412+
by the order in which the rule is written. Thus, a rule that appears
413+
at the top of the ingress rules would take the highest precedence.
414+
ANPs with no ingress rules do not affect ingress traffic.
407415
items:
408416
description: AdminNetworkPolicyIngressRule describes an action to
409417
take on a particular set of traffic destined for pods selected
@@ -758,13 +766,7 @@ spec:
758766
priority values have higher precedence, and are checked before rules
759767
with higher priority values. All AdminNetworkPolicy rules have higher
760768
precedence than NetworkPolicy or BaselineAdminNetworkPolicy rules
761-
The relative precedence of the rules within a single ANP object
762-
(all of which share the priority) will be determined by the order
763-
in which the rule is written. Thus, a rule that appears at the top
764-
of the ingress/egress rules would take the highest precedence. If
765-
ingress rules are defined before egress rules in the same ANP object
766-
then ingress would take precedence and vice versa. The behavior
767-
is undefined if two ANP objects have same priority.
769+
The behavior is undefined if two ANP objects have same priority.
768770
format: int32
769771
maximum: 1000
770772
minimum: 0

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@ spec:
4747
description: Egress is the list of Egress rules to be applied to the
4848
selected pods if they are not matched by any AdminNetworkPolicy
4949
or NetworkPolicy rules. A total of 100 Egress rules will be allowed
50-
in each BANP instance. BANPs with no egress rules do not affect
51-
egress traffic.
50+
in each BANP instance. The relative precedence of egress rules within
51+
a single BANP object will be determined by the order in which the
52+
rule is written. Thus, a rule that appears at the top of the egress
53+
rules would take the highest precedence. BANPs with no egress rules
54+
do not affect egress traffic.
5255
items:
5356
description: BaselineAdminNetworkPolicyEgressRule describes an action
5457
to take on a particular set of traffic originating from pods selected
@@ -397,8 +400,11 @@ spec:
397400
description: Ingress is the list of Ingress rules to be applied to
398401
the selected pods if they are not matched by any AdminNetworkPolicy
399402
or NetworkPolicy rules. A total of 100 Ingress rules will be allowed
400-
in each BANP instance. BANPs with no ingress rules do not affect
401-
ingress traffic.
403+
in each BANP instance. The relative precedence of ingress rules
404+
within a single BANP object will be determined by the order in which
405+
the rule is written. Thus, a rule that appears at the top of the
406+
ingress rules would take the highest precedence. BANPs with no ingress
407+
rules do not affect ingress traffic.
402408
items:
403409
description: BaselineAdminNetworkPolicyIngressRule describes an
404410
action to take on a particular set of traffic destined for pods

0 commit comments

Comments
 (0)