Skip to content

Commit f3d5b41

Browse files
authored
Merge pull request #79 from danitso/release/v0.4.4
Release/v0.4.4
2 parents 846b298 + 30be265 commit f3d5b41

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## v0.4.4
2+
3+
BUG FIXES:
4+
5+
* resource/virtual_environment_vm: Fix watchdog deserialization issue
6+
17
## v0.4.3
28

39
BUG FIXES:

proxmox/virtual_environment_vm_types.go

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ type CustomVirtualIODevices []CustomVirtualIODevice
201201
// CustomWatchdogDevice handles QEMU watchdog device parameters.
202202
type CustomWatchdogDevice struct {
203203
Action *string `json:"action,omitempty" url:"action,omitempty"`
204-
Model string `json:"model" url:"model"`
204+
Model *string `json:"model" url:"model"`
205205
}
206206

207207
// VirtualEnvironmentVMCloneRequestBody contains the data for an virtual machine clone request.
@@ -1615,3 +1615,37 @@ func (r *CustomVGADevice) UnmarshalJSON(b []byte) error {
16151615

16161616
return nil
16171617
}
1618+
1619+
// UnmarshalJSON converts a CustomWatchdogDevice string to an object.
1620+
func (r *CustomWatchdogDevice) UnmarshalJSON(b []byte) error {
1621+
var s string
1622+
1623+
err := json.Unmarshal(b, &s)
1624+
1625+
if err != nil {
1626+
return err
1627+
}
1628+
1629+
if s == "" {
1630+
return nil
1631+
}
1632+
1633+
pairs := strings.Split(s, ",")
1634+
1635+
for _, p := range pairs {
1636+
v := strings.Split(strings.TrimSpace(p), "=")
1637+
1638+
if len(v) == 1 {
1639+
r.Model = &v[0]
1640+
} else if len(v) == 2 {
1641+
switch v[0] {
1642+
case "action":
1643+
r.Action = &v[1]
1644+
case "model":
1645+
r.Model = &v[1]
1646+
}
1647+
}
1648+
}
1649+
1650+
return nil
1651+
}

proxmoxtf/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ const (
99
TerraformProviderName = "terraform-provider-proxmox"
1010

1111
// TerraformProviderVersion specifies the version number.
12-
TerraformProviderVersion = "0.4.3"
12+
TerraformProviderVersion = "0.4.4"
1313
)

0 commit comments

Comments
 (0)