Skip to content

Commit 4bc9b48

Browse files
authored
Address json decoding error associated with new 'filtered-vcpi-devices-allowed' runtime data field in Azure TDX adapter (#236)
1 parent 54e335d commit 4bc9b48

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

go-aztdx/az_runtime_data.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,13 @@ type azKey struct {
7676
}
7777

7878
type azVmConfiguration struct {
79-
ConsoleEnabled bool `json:"console-enabled"`
80-
RootCertThumbprint string `json:"root-cert-thumbprint"`
81-
SecureBoot bool `json:"secure-boot"`
82-
TpmEnabled bool `json:"tpm-enabled"`
83-
TpmPersisted bool `json:"tpm-persisted"`
84-
VmUniqueId string `json:"vmUniqueId"`
79+
ConsoleEnabled bool `json:"console-enabled"`
80+
RootCertThumbprint string `json:"root-cert-thumbprint"`
81+
SecureBoot bool `json:"secure-boot"`
82+
TpmEnabled bool `json:"tpm-enabled"`
83+
TpmPersisted bool `json:"tpm-persisted"`
84+
VmUniqueId string `json:"vmUniqueId"`
85+
FilteredVpciDevicesAllowed bool `json:"filtered-vpci-devices-allowed"`
8586
}
8687

8788
func newAzRuntimeData(data []byte) (*azRuntimeData, error) {
@@ -106,7 +107,7 @@ func (azrtd *azRuntimeData) runtimeData() (*azRuntimeJson, error) {
106107
decoder.DisallowUnknownFields()
107108
err := decoder.Decode(&azRuntimeJson)
108109
if err != nil {
109-
return nil, err
110+
return nil, errors.Wrap(err, "Failed to unmarshall runtime data from azure")
110111
}
111112

112113
return &azRuntimeJson, nil

0 commit comments

Comments
 (0)