From: Tom Clegg Date: Wed, 13 Jul 2022 19:38:26 +0000 (-0400) Subject: 17344: Diagnostics warning, not error, if there are no VMs listed. X-Git-Tag: 2.5.0~115^2~10 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/249411c97c0f3740c66e4f3260481262b89b23dc 17344: Diagnostics warning, not error, if there are no VMs listed. Arvados-DCO-1.1-Signed-off-by: Tom Clegg --- diff --git a/lib/diagnostics/cmd.go b/lib/diagnostics/cmd.go index 6dc5f679b5..ed8d440b89 100644 --- a/lib/diagnostics/cmd.go +++ b/lib/diagnostics/cmd.go @@ -458,9 +458,10 @@ func (diag *diagnoser) runtests() { return err } if len(vmlist.Items) < 1 { - return fmt.Errorf("no VMs found") + diag.warnf("no VMs found") + } else { + vm = vmlist.Items[0] } - vm = vmlist.Items[0] return nil }) @@ -468,7 +469,8 @@ func (diag *diagnoser) runtests() { ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(diag.timeout)) defer cancel() if vm.UUID == "" { - return fmt.Errorf("skipping, no vm available") + diag.warnf("skipping, no vm available") + return nil } webshelltermurl := cluster.Services.Workbench1.ExternalURL.String() + "virtual_machines/" + vm.UUID + "/webshell/testusername" diag.debugf("url %s", webshelltermurl) @@ -496,7 +498,8 @@ func (diag *diagnoser) runtests() { ctx, cancel := context.WithDeadline(context.Background(), time.Now().Add(diag.timeout)) defer cancel() if vm.UUID == "" { - return fmt.Errorf("skipping, no vm available") + diag.warnf("skipping, no vm available") + return nil } u := cluster.Services.WebShell.ExternalURL webshellurl := u.String() + vm.Hostname + "?"