From 70153311764c7b95dab2e822adb3aa0eb73bcba8 Mon Sep 17 00:00:00 2001 From: Sahil Soni Date: Fri, 26 Jul 2019 23:46:51 +0530 Subject: [PATCH] Remove the IP address check in parseGCPSSHCmd This is not needed since dry-run will provide a working host, or will throw error anyways --- sshcode.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/sshcode.go b/sshcode.go index ddd3343..e4a623d 100644 --- a/sshcode.go +++ b/sshcode.go @@ -552,17 +552,6 @@ func parseGCPSSHCmd(instance string) (ip, sshFlags string, err error) { // E.g. foo@1.2.3.4. userIP := toks[len(toks)-1] - toks = strings.Split(userIP, "@") - // Assume the '@' 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 }