batch: Fix a typo while validating smallerThan field (#18942)

This commit is contained in:
Anis Eleuch 2024-02-01 22:53:26 +01:00 committed by GitHub
parent b192bc348c
commit 61a4bb38cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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