Verify manifest name format
Signed-off-by: Troels Thomsen <troels@thomsen.io>
This commit is contained in:
parent
34c8194c95
commit
d309bce2d1
1 changed files with 4 additions and 0 deletions
|
@ -112,6 +112,10 @@ func (ms *manifestStore) verifyManifest(ctx context.Context, mnfst *schema1.Sign
|
||||||
errs = append(errs, fmt.Errorf("manifest name must not be more than %v characters", reference.NameTotalLengthMax))
|
errs = append(errs, fmt.Errorf("manifest name must not be more than %v characters", reference.NameTotalLengthMax))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !reference.NameRegexp.MatchString(mnfst.Name) {
|
||||||
|
errs = append(errs, fmt.Errorf("invalid manifest name format"))
|
||||||
|
}
|
||||||
|
|
||||||
if len(mnfst.History) != len(mnfst.FSLayers) {
|
if len(mnfst.History) != len(mnfst.FSLayers) {
|
||||||
errs = append(errs, fmt.Errorf("mismatched history and fslayer cardinality %d != %d",
|
errs = append(errs, fmt.Errorf("mismatched history and fslayer cardinality %d != %d",
|
||||||
len(mnfst.History), len(mnfst.FSLayers)))
|
len(mnfst.History), len(mnfst.FSLayers)))
|
||||||
|
|
Loading…
Reference in a new issue