Skip to content

Commit

Permalink
Disallow empty port list for ANP peers.
Browse files Browse the repository at this point in the history
Signed-off-by: Nadia Pinaeva <[email protected]>
  • Loading branch information
npinaeva committed Oct 10, 2024
1 parent 990c5a1 commit a14d924
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apis/v1alpha1/adminnetworkpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ type AdminNetworkPolicyIngressRule struct {
// Support: Core
//
// +optional
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=100
Ports *[]AdminNetworkPolicyPort `json:"ports,omitempty"`
}
Expand Down Expand Up @@ -207,6 +208,7 @@ type AdminNetworkPolicyEgressRule struct {
// Support: Core
//
// +optional
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=100
Ports *[]AdminNetworkPolicyPort `json:"ports,omitempty"`
}
Expand Down
2 changes: 2 additions & 0 deletions apis/v1alpha1/baselineadminnetworkpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ type BaselineAdminNetworkPolicyIngressRule struct {
// Support: Core
//
// +optional
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=100
Ports *[]AdminNetworkPolicyPort `json:"ports,omitempty"`
}
Expand Down Expand Up @@ -181,6 +182,7 @@ type BaselineAdminNetworkPolicyEgressRule struct {
// This field is a list of destination ports for the outgoing egress traffic.
// If Ports is not set then the rule does not filter traffic via port.
// +optional
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=100
Ports *[]AdminNetworkPolicyPort `json:"ports,omitempty"`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ spec:
type: object
type: object
maxItems: 100
minItems: 1
type: array
to:
description: |-
Expand Down Expand Up @@ -869,6 +870,7 @@ spec:
type: object
type: object
maxItems: 100
minItems: 1
type: array
required:
- action
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ spec:
type: object
type: object
maxItems: 100
minItems: 1
type: array
to:
description: |-
Expand Down Expand Up @@ -808,6 +809,7 @@ spec:
type: object
type: object
maxItems: 100
minItems: 1
type: array
required:
- action
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ spec:
type: object
type: object
maxItems: 100
minItems: 1
type: array
to:
description: |-
Expand Down Expand Up @@ -704,6 +705,7 @@ spec:
type: object
type: object
maxItems: 100
minItems: 1
type: array
required:
- action
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ spec:
type: object
type: object
maxItems: 100
minItems: 1
type: array
to:
description: |-
Expand Down Expand Up @@ -690,6 +691,7 @@ spec:
type: object
type: object
maxItems: 100
minItems: 1
type: array
required:
- action
Expand Down

0 comments on commit a14d924

Please sign in to comment.