Skip to content

Commit 7405f17

Browse files
author
OpenShift Bot
authored
Merge pull request #11408 from miaoyq/fix-a-if-condition
Merged by openshift-bot
2 parents 44fd91b + b538101 commit 7405f17

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)