Skip to content

Commit 7e5b3b1

Browse files
authored
Merge pull request #302 from tssurya/address-review-comments-before-v1alpha1
Address review comments before v1alpha1
2 parents e333b5e + 28bb67f commit 7e5b3b1

8 files changed

+24
-23
lines changed

apis/v1alpha1/adminnetworkpolicy_types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ type AdminNetworkPolicyIngressRule struct {
126126
Action AdminNetworkPolicyRuleAction `json:"action"`
127127

128128
// From is the list of sources whose traffic this rule applies to.
129-
// If any AdminNetworkPolicyIngressPeer matches the source of incoming
129+
// If any element matches the source of incoming
130130
// traffic then the specified action is applied.
131131
// This field must be defined and contain at least one item.
132132
//
@@ -150,7 +150,7 @@ type AdminNetworkPolicyIngressRule struct {
150150
// set of traffic originating from pods selected by a AdminNetworkPolicy's
151151
// Subject field.
152152
// <network-policy-api:experimental:validation>
153-
// +kubebuilder:validation:XValidation:rule="!(self.to.exists(peer, has(peer.networks) || has(peer.nodes)) && has(self.ports) && self.ports.exists(port, has(port.namedPort)))",message="networks/nodes peer cannot be set with namedPorts since there are no namedPorts for networks/nodes"
153+
// +kubebuilder:validation:XValidation:rule="!(self.to.exists(peer, has(peer.networks) || has(peer.nodes) || has(peer.domainNames)) && has(self.ports) && self.ports.exists(port, has(port.namedPort)))",message="networks/nodes/domainNames peer cannot be set with namedPorts since there are no namedPorts for networks/nodes/domainNames"
154154
type AdminNetworkPolicyEgressRule struct {
155155
// Name is an identifier for this rule, that may be no more than 100 characters
156156
// in length. This field should be used by the implementation to help
@@ -173,7 +173,7 @@ type AdminNetworkPolicyEgressRule struct {
173173
Action AdminNetworkPolicyRuleAction `json:"action"`
174174

175175
// To is the List of destinations whose traffic this rule applies to.
176-
// If any AdminNetworkPolicyEgressPeer matches the destination of outgoing
176+
// If any element matches the destination of outgoing
177177
// traffic then the specified action is applied.
178178
// This field must be defined and contain at least one item.
179179
//
@@ -254,7 +254,7 @@ type AdminNetworkPolicyEgressPeer struct {
254254
// DomainNames provides a way to specify domain names as peers.
255255
//
256256
// DomainNames is only supported for ALLOW rules. In order to control
257-
// access, DomainNames ALLOW rules should be used with a lower priority
257+
// access, DomainNames Allow rules should be used with a lower priority
258258
// egress deny -- this allows the admin to maintain an explicit "allowlist"
259259
// of reachable domains.
260260
//

apis/v1alpha1/baselineadminnetworkpolicy_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ type BaselineAdminNetworkPolicyIngressRule struct {
107107
Action BaselineAdminNetworkPolicyRuleAction `json:"action"`
108108

109109
// From is the list of sources whose traffic this rule applies to.
110-
// If any AdminNetworkPolicyIngressPeer matches the source of incoming
110+
// If any element matches the source of incoming
111111
// traffic then the specified action is applied.
112112
// This field must be defined and contain at least one item.
113113
//
@@ -150,7 +150,7 @@ type BaselineAdminNetworkPolicyEgressRule struct {
150150
Action BaselineAdminNetworkPolicyRuleAction `json:"action"`
151151

152152
// To is the list of destinations whose traffic this rule applies to.
153-
// If any BaselineAdminNetworkPolicyEgressPeer matches the destination of outgoing
153+
// If any element matches the destination of outgoing
154154
// traffic then the specified action is applied.
155155
// This field must be defined and contain at least one item.
156156
// +kubebuilder:validation:MinItems=1

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ spec:
167167
to:
168168
description: |-
169169
To is the List of destinations whose traffic this rule applies to.
170-
If any AdminNetworkPolicyEgressPeer matches the destination of outgoing
170+
If any element matches the destination of outgoing
171171
traffic then the specified action is applied.
172172
This field must be defined and contain at least one item.
173173
items:
@@ -190,7 +190,7 @@ spec:
190190
DomainNames provides a way to specify domain names as peers.
191191
192192
DomainNames is only supported for ALLOW rules. In order to control
193-
access, DomainNames ALLOW rules should be used with a lower priority
193+
access, DomainNames Allow rules should be used with a lower priority
194194
egress deny -- this allows the admin to maintain an explicit "allowlist"
195195
of reachable domains.
196196
@@ -468,10 +468,11 @@ spec:
468468
- to
469469
type: object
470470
x-kubernetes-validations:
471-
- message: networks/nodes peer cannot be set with namedPorts since
472-
there are no namedPorts for networks/nodes
473-
rule: '!(self.to.exists(peer, has(peer.networks) || has(peer.nodes))
474-
&& has(self.ports) && self.ports.exists(port, has(port.namedPort)))'
471+
- message: networks/nodes/domainNames peer cannot be set with namedPorts
472+
since there are no namedPorts for networks/nodes/domainNames
473+
rule: '!(self.to.exists(peer, has(peer.networks) || has(peer.nodes)
474+
|| has(peer.domainNames)) && has(self.ports) && self.ports.exists(port,
475+
has(port.namedPort)))'
475476
maxItems: 100
476477
type: array
477478
ingress:
@@ -507,7 +508,7 @@ spec:
507508
from:
508509
description: |-
509510
From is the list of sources whose traffic this rule applies to.
510-
If any AdminNetworkPolicyIngressPeer matches the source of incoming
511+
If any element matches the source of incoming
511512
traffic then the specified action is applied.
512513
This field must be defined and contain at least one item.
513514
items:

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ spec:
160160
to:
161161
description: |-
162162
To is the list of destinations whose traffic this rule applies to.
163-
If any BaselineAdminNetworkPolicyEgressPeer matches the destination of outgoing
163+
If any element matches the destination of outgoing
164164
traffic then the specified action is applied.
165165
This field must be defined and contain at least one item.
166166
items:
@@ -458,7 +458,7 @@ spec:
458458
from:
459459
description: |-
460460
From is the list of sources whose traffic this rule applies to.
461-
If any AdminNetworkPolicyIngressPeer matches the source of incoming
461+
If any element matches the source of incoming
462462
traffic then the specified action is applied.
463463
This field must be defined and contain at least one item.
464464
items:

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ spec:
161161
to:
162162
description: |-
163163
To is the List of destinations whose traffic this rule applies to.
164-
If any AdminNetworkPolicyEgressPeer matches the destination of outgoing
164+
If any element matches the destination of outgoing
165165
traffic then the specified action is applied.
166166
This field must be defined and contain at least one item.
167167
items:
@@ -404,7 +404,7 @@ spec:
404404
from:
405405
description: |-
406406
From is the list of sources whose traffic this rule applies to.
407-
If any AdminNetworkPolicyIngressPeer matches the source of incoming
407+
If any element matches the source of incoming
408408
traffic then the specified action is applied.
409409
This field must be defined and contain at least one item.
410410
items:

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ spec:
154154
to:
155155
description: |-
156156
To is the list of destinations whose traffic this rule applies to.
157-
If any BaselineAdminNetworkPolicyEgressPeer matches the destination of outgoing
157+
If any element matches the destination of outgoing
158158
traffic then the specified action is applied.
159159
This field must be defined and contain at least one item.
160160
items:
@@ -393,7 +393,7 @@ spec:
393393
from:
394394
description: |-
395395
From is the list of sources whose traffic this rule applies to.
396-
If any AdminNetworkPolicyIngressPeer matches the source of incoming
396+
If any element matches the source of incoming
397397
traffic then the specified action is applied.
398398
This field must be defined and contain at least one item.
399399
items:

npeps/npep-133-fqdn-egress-selector.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ type AdminNetworkPolicyEgressPeer struct {
130130
<snipped>
131131
// DomainNames provides a way to specify domain names as peers.
132132
//
133-
// DomainNames is only supported for ALLOW rules. In order to control
134-
// access, DomainNames ALLOW rules should be used with a lower priority
133+
// DomainNames is only supported for Allow rules. In order to control
134+
// access, DomainNames Allow rules should be used with a lower priority
135135
// egress deny -- this allows the admin to maintain an explicit "allowlist"
136136
// of reachable domains.
137137
//

site-src/npeps/npep-133-fqdn-egress-selector.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ type AdminNetworkPolicyEgressPeer struct {
130130
<snipped>
131131
// DomainNames provides a way to specify domain names as peers.
132132
//
133-
// DomainNames is only supported for ALLOW rules. In order to control
134-
// access, DomainNames ALLOW rules should be used with a lower priority
133+
// DomainNames is only supported for Allow rules. In order to control
134+
// access, DomainNames Allow rules should be used with a lower priority
135135
// egress deny -- this allows the admin to maintain an explicit "allowlist"
136136
// of reachable domains.
137137
//

0 commit comments

Comments
 (0)