diff --git a/lib/app.js b/lib/app.js index f1dc77a76..5f4f224ab 100644 --- a/lib/app.js +++ b/lib/app.js @@ -351,11 +351,15 @@ module.exports = class App { // reset the default service to the primary v4 service if we only have v4 services if (this._serviceApi === 4) this._defaultService = this.v4.primaryService.name; - // reset the default service to the first v3 service if there is no appserver - else if (this.serviceGroups['3'].length > 0 && !_.find(this.serviceGroups['3'], {service: 'appserver'})) { + // reset the default service to the first v3 service if there is no appserver in v3 or v4 + else if (this.serviceGroups['3'].length > 0 + && !_.find(this.serviceGroups['3'], {service: 'appserver'}) + && !_.find(this.serviceGroups['4'], {service: 'appserver'})) { this._defaultService = this.serviceGroups['3'][0].service; - // reset the default service to the first compose service if there is no appserver - } else if (this.serviceGroups.compose.length > 0 && !_.find(this.serviceGroups.compose, {service: 'appserver'})) { + // reset the default service to the first compose service if there is no appserver in compose or v4 + } else if (this.serviceGroups.compose.length > 0 + && !_.find(this.serviceGroups.compose, {service: 'appserver'}) + && !_.find(this.serviceGroups['4'], {service: 'appserver'})) { this._defaultService = this.serviceGroups.compose[0].service; }