From e1bc7a02b6ee8f6d1ec59dd56446f3ac568f04ee Mon Sep 17 00:00:00 2001 From: Ben Jackson Date: Thu, 11 Nov 2021 10:46:39 +1100 Subject: [PATCH] fix: actually check the project defined routerpattern exists --- node-packages/commons/src/tasks.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/node-packages/commons/src/tasks.ts b/node-packages/commons/src/tasks.ts index 6904ae962f..e634c17e7c 100644 --- a/node-packages/commons/src/tasks.ts +++ b/node-packages/commons/src/tasks.ts @@ -402,11 +402,18 @@ export const getControllerBuildData = async function(deployData: any) { var openshiftProject = openshiftProjectPattern ? openshiftProjectPattern.replace('${environment}',environmentName).replace('${project}', projectName) : `${projectName}-${environmentName}` + // set routerpattern to the routerpattern of what is defined in the project scope openshift var routerPattern = lagoonProjectData.openshift.routerPattern if (typeof deployTarget.openshift.routerPattern !== 'undefined') { - // null is a valid value for routerPatterns... + // if deploytargets are being provided, then use what is defined in the deploytarget + // null is a valid value for routerPatterns here... routerPattern = deployTarget.openshift.routerPattern } + // but if the project itself has a routerpattern defined, then this should be used + if (lagoonProjectData.routerPattern) { + // if a project has a routerpattern defined, use it. `null` is not valid here + routerPattern = lagoonProjectData.routerPattern + } var deployTargetName = deployTarget.openshift.name var monitoringConfig: any = {}; try {