Skip to content

Commit

Permalink
track tags with a map
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaGuerra committed Jan 18, 2024
1 parent 066ffe4 commit 0a54b67
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions build/registry/pkg/oci/oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,22 +231,28 @@ func newReleases(artifactName, remoteVersion string) ([]semver.Version, error) {
return append(versions, *v), nil
}

tags, err := git("--no-pager", "tag", "--list", tagPrefix, "--contains", remoteTag)
tagList, err := git("--no-pager", "tag", "--list", tagPrefix, "--contains", remoteTag)
if err != nil {
return nil, err
}

klog.Infof("newReleases tags: %q", tags)
klog.Infof("newReleases tagList: %q", tagList)

tags := make(map[string]struct{})

for _, t := range tagList {
tags[t] = struct{}{}
}

// Since the remoteTag is always self-contained, we remove it.
tags = tags[1:]
delete(tags, remoteTag)

// If not new versions are found then return.
if len(tags) == 0 {
return nil, nil
}

for _, tag := range tags {
for tag := range tags {

if tag == "" {
continue
Expand Down

0 comments on commit 0a54b67

Please sign in to comment.