@@ -1236,7 +1236,7 @@ class NCLifecycle {
1236
1236
const { bucket_rule_id, in_bucket_path, in_bucket_internal_dir } = ilm_policy_helpers ;
1237
1237
const mod_age_definition = `define( mod_age, (DAYS(CURRENT_TIMESTAMP) - DAYS(MODIFICATION_TIME)) )\n` ;
1238
1238
const change_age_definition = `define( change_age, (DAYS(CURRENT_TIMESTAMP) - DAYS(CHANGE_TIME)) )\n` ;
1239
- const rule_id_definition = `RULE ${ bucket_rule_id } LIST ${ bucket_rule_id } \n` ;
1239
+ const rule_id_definition = `RULE ' ${ bucket_rule_id } ' LIST ' ${ bucket_rule_id } ' \n` ;
1240
1240
const policy_path_base = `WHERE PATH_NAME LIKE '${ in_bucket_path } '\n` +
1241
1241
`AND PATH_NAME NOT LIKE '${ in_bucket_internal_dir } '\n` ;
1242
1242
@@ -1285,8 +1285,8 @@ class NCLifecycle {
1285
1285
const { object_size_greater_than = undefined , object_size_less_than = undefined , tags = undefined } = filter ;
1286
1286
const rule_prefix = prefix || filter . prefix ;
1287
1287
filter_policy += rule_prefix ? `AND PATH_NAME LIKE '${ path . join ( bucket_path , rule_prefix ) } %'\n` : '' ;
1288
- filter_policy += object_size_greater_than ? `AND FILE_SIZE > ${ object_size_greater_than } \n` : '' ;
1289
- filter_policy += object_size_less_than ? `AND FILE_SIZE < ${ object_size_less_than } \n` : '' ;
1288
+ filter_policy += object_size_greater_than === undefined ? '' : `AND FILE_SIZE > ${ object_size_greater_than } \n` ;
1289
+ filter_policy += object_size_less_than === undefined ? '' : `AND FILE_SIZE < ${ object_size_less_than } \n` ;
1290
1290
filter_policy += tags ? tags . map ( tag => `AND XATTR('user.noobaa.tag.${ tag . key } ') LIKE ${ tag . value } \n` ) . join ( '' ) : '' ;
1291
1291
}
1292
1292
return filter_policy ;
@@ -1434,7 +1434,7 @@ class NCLifecycle {
1434
1434
if ( err . code === 'ENOENT' ) {
1435
1435
dbg . log2 ( `parse_candidates_from_gpfs_ilm_policy ilm_candidates_file_exists does not exist, no candidates to delete` ) ;
1436
1436
this . _set_rule_state ( bucket_json , lifecycle_rule , finished_state ) ;
1437
- return ;
1437
+ return [ ] ;
1438
1438
}
1439
1439
dbg . error ( 'parse_candidates_from_gpfs_ilm_policy: error' , err ) ;
1440
1440
throw err ;
0 commit comments