Skip to content

Commit 2cc1bfb

Browse files
authored
Merge pull request #96 from tssurya/clarify-port-definition
Clarify what the Ports field means
2 parents 4acd68c + 1c513e2 commit 2cc1bfb

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

apis/v1alpha1/adminnetworkpolicy_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ type AdminNetworkPolicyIngressRule struct {
119119
From []AdminNetworkPolicyPeer `json:"from"`
120120

121121
// Ports allows for matching traffic based on port and protocols.
122+
// This field is a list of ports which should be matched on
123+
// the pods selected for this policy i.e the subject of the policy.
124+
// So it matches on the destination port for the ingress traffic.
122125
// If Ports is not set then the rule does not filter traffic via port.
123126
// +optional
124127
// +kubebuilder:validation:MaxItems=100
@@ -156,6 +159,7 @@ type AdminNetworkPolicyEgressRule struct {
156159
To []AdminNetworkPolicyPeer `json:"to"`
157160

158161
// Ports allows for matching traffic based on port and protocols.
162+
// This field is a list of destination ports for the outging egress traffic.
159163
// If Ports is not set then the rule does not filter traffic via port.
160164
// +optional
161165
// +kubebuilder:validation:MaxItems=100

apis/v1alpha1/baselineadminnetworkpolicy_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ type BaselineAdminNetworkPolicyIngressRule struct {
105105
From []AdminNetworkPolicyPeer `json:"from"`
106106

107107
// Ports allows for matching traffic based on port and protocols.
108+
// This field is a list of ports which should be matched on
109+
// the pods selected for this policy i.e the subject of the policy.
110+
// So it matches on the destination port for the ingress traffic.
108111
// If Ports is not set then the rule does not filter traffic via port.
109112
// +optional
110113
// +kubebuilder:validation:MaxItems=100
@@ -137,6 +140,7 @@ type BaselineAdminNetworkPolicyEgressRule struct {
137140
To []AdminNetworkPolicyPeer `json:"to"`
138141

139142
// Ports allows for matching traffic based on port and protocols.
143+
// This field is a list of destination ports for the outging egress traffic.
140144
// If Ports is not set then the rule does not filter traffic via port.
141145
// +optional
142146
// +kubebuilder:validation:MaxItems=100

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ spec:
7979
type: string
8080
ports:
8181
description: Ports allows for matching traffic based on port
82-
and protocols. If Ports is not set then the rule does not
83-
filter traffic via port.
82+
and protocols. This field is a list of destination ports for
83+
the outging egress traffic. If Ports is not set then the rule
84+
does not filter traffic via port.
8485
items:
8586
description: AdminNetworkPolicyPort describes how to select
8687
network ports on pod(s). Exactly one field must be set.
@@ -670,7 +671,10 @@ spec:
670671
type: string
671672
ports:
672673
description: Ports allows for matching traffic based on port
673-
and protocols. If Ports is not set then the rule does not
674+
and protocols. This field is a list of ports which should
675+
be matched on the pods selected for this policy i.e the subject
676+
of the policy. So it matches on the destination port for the
677+
ingress traffic. If Ports is not set then the rule does not
674678
filter traffic via port.
675679
items:
676680
description: AdminNetworkPolicyPort describes how to select

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ spec:
7272
type: string
7373
ports:
7474
description: Ports allows for matching traffic based on port
75-
and protocols. If Ports is not set then the rule does not
76-
filter traffic via port.
75+
and protocols. This field is a list of destination ports for
76+
the outging egress traffic. If Ports is not set then the rule
77+
does not filter traffic via port.
7778
items:
7879
description: AdminNetworkPolicyPort describes how to select
7980
network ports on pod(s). Exactly one field must be set.
@@ -657,7 +658,10 @@ spec:
657658
type: string
658659
ports:
659660
description: Ports allows for matching traffic based on port
660-
and protocols. If Ports is not set then the rule does not
661+
and protocols. This field is a list of ports which should
662+
be matched on the pods selected for this policy i.e the subject
663+
of the policy. So it matches on the destination port for the
664+
ingress traffic. If Ports is not set then the rule does not
661665
filter traffic via port.
662666
items:
663667
description: AdminNetworkPolicyPort describes how to select

0 commit comments

Comments
 (0)