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 /vm/vmm | |
| 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 'vm/vmm')
| -rw-r--r-- | vm/vmm/vmm.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/vm/vmm/vmm.go b/vm/vmm/vmm.go index 3cee24d53..1f9b911f7 100644 --- a/vm/vmm/vmm.go +++ b/vm/vmm/vmm.go @@ -201,11 +201,17 @@ func (inst *instance) lookupSSHAddress() (string, error) { } lines := strings.Split(out, "\n") if len(lines) < 2 { - return "", vmimpl.BootError{Title: "Unexpected vmctl status output", Output: []byte(out)} + return "", vmimpl.InfraError{ + Title: "unexpected vmctl status output", + Output: []byte(out), + } } matches := vmctlStatusRegex.FindStringSubmatch(lines[1]) if len(matches) < 2 { - return "", vmimpl.BootError{Title: "Unexpected vmctl status output", Output: []byte(out)} + return "", vmimpl.InfraError{ + Title: "unexpected vmctl status output", + Output: []byte(out), + } } return fmt.Sprintf("100.64.%s.3", matches[1]), nil } |
