Skip to content

Commit

Permalink
Support SameLabels as peer Namespace selection in ACNP
Browse files Browse the repository at this point in the history
Signed-off-by: Dyanngg <[email protected]>
  • Loading branch information
Dyanngg committed Jan 3, 2023
1 parent 00f59cd commit 6c6f020
Show file tree
Hide file tree
Showing 11 changed files with 377 additions and 35 deletions.
8 changes: 8 additions & 0 deletions build/charts/antrea/crds/clusternetworkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ spec:
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down Expand Up @@ -582,6 +586,10 @@ spec:
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down
8 changes: 8 additions & 0 deletions build/yamls/antrea-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,10 @@ spec:
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down Expand Up @@ -960,6 +964,10 @@ spec:
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down
8 changes: 8 additions & 0 deletions build/yamls/antrea-crds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,10 @@ spec:
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down Expand Up @@ -953,6 +957,10 @@ spec:
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down
8 changes: 8 additions & 0 deletions build/yamls/antrea-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,10 @@ spec:
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down Expand Up @@ -960,6 +964,10 @@ spec:
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down
8 changes: 8 additions & 0 deletions build/yamls/antrea-gke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,10 @@ spec:
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down Expand Up @@ -960,6 +964,10 @@ spec:
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down
8 changes: 8 additions & 0 deletions build/yamls/antrea-ipsec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,10 @@ spec:
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down Expand Up @@ -960,6 +964,10 @@ spec:
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down
8 changes: 8 additions & 0 deletions build/yamls/antrea.yml
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,10 @@ spec:
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down Expand Up @@ -960,6 +964,10 @@ spec:
enum:
- Self
type: string
sameLabels:
type: array
items:
type: string
ipBlock:
type: object
properties:
Expand Down
6 changes: 6 additions & 0 deletions pkg/apis/crd/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,14 @@ type AppliedTo struct {
Service *NamespacedName `json:"service,omitempty"`
}

// PeerNamespaces describes criteria for selecting Pod/ExternalEntity
// from matched Namespaces. Only one of the criteria can be set.
type PeerNamespaces struct {
// Selects from the same Namespace of the appliedTo workloads.
Match NamespaceMatchType `json:"match,omitempty"`
// Selects Namespaces that share the same values for the given set of label keys
// with the appliedTo Namespace. Namespaces must have all the label keys.
SameLabels []string `json:"sameLabels,omitempty"`
}

// NamespaceMatchType describes Namespace matching strategy.
Expand Down
7 changes: 6 additions & 1 deletion pkg/apis/crd/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6c6f020

Please sign in to comment.