Skip to content

app-proxy-fixes #702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions lib/interface/cli/commands/hybrid/init.cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ function printInstallationOptionsSummary({
noProxy,
appProxy,
appProxyHost,
appProxyPathPrefix,
dryRun,
shouldUseHelm,
}) {
Expand All @@ -77,7 +78,7 @@ function printInstallationOptionsSummary({
`;

if (appProxy) {
summary += `7. App-Proxy hostname: ${colors.cyan(appProxyHost)}\n`;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to print the full address in the summary. It's more helpful to us for debugging because that's the value that would actually be used by the ui.

summary += `7. App-Proxy address: ${colors.cyan(`https://${appProxyHost}${appProxyPathPrefix || ''}`)}\n`;
}
if (dryRun) {
summary += '**** running in dry-run mode ****';
Expand Down Expand Up @@ -425,10 +426,11 @@ const initCmd = new Command({
const answers = await inquirer.prompt(questions);
kubeContextName = kubeContextName || answers.context;
kubeNamespace = kubeNamespace || answers.namespace;
appProxyHost = appProxyHost || answers.appProxyHost;
shouldMakeDefaultRe = _.isUndefined(shouldMakeDefaultRe) ? answers.shouldMakeDefaultRe : shouldMakeDefaultRe;
shouldExecutePipeline = _.isUndefined(shouldExecutePipeline) ? answers.shouldExecutePipeline : shouldExecutePipeline;
// eslint-disable-next-line object-curly-newline
({ httpProxy, httpsProxy, noProxy, appProxyHost } = answers);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the bug. it would just get override if it's given by flag instead of question

({ httpProxy, httpsProxy, noProxy } = answers);
}

printInstallationOptionsSummary({
Expand All @@ -441,6 +443,7 @@ const initCmd = new Command({
noProxy,
appProxy,
appProxyHost,
appProxyPathPrefix,
dryRun,
shouldUseHelm,
});
Expand Down Expand Up @@ -736,6 +739,7 @@ const initCmd = new Command({
condition: !shouldUseHelm,
});

// install app-proxy
installationPlan.addStep({
name: 'install app-proxy',
func: async () => {
Expand All @@ -755,8 +759,6 @@ const initCmd = new Command({
appProxyIngressClass,
dryRun,
});
const appProxyUrl = `https://${appProxyHost}${appProxyPathPrefix || ''}`;
installationPlan.addContext('appProxyIP', `${appProxyUrl}`);
},
installationEvent: installationProgress.events.APP_PROXY_INSTALLED,
condition: !!appProxy && !shouldUseHelm,
Expand All @@ -771,19 +773,13 @@ const initCmd = new Command({
const re = await sdk.runtimeEnvs.get({ name: reName });
const body = {
appProxy: {
externalIP: installationPlan.getContext('appProxyIP'),
externalIP: `https://${appProxyHost}${appProxyPathPrefix || ''}`,
},
};
await sdk.runtimeEnvs.update({ name: reName }, _.merge(re, body));
console.log(`Runtime environment "${colors.cyan(reName)}" has been updated with the app proxy`);
},
condition: async () => {
if (shouldUseHelm) {
return false;
}

return installationPlan.getContext('appProxyIP');
},
condition: !!appProxy && !!appProxyHost,
});

// update agent with new runtime
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "codefresh",
"version": "0.75.32",
"version": "0.75.34",
"description": "Codefresh command line utility",
"main": "index.js",
"preferGlobal": true,
Expand Down