fix(runners): pass vault key

This commit is contained in:
Denis Gukov 2023-09-11 02:00:10 +02:00
parent 6fa3e50198
commit 0304e7cac3
2 changed files with 8 additions and 0 deletions

View File

@ -71,6 +71,10 @@ func GetRunner(w http.ResponseWriter, r *http.Request) {
data.AccessKeys[*tsk.Inventory.BecomeKeyID] = tsk.Inventory.BecomeKey data.AccessKeys[*tsk.Inventory.BecomeKeyID] = tsk.Inventory.BecomeKey
} }
if tsk.Template.VaultKeyID != nil {
data.AccessKeys[*tsk.Template.VaultKeyID] = tsk.Template.VaultKey
}
data.AccessKeys[tsk.Repository.SSHKeyID] = tsk.Repository.SSHKey data.AccessKeys[tsk.Repository.SSHKeyID] = tsk.Repository.SSHKey
} else { } else {

View File

@ -419,6 +419,10 @@ func (p *JobPool) checkNewJobs() {
taskRunner.job.Inventory.BecomeKey = response.AccessKeys[*taskRunner.job.Inventory.BecomeKeyID] taskRunner.job.Inventory.BecomeKey = response.AccessKeys[*taskRunner.job.Inventory.BecomeKeyID]
} }
if taskRunner.job.Template.VaultKeyID != nil {
taskRunner.job.Template.VaultKey = response.AccessKeys[*taskRunner.job.Template.VaultKeyID]
}
p.queue = append(p.queue, &taskRunner) p.queue = append(p.queue, &taskRunner)
} }
} }