fix invalid validation error checking

Signed-off-by: Mike Brown <brownwm@us.ibm.com>
This commit is contained in:
Mike Brown 2021-06-03 15:58:11 -05:00
parent 6ae90906ab
commit 014748bc04
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")
} }
} }