I am seeing Host key verification failed
errors in the Multibranch Pipeline Scan Logs of a brand new Jenkins instance, configured entirely through the Configuration-as-Code plugin.
My Job DSL multibranchPipelineJob
definition uses a git@myserver.com:namespace/repo
URL in its git
branchSources
.
I have figured out that as soon as I change the URL from git@
to https://
, the error goes away, but - really - this just feels like a workaround.
As far as I understand, multibranchPipelineJob
scans run on the Jenkins instance itself - not one of its build agents.
As such, I imagine this is simply a case of adding the host key in some known_hosts
file, but I am not looking for the manual "log in to the server, as the jenkins
user and add the key yourself" solution, that has been proposed elsewhere.
Rather, I am wondering if anyone knows of a way to add this key either through the Configuration-as-Code casc.yaml
file, or if this would be something I should add as a Volume
in the Pod
that runs Jenkins itself.