Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 13bf4d4

Browse files
author
Paul Holzinger
committed
return dnsmasq errors
While debugging the rootless cni PR in podman I had a problem with the dnsname plugin because dnsmasq failed to start. The returned error was just `exit status 5`. This is not helpful. To solve this use CombinedOutput and wrap the dnsmasq output to the returned error. Signed-off-by: Paul Holzinger <[email protected]>
1 parent a05ec9a commit 13bf4d4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

plugins/meta/dnsname/service.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ func (d dnsNameFile) start() error {
6666
fmt.Sprintf("--conf-file=%s", d.ConfigFile),
6767
}
6868
cmd := exec.Command(d.Binary, args...)
69-
return cmd.Run()
69+
if b, err := cmd.CombinedOutput(); err != nil {
70+
return errors.Wrapf(err, "dnsname error: dnsmasq failed with %q", b)
71+
}
72+
return nil
7073
}
7174

7275
// stop stops the dnsmasq instance.

0 commit comments

Comments
 (0)