From 55149e5130333e9e3a38042b86f7d33e335f1091 Mon Sep 17 00:00:00 2001 From: Richard Case Date: Mon, 15 May 2023 07:45:35 +0100 Subject: [PATCH] refactor: return error on unknown interface type Signed-off-by: Richard Case --- infrastructure/microvm/cloudhypervisor/create.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infrastructure/microvm/cloudhypervisor/create.go b/infrastructure/microvm/cloudhypervisor/create.go index 143c095a..264b7135 100644 --- a/infrastructure/microvm/cloudhypervisor/create.go +++ b/infrastructure/microvm/cloudhypervisor/create.go @@ -142,7 +142,7 @@ func (p *provider) buildArgs(vm *models.MicroVM, state State, logger *logrus.Ent } else if iface.Type == models.IfaceTypeTap { args = append(args, fmt.Sprintf("tap=%s,mac=%s", status.HostDeviceName, iface.GuestMAC)) } else { - logger.Warn("unknown network interface type", "name", iface.GuestDeviceName, "type", iface.Type) + return nil, fmt.Errorf("unknown network interface type %v for %s", iface.Type, iface.GuestDeviceName) } }