Skip to content

Commit

Permalink
Use default tag 'latest' for images that are missing one
Browse files Browse the repository at this point in the history
Copy OCI container semantics and use `latest` for the default tag when
it's missing from an image reference.
  • Loading branch information
amisevsk committed Mar 4, 2024
1 parent 1027a1c commit d21ad98
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/lib/repo/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ func ParseReference(refString string) (ref *registry.Reference, extraTags []stri
// Split off extra tags (e.g. repo:tag1,tag2,tag3)
refAndTags := strings.Split(refString, ",")
baseRef, err := registry.ParseReference(refAndTags[0])

// Set default tag 'latest' if no tag is present, for convenience
baseRef.Reference = baseRef.ReferenceOrDefault()
if err != nil {
return nil, nil, err
}
Expand Down

0 comments on commit d21ad98

Please sign in to comment.