mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
don't add extra variable for searches
This commit is contained in:
parent
9dac0c2d02
commit
c959b5ef8a
@ -231,11 +231,10 @@ func parseResolvConf(reader io.Reader) (nameservers []string, searches []string,
|
|||||||
}
|
}
|
||||||
if fields[0] == "search" {
|
if fields[0] == "search" {
|
||||||
// Normalise search fields so the same domain with and without trailing dot will only count once, to avoid hitting search validation limits.
|
// Normalise search fields so the same domain with and without trailing dot will only count once, to avoid hitting search validation limits.
|
||||||
trimTrailingDot := []string{}
|
searches = []string{}
|
||||||
for _, s := range fields[1:] {
|
for _, s := range fields[1:] {
|
||||||
trimTrailingDot = append(trimTrailingDot, strings.TrimSuffix(s, "."))
|
searches = append(searches, strings.TrimSuffix(s, "."))
|
||||||
}
|
}
|
||||||
searches = trimTrailingDot
|
|
||||||
}
|
}
|
||||||
if fields[0] == "options" {
|
if fields[0] == "options" {
|
||||||
options = fields[1:]
|
options = fields[1:]
|
||||||
|
Loading…
Reference in New Issue
Block a user