@@ -14,7 +14,6 @@ const cfRuntimeTypes = {
14
14
15
15
const timestamp = new Date ( ) . getTime ( ) ;
16
16
const dirPath = `./codefresh-support-${ timestamp } ` ;
17
- const supportPackageZip = `./codefresh-support-package-${ timestamp } .tar.gz` ;
18
17
const numOfProcesses = 5 ;
19
18
20
19
// ##############################
@@ -360,7 +359,7 @@ async function gatherPipelinesRuntime(cfConfig) {
360
359
await Deno . writeTextFile ( `${ dirPath } /testPipelineBuildId.txt` , pipelineExecutionOutput . buildID ) ;
361
360
}
362
361
363
- await prepareAndCleanup ( ) ;
362
+ await prepareAndCleanup ( 'pipelines' ) ;
364
363
} catch ( error ) {
365
364
throw new Error ( 'Error gathering Pipelines Runtime data:' , error ) ;
366
365
}
@@ -375,7 +374,7 @@ async function gatherGitopsRuntime() {
375
374
console . log ( `\nGathering data in "${ namespace } " namespace for the GitOps Runtime.` ) ;
376
375
await fetchAndSaveData ( namespace ) ;
377
376
console . log ( '\nData Gathered Successfully.' ) ;
378
- await prepareAndCleanup ( ) ;
377
+ await prepareAndCleanup ( 'gitops' ) ;
379
378
} catch ( error ) {
380
379
throw new Error ( `Error gathering GitOps runtime data:` , error ) ;
381
380
}
@@ -441,7 +440,7 @@ async function gatherOnPrem(cfConfig) {
441
440
] ) ;
442
441
443
442
console . log ( '\nData Gathered Successfully.' ) ;
444
- await prepareAndCleanup ( ) ;
443
+ await prepareAndCleanup ( 'onprem' ) ;
445
444
} catch ( error ) {
446
445
throw new Error ( `Error gathering On-Prem data: ${ error . message } ` ) ;
447
446
}
@@ -471,7 +470,8 @@ async function writeGetApiCalls(resources, k8sType) {
471
470
} ) ) ;
472
471
}
473
472
474
- async function prepareAndCleanup ( ) {
473
+ async function prepareAndCleanup ( selectedRuntime ) {
474
+ const supportPackageZip = `./cf-support-${ selectedRuntime } -${ timestamp } .tar.gz` ;
475
475
console . log ( `Saving data to ${ supportPackageZip } ` ) ;
476
476
await tgz . compress ( dirPath , supportPackageZip ) ;
477
477
0 commit comments