Skip to content

Commit e2f7842

Browse files
authored
Merge pull request #5565 from mikebrow/wrapf-fixes
fix invalid validation error checking
2 parents 6ae9090 + 014748b commit e2f7842

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

metadata/containers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func validateContainer(container *containers.Container) error {
290290

291291
// image has no validation
292292
for k, v := range container.Labels {
293-
if err := labels.Validate(k, v); err == nil {
293+
if err := labels.Validate(k, v); err != nil {
294294
return errors.Wrapf(err, "containers.Labels")
295295
}
296296
}

metadata/content.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ func (cs *contentStore) checkAccess(ctx context.Context, dgst digest.Digest) err
708708

709709
func validateInfo(info *content.Info) error {
710710
for k, v := range info.Labels {
711-
if err := labels.Validate(k, v); err == nil {
711+
if err := labels.Validate(k, v); err != nil {
712712
return errors.Wrapf(err, "info.Labels")
713713
}
714714
}

0 commit comments

Comments
 (0)