fix: discovery problems solved
This commit is contained in:
@@ -43,8 +43,5 @@ func parseLXCProperties(data json.RawMessage) (*LXCProperties, error) {
|
|||||||
if props.Hostname == "" {
|
if props.Hostname == "" {
|
||||||
return nil, fmt.Errorf("name missing")
|
return nil, fmt.Errorf("name missing")
|
||||||
}
|
}
|
||||||
if props.OSTemplate == "" {
|
|
||||||
return nil, fmt.Errorf("ostemplate missing")
|
|
||||||
}
|
|
||||||
return &props, nil
|
return &props, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -211,6 +211,7 @@ func (p *Plugin) Read(ctx context.Context, req *resource.ReadRequest) (*resource
|
|||||||
VMID: req.NativeID,
|
VMID: req.NativeID,
|
||||||
Hostname: lxcdata.Hostname,
|
Hostname: lxcdata.Hostname,
|
||||||
Description: lxcdata.Description,
|
Description: lxcdata.Description,
|
||||||
|
OSTemplate: "",
|
||||||
}
|
}
|
||||||
|
|
||||||
propsJSON, err := json.Marshal(properties)
|
propsJSON, err := json.Marshal(properties)
|
||||||
|
|||||||
@@ -29,12 +29,12 @@ class LXC extends formae.Resource {
|
|||||||
createOnly = true
|
createOnly = true
|
||||||
writeOnly = true
|
writeOnly = true
|
||||||
}
|
}
|
||||||
ostemplate: String
|
ostemplate: String?
|
||||||
|
|
||||||
@formae.FieldHint {}
|
@formae.FieldHint {}
|
||||||
hostname: String
|
hostname: String
|
||||||
|
|
||||||
@formae.FieldHint {}
|
@formae.FieldHint {}
|
||||||
description: String = "No description"
|
description: String?
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
2
types.go
2
types.go
@@ -11,7 +11,7 @@ type LXCProperties struct {
|
|||||||
VMID string `json:"vmid"`
|
VMID string `json:"vmid"`
|
||||||
Hostname string `json:"hostname"`
|
Hostname string `json:"hostname"`
|
||||||
Description string `json:"description,omitempty"`
|
Description string `json:"description,omitempty"`
|
||||||
OSTemplate string `json:"ostemplate"`
|
OSTemplate string `json:"ostemplate,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ReadRequest struct {
|
type ReadRequest struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user