Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Hyper-V GetIP use cached value #4870

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion drivers/hyperv/hyperv.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,9 @@ func (d *Driver) Kill() error {
}

func (d *Driver) GetIP() (string, error) {
if d.IPAddress != "" {
return d.IPAddress, nil
}
s, err := d.GetState()
if err != nil {
return "", err
Expand All @@ -432,7 +435,8 @@ func (d *Driver) GetIP() (string, error) {
return "", fmt.Errorf("IP not found")
}

return resp[0], nil
d.IPAddress = resp[0]
return d.IPAddress, nil
}

func (d *Driver) publicSSHKeyPath() string {
Expand Down