From b6483fa4f9d956aef5f2bc5e1d5ca5fda3d551c3 Mon Sep 17 00:00:00 2001 From: Bianca Date: Tue, 19 Mar 2024 13:59:09 +0000 Subject: [PATCH 1/2] Only attach error to diagnostics if podman machine is required --- internal/podman/client.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/podman/client.go b/internal/podman/client.go index 43f26b7aa0..da84c13e32 100644 --- a/internal/podman/client.go +++ b/internal/podman/client.go @@ -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 d.MachineRequired { + d.Errors = append(d.Errors, fmt.Errorf("failed to detect podman machine: %w", err).Error()) + } } else { d.MachineInfo = info d.MachineState = info.State From d0683b61011c4d2dafd9d43677d4acbb17720d56 Mon Sep 17 00:00:00 2001 From: Bianca Date: Tue, 19 Mar 2024 14:07:32 +0000 Subject: [PATCH 2/2] Address comment --- internal/podman/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/podman/client.go b/internal/podman/client.go index da84c13e32..f3c713a19c 100644 --- a/internal/podman/client.go +++ b/internal/podman/client.go @@ -182,7 +182,7 @@ func (o *client) Diagnostics(ctx context.Context) *Diagnostic { if err != nil { d.MachineFound = false if d.MachineRequired { - d.Errors = append(d.Errors, fmt.Errorf("failed to detect podman machine: %w", err).Error()) + d.Errors = append(d.Errors, fmt.Sprintf("failed to detect podman machine: %s", err)) } } else { d.MachineInfo = info