Skip to content

Commit

Permalink
Merge pull request #124 from sp-yduck/fix/crd
Browse files Browse the repository at this point in the history
use optional for hardware devices
  • Loading branch information
sp-yduck authored Nov 7, 2023
2 parents b5464ca + 7329e48 commit e43ea95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion api/v1beta1/proxmoxmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type ProxmoxMachineSpec struct {

// Hardware
// +kubebuilder:default:={cpu:2,disk:"50G",memory:4096,networkDevice:{model:virtio,bridge:vmbr0,firewall:true}}
Hardware Hardware `json:"hardware"`
Hardware Hardware `json:"hardware,omitempty"`

// Network
Network Network `json:"network,omitempty"`
Expand Down
6 changes: 3 additions & 3 deletions api/v1beta1/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,16 @@ type Hardware struct {
// network devices
// to do: multiple devices
// +kubebuilder:default:={model:virtio,bridge:vmbr0,firewall:true}
NetworkDevice NetworkDevice `json:"networkDevice"`
NetworkDevice NetworkDevice `json:"networkDevice,omitempty"`
}

// Network Device
type NetworkDevice struct {
// +kubebuilder:default:="virtio"
Model NetworkDeviceModel `json:"model"`
Model NetworkDeviceModel `json:"model,omitempty"`

// +kubebuilder:default:="vmbr0"
Bridge NetworkDeviceBridge `json:"bridge"`
Bridge NetworkDeviceBridge `json:"bridge,omitempty"`

// +kubebuilder:default:=true
Firewall bool `json:"firewall,omitempty"`
Expand Down

0 comments on commit e43ea95

Please sign in to comment.