Skip to content

Commit 0a57a7c

Browse files
committed
fix(grpc): validate the payload for Kernel info
1 parent 5ced644 commit 0a57a7c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

infrastructure/grpc/convert.go

+5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ func convertMicroVMToModel(spec *types.MicroVMSpec) (*models.MicroVM, error) {
1717
uid = *spec.Uid
1818
}
1919

20+
if spec.Kernel == nil {
21+
// Add the kernel to the spec if it's missing so that we can correctly progress to the validate step
22+
spec.Kernel = &types.Kernel{}
23+
}
24+
2025
vmid, err := models.NewVMID(spec.Id, spec.Namespace, uid)
2126
if err != nil {
2227
return nil, fmt.Errorf("creating vmid from spec: %w", err)

0 commit comments

Comments
 (0)