@@ -84,6 +84,7 @@ def __init__(self, args):
8484 else :
8585 self .init_project_data (args )
8686 self .serialize = args .serialize
87+ self .skip_group = args .skip_group
8788
8889 def connect (self ):
8990 self .client = Client (base_url = self .base_url , token = self .access_token , verify = self .no_verify , timeout = 60.0 , retries = 4 )
@@ -314,15 +315,17 @@ def process_text_spec_file(self,args):
314315 prefix = args .string_to_put_in_front_of_subproject_name
315316 if not prefix :
316317 prefix = args .project_name
317- with open (args .subproject_spec_file , "r" ) as f :
318- lines = f .read ().splitlines ()
319- for line in lines :
320- image_name = line .split ('/' )[- 1 ].split (':' )[0 ] # Don't look at me, you wrote it!
321- sub_project_name = "_" .join ((prefix , image_name ))
322- spec_line = ":" .join ((sub_project_name , line ))
323- # if "ciena.com" in spec_line:
324- project_list .append (spec_line )
325- return (project_list )
318+ if args .subproject_spec_file is not None :
319+ with open (args .subproject_spec_file , "r" ) as f :
320+ lines = f .read ().splitlines ()
321+ for line in lines :
322+ print (line )
323+ image_name = line .split ('/' )[- 1 ].split (':' )[0 ] # Don't look at me, you wrote it!
324+ sub_project_name = "_" .join ((prefix , image_name ))
325+ spec_line = ":" .join ((sub_project_name , line ))
326+ # if "ciena.com" in spec_line:
327+ project_list .append (spec_line )
328+ return (project_list )
326329
327330 def get_child_spec_list (self ,args ):
328331 if args .subproject_list :
@@ -459,7 +462,8 @@ def scan_container_images(self):
459462 parent_version ,
460463 detect_options ,
461464 hub = hub ,
462- binary = self .binary
465+ binary = self .binary ,
466+ skip_group = self .skip_group
463467 )
464468 child ['scan_results' ] = results
465469 except Exception as e :
@@ -537,6 +541,7 @@ def parse_command_args():
537541 parser .add_argument ("-ifm" , "--individual-file-matching" , action = 'store_true' , help = "Turn Individual file matching on" )
538542 parser .add_argument ("--reprocess-run-file" , help = "Reprocess Failures from previous run report." )
539543 parser .add_argument ("--serialize" , action = 'store_true' , help = "Serialize scan submissions by adding --detect.wait.for.results=true to scan invocations" )
544+ parser .add_argument ("--skip-group" , required = False , help = "exclude layers belog to specific groups, ex. 'base' " )
540545 args = parser .parse_args ()
541546 if not args .reprocess_run_file and not (args .project_name and args .version_name ):
542547 parser .error ("[ -p/--project-name and -pv/--version-name ] or --reprocess-run-file are required" )
@@ -565,3 +570,5 @@ def main():
565570
566571if __name__ == "__main__" :
567572 sys .exit (main ())
573+
574+
0 commit comments