diff options
author | Paul Holzinger <pholzing@redhat.com> | 2022-05-12 14:34:37 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2022-06-07 15:17:04 +0200 |
commit | 90d80cf81e21cc0ff47829d78e4d44f8e0028a6c (patch) | |
tree | ba13633162fd728de417a69feeff5ff103cbe6bb /pkg/resolvconf/dns | |
parent | ddf1d2cb38aee698cc176f4ab291b22c6a47644d (diff) | |
download | podman-90d80cf81e21cc0ff47829d78e4d44f8e0028a6c.tar.gz podman-90d80cf81e21cc0ff47829d78e4d44f8e0028a6c.tar.bz2 podman-90d80cf81e21cc0ff47829d78e4d44f8e0028a6c.zip |
use resolvconf package from c/common/libnetwork
Podman and Buildah should use the same code the generate the resolv.conf
file. This mostly moved the podman code into c/common and created a
better API for it so buildah can use it as well.
[NO NEW TESTS NEEDED] All existing tests should continue to pass.
Fixes #13599 (There is no way to test this in CI without breaking the
hosts resolv.conf)
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'pkg/resolvconf/dns')
-rw-r--r-- | pkg/resolvconf/dns/resolvconf.go | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/pkg/resolvconf/dns/resolvconf.go b/pkg/resolvconf/dns/resolvconf.go deleted file mode 100644 index cb4bd1033..000000000 --- a/pkg/resolvconf/dns/resolvconf.go +++ /dev/null @@ -1,28 +0,0 @@ -// Originally from github.com/docker/libnetwork/resolvconf/dns - -package dns - -import ( - "regexp" -) - -// IPLocalhost is a regex pattern for IPv4 or IPv6 loopback range. -const IPLocalhost = `((127\.([0-9]{1,3}\.){2}[0-9]{1,3})|(::1)$)` - -// IPv4Localhost is a regex pattern for IPv4 localhost address range. -const IPv4Localhost = `(127\.([0-9]{1,3}\.){2}[0-9]{1,3})` - -var localhostIPRegexp = regexp.MustCompile(IPLocalhost) -var localhostIPv4Regexp = regexp.MustCompile(IPv4Localhost) - -// IsLocalhost returns true if ip matches the localhost IP regular expression. -// Used for determining if nameserver settings are being passed which are -// localhost addresses -func IsLocalhost(ip string) bool { - return localhostIPRegexp.MatchString(ip) -} - -// IsIPv4Localhost returns true if ip matches the IPv4 localhost regular expression. -func IsIPv4Localhost(ip string) bool { - return localhostIPv4Regexp.MatchString(ip) -} |