From dc9f7f006dcc7d88d2916467472a9fa5140ab6a3 Mon Sep 17 00:00:00 2001 From: Girish Date: Mon, 31 Jan 2022 03:32:55 +0530 Subject: [PATCH] use the correct version in manifest for docker packages (#1258) --- cmd/extract_from_docker.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/extract_from_docker.go b/cmd/extract_from_docker.go index 28ae1114..e4cea345 100644 --- a/cmd/extract_from_docker.go +++ b/cmd/extract_from_docker.go @@ -148,12 +148,17 @@ func ExtractFromDockerImage(imageName string, packageName string, targetExecutab } } - parts := strings.Split(packageName, ":") + // like docker if the user doesn't provide version of the image we consider "latest" as the version + parts := strings.Split(imageName, ":") + version := parts[len(parts)-1] + if len(parts) == 1 { + version = "latest" + } c := &types.Config{ Program: packageName + "/program", Args: []string{"/program"}, - Version: parts[len(parts)-1], + Version: version, } json, _ := json.MarshalIndent(c, "", " ")