From 117beff05c4507112c6f4aadbff055994306fa43 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Mon, 8 May 2023 12:04:29 +0200 Subject: vm: separate boot time and infrastructure errors It's not correct to mix them since they point to fundamentally different issues: 1) Boot time errors are caused by a problematic kernel image and can only be resolved by using another kernel version or config. 2) Infrastructure errors are temporary, so we can just try again some time later. Reserve the existing BootError for (1) errors and let all other VM handling errors refer to (2). To make it possible to attach more output to the infra error, introduce the VerboseInfraError type. --- pkg/instance/instance.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pkg') diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index 882d678d4..73cef6931 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -216,6 +216,7 @@ func OverrideVMCount(cfg *mgrconfig.Config, n int) error { type TestError struct { Boot bool // says if the error happened during booting or during instance testing + Infra bool // whether the problem is related to some infrastructure problems Title string Output []byte Report *report.Report @@ -323,6 +324,12 @@ func (inst *inst) test() EnvTestResult { } testErr.Report = rep testErr.Title = rep.Title + } else { + testErr.Infra = true + if infraErr, ok := err.(vm.InfraErrorer); ok { + // In case there's more info available. + testErr.Title, testErr.Output = infraErr.InfraError() + } } return ret } -- cgit mrf-deployment