From 7dab4bf2ac4b0cb47eb00736412cae62f2fcdcb0 Mon Sep 17 00:00:00 2001 From: Nikita Podshivalov Date: Tue, 8 Nov 2022 13:55:04 +0300 Subject: [PATCH] showed the full ssh config when it is invalid --- internal/commands/tunnel_up.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/commands/tunnel_up.go b/internal/commands/tunnel_up.go index e8597e8b..5ddcd693 100644 --- a/internal/commands/tunnel_up.go +++ b/internal/commands/tunnel_up.go @@ -498,7 +498,11 @@ func writeSSHConfigFromSSM(wr *SSMWrapper, env string, dir string) (string, []st hosts := getHosts(sshConfig) if len(hosts) == 0 { - return "", []string{}, fmt.Errorf("can't write SSH config: forwarding config is not valid") + errMsg := "can't write SSH config: forwarding config is not valid" + if logrus.GetLevel() == logrus.DebugLevel { + errMsg += fmt.Sprintf(". Config in SSM: \n%s", sshConfig) + } + return "", []string{}, fmt.Errorf(errMsg) } bastionHostID = to.BastionInstanceID.Value