Przeglądaj źródła

Merge pull request #39250 from shuchow/706-cifs-lookup

Enable DNS Lookups for CIFS Volumes
Sebastiaan van Stijn 5 lat temu
rodzic
commit
a114a2c019
1 zmienionych plików z 3 dodań i 2 usunięć
  1. 3 2
      volume/local/local_unix.go

+ 3 - 2
volume/local/local_unix.go

@@ -97,11 +97,12 @@ func (v *localVolume) mount() error {
 		return fmt.Errorf("missing device in volume options")
 		return fmt.Errorf("missing device in volume options")
 	}
 	}
 	mountOpts := v.opts.MountOpts
 	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 {
 		if addrValue := getAddress(v.opts.MountOpts); addrValue != "" && net.ParseIP(addrValue).To4() == nil {
 			ipAddr, err := net.ResolveIPAddr("ip", addrValue)
 			ipAddr, err := net.ResolveIPAddr("ip", addrValue)
 			if err != nil {
 			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)
 			mountOpts = strings.Replace(mountOpts, "addr="+addrValue, "addr="+ipAddr.String(), 1)
 		}
 		}