Open siretart opened 1 week ago
An empty resolv.conf
file is possible, as in environments that only depend on IP addresses. It is unlikely for us to work as expected; though a warning is more appropriate than hard failure (crash) ;-)
For the Debian package, I've come up with this patch:
let me know if you prefer me to send this is a PR.
@siretart It would be nice if you make a PR with your fix
@evidolob see #420
While working on the Debian package of this project, I noticed a panic while running the testsuite of this package:
This panic starts happening when upgrading to version 0.8.0. It does not occur with version 0.7.3
Looking at the code, I believe this is caused by 58eb054369873855afdc329ae724db779800cf74, which introduces https://github.com/containers/gvisor-tap-vsock/blob/72b102d1d443d6d02e4c04f5c2af809e4c2e0910/pkg/services/dns/dns_config_unix.go#L9-L17
The panic occurs in line 15 when the test machine does have an empty
/etc/resolv.conf
. This makes sense for a build machine to attempt to disable connections to the internet.Arguably, this can also happen outside of the test suite. Having the code raise an error seems preferable over a
runtime error: index out of range [0] with length 0