hashicorp / go-getter

Package for downloading things from a string URL using a variety of protocols.
Mozilla Public License 2.0
1.62k stars 227 forks source link

Regression in v1.7.2 - Existing `GIT_SSH_COMMAND` env variables are unset. #452

Closed aliscott closed 9 months ago

aliscott commented 10 months ago

It looks like v1.7.2 caused a regression. https://github.com/hashicorp/go-getter/pull/300 caused a regression that unsets an existing GIT_SSH_COMMAND env variable if it is set.

Problem

If I have GIT_SSH_COMMAND="ssh -o 'StrictHostKeyChecking=no'" and no sshKey query param set, go-getter is not passing the StrictHostKeyChecking=no option when downloading the repo.

Expected

From what I understand from https://github.com/hashicorp/go-getter/issues/299 we want to leave the GIT_SSH_COMMAND untouched when an sshKey param is not set.

Although #300 fixed the case so GIT_SSH_COMMAND isn't set to GIT_SSH_COMMAND=ssh when a sshKey param is not used, it also unset it if it had an existing value. I think if GIT_SSH_COMMAND is already set in the environment then it should be left unchanged.

jbardin commented 9 months ago

Closed via #459