Skip to content

Commit

Permalink
Merge pull request moby#39250 from shuchow/706-cifs-lookup
Browse files Browse the repository at this point in the history
Enable DNS Lookups for CIFS Volumes
  • Loading branch information
thaJeztah authored Sep 3, 2019
2 parents 1a117b8 + 75a59c6 commit a114a2c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions volume/local/local_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit a114a2c

Please sign in to comment.