Skip to content

Commit

Permalink
Add Except for Antrea-native ipBlock (antrea-io#6658)
Browse files Browse the repository at this point in the history
Fixes antrea-io#6428

This PR adds an "except" field for all ipBlocks in Antrea-native
policies and groups. Users can exclude certain CIDRs from the
ipBlock.cidr in all resources that support ipBlocks, including
AntreaClusterNetworkPolicy, AntreaNetworkPolicy, ClusterGroup and
Group. Group membership and IP association query logic are also updated
to accommodate this change. Documentation will follow in a separate PR.

Signed-off-by: Dyanngg <dingyang@vmware.com>
  • Loading branch information
Dyanngg authored and hangyan committed Oct 29, 2024
1 parent 09ec777 commit 0d094a5
Show file tree
Hide file tree
Showing 32 changed files with 1,148 additions and 186 deletions.
5 changes: 5 additions & 0 deletions build/charts/antrea/crds/clustergroup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
serviceReference:
type: object
properties:
Expand Down
10 changes: 10 additions & 0 deletions build/charts/antrea/crds/clusternetworkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
group:
type: string
serviceAccount:
Expand Down Expand Up @@ -683,6 +688,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
group:
type: string
fqdn:
Expand Down
5 changes: 5 additions & 0 deletions build/charts/antrea/crds/group.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
serviceReference:
type: object
properties:
Expand Down
10 changes: 10 additions & 0 deletions build/charts/antrea/crds/networkpolicy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
nodeSelector:
type: object
properties:
Expand Down Expand Up @@ -570,6 +575,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
fqdn:
type: string
nodeSelector:
Expand Down
30 changes: 30 additions & 0 deletions build/yamls/antrea-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
serviceReference:
type: object
properties:
Expand Down Expand Up @@ -979,6 +984,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
group:
type: string
serviceAccount:
Expand Down Expand Up @@ -1261,6 +1271,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
group:
type: string
fqdn:
Expand Down Expand Up @@ -1861,6 +1876,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
serviceReference:
type: object
properties:
Expand Down Expand Up @@ -2477,6 +2497,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
nodeSelector:
type: object
properties:
Expand Down Expand Up @@ -2726,6 +2751,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
fqdn:
type: string
nodeSelector:
Expand Down
30 changes: 30 additions & 0 deletions build/yamls/antrea-crds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
serviceReference:
type: object
properties:
Expand Down Expand Up @@ -970,6 +975,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
group:
type: string
serviceAccount:
Expand Down Expand Up @@ -1252,6 +1262,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
group:
type: string
fqdn:
Expand Down Expand Up @@ -1842,6 +1857,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
serviceReference:
type: object
properties:
Expand Down Expand Up @@ -2454,6 +2474,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
nodeSelector:
type: object
properties:
Expand Down Expand Up @@ -2703,6 +2728,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
fqdn:
type: string
nodeSelector:
Expand Down
30 changes: 30 additions & 0 deletions build/yamls/antrea-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
serviceReference:
type: object
properties:
Expand Down Expand Up @@ -979,6 +984,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
group:
type: string
serviceAccount:
Expand Down Expand Up @@ -1261,6 +1271,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
group:
type: string
fqdn:
Expand Down Expand Up @@ -1861,6 +1876,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
serviceReference:
type: object
properties:
Expand Down Expand Up @@ -2477,6 +2497,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
nodeSelector:
type: object
properties:
Expand Down Expand Up @@ -2726,6 +2751,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
fqdn:
type: string
nodeSelector:
Expand Down
30 changes: 30 additions & 0 deletions build/yamls/antrea-gke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
serviceReference:
type: object
properties:
Expand Down Expand Up @@ -979,6 +984,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
group:
type: string
serviceAccount:
Expand Down Expand Up @@ -1261,6 +1271,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
group:
type: string
fqdn:
Expand Down Expand Up @@ -1861,6 +1876,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
serviceReference:
type: object
properties:
Expand Down Expand Up @@ -2477,6 +2497,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
nodeSelector:
type: object
properties:
Expand Down Expand Up @@ -2726,6 +2751,11 @@ spec:
cidr:
type: string
format: cidr
except:
type: array
items:
type: string
format: cidr
fqdn:
type: string
nodeSelector:
Expand Down
Loading

0 comments on commit 0d094a5

Please sign in to comment.