Skip to content

Commit

Permalink
fix(service-util): support Pods task ids
Browse files Browse the repository at this point in the history
Pods have the container part in the task id like foo_baz.123.container-bar
This commit ensures we support them
  • Loading branch information
nLight committed Mar 21, 2018
1 parent f2935c9 commit 4b0f52a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/services/src/js/utils/ServiceUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ const ServiceUtil = {
getServiceIDFromTaskID(taskID = "") {
// Parse the task id (e.g. foo_bar.abc-123) to get the corresponding
// service id parts (foo, bar)
const parts = taskID.match(/([^_]+)(?=[_.])/g);
const parts = taskID.split(".")[0].split("_");

// Join service id parts and prepend with a slash to form a valid id
if (parts) {
if (parts[0] !== "") {
return `/${parts.join("/")}`;
}

Expand Down

0 comments on commit 4b0f52a

Please sign in to comment.