From 442fabdcc5c17a6506a0103dd13417907c1b3ba5 Mon Sep 17 00:00:00 2001 From: Jacob Weinstock Date: Thu, 14 Apr 2022 11:38:14 -0600 Subject: [PATCH] Move to path.Join for repo + image_name: With this a tink-worker can be started without a registry defined and templates in Tink server can specify any registry. Signed-off-by: Jacob Weinstock --- cmd/tink-worker/worker/registry.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/tink-worker/worker/registry.go b/cmd/tink-worker/worker/registry.go index 9c8e41dc7..5303f99e3 100644 --- a/cmd/tink-worker/worker/registry.go +++ b/cmd/tink-worker/worker/registry.go @@ -5,6 +5,7 @@ import ( "encoding/base64" "encoding/json" "io" + "path" "github.com/docker/docker/api/types" "github.com/pkg/errors" @@ -42,7 +43,7 @@ func (m *containerManager) PullImage(ctx context.Context, image string) error { } authStr := base64.URLEncoding.EncodeToString(encodedJSON) - out, err := m.cli.ImagePull(ctx, m.registryDetails.Registry+"/"+image, types.ImagePullOptions{RegistryAuth: authStr}) + out, err := m.cli.ImagePull(ctx, path.Join(m.registryDetails.Registry, image), types.ImagePullOptions{RegistryAuth: authStr}) if err != nil { return errors.Wrap(err, "DOCKER PULL") }