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 11import { PluginType } from '@cloudgraph/sdk'
22import { isEmpty , uniqBy } from 'lodash'
3+ import { DEFAULT_CG_CONFIG } from '../../utils/constants'
34
45import OperationBaseCommand from '../operation'
56
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-
207export default class AddPolicy extends OperationBaseCommand {
218 static description = 'Add new policy packs'
229
@@ -42,7 +29,7 @@ export default class AddPolicy extends OperationBaseCommand {
4229 } = installedPolicy
4330
4431 // Save policy to CG config file
45- const config = this . getCGConfig ( ) || defaultCGConfig
32+ const config = this . getCGConfig ( ) || DEFAULT_CG_CONFIG
4633 let configuredPolicies =
4734 config . cloudGraph . plugins ?. [ PluginType . PolicyPack ] || [ ]
4835 if ( isEmpty ( configuredPolicies ) ) {
Original file line number Diff line number Diff line change @@ -25,3 +25,13 @@ export const messages = {
2525 plural : 'providers' ,
2626 } ,
2727}
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