File tree Expand file tree Collapse file tree 2 files changed +12
-15
lines changed Expand file tree Collapse file tree 2 files changed +12
-15
lines changed Original file line number Diff line number Diff line change 1
1
import { PluginType } from '@cloudgraph/sdk'
2
2
import { isEmpty , uniqBy } from 'lodash'
3
+ import { DEFAULT_CG_CONFIG } from '../../utils/constants'
3
4
4
5
import OperationBaseCommand from '../operation'
5
6
6
- const defaultCGConfig = {
7
- cloudGraph : {
8
- plugins : { } ,
9
- storageConfig : {
10
- host : 'localhost' ,
11
- port : '8997' ,
12
- scheme : 'http' ,
13
- } ,
14
- versionLimit : 10 ,
15
- queryEngine : 'playground' ,
16
- port : '5555' ,
17
- } ,
18
- }
19
-
20
7
export default class AddPolicy extends OperationBaseCommand {
21
8
static description = 'Add new policy packs'
22
9
@@ -42,7 +29,7 @@ export default class AddPolicy extends OperationBaseCommand {
42
29
} = installedPolicy
43
30
44
31
// Save policy to CG config file
45
- const config = this . getCGConfig ( ) || defaultCGConfig
32
+ const config = this . getCGConfig ( ) || DEFAULT_CG_CONFIG
46
33
let configuredPolicies =
47
34
config . cloudGraph . plugins ?. [ PluginType . PolicyPack ] || [ ]
48
35
if ( isEmpty ( configuredPolicies ) ) {
Original file line number Diff line number Diff line change @@ -25,3 +25,13 @@ export const messages = {
25
25
plural : 'providers' ,
26
26
} ,
27
27
}
28
+
29
+ export const DEFAULT_CG_CONFIG = {
30
+ cloudGraph : {
31
+ plugins : { } ,
32
+ storageConfig : DEFAULT_CONFIG ,
33
+ versionLimit : 10 ,
34
+ queryEngine : 'playground' ,
35
+ port : '5555' ,
36
+ } ,
37
+ }
You can’t perform that action at this time.
0 commit comments