fix: add creation password
This commit is contained in:
1
lxc.go
1
lxc.go
@@ -69,6 +69,7 @@ func (p *Plugin) CreateLXC(ctx context.Context, req *resource.CreateRequest) (*r
|
||||
urlparams := url.Values{
|
||||
"vmid": {props.VMID},
|
||||
"ostemplate": {props.OSTemplate},
|
||||
"password": {props.Password},
|
||||
"hostname": {props.Hostname},
|
||||
"cores": {strconv.Itoa(props.Cores)},
|
||||
"memory": {strconv.Itoa(props.Memory)},
|
||||
|
||||
@@ -31,6 +31,7 @@ func TestCreate(t *testing.T) {
|
||||
"hostname": "testlxc",
|
||||
"description": "none",
|
||||
"ostemplate": "local:vztmpl/alpine-3.22-default_20250617_amd64.tar.xz",
|
||||
"password": "password",
|
||||
"cores": 1,
|
||||
"memory": 512,
|
||||
}
|
||||
|
||||
@@ -28,6 +28,9 @@ class LXC extends formae.Resource {
|
||||
@formae.FieldHint {}
|
||||
ostemplate: String?
|
||||
|
||||
@formae.FieldHint {}
|
||||
password: String?
|
||||
|
||||
@formae.FieldHint {}
|
||||
hostname: String
|
||||
|
||||
|
||||
1
testdata/resource-replace.pkl
vendored
1
testdata/resource-replace.pkl
vendored
@@ -31,6 +31,7 @@ forma {
|
||||
hostname = "test-lxc"
|
||||
description = "some other description"
|
||||
ostemplate = "local:vztmpl/alpine-3.22-default_20250617_amd64.tar.xz"
|
||||
password = "test"
|
||||
cores = 1
|
||||
memory = 512
|
||||
}
|
||||
|
||||
1
testdata/resource.pkl
vendored
1
testdata/resource.pkl
vendored
@@ -33,6 +33,7 @@ forma {
|
||||
hostname = "test-lxc"
|
||||
description = "no description provided"
|
||||
ostemplate = "local:vztmpl/alpine-3.22-default_20250617_amd64.tar.xz"
|
||||
password = "abcd"
|
||||
cores = 1
|
||||
memory = 512
|
||||
}
|
||||
|
||||
1
types.go
1
types.go
@@ -12,6 +12,7 @@ type LXCProperties struct {
|
||||
Hostname string `json:"hostname"`
|
||||
Description string `json:"description,omitempty"`
|
||||
OSTemplate string `json:"ostemplate,omitempty"`
|
||||
Password string `json:"password,omitempty"`
|
||||
Cores int `json:"cores"`
|
||||
Memory int `json:"memory"`
|
||||
OnBoot int `json:"onboot"`
|
||||
|
||||
Reference in New Issue
Block a user