Fixed error showing vault password prompts on relaunch

This commit is contained in:
mabashian
2018-04-30 10:47:34 -04:00
parent 7781667977
commit 24e363888a
7 changed files with 70 additions and 57 deletions

View File

@@ -33,11 +33,12 @@ function atRelaunchCtrl (
) {
const jobPromises = [
jobObj.request('get', vm.job.id),
jobTemplate.optionsLaunch(vm.job.unified_job_template)
jobTemplate.optionsLaunch(vm.job.unified_job_template),
jobObj.getCredentials(vm.job.id)
];
$q.all(jobPromises)
.then(([jobRes, launchOptions]) => {
.then(([jobRes, launchOptions, jobCreds]) => {
const populatedJob = jobRes.data;
const jobTypeChoices = _.get(
launchOptions,
@@ -68,7 +69,11 @@ function atRelaunchCtrl (
relaunchHostType: option ? (option.name).toLowerCase() : null,
prompts: {
credentials: {
value: populatedJob.summary_fields.credentials || []
value: populatedJob.summary_fields.credentials ?
_.merge(
jobCreds.data.results,
populatedJob.summary_fields.credentials
) : []
},
variables: {
value: populatedJob.extra_vars