Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit 2ccb6c6

Browse files
committed
add image tag as latest if none given
Right now if the image is provided with DaemonPrefix and no image tag is given then the name resolution does not work, so if no image tag given default to latest.
1 parent 392830b commit 2ccb6c6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cmd/root.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,16 @@ func getPrepperForImage(image string) (pkgutil.Prepper, error) {
145145
}, nil
146146

147147
} else if strings.HasPrefix(image, DaemonPrefix) {
148+
149+
// remove the DaemonPrefix
150+
image := strings.Replace(image, DaemonPrefix, "", -1)
151+
// see if the image name has tag provided, if not add latest as tag
152+
if !strings.Contains(image, ":") {
153+
image = image + ":latest"
154+
}
155+
148156
return pkgutil.DaemonPrepper{
149-
Source: strings.Replace(image, DaemonPrefix, "", -1),
157+
Source: image,
150158
Client: cli,
151159
Cache: fsCache,
152160
}, nil

0 commit comments

Comments
 (0)