Skip to content

Commit

Permalink
use the correct version in manifest for docker packages (#1258)
Browse files Browse the repository at this point in the history
  • Loading branch information
girishramnani authored Jan 30, 2022
1 parent 67e3d03 commit dc9f7f0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/extract_from_docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, "", " ")
Expand Down

0 comments on commit dc9f7f0

Please sign in to comment.