Skip to content

Commit 52c61d3

Browse files
author
Joe Bowers
committed
build: include URL scheme in host configuration
This change allows passing empty strings to the dashboard backend process, which in turn allows developers to run the dashboard using a heapster service proxy.
1 parent 8af7465 commit 52c61d3

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

build/cluster.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ import conf from './conf';
2424
/**
2525
* The healthz URL of the cluster to check that it is running.
2626
*/
27-
const clusterHealthzUrl = `http://${conf.backend.apiServerHost}/healthz`;
27+
const clusterHealthzUrl = `${conf.backend.apiServerHost}/healthz`;
2828

2929
/**
3030
* The validate URL of the heapster to check that it is running.
3131
*/
32-
const heapsterValidateUrl = `http://${conf.backend.heapsterServerHost}/api/v1/model/stats/`;
32+
const heapsterValidateUrl = `${conf.backend.heapsterServerHost}/api/v1/model/stats/`;
3333

3434
/**
3535
* A Number, representing the ID value of the timer that is set for function which periodically
@@ -143,7 +143,7 @@ gulp.task('wait-for-cluster', function(doneFn) {
143143
if (counter % 10 === 0) {
144144
gulpUtil.log(
145145
gulpUtil.colors.magenta(
146-
`Waiting for a Kubernetes cluster on ${conf.backend.apiServerHost}...`));
146+
`Waiting for a Kubernetes cluster at ${conf.backend.apiServerHost}...`));
147147
}
148148
counter += 1;
149149

build/conf.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@ export default {
4545
/**
4646
* Address for the Kubernetes API server.
4747
*/
48-
apiServerHost: 'localhost:8080',
48+
apiServerHost: 'http://localhost:8080',
4949
/**
50-
* Address for the Heapster API server.
50+
* Address for the Heapster API server. If blank, the dashboard
51+
* will attempt to connect to Heapster via a service proxy.
5152
*/
52-
heapsterServerHost: 'localhost:8082',
53+
heapsterServerHost: 'http://localhost:8082',
5354
},
5455

5556
/**

build/serve.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ export const browserSyncInstance = browserSync.create();
3636
* @type {!Array<string>}
3737
*/
3838
const backendDevArgs = [
39-
`--apiserver-host=http://${conf.backend.apiServerHost}`,
39+
`--apiserver-host=${conf.backend.apiServerHost}`,
4040
`--port=${conf.backend.devServerPort}`,
41-
`--heapster-host=http://${conf.backend.heapsterServerHost}`,
41+
`--heapster-host=${conf.backend.heapsterServerHost}`,
4242
];
4343

4444
/**
@@ -47,9 +47,9 @@ const backendDevArgs = [
4747
* @type {!Array<string>}
4848
*/
4949
const backendArgs = [
50-
`--apiserver-host=http://${conf.backend.apiServerHost}`,
50+
`--apiserver-host=${conf.backend.apiServerHost}`,
5151
`--port=${conf.frontend.serverPort}`,
52-
`--heapster-host=http://${conf.backend.heapsterServerHost}`,
52+
`--heapster-host=${conf.backend.heapsterServerHost}`,
5353
];
5454

5555
/**

0 commit comments

Comments
 (0)