-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allow proxy during SSH host key scan in FluxCD CLI #827
base: main
Are you sure you want to change the base?
Conversation
ssh.Dial uses net.DialTimeout under the hood and there is no possibility to use a proxy when running command like `flux create source git` so we use almost all internal implementation of ssh.Dial except net.DialTimeout is replaced with proxy.Dial like it is done in go-git Signed-off-by: Artem Nistratov <[email protected]>
d0fe81e
to
63c6588
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm generally in favor of this change. What I can't judge right now is which Flux CLI commands are affected by this. I couldn't find any controller code affected by this.
It will be very important to document this change with respect to the affected commands.
ssh/host_key.go
Outdated
defer client.Close() | ||
ctx, cancel := context.WithTimeout(context.Background(), timeout) | ||
defer cancel() | ||
// support for ALL_PROXY ENV varaible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// support for ALL_PROXY ENV varaible | |
// this reads the ALL_PROXY environment variable |
I've tried to improve as I understand another PR should be made to document P.S. and tests for go-git's clone are broken, I'm trying to understand why |
ah! |
0c5c378
to
8c10c5e
Compare
previously ScanHostKey ignored any SSH/network errors in case it managed to get host keys to make it more obvious we imitate `ssh.Dial` with `sshDial` func Signed-off-by: Artem Nistratov <[email protected]>
8c10c5e
to
ddb3fd8
Compare
ssh.Dial
usesnet.DialTimeout
under the hood srcand there is no possibility to use a proxy when running command like
flux create source git --url ssh://[email protected]/repository.git
(unlike for the source controller withALL_PROXY
)so I replaced
ssh.Dial
with its almost full internal implementationexcept
net.DialTimeout
replaced withproxy.Dial
like it is done in go-git