Skip to content

Commit 014748b

Browse files
committed
fix invalid validation error checking
Signed-off-by: Mike Brown <[email protected]>
1 parent 6ae9090 commit 014748b

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)