Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion image/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,15 @@ func (m *manifest) validate(w walker) error {
return errors.Wrap(err, "config validation failed")
}

validLayerMediaTypes := []string{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to make this private? If a third party wants to support an extension layer type (which we explicitly allow), that would give them a way to do it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it can stay private until asked for. :-)

v1.MediaTypeImageLayer,
v1.MediaTypeImageLayerGzip,
v1.MediaTypeImageLayerNonDistributable,
v1.MediaTypeImageLayerNonDistributableGzip,
}

for _, d := range m.Layers {
if err := d.validate(w, []string{v1.MediaTypeImageLayer}); err != nil {
if err := d.validate(w, validLayerMediaTypes); err != nil {
return errors.Wrap(err, "layer validation failed")
}
}
Expand Down