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