You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the test server listens on an ephemeral port, and the known_hosts generated by ssh.ScanHostKey includes the port, while the value passed to the callback does not;
fluxcd/pkg/ssh.ScanHostKey produces an entry with braces surrounding the IP address, like [127.0.0.1]:56464, which is not understood by the match procedure.
The second one is easily fixable. It's not obvious what to do about the first though -- the port seems like an important piece of information!
The text was updated successfully, but these errors were encountered:
The "auth strategy", which depends on the GitImplementation, was
hard-wired to the "gogit" constant, but it should come from the
GitRepository spec. When the implementation is "libgit2" and the git
URL entails SSH, the result would normally include a callback for
checking the host key against known_hosts; but since it was
hard-wired, it was missing that callback.
This explains at least some instances of the error `user cancelled
hostkey check` from #106. The error, or a close relative, might also
arise if the callback rejects the host key because the host as it
appears in the known_hosts doesn't match that host as passed to the
callback -- see
fluxcd/source-controller#287.
Signed-off-by: Michael Bridgen <michael@weave.works>
Writing tests for image-automation-controller, I find that the known_host matching in https://github.com/fluxcd/source-controller/blob/main/pkg/git/libgit2/transport.go#L176 will fail when used with a test server, for two reasons:
known_hosts
generated byssh.ScanHostKey
includes the port, while the value passed to the callback does not;fluxcd/pkg/ssh.ScanHostKey
produces an entry with braces surrounding the IP address, like[127.0.0.1]:56464
, which is not understood by the match procedure.The second one is easily fixable. It's not obvious what to do about the first though -- the port seems like an important piece of information!
The text was updated successfully, but these errors were encountered: