Merge pull request #5565 from mikebrow/wrapf-fixes

fix invalid validation error checking
This commit is contained in:
Fu Wei 2021-06-04 11:23:08 +08:00 committed by GitHub
commit e2f784269d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -290,7 +290,7 @@ func validateContainer(container *containers.Container) error {
// image has no validation // image has no validation
for k, v := range container.Labels { for k, v := range container.Labels {
if err := labels.Validate(k, v); err == nil { if err := labels.Validate(k, v); err != nil {
return errors.Wrapf(err, "containers.Labels") return errors.Wrapf(err, "containers.Labels")
} }
} }

View File

@ -708,7 +708,7 @@ func (cs *contentStore) checkAccess(ctx context.Context, dgst digest.Digest) err
func validateInfo(info *content.Info) error { func validateInfo(info *content.Info) error {
for k, v := range info.Labels { for k, v := range info.Labels {
if err := labels.Validate(k, v); err == nil { if err := labels.Validate(k, v); err != nil {
return errors.Wrapf(err, "info.Labels") return errors.Wrapf(err, "info.Labels")
} }
} }