Set overwriteDns to be true when re-configuring
This commit is contained in:
+1
-1
@@ -1880,7 +1880,7 @@ function configureInstalledApps(callback) {
|
|||||||
|
|
||||||
const oldConfig = _.pick(app, 'location', 'domain', 'fqdn', 'alternateDomains', 'portBindings');
|
const oldConfig = _.pick(app, 'location', 'domain', 'fqdn', 'alternateDomains', 'portBindings');
|
||||||
const task = {
|
const task = {
|
||||||
args: { oldConfig },
|
args: { oldConfig, overwriteDns: true },
|
||||||
values: {},
|
values: {},
|
||||||
scheduleNow: false, // task will be scheduled by autoRestartTasks when platform is ready
|
scheduleNow: false, // task will be scheduled by autoRestartTasks when platform is ready
|
||||||
requireNullTaskId: false // ignore existing stale taskId
|
requireNullTaskId: false // ignore existing stale taskId
|
||||||
|
|||||||
+9
-5
@@ -667,6 +667,7 @@ function changeLocation(app, args, progressCallback, callback) {
|
|||||||
|
|
||||||
const oldConfig = args.oldConfig;
|
const oldConfig = args.oldConfig;
|
||||||
const locationChanged = oldConfig.fqdn !== app.fqdn;
|
const locationChanged = oldConfig.fqdn !== app.fqdn;
|
||||||
|
const overwriteDns = args.overwriteDns;
|
||||||
|
|
||||||
async.series([
|
async.series([
|
||||||
progressCallback.bind(null, { percent: 10, message: 'Cleaning up old install' }),
|
progressCallback.bind(null, { percent: 10, message: 'Cleaning up old install' }),
|
||||||
@@ -686,7 +687,7 @@ function changeLocation(app, args, progressCallback, callback) {
|
|||||||
},
|
},
|
||||||
|
|
||||||
progressCallback.bind(null, { percent: 30, message: 'Registering subdomains' }),
|
progressCallback.bind(null, { percent: 30, message: 'Registering subdomains' }),
|
||||||
registerSubdomains.bind(null, app, args.overwriteDns),
|
registerSubdomains.bind(null, app, overwriteDns),
|
||||||
|
|
||||||
// re-setup addons since they rely on the app's fqdn (e.g oauth)
|
// re-setup addons since they rely on the app's fqdn (e.g oauth)
|
||||||
progressCallback.bind(null, { percent: 50, message: 'Setting up addons' }),
|
progressCallback.bind(null, { percent: 50, message: 'Setting up addons' }),
|
||||||
@@ -767,6 +768,9 @@ function configure(app, args, progressCallback, callback) {
|
|||||||
assert.strictEqual(typeof progressCallback, 'function');
|
assert.strictEqual(typeof progressCallback, 'function');
|
||||||
assert.strictEqual(typeof callback, 'function');
|
assert.strictEqual(typeof callback, 'function');
|
||||||
|
|
||||||
|
const oldConfig = args.oldConfig || null;
|
||||||
|
const overwriteDns = args.overwriteDns;
|
||||||
|
|
||||||
async.series([
|
async.series([
|
||||||
progressCallback.bind(null, { percent: 10, message: 'Cleaning up old install' }),
|
progressCallback.bind(null, { percent: 10, message: 'Cleaning up old install' }),
|
||||||
unconfigureReverseProxy.bind(null, app),
|
unconfigureReverseProxy.bind(null, app),
|
||||||
@@ -775,13 +779,13 @@ function configure(app, args, progressCallback, callback) {
|
|||||||
docker.stopContainers.bind(null, app.id),
|
docker.stopContainers.bind(null, app.id),
|
||||||
deleteContainers.bind(null, app, { managedOnly: true }),
|
deleteContainers.bind(null, app, { managedOnly: true }),
|
||||||
function (next) {
|
function (next) {
|
||||||
if (!args.oldConfig) return next();
|
if (!oldConfig) return next();
|
||||||
|
|
||||||
let obsoleteDomains = args.oldConfig.alternateDomains.filter(function (o) {
|
let obsoleteDomains = oldConfig.alternateDomains.filter(function (o) {
|
||||||
return !app.alternateDomains.some(function (n) { return n.subdomain === o.subdomain && n.domain === o.domain; });
|
return !app.alternateDomains.some(function (n) { return n.subdomain === o.subdomain && n.domain === o.domain; });
|
||||||
});
|
});
|
||||||
|
|
||||||
if (args.oldConfig.fqdn !== app.fqdn) obsoleteDomains.push({ subdomain: args.oldConfig.location, domain: args.oldConfig.domain });
|
if (oldConfig.fqdn !== app.fqdn) obsoleteDomains.push({ subdomain: oldConfig.location, domain: oldConfig.domain });
|
||||||
|
|
||||||
if (obsoleteDomains.length === 0) return next();
|
if (obsoleteDomains.length === 0) return next();
|
||||||
|
|
||||||
@@ -794,7 +798,7 @@ function configure(app, args, progressCallback, callback) {
|
|||||||
downloadIcon.bind(null, app),
|
downloadIcon.bind(null, app),
|
||||||
|
|
||||||
progressCallback.bind(null, { percent: 30, message: 'Registering subdomains' }),
|
progressCallback.bind(null, { percent: 30, message: 'Registering subdomains' }),
|
||||||
registerSubdomains.bind(null, app, false /* overwrite */), // if location changed, do not overwrite to detect conflicts
|
registerSubdomains.bind(null, app, overwriteDns),
|
||||||
|
|
||||||
progressCallback.bind(null, { percent: 40, message: 'Downloading image' }),
|
progressCallback.bind(null, { percent: 40, message: 'Downloading image' }),
|
||||||
downloadImage.bind(null, app.manifest),
|
downloadImage.bind(null, app.manifest),
|
||||||
|
|||||||
Reference in New Issue
Block a user