Skip to content

Commit b538101

Browse files
author
Yanqiang Miao
committedOct 18, 2016
Fix an imperfect if statement
1 parent 2142bdb commit b538101

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎pkg/image/importer/importer.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ func importRepositoryFromDockerV1(ctx gocontext.Context, repository *importRepos
562562
}
563563

564564
// if repository import is requested (MaximumTags), attempt to load the tags, sort them, and request the first N
565-
if count := repository.MaximumTags; count > 0 {
565+
if count := repository.MaximumTags; count > 0 || count == -1 {
566566
tagMap, err := conn.ImageTags(repository.Ref.Namespace, repository.Ref.Name)
567567
if err != nil {
568568
repository.Err = err
@@ -582,7 +582,7 @@ func importRepositoryFromDockerV1(ctx gocontext.Context, repository *importRepos
582582
// include only the top N tags in the result, put the rest in AdditionalTags
583583
api.PrioritizeTags(tags)
584584
for _, s := range tags {
585-
if count <= 0 {
585+
if count <= 0 && repository.MaximumTags != -1 {
586586
repository.AdditionalTags = append(repository.AdditionalTags, s)
587587
continue
588588
}

0 commit comments

Comments
 (0)
Please sign in to comment.