Skip to content

Commit

Permalink
container-name patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Totodore committed Dec 8, 2020
1 parent c04efb1 commit 7882ea0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class DockerManager {
for (const container of containers) {
const labels: DockerCiLabels = container.Labels;
if (labels["docker-ci.enable"] === "true")
response[container.Id] = labels["docker-ci.name"] || (await this.getContainer(container.Id).inspect()).Name;
response[container.Id] = labels["docker-ci.name"] || (await this.getContainer(container.Id).inspect()).Name.replace("/", "")
}
return response;
}
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class App {
try {
const containerInfos = await this._dockerManager.getContainer(res.Actor.ID).inspect();
const labels: DockerCiLabels = containerInfos.Config.Labels;
const routeId = labels["docker-ci.name"] || containerName;
const routeId = labels["docker-ci.name"] || containerName.replace("/", "");
if (labels["docker-ci.enable"] === "true") {
this._logger.log("Docker-ci enabled, adding container to webhook conf");
this._addContainerConf(routeId, containerInfos.Id);
Expand Down

0 comments on commit 7882ea0

Please sign in to comment.