From 61a4bb38cde4d0ecb8851e5e3327b7dd2bdb9e14 Mon Sep 17 00:00:00 2001 From: Anis Eleuch Date: Thu, 1 Feb 2024 22:53:26 +0100 Subject: [PATCH] batch: Fix a typo while validating smallerThan field (#18942) --- cmd/batch-job-common-types.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cmd/batch-job-common-types.go b/cmd/batch-job-common-types.go index 894c2264d..3c256378b 100644 --- a/cmd/batch-job-common-types.go +++ b/cmd/batch-job-common-types.go @@ -213,11 +213,14 @@ func (b BatchJobSnowball) Validate() error { } } _, err := humanize.ParseBytes(*b.SmallerThan) - return BatchJobYamlErr{ - line: b.line, - col: b.col, - msg: err.Error(), + if err != nil { + return BatchJobYamlErr{ + line: b.line, + col: b.col, + msg: err.Error(), + } } + return nil } // BatchJobSizeFilter supports size based filters - LesserThan and GreaterThan