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

[DnsDock] Fix for image name including forward slash #115

Merged
merged 2 commits into from
May 24, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Strip everything before slash in image name
  • Loading branch information
Artur 'Wodor' Wielogorski committed May 24, 2016
commit cca878944c4162309d132fd707037824a8e9be00
2 changes: 1 addition & 1 deletion spec/Dock/Docker/Dns/DnsDockResolverSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ function it_removes_the_tag_in_image_name()

function it_removes_the_slash_in_image_name()
{
$this->getDnsByContainerNameAndImage('container', 'someone/image:latest')->shouldContain('container.someone_image.docker');
$this->getDnsByContainerNameAndImage('container', 'someone/image:latest')->shouldContain('container.image.docker');
}
}
6 changes: 5 additions & 1 deletion src/Docker/Dns/DnsDockResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ private function stripTagNameFromImageName($imageName)

private function stripSlashFromImageName($imageName)
{
return str_replace('/', '_', $imageName);
if (false !== ($position = strpos($imageName, '/'))) {
$imageName = substr($imageName, $position+1 );
}

return $imageName;
}
}