Skip to content

Commit

Permalink
add env var to support rhods-dashboard for start:dev:ext
Browse files Browse the repository at this point in the history
  • Loading branch information
christianvogt committed May 7, 2024
1 parent 424378e commit cc57071
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/config/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,23 @@ module.exports = merge(
proxy: (() => {
if (process.env.EXT_CLUSTER) {
const odhProject = process.env.OC_PROJECT || 'opendatahub';
const app = process.env.ODH_APP || 'odh-dashboard';
console.info('Using project:', odhProject);

let dashboardHost;
let token;
try {
try {
dashboardHost = execSync(
`oc get routes -n ${odhProject} odh-dashboard -o jsonpath='{.spec.host}'`,
`oc get routes -n ${odhProject} ${app} -o jsonpath='{.spec.host}'`,
)
.toString()
.trim();
} catch (e) {
console.info('Failed to GET dashboard route, constructing host manually.');
dashboardHost = new URL(execSync(`oc whoami --show-server`).toString()).host
.replace(/:\d+$/, '')
.replace(/^api./, `odh-dashboard-${odhProject}.apps.`);
.replace(/^api./, `${app}-${odhProject}.apps.`);
}
console.info('Dashboard host:', dashboardHost);

Expand Down

0 comments on commit cc57071

Please sign in to comment.