Update parseDNSOptions maxDNSSearches in error message

Minor correctness. We should use the value of the const in the error message
instead of hard coding it in the string so if maxDNSSearches ever changes so
does the error.

Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
This commit is contained in:
Justin Terry (VM) 2019-05-24 14:42:48 -07:00
parent 6e14e01307
commit f544955e4a

View File

@ -500,7 +500,7 @@ func parseDNSOptions(servers, searches, options []string) (string, error) {
resolvContent := ""
if len(searches) > maxDNSSearches {
return "", errors.New("DNSOption.Searches has more than 6 domains")
return "", errors.Errorf("DNSOption.Searches has more than %d domains", maxDNSSearches)
}
if len(searches) > 0 {