Skip to content

Commit

Permalink
Ensure no duplicate tags are created
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexGustafsson committed Jan 12, 2025
1 parent 262f13b commit 46a9241
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ func (w *Worker) ProcessRawImage(ctx context.Context, reference oci.Reference) e
// Add some basic tags
if data.LatestReference != nil {
if data.ImageReference.String() == data.LatestReference.String() {
data.Tags = append(data.Tags, "up-to-date")
data.InsertTag("up-to-date")
} else {
data.Tags = append(data.Tags, "outdated")
data.InsertTag("outdated")
}

// Add tags based on version diff
Expand All @@ -123,7 +123,7 @@ func (w *Worker) ProcessRawImage(ctx context.Context, reference oci.Reference) e
if currentVersion != nil && currentVersionErr == nil && newVersion != nil && newVersionErr == nil {
diff := currentVersion.Diff(newVersion)
if diff != "" {
data.Tags = append(data.Tags, diff)
data.InsertTag(diff)
}

versionDiffSortable = semver.PackInt64(newVersion) - semver.PackInt64(currentVersion)
Expand Down

0 comments on commit 46a9241

Please sign in to comment.