X Tutup
Skip to content

Commit bd35fb3

Browse files
Fixing bug in GetIP where Public IP would always be returned despite use of --softlayer-private-net-only
Signed-off-by: Dave Henderson <Dave.Henderson@ca.ibm.com>
1 parent 6036c28 commit bd35fb3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/softlayer/driver.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,11 @@ func (d *Driver) GetIP() (string, error) {
275275
if d.IPAddress != "" {
276276
return d.IPAddress, nil
277277
}
278-
return d.getClient().VirtualGuest().GetPublicIp(d.Id)
278+
if d.deviceConfig.PrivateNet {
279+
return d.getClient().VirtualGuest().GetPrivateIp(d.Id)
280+
} else {
281+
return d.getClient().VirtualGuest().GetPublicIp(d.Id)
282+
}
279283
}
280284

281285
func (d *Driver) GetState() (state.State, error) {

0 commit comments

Comments
 (0)
X Tutup