flannel-io / flannel

flannel is a network fabric for containers, designed for Kubernetes
Apache License 2.0
8.74k stars 2.87k forks source link

If there is an error in the execution of a powershell command, the error is lost #1851

Closed manuelbuil closed 8 months ago

manuelbuil commented 8 months ago

I am currently trying flannel on windows and forgot to give a correct $PATH to reach powershell.exe. The error I am getting in the logs is an empty string which provides no information. The reason for this is that this function: https://github.com/flannel-io/flannel/blob/master/pkg/powershell/powershell.go#L34 ig nores the error of cmd.Output() if cmd.ProcessState.ExitCode() != 0

Expected Behavior

We get a useful log that explain what is going on

Current Behavior

This is the log we get:

E0110 06:08:53.485895    3408 main.go:276] Failed to find any valid interface to use: failed to get default interface:

which is useless

Possible Solution

Steps to Reproduce (for bugs)

1. 2. 3. 4.

Context

Your Environment