From 0b5e68a5c64307733b19182fdbc3d7ace5e5415e Mon Sep 17 00:00:00 2001 From: renat Date: Thu, 4 Jan 2018 20:37:46 +0600 Subject: [PATCH] Correctly handle images with dots in their names, e.g. "brandonmoser/meteor-node-0.10.41". --- drivers/driver.go | 2 +- drivers/driver_test.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/driver.go b/drivers/driver.go index 82d6da2..848e698 100644 --- a/drivers/driver.go +++ b/drivers/driver.go @@ -273,7 +273,7 @@ func ParseImage(image string) (registry, repo, tag string) { case 1: repo = "library/" + repo case 2: - if strings.Contains(repo, ".") { + if strings.Contains(parts[0], ".") { registry = parts[0] repo = parts[1] } diff --git a/drivers/driver_test.go b/drivers/driver_test.go index 2148b0a..3b08301 100644 --- a/drivers/driver_test.go +++ b/drivers/driver_test.go @@ -117,6 +117,8 @@ func TestParseImage(t *testing.T) { "quay.com/iron/hello": {"quay.com", "iron/hello", "latest"}, "quay.com:8080/iron/hello:v2": {"quay.com:8080", "iron/hello", "v2"}, "localhost.localdomain:5000/samalba/hipache:latest": {"localhost.localdomain:5000", "samalba/hipache", "latest"}, + "some-other.registry.com/busybox": {"some-other.registry.com", "busybox", "latest"}, + "brandonmoser/meteor-node-0.10.41": {"", "brandonmoser/meteor-node-0.10.41", "latest"}, } for in, out := range cases {