forked from TrueCloudLab/distribution
Merge pull request #2087 from aaronlehmann/missing-digest-panic
schema1: Validate descriptors in AppendReference
This commit is contained in:
commit
c599955707
1 changed files with 7 additions and 2 deletions
|
@ -240,8 +240,13 @@ func (mb *configManifestBuilder) emptyTar(ctx context.Context) (digest.Digest, e
|
||||||
|
|
||||||
// AppendReference adds a reference to the current ManifestBuilder
|
// AppendReference adds a reference to the current ManifestBuilder
|
||||||
func (mb *configManifestBuilder) AppendReference(d distribution.Describable) error {
|
func (mb *configManifestBuilder) AppendReference(d distribution.Describable) error {
|
||||||
// todo: verification here?
|
descriptor := d.Descriptor()
|
||||||
mb.descriptors = append(mb.descriptors, d.Descriptor())
|
|
||||||
|
if err := descriptor.Digest.Validate(); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
mb.descriptors = append(mb.descriptors, descriptor)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue