Skip to content

Commit

Permalink
feat(crd): update vm-dhcp-controller crd manifests
Browse files Browse the repository at this point in the history
Add declarative validations and some additional fields to support agent
upgrades

Signed-off-by: Zespre Chang <[email protected]>
  • Loading branch information
starbops committed Feb 19, 2024
1 parent 9765f09 commit 05dd006
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,14 @@ spec:
properties:
cidr:
type: string
x-kubernetes-validations:
- message: CIDR is immutable
rule: self == oldSelf
dns:
format: ipv4
items:
type: string
maxItems: 3
type: array
domainName:
type: string
Expand All @@ -81,36 +86,84 @@ spec:
ntp:
items:
type: string
maxItems: 4
type: array
pool:
properties:
end:
format: ipv4
type: string
x-kubernetes-validations:
- message: End is immutable
rule: self == oldSelf
exclude:
format: ipv4
items:
type: string
type: array
x-kubernetes-validations:
- message: Exclude is immutable
rule: self == oldSelf
start:
format: ipv4
type: string
x-kubernetes-validations:
- message: Start is immutable
rule: self == oldSelf
required:
- end
- start
type: object
x-kubernetes-validations:
- message: End is required once set
rule: '!has(oldSelf.exclude) || has(self.exclude)'
router:
format: ipv4
type: string
x-kubernetes-validations:
- message: Router is immutable
rule: self == oldSelf
serverIP:
format: ipv4
type: string
x-kubernetes-validations:
- message: ServerIP is immutable
rule: self == oldSelf
required:
- cidr
- pool
- serverIP
type: object
x-kubernetes-validations:
- message: Router is required once set
rule: '!has(oldSelf.router) || has(self.router)'
networkName:
maxLength: 64
type: string
x-kubernetes-validations:
- message: NetworkName is immutable
rule: self == oldSelf
paused:
type: boolean
required:
- networkName
type: object
status:
properties:
agentPodRef:
properties:
image:
type: string
name:
type: string
namespace:
type: string
uid:
description: |-
UID is a type that holds unique ID values, including UUIDs. Because we
don't ONLY use UUIDs, this is an alias to string. Being a type captures
intent and helps make sure that UIDs and names do not get conflated.
type: string
type: object
conditions:
items:
Expand Down Expand Up @@ -161,4 +214,5 @@ spec:
type: object
served: true
storage: true
subresources: {}
subresources:
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,37 @@ spec:
type: object
spec:
properties:
networkConfig:
networkConfigs:
items:
properties:
ipAddress:
format: ipv4
type: string
macAddress:
maxLength: 17
type: string
networkName:
maxLength: 64
type: string
required:
- macAddress
- networkName
type: object
maxItems: 4
type: array
x-kubernetes-validations:
- message: NetworkConfig may only be added
rule: oldSelf.all(x, x in self)
paused:
type: boolean
vmName:
maxLength: 64
type: string
x-kubernetes-validations:
- message: VMName is immutable
rule: self == oldSelf
required:
- vmName
type: object
status:
properties:
Expand Down Expand Up @@ -96,7 +112,7 @@ spec:
- type
type: object
type: array
networkConfig:
networkConfigs:
items:
properties:
allocatedIPAddress:
Expand All @@ -113,4 +129,5 @@ spec:
type: object
served: true
storage: true
subresources: {}
subresources:
status: {}

0 comments on commit 05dd006

Please sign in to comment.