mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-21 17:01:04 +01:00
Fix issue with multiple vaults and runners
This commit is contained in:
parent
0250b0b9f7
commit
76d14365fd
@ -95,7 +95,7 @@ func GetRunner(w http.ResponseWriter, r *http.Request) {
|
||||
if err != nil {
|
||||
// TODO: return error
|
||||
}
|
||||
data.AccessKeys[vault.Vault.ID] = *vault.Vault
|
||||
data.AccessKeys[vault.VaultKeyID] = *vault.Vault
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/ansible-semaphore/semaphore/db"
|
||||
"io"
|
||||
"net/http"
|
||||
"os"
|
||||
@ -425,11 +426,16 @@ func (p *JobPool) checkNewJobs() {
|
||||
taskRunner.job.Inventory.BecomeKey = response.AccessKeys[*taskRunner.job.Inventory.BecomeKeyID]
|
||||
}
|
||||
|
||||
var vaults []db.TemplateVault
|
||||
if taskRunner.job.Template.Vaults != nil {
|
||||
for _, vault := range taskRunner.job.Template.Vaults {
|
||||
*vault.Vault = response.AccessKeys[vault.Vault.ID]
|
||||
vault := vault
|
||||
key := response.AccessKeys[vault.VaultKeyID]
|
||||
vault.Vault = &key
|
||||
vaults = append(vaults, vault)
|
||||
}
|
||||
}
|
||||
taskRunner.job.Template.Vaults = vaults
|
||||
|
||||
if taskRunner.job.Inventory.RepositoryID != nil {
|
||||
taskRunner.job.Inventory.Repository.SSHKey = response.AccessKeys[taskRunner.job.Inventory.Repository.SSHKeyID]
|
||||
|
Loading…
Reference in New Issue
Block a user