Skip to content

Commit

Permalink
Merge pull request actions#27 from akamai/feature/DEVPOPS-789
Browse files Browse the repository at this point in the history
Feature/Devpops-789
  • Loading branch information
bradforj287 committed Mar 5, 2019
2 parents 834eb6c + dd12b46 commit 299a852
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cli-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -785,8 +785,11 @@ async function registerSandbox(sandboxId: string, jwt: string, name: string, cli
console.log('building origin list');
var origins: Array<string> = await getOriginListForSandboxId(sandboxId);
var passThrough = false;
let hasVariableForOrigin = false;
if (origins.length > 0) {
console.log(`Detected the following origins: ${origins.join(', ')}`);
const regexPMUserVariable = new RegExp("(\{\{(.)+\}\})");
hasVariableForOrigin = origins.some(origin => regexPMUserVariable.test(origin));
if (await cliUtils.confirm('Would you like the Sandbox Client to proxy these to the destination defined in the Akamai config?')) {
passThrough = true;
}
Expand All @@ -796,6 +799,10 @@ async function registerSandbox(sandboxId: string, jwt: string, name: string, cli
var registration = sandboxClientManager.registerNewSandbox(sandboxId, jwt, name, origins, clientConfig, passThrough);

console.info(`Successfully created sandbox_id ${sandboxId}. Generated sandbox client configuration at ${registration.configPath} please edit this file`);
if(hasVariableForOrigin) {
console.error(`Atleast one of the property of this sandbox has user defined variable for an origin hostname. Please edit the sandbox client configuration file ${registration.configPath}
manually and replace the variable with an actual hostname`);
}
}

async function downloadClientIfNecessary() {
Expand Down

0 comments on commit 299a852

Please sign in to comment.