diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2023-05-08 12:04:29 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2023-05-09 16:23:28 +0200 |
| commit | 117beff05c4507112c6f4aadbff055994306fa43 (patch) | |
| tree | 7e08702d07456a19629e7e65df30208d5f40761f /pkg/instance/instance.go | |
| parent | a4f0ae5e41b92db1cfcc4172269dbd585410218d (diff) | |
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.
Diffstat (limited to 'pkg/instance/instance.go')
| -rw-r--r-- | pkg/instance/instance.go | 7 |
1 files changed, 7 insertions, 0 deletions
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 } |
