Skip to content

Commit

Permalink
Only attach error to diagnostics if podman machine is required
Browse files Browse the repository at this point in the history
  • Loading branch information
blva committed Mar 19, 2024
1 parent b6d1f93 commit 9d3f93d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/podman/client.go
Expand Up @@ -181,7 +181,9 @@ func (o *client) Diagnostics(ctx context.Context) *Diagnostic {
info, err := o.machineInspect(ctx)
if err != nil {
d.MachineFound = false
d.Errors = append(d.Errors, fmt.Errorf("failed to detect podman machine: %w", err).Error())
if MachineRequired {

Check failure on line 184 in internal/podman/client.go

View workflow job for this annotation

GitHub Actions / docs

undefined: MachineRequired

Check failure on line 184 in internal/podman/client.go

View workflow job for this annotation

GitHub Actions / lint

undefined: MachineRequired (typecheck)

Check failure on line 184 in internal/podman/client.go

View workflow job for this annotation

GitHub Actions / lint

undefined: MachineRequired) (typecheck)

Check failure on line 184 in internal/podman/client.go

View workflow job for this annotation

GitHub Actions / lint

undefined: MachineRequired) (typecheck)

Check failure on line 184 in internal/podman/client.go

View workflow job for this annotation

GitHub Actions / lint

undefined: MachineRequired) (typecheck)

Check failure on line 184 in internal/podman/client.go

View workflow job for this annotation

GitHub Actions / unit-tests (ubuntu-latest)

undefined: MachineRequired

Check failure on line 184 in internal/podman/client.go

View workflow job for this annotation

GitHub Actions / unit-tests (ubuntu-latest)

undefined: MachineRequired

Check failure on line 184 in internal/podman/client.go

View workflow job for this annotation

GitHub Actions / unit-tests (windows-latest)

undefined: MachineRequired

Check failure on line 184 in internal/podman/client.go

View workflow job for this annotation

GitHub Actions / unit-tests (windows-latest)

undefined: MachineRequired

Check failure on line 184 in internal/podman/client.go

View workflow job for this annotation

GitHub Actions / unit-tests (macos-latest)

undefined: MachineRequired

Check failure on line 184 in internal/podman/client.go

View workflow job for this annotation

GitHub Actions / unit-tests (macos-latest)

undefined: MachineRequired
d.Errors = append(d.Errors, fmt.Errorf("failed to detect podman machine: %w", err).Error())
}
} else {
d.MachineInfo = info
d.MachineState = info.State
Expand Down

0 comments on commit 9d3f93d

Please sign in to comment.