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

Commit

Permalink
Remove the IP address check in parseGCPSSHCmd
Browse files Browse the repository at this point in the history
This is not needed since dry-run will provide a working host, or will throw error anyways
  • Loading branch information
SscSPs committed Jul 27, 2019
1 parent 8c72965 commit 7015331
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions sshcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -552,17 +552,6 @@ func parseGCPSSHCmd(instance string) (ip, sshFlags string, err error) {

// E.g. [email protected].
userIP := toks[len(toks)-1]
toks = strings.Split(userIP, "@")
// Assume the '<user>@' is missing.
if len(toks) < 2 {
ip = strings.TrimSpace(toks[0])
} else {
ip = strings.TrimSpace(toks[1])
}

if net.ParseIP(ip) == nil {
return "", "", xerrors.Errorf("parsed invalid ip address %v", ip)
}

return strings.TrimSpace(userIP), sshFlags, nil
}

0 comments on commit 7015331

Please sign in to comment.