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

Commit 7015331

Browse files
committed
Remove the IP address check in parseGCPSSHCmd
This is not needed since dry-run will provide a working host, or will throw error anyways
1 parent 8c72965 commit 7015331

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

sshcode.go

-11
Original file line numberDiff line numberDiff line change
@@ -552,17 +552,6 @@ func parseGCPSSHCmd(instance string) (ip, sshFlags string, err error) {
552552

553553
554554
userIP := toks[len(toks)-1]
555-
toks = strings.Split(userIP, "@")
556-
// Assume the '<user>@' is missing.
557-
if len(toks) < 2 {
558-
ip = strings.TrimSpace(toks[0])
559-
} else {
560-
ip = strings.TrimSpace(toks[1])
561-
}
562-
563-
if net.ParseIP(ip) == nil {
564-
return "", "", xerrors.Errorf("parsed invalid ip address %v", ip)
565-
}
566555

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

0 commit comments

Comments
 (0)