apps: add skipDnsSetup to install/restore/clone routes

these are not used in the UI but added for completeness

part of #737
This commit is contained in:
Girish Ramakrishnan
2021-02-24 14:49:30 -08:00
parent 2056ede942
commit d74537868a
2 changed files with 12 additions and 4 deletions

View File

@@ -754,6 +754,7 @@ function install(data, auditSource, callback) {
label = data.label || null,
tags = data.tags || [],
overwriteDns = 'overwriteDns' in data ? data.overwriteDns : false,
skipDnsSetup = 'skipDnsSetup' in data ? data.skipDnsSetup : false,
appStoreId = data.appStoreId,
manifest = data.manifest;
@@ -848,7 +849,7 @@ function install(data, auditSource, callback) {
}
const task = {
args: { restoreConfig: null, overwriteDns },
args: { restoreConfig: null, skipDnsSetup, overwriteDns },
values: { },
requiredState: data.installationState
};
@@ -1250,6 +1251,7 @@ function setLocation(app, data, auditSource, callback) {
const task = {
args: {
oldConfig: _.pick(app, 'location', 'domain', 'fqdn', 'alternateDomains', 'aliasDomains', 'portBindings'),
skipDnsSetup: !!data.skipDnsSetup,
overwriteDns: !!data.overwriteDns
},
values
@@ -1455,7 +1457,7 @@ function repair(app, data, auditSource, callback) {
// maybe split this into a separate route like reinstall?
if (errorState === exports.ISTATE_PENDING_INSTALL || errorState === exports.ISTATE_PENDING_CLONE) {
task.args = { overwriteDns: true };
task.args = { skipDnsSetup: false, overwriteDns: true };
if (data.manifest) {
let error = manifestFormat.parse(data.manifest);
if (error) return callback(new BoxError(BoxError.BAD_FIELD, `manifest error: ${error.message}`));
@@ -1528,6 +1530,7 @@ function restore(app, backupId, auditSource, callback) {
args: {
restoreConfig,
oldManifest: app.manifest,
skipDnsSetup: false,
overwriteDns: true
},
values
@@ -1583,6 +1586,7 @@ function importApp(app, data, auditSource, callback) {
args: {
restoreConfig,
oldManifest: app.manifest,
skipDnsSetup: false,
overwriteDns: true
},
values: {}
@@ -1645,6 +1649,7 @@ function clone(app, data, user, auditSource, callback) {
portBindings = data.portBindings || null,
backupId = data.backupId,
overwriteDns = 'overwriteDns' in data ? data.overwriteDns : false,
skipDnsSetup = 'skipDnsSetup' in data ? data.skipDnsSetup : false,
appId = app.id;
assert.strictEqual(typeof backupId, 'string');
@@ -1701,7 +1706,7 @@ function clone(app, data, user, auditSource, callback) {
const restoreConfig = { backupId: backupId, backupFormat: backupInfo.format };
const task = {
args: { restoreConfig, overwriteDns, oldManifest: null },
args: { restoreConfig, overwriteDns, skipDnsSetup, oldManifest: null },
values: {},
requiredState: exports.ISTATE_PENDING_CLONE
};
@@ -1997,7 +2002,7 @@ function restoreInstalledApps(callback) {
}
const task = {
args: { restoreConfig, overwriteDns: true, oldManifest },
args: { restoreConfig, skipDnsSetup: false, overwriteDns: true, oldManifest },
values: {},
scheduleNow: false, // task will be scheduled by autoRestartTasks when platform is ready
requireNullTaskId: false // ignore existing stale taskId