Skip to content

Commit

Permalink
Add crd/v1alpha3 for ClusterGroup
Browse files Browse the repository at this point in the history
Add apiextensions-apiserver clientset and convert function for two versions of CRDs

Add convert function for the two versions of CRDs

Add controller logic to handle ipBlocks

Fix issues in webhook registration

Fix conversion logic

Add E2E test and fix UT

Address comment
  • Loading branch information
Dyanngg committed May 14, 2021
1 parent 771477a commit 7364b7f
Show file tree
Hide file tree
Showing 56 changed files with 2,843 additions and 345 deletions.
139 changes: 137 additions & 2 deletions build/yamls/antrea-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ spec:
spec:
properties:
childGroups:
x-kubernetes-preserve-unknown-fields: true
items:
type: string
type: array
externalEntitySelector:
properties:
matchExpressions:
Expand Down Expand Up @@ -236,6 +238,17 @@ metadata:
app: antrea
name: clustergroups.crd.antrea.io
spec:
conversion:
strategy: Webhook
webhook:
clientConfig:
service:
name: antrea
namespace: kube-system
path: /convert/clustergroup
conversionReviewVersions:
- v1
- v1beta1
group: crd.antrea.io
names:
kind: ClusterGroup
Expand All @@ -252,7 +265,9 @@ spec:
spec:
properties:
childGroups:
x-kubernetes-preserve-unknown-fields: true
items:
type: string
type: array
externalEntitySelector:
properties:
matchExpressions:
Expand Down Expand Up @@ -360,6 +375,118 @@ spec:
type: object
type: object
served: true
storage: false
- name: v1alpha3
schema:
openAPIV3Schema:
properties:
spec:
properties:
childGroups:
items:
type: string
type: array
externalEntitySelector:
properties:
matchExpressions:
items:
properties:
key:
type: string
operator:
enum:
- In
- NotIn
- Exists
- DoesNotExist
type: string
values:
items:
type: string
type: array
type: object
type: array
matchLabels:
x-kubernetes-preserve-unknown-fields: true
type: object
ipBlocks:
items:
properties:
cidr:
format: cidr
type: string
type: object
type: array
namespaceSelector:
properties:
matchExpressions:
items:
properties:
key:
type: string
operator:
enum:
- In
- NotIn
- Exists
- DoesNotExist
type: string
values:
items:
type: string
type: array
type: object
type: array
matchLabels:
x-kubernetes-preserve-unknown-fields: true
type: object
podSelector:
properties:
matchExpressions:
items:
properties:
key:
type: string
operator:
enum:
- In
- NotIn
- Exists
- DoesNotExist
type: string
values:
items:
type: string
type: array
type: object
type: array
matchLabels:
x-kubernetes-preserve-unknown-fields: true
type: object
serviceReference:
properties:
name:
type: string
namespace:
type: string
type: object
type: object
status:
properties:
conditions:
items:
properties:
lastTransitionTime:
type: string
status:
type: string
type:
type: string
type: object
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
Expand Down Expand Up @@ -3105,6 +3232,13 @@ rules:
- subjectaccessreviews
verbs:
- create
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
- update
- apiGroups:
- ""
resourceNames:
Expand Down Expand Up @@ -4261,6 +4395,7 @@ webhooks:
- apiGroups:
- crd.antrea.io
apiVersions:
- v1alpha3
- v1alpha2
operations:
- CREATE
Expand Down
139 changes: 137 additions & 2 deletions build/yamls/antrea-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ spec:
spec:
properties:
childGroups:
x-kubernetes-preserve-unknown-fields: true
items:
type: string
type: array
externalEntitySelector:
properties:
matchExpressions:
Expand Down Expand Up @@ -236,6 +238,17 @@ metadata:
app: antrea
name: clustergroups.crd.antrea.io
spec:
conversion:
strategy: Webhook
webhook:
clientConfig:
service:
name: antrea
namespace: kube-system
path: /convert/clustergroup
conversionReviewVersions:
- v1
- v1beta1
group: crd.antrea.io
names:
kind: ClusterGroup
Expand All @@ -252,7 +265,9 @@ spec:
spec:
properties:
childGroups:
x-kubernetes-preserve-unknown-fields: true
items:
type: string
type: array
externalEntitySelector:
properties:
matchExpressions:
Expand Down Expand Up @@ -360,6 +375,118 @@ spec:
type: object
type: object
served: true
storage: false
- name: v1alpha3
schema:
openAPIV3Schema:
properties:
spec:
properties:
childGroups:
items:
type: string
type: array
externalEntitySelector:
properties:
matchExpressions:
items:
properties:
key:
type: string
operator:
enum:
- In
- NotIn
- Exists
- DoesNotExist
type: string
values:
items:
type: string
type: array
type: object
type: array
matchLabels:
x-kubernetes-preserve-unknown-fields: true
type: object
ipBlocks:
items:
properties:
cidr:
format: cidr
type: string
type: object
type: array
namespaceSelector:
properties:
matchExpressions:
items:
properties:
key:
type: string
operator:
enum:
- In
- NotIn
- Exists
- DoesNotExist
type: string
values:
items:
type: string
type: array
type: object
type: array
matchLabels:
x-kubernetes-preserve-unknown-fields: true
type: object
podSelector:
properties:
matchExpressions:
items:
properties:
key:
type: string
operator:
enum:
- In
- NotIn
- Exists
- DoesNotExist
type: string
values:
items:
type: string
type: array
type: object
type: array
matchLabels:
x-kubernetes-preserve-unknown-fields: true
type: object
serviceReference:
properties:
name:
type: string
namespace:
type: string
type: object
type: object
status:
properties:
conditions:
items:
properties:
lastTransitionTime:
type: string
status:
type: string
type:
type: string
type: object
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
Expand Down Expand Up @@ -3105,6 +3232,13 @@ rules:
- subjectaccessreviews
verbs:
- create
- apiGroups:
- apiextensions.k8s.io
resources:
- customresourcedefinitions
verbs:
- get
- update
- apiGroups:
- ""
resourceNames:
Expand Down Expand Up @@ -4263,6 +4397,7 @@ webhooks:
- apiGroups:
- crd.antrea.io
apiVersions:
- v1alpha3
- v1alpha2
operations:
- CREATE
Expand Down
Loading

0 comments on commit 7364b7f

Please sign in to comment.