repair: take optional docker image for re-configure

This commit is contained in:
Girish Ramakrishnan
2020-02-11 21:05:01 -08:00
parent 4b93b31c3d
commit f80f40cbcd
2 changed files with 10 additions and 1 deletions

View File

@@ -1393,6 +1393,7 @@ function getLogs(appId, options, callback) {
}
// does a re-configure when called from most states. for install/clone errors, it re-installs with an optional manifest
// re-configure can take a dockerImage but not a manifest because re-configure does not clean up addons
function repair(appId, data, auditSource, callback) {
assert.strictEqual(typeof appId, 'string');
assert.strictEqual(typeof data, 'object'); // { manifest }
@@ -1427,6 +1428,10 @@ function repair(appId, data, auditSource, callback) {
}
} else {
errorState = exports.ISTATE_PENDING_CONFIGURE;
if (data.dockerImage) {
let newManifest = _.extend({}, app.manifest, { dockerImage: data.dockerImage });
task.values.manifest = newManifest;
}
}
addTask(appId, errorState, task, function (error, result) {