Skip to content

Commit

Permalink
Merge pull request #2783 from christianvogt/rhods-ext
Browse files Browse the repository at this point in the history
add env var to support rhods-dashboard for dev:start:ext
  • Loading branch information
openshift-merge-bot[bot] authored May 8, 2024
2 parents 62b5097 + cc57071 commit 070fe7e
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 070fe7e

Please sign in to comment.