Skip to content

Commit

Permalink
Merge pull request #111 from cyphar/fix-layer-validation
Browse files Browse the repository at this point in the history
image: make layer validation work
  • Loading branch information
coolljt0725 authored Feb 10, 2017
2 parents 9386a7f + 950230c commit a358e03
Showing 1 changed file with 8 additions and 1 deletion.
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{
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

0 comments on commit a358e03

Please sign in to comment.