Skip to content

Commit 1c95f07

Browse files
authored
Dynamically retrieve config endpoint IP from envs (#30)
1 parent 620ebcc commit 1c95f07

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
function fetch_config_endpoint(r) {
2-
return process.env.CONFIG_ENDPOINT;
2+
// CONFIG_ENDPOINT_HOST and CONFIG_ENDPOINT_PORT are names of the
3+
// environment variables injected by kubernetes. The actual values
4+
// of those environment variables contain the IP and port
5+
var endpoint = "http://";
6+
endpoint += process.env[process.env.CONFIG_ENDPOINT_HOST]
7+
endpoint += ":"
8+
endpoint += process.env[process.env.CONFIG_ENDPOINT_PORT];
9+
10+
return endpoint;
311
}

0 commit comments

Comments
 (0)