Skip to content

Commit

Permalink
Merge pull request #5 from SPSCommerce/taskid
Browse files Browse the repository at this point in the history
support the legacy task arn format
  • Loading branch information
jmhoeft authored Apr 28, 2021
2 parents b2503a7 + 36d9b7e commit a24d5b0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions bridge/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ func serviceMetaData(config *dockerapi.Config, port string) (map[string]string,
}
}
if (kvp[0] == "com.amazonaws.ecs.task-arn") && len(kvp) > 1 {
key := "taskId"
value := strings.SplitN(kvp[1], "/", -1)[2]
metadata[key] = value
taskIdSplit := strings.Split(kvp[1], "/")
if len(taskIdSplit) > 1 {
taskId := taskIdSplit[len(taskIdSplit)-1]
metadata["taskId"] = taskId
}
}
}
return metadata, metadataFromPort
Expand Down

0 comments on commit a24d5b0

Please sign in to comment.