Skip to content

Commit c959b5e

Browse files
committed
don't add extra variable for searches
1 parent 9dac0c2 commit c959b5e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pkg/kubelet/network/dns/dns.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,10 @@ func parseResolvConf(reader io.Reader) (nameservers []string, searches []string,
231231
}
232232
if fields[0] == "search" {
233233
// Normalise search fields so the same domain with and without trailing dot will only count once, to avoid hitting search validation limits.
234-
trimTrailingDot := []string{}
234+
searches = []string{}
235235
for _, s := range fields[1:] {
236-
trimTrailingDot = append(trimTrailingDot, strings.TrimSuffix(s, "."))
236+
searches = append(searches, strings.TrimSuffix(s, "."))
237237
}
238-
searches = trimTrailingDot
239238
}
240239
if fields[0] == "options" {
241240
options = fields[1:]

0 commit comments

Comments
 (0)