diff --git a/helper.go b/helper.go index 07e6f88..d828df7 100644 --- a/helper.go +++ b/helper.go @@ -43,8 +43,5 @@ func parseLXCProperties(data json.RawMessage) (*LXCProperties, error) { if props.Hostname == "" { return nil, fmt.Errorf("name missing") } - if props.OSTemplate == "" { - return nil, fmt.Errorf("ostemplate missing") - } return &props, nil } diff --git a/proxmox.go b/proxmox.go index 959dbc5..d511bda 100644 --- a/proxmox.go +++ b/proxmox.go @@ -211,6 +211,7 @@ func (p *Plugin) Read(ctx context.Context, req *resource.ReadRequest) (*resource VMID: req.NativeID, Hostname: lxcdata.Hostname, Description: lxcdata.Description, + OSTemplate: "", } propsJSON, err := json.Marshal(properties) diff --git a/schema/pkl/proxmox.pkl b/schema/pkl/proxmox.pkl index 73c2ded..48a4f86 100644 --- a/schema/pkl/proxmox.pkl +++ b/schema/pkl/proxmox.pkl @@ -29,12 +29,12 @@ class LXC extends formae.Resource { createOnly = true writeOnly = true } - ostemplate: String + ostemplate: String? @formae.FieldHint {} hostname: String @formae.FieldHint {} - description: String = "No description" + description: String? } diff --git a/types.go b/types.go index eb7d291..e4a7fcd 100644 --- a/types.go +++ b/types.go @@ -11,7 +11,7 @@ type LXCProperties struct { VMID string `json:"vmid"` Hostname string `json:"hostname"` Description string `json:"description,omitempty"` - OSTemplate string `json:"ostemplate"` + OSTemplate string `json:"ostemplate,omitempty"` } type ReadRequest struct {