Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

Commit

Permalink
Fixes parsing of service URL (#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
prydonius authored Jun 16, 2017
1 parent ebbe797 commit 2e0af23
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions docs/config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ repos:
# url: my-repository-url
# source: my-repository-source

cors:
allowed_origins:
- my-api-server
allowed_headers:
- "access-control-allow-headers"
- "x-xsrf-token"
# cors:
# allowed_origins:
# - my-api-server
# allowed_headers:
# - "access-control-allow-headers"
# - "x-xsrf-token"

# Enables Helm deployment integration
# https://github.com/helm/monocular/blob/master/docs/configuration.md#enable-helm-releases-integration
Expand Down
8 changes: 4 additions & 4 deletions src/ui/src/app/shared/services/deployments.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ export class DeploymentsService {
* @param ret out parameter to store urls in
*/
private svcToURLs(portSpec) {
// pattern is INT_PORT:EXT_PORT/TCP
const portsRE = /^(\d+:)?(\d+)\/TCP$/;
// pattern is EXT_PORT:INT_PORT/TCP
const portsRE = /^(\d+):(\d+)\/TCP$/;
// match ip4/6 ips, as opposed to <pending>
const ipRE = /^[\d\.:]+$/;
const EXT_IP = "EXTERNAL-IP";
Expand All @@ -93,8 +93,8 @@ export class DeploymentsService {
return;
var portMatch = portsRE.exec(port);
if (portMatch) {
var protocol = portMatch[1] == '443:' ? 'https' : 'http';
ret.push(`${protocol}://${extIP}:${portMatch[2]}`);
var protocol = portMatch[1] == '443' ? 'https' : 'http';
ret.push(`${protocol}://${extIP}:${portMatch[1]}`);
}
})
return ret;
Expand Down

0 comments on commit 2e0af23

Please sign in to comment.