Skip to content
Merged
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
9 changes: 2 additions & 7 deletions builder/vsphere/common/step_wait_for_ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"fmt"
"log"
"net"
"strings"
"time"

"github.com/hashicorp/packer-plugin-sdk/multistep"
Expand Down Expand Up @@ -171,12 +170,8 @@ loop:
} else {
log.Printf("VM IP is still the same: %s", prevIp)
if time.Now().After(stopTime) {
if strings.Contains(ip, ":") {
// To use a literal IPv6 address in a URL the literal address should be enclosed in
// "[" and "]" characters. Refer to https://www.ietf.org/rfc/rfc2732.
// Example: ssh example@[2010:836B:4179::836B:4179]
ip = "[" + ip + "]"
}
// NOTE: IPv6 addresses are returned without brackets.
// The SSH communicator wraps them when needed.
log.Printf("VM IP seems stable enough: %s", ip)
return ip, nil
}
Expand Down
Loading