Skip to content

Commit eeb568f

Browse files
committed
FIX 2510 Support DNS names
Signed-off-by: David Gageot <david@gageot.net>
1 parent c41476e commit eeb568f

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

libmachine/drivers/base.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ package drivers
22

33
import (
44
"errors"
5-
"fmt"
6-
"net"
75
"path/filepath"
86
)
97

@@ -41,10 +39,6 @@ func (d *BaseDriver) GetIP() (string, error) {
4139
if d.IPAddress == "" {
4240
return "", errors.New("IP address is not set")
4341
}
44-
ip := net.ParseIP(d.IPAddress)
45-
if ip == nil {
46-
return "", fmt.Errorf("IP address is invalid: %s", d.IPAddress)
47-
}
4842
return d.IPAddress, nil
4943
}
5044

libmachine/drivers/base_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package drivers
22

33
import (
44
"errors"
5-
"fmt"
65
"testing"
76

87
"github.com/stretchr/testify/assert"
@@ -18,7 +17,7 @@ func TestIP(t *testing.T) {
1817
{&BaseDriver{IPAddress: "2001:4860:0:2001::68"}, "2001:4860:0:2001::68", nil},
1918
{&BaseDriver{IPAddress: "192.168.0.1"}, "192.168.0.1", nil},
2019
{&BaseDriver{IPAddress: "::1"}, "::1", nil},
21-
{&BaseDriver{IPAddress: "whatever"}, "", fmt.Errorf("IP address is invalid: %s", "whatever")},
20+
{&BaseDriver{IPAddress: "hostname"}, "hostname", nil},
2221
}
2322

2423
for _, c := range cases {

0 commit comments

Comments
 (0)