Skip to content

Commit

Permalink
fixup! sparse: do not modify media type when unspecified
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Brown <jabrown85@gmail.com>
  • Loading branch information
jabrown85 committed Nov 3, 2023
1 parent 314f7b6 commit 6c66712
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions layout/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ func NewImage(path string, ops ...ImageOption) (*Image, error) {
ri.createdAt = imageOpts.createdAt
}

if imageOpts.mediaTypes == imgutil.MissingTypes && !hasBaseImage {
ri.requestedMediaTypes = imgutil.OCITypes
} else {
if imageOpts.mediaTypes != imgutil.MissingTypes {
ri.requestedMediaTypes = imageOpts.mediaTypes
} else if !hasBaseImage {
ri.requestedMediaTypes = imgutil.OCITypes
}
if err = ri.setUnderlyingImage(ri.Image); err != nil { // update media types
return nil, err
Expand Down

0 comments on commit 6c66712

Please sign in to comment.