MCPcopy Create free account
hub / github.com/docker/cli / convertDNSConfig

Function convertDNSConfig

cli/compose/convert/service.go:658–666  ·  view source on GitHub ↗
(dns []string, dnsSearch []string)

Source from the content-addressed store, hash-verified

656}
657
658func convertDNSConfig(dns []string, dnsSearch []string) *swarm.DNSConfig {
659 if len(dns) > 0 || len(dnsSearch) > 0 {
660 return &swarm.DNSConfig{
661 Nameservers: toNetipAddrSlice(dns),
662 Search: dnsSearch,
663 }
664 }
665 return nil
666}
667
668func toNetipAddrSlice(ips []string) []netip.Addr {
669 if len(ips) == 0 {

Callers 5

TestConvertDNSConfigAllFunction · 0.85
ServiceFunction · 0.85

Calls 1

toNetipAddrSliceFunction · 0.70

Tested by 4

TestConvertDNSConfigAllFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…