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

Commit 2929641

Browse files
Merge pull request #134 from surajssd/add-default-image-tag
add image tag as latest if none given
2 parents 392830b + 2ccb6c6 commit 2929641

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)