jenkins: Add ssh_known_hosts ConfigMap
When cloning/fetching a Git repository in a Jenkins pipeline, the Git Client plugin uses the configured *Host Key Verification Strategy* to verify the SSH host key of the remote Git server. Unfortunately, there does not seem to be any way to use the configured strategy from the `git` command line in a Pipeline job, so e.g. `git push` does not respect it. This causes jobs to fail to push changes to the remote if the container they're using does not already have the SSH host key for the remote in its known hosts database. This commit adds a ConfigMap to the *jenkins-jobs* namespace that can be mounted in containers to populate the SSH host key database.
This commit is contained in:
@@ -10,3 +10,11 @@ secretGenerator:
|
||||
type: kubernetes.io/dockerconfigjson
|
||||
files:
|
||||
- .dockerconfigjson
|
||||
|
||||
configMapGenerator:
|
||||
- name: ssh-known-hosts
|
||||
namespace: jenkins-jobs
|
||||
files:
|
||||
- ssh_known_hosts
|
||||
options:
|
||||
disableNameSuffixHash: true
|
||||
|
||||
Reference in New Issue
Block a user