From 7329e48d6b12fe189b681a73b60dbdb13c0a25c2 Mon Sep 17 00:00:00 2001 From: sp-yduck Date: Tue, 7 Nov 2023 23:29:46 +0900 Subject: [PATCH] use optional for hardware devices --- api/v1beta1/proxmoxmachine_types.go | 2 +- api/v1beta1/type.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/v1beta1/proxmoxmachine_types.go b/api/v1beta1/proxmoxmachine_types.go index c83693d..07d4ffb 100644 --- a/api/v1beta1/proxmoxmachine_types.go +++ b/api/v1beta1/proxmoxmachine_types.go @@ -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"` diff --git a/api/v1beta1/type.go b/api/v1beta1/type.go index 4d8f16b..355aa51 100644 --- a/api/v1beta1/type.go +++ b/api/v1beta1/type.go @@ -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"`