@@ -14,7 +14,6 @@ const cfRuntimeTypes = {
1414
1515const timestamp = new Date ( ) . getTime ( ) ;
1616const dirPath = `./codefresh-support-${ timestamp } ` ;
17- const supportPackageZip = `./codefresh-support-package-${ timestamp } .tar.gz` ;
1817const numOfProcesses = 5 ;
1918
2019// ##############################
@@ -360,7 +359,7 @@ async function gatherPipelinesRuntime(cfConfig) {
360359 await Deno . writeTextFile ( `${ dirPath } /testPipelineBuildId.txt` , pipelineExecutionOutput . buildID ) ;
361360 }
362361
363- await prepareAndCleanup ( ) ;
362+ await prepareAndCleanup ( 'pipelines' ) ;
364363 } catch ( error ) {
365364 throw new Error ( 'Error gathering Pipelines Runtime data:' , error ) ;
366365 }
@@ -375,7 +374,7 @@ async function gatherGitopsRuntime() {
375374 console . log ( `\nGathering data in "${ namespace } " namespace for the GitOps Runtime.` ) ;
376375 await fetchAndSaveData ( namespace ) ;
377376 console . log ( '\nData Gathered Successfully.' ) ;
378- await prepareAndCleanup ( ) ;
377+ await prepareAndCleanup ( 'gitops' ) ;
379378 } catch ( error ) {
380379 throw new Error ( `Error gathering GitOps runtime data:` , error ) ;
381380 }
@@ -441,7 +440,7 @@ async function gatherOnPrem(cfConfig) {
441440 ] ) ;
442441
443442 console . log ( '\nData Gathered Successfully.' ) ;
444- await prepareAndCleanup ( ) ;
443+ await prepareAndCleanup ( 'onprem' ) ;
445444 } catch ( error ) {
446445 throw new Error ( `Error gathering On-Prem data: ${ error . message } ` ) ;
447446 }
@@ -471,7 +470,8 @@ async function writeGetApiCalls(resources, k8sType) {
471470 } ) ) ;
472471}
473472
474- async function prepareAndCleanup ( ) {
473+ async function prepareAndCleanup ( selectedRuntime ) {
474+ const supportPackageZip = `./cf-support-${ selectedRuntime } -${ timestamp } .tar.gz` ;
475475 console . log ( `Saving data to ${ supportPackageZip } ` ) ;
476476 await tgz . compress ( dirPath , supportPackageZip ) ;
477477
0 commit comments