allow proxy during SSH host key scan in FluxCD CLI#827
Open
adone wants to merge 4 commits intofluxcd:mainfrom
Open
allow proxy during SSH host key scan in FluxCD CLI#827adone wants to merge 4 commits intofluxcd:mainfrom
adone wants to merge 4 commits intofluxcd:mainfrom
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
makkes
reviewed
Nov 27, 2024
Member
makkes
left a comment
There was a problem hiding this comment.
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 |
Member
There was a problem hiding this comment.
Suggested change
| // support for ALL_PROXY ENV varaible | |
| // this reads the ALL_PROXY environment variable |
Author
|
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 |
Author
|
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
Signed-off-by: Artem Nistratov <[email protected]>
Signed-off-by: Artem Nistratov <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ssh.Dialusesnet.DialTimeoutunder 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.Dialwith its almost full internal implementationexcept
net.DialTimeoutreplaced withproxy.Diallike it is done in go-git