mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #39250 from shuchow/706-cifs-lookup
Enable DNS Lookups for CIFS Volumes
This commit is contained in:
commit
a114a2c019
1 changed files with 3 additions and 2 deletions
|
@ -97,11 +97,12 @@ func (v *localVolume) mount() error {
|
|||
return fmt.Errorf("missing device in volume options")
|
||||
}
|
||||
mountOpts := v.opts.MountOpts
|
||||
if v.opts.MountType == "nfs" {
|
||||
switch v.opts.MountType {
|
||||
case "nfs", "cifs":
|
||||
if addrValue := getAddress(v.opts.MountOpts); addrValue != "" && net.ParseIP(addrValue).To4() == nil {
|
||||
ipAddr, err := net.ResolveIPAddr("ip", addrValue)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "error resolving passed in nfs address")
|
||||
return errors.Wrapf(err, "error resolving passed in network volume address")
|
||||
}
|
||||
mountOpts = strings.Replace(mountOpts, "addr="+addrValue, "addr="+ipAddr.String(), 1)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue