1
1
'use strict' ;
2
2
3
3
import { Codefresh } from './codefresh.js' ;
4
- import { autoDetectClient } from 'https://deno.land/x/kubernetes_client@v0.7.0 /mod.ts' ;
4
+ import { autoDetectClient } from 'https://deno.land/x/kubernetes_client@v0.7.2 /mod.ts' ;
5
5
import { BatchV1Api } from 'https://deno.land/x/kubernetes_apis@v0.5.0/builtin/batch@v1/mod.ts' ;
6
6
import { CoreV1Api } from 'https://deno.land/x/kubernetes_apis@v0.5.0/builtin/core@v1/mod.ts' ;
7
7
import { StorageV1Api } from 'https://deno.land/x/kubernetes_apis@v0.5.0/builtin/storage.k8s.io@v1/mod.ts' ;
8
8
import { ArgoprojIoV1alpha1Api } from 'https://deno.land/x/kubernetes_apis@v0.5.0/argo-cd/argoproj.io@v1alpha1/mod.ts' ;
9
9
import { compress } from 'https://deno.land/x/zip@v1.2.5/mod.ts' ;
10
+ import { stringify as toYaml } from 'https://deno.land/std@0.211.0/yaml/mod.ts' ;
10
11
11
12
console . log ( 'Initializing \n' ) ;
12
13
const kubeConfig = await autoDetectClient ( ) ;
@@ -20,7 +21,7 @@ const dirPath = `./codefresh-support-${timestamp}`;
20
21
async function saveItems ( resources , dir ) {
21
22
await Deno . mkdir ( `${ dirPath } /${ dir } /` , { recursive : true } ) ;
22
23
return Promise . all ( resources . map ( ( item ) => {
23
- return Deno . writeTextFile ( `${ dirPath } /${ dir } /${ item . metadata . name } .json ` , JSON . stringify ( item , null , 2 ) ) ;
24
+ return Deno . writeTextFile ( `${ dirPath } /${ dir } /${ item . metadata . name } .yaml ` , toYaml ( item , { skipInvalid : true } ) ) ;
24
25
} ) ) ;
25
26
}
26
27
@@ -64,7 +65,7 @@ async function gatherClassic() {
64
65
}
65
66
}
66
67
67
- Deno . writeTextFile ( `${ dirPath } /runtimeSpec.json ` , JSON . stringify ( reSpec , null , 2 ) ) ;
68
+ Deno . writeTextFile ( `${ dirPath } /runtimeSpec.yaml ` , toYaml ( reSpec , { skipInvalid : true } ) ) ;
68
69
}
69
70
70
71
async function gatherGitOps ( ) {
0 commit comments