@firestartr/cli 1.59.0-snapshot-14 → 1.59.0-snapshot-16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +442 -85
- package/build/packages/cdk8s_renderer/src/claims/base/schemas/argodeploy.schema.d.ts +1 -0
- package/build/packages/cdk8s_renderer/src/claims/base/schemas/common-meta.schema.d.ts +46 -0
- package/build/packages/cdk8s_renderer/src/claims/base/schemas/component.schema.d.ts +1 -0
- package/build/packages/cdk8s_renderer/src/claims/base/schemas/group.schema.d.ts +1 -0
- package/build/packages/cdk8s_renderer/src/claims/base/schemas/index.d.ts +237 -0
- package/build/packages/cdk8s_renderer/src/claims/base/schemas/orgwebhook.schema.d.ts +1 -0
- package/build/packages/cdk8s_renderer/src/claims/base/schemas/secrets.schema.d.ts +1 -0
- package/build/packages/cdk8s_renderer/src/claims/base/schemas/tfworkspace.schema.d.ts +1 -0
- package/build/packages/cdk8s_renderer/src/claims/base/schemas/user.schema.d.ts +1 -0
- package/build/packages/cdk8s_renderer/src/claims/external-secrets/external-secrets.schema.d.ts +12 -0
- package/build/packages/cdk8s_renderer/src/claims/external-secrets/index.d.ts +12 -0
- package/build/packages/cdk8s_renderer/src/claims/github/component.schema.d.ts +136 -0
- package/build/packages/cdk8s_renderer/src/claims/github/group.schema.d.ts +11 -0
- package/build/packages/cdk8s_renderer/src/claims/github/index.d.ts +167 -0
- package/build/packages/cdk8s_renderer/src/claims/github/orgwebhook.schema.d.ts +9 -0
- package/build/packages/cdk8s_renderer/src/claims/github/user.schema.d.ts +11 -0
- package/build/packages/cdk8s_renderer/src/claims/tfworkspaces/index.d.ts +5 -0
- package/build/packages/cdk8s_renderer/src/claims/tfworkspaces/terraform.schema.d.ts +5 -0
- package/build/packages/cdk8s_renderer/src/renderer/imported-refs.d.ts +1 -1
- package/build/packages/importer/src/utils/nomicon.d.ts +1 -0
- package/build/packages/operator/src/definitions.d.ts +1 -0
- package/build/packages/operator/src/informer.d.ts +1 -0
- package/build/packages/terraform_provisioner/index.d.ts +2 -1
- package/build/packages/terraform_provisioner/src/process_handler.d.ts +7 -0
- package/build/packages/terraform_provisioner/src/project_tf.d.ts +5 -1
- package/build/packages/terraform_provisioner/src/project_tf_remote.d.ts +4 -0
- package/build/packages/terraform_provisioner/src/utils.d.ts +5 -4
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -357922,6 +357922,42 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
|
357922
357922
|
},
|
|
357923
357923
|
additionalProperties: false,
|
|
357924
357924
|
},
|
|
357925
|
+
GithubRules: {
|
|
357926
|
+
$id: 'firestartr.dev://common/FirestartrGithubRules',
|
|
357927
|
+
type: 'object',
|
|
357928
|
+
properties: {
|
|
357929
|
+
path: { type: 'string' },
|
|
357930
|
+
owners: {
|
|
357931
|
+
type: 'array',
|
|
357932
|
+
items: {
|
|
357933
|
+
$ref: 'firestartr.dev://common/FirestartrOwnerRef',
|
|
357934
|
+
},
|
|
357935
|
+
},
|
|
357936
|
+
},
|
|
357937
|
+
required: ['path', 'owners'],
|
|
357938
|
+
additionalProperties: false,
|
|
357939
|
+
},
|
|
357940
|
+
GithubSync: {
|
|
357941
|
+
$id: 'firestartr.dev://common/FirestartrGithubSync',
|
|
357942
|
+
type: 'object',
|
|
357943
|
+
properties: {
|
|
357944
|
+
enabled: { type: 'boolean' },
|
|
357945
|
+
period: {
|
|
357946
|
+
type: 'string',
|
|
357947
|
+
pattern: '^[0-9]+[smhd]$',
|
|
357948
|
+
},
|
|
357949
|
+
policy: { type: 'string' },
|
|
357950
|
+
schedule: { type: 'string' },
|
|
357951
|
+
schedule_timezone: { type: 'string' },
|
|
357952
|
+
},
|
|
357953
|
+
additionalProperties: false,
|
|
357954
|
+
required: ['enabled'],
|
|
357955
|
+
},
|
|
357956
|
+
TfStateKey: {
|
|
357957
|
+
$id: 'firestartr.dev://common/TerraformStateKey',
|
|
357958
|
+
type: 'string',
|
|
357959
|
+
pattern: '^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12,}$',
|
|
357960
|
+
},
|
|
357925
357961
|
},
|
|
357926
357962
|
});
|
|
357927
357963
|
|
|
@@ -357957,6 +357993,7 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
|
357957
357993
|
$ref: 'firestartr.dev://github/GithubTeamClaim',
|
|
357958
357994
|
},
|
|
357959
357995
|
},
|
|
357996
|
+
additionalProperties: false,
|
|
357960
357997
|
},
|
|
357961
357998
|
},
|
|
357962
357999
|
},
|
|
@@ -357988,6 +358025,7 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
|
357988
358025
|
$ref: 'firestartr.dev://github/GithubUserClaim',
|
|
357989
358026
|
},
|
|
357990
358027
|
},
|
|
358028
|
+
additionalProperties: false,
|
|
357991
358029
|
},
|
|
357992
358030
|
},
|
|
357993
358031
|
},
|
|
@@ -358033,6 +358071,7 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
|
358033
358071
|
$ref: 'firestartr.dev://github/GithubComponentClaim',
|
|
358034
358072
|
},
|
|
358035
358073
|
},
|
|
358074
|
+
additionalProperties: false,
|
|
358036
358075
|
},
|
|
358037
358076
|
},
|
|
358038
358077
|
required: ['owner'],
|
|
@@ -358122,6 +358161,7 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
|
358122
358161
|
$ref: 'firestartr.dev://terraform/TerraformProvider',
|
|
358123
358162
|
},
|
|
358124
358163
|
},
|
|
358164
|
+
additionalProperties: false,
|
|
358125
358165
|
required: ['terraform'],
|
|
358126
358166
|
},
|
|
358127
358167
|
},
|
|
@@ -358159,6 +358199,7 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
|
358159
358199
|
$ref: 'firestartr.dev://argocd/ArgoCDProvider',
|
|
358160
358200
|
},
|
|
358161
358201
|
},
|
|
358202
|
+
additionalProperties: false,
|
|
358162
358203
|
required: ['argocd'],
|
|
358163
358204
|
},
|
|
358164
358205
|
},
|
|
@@ -358195,6 +358236,7 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
|
358195
358236
|
$ref: 'firestartr.dev://secrets/ExternalSecretsProvider',
|
|
358196
358237
|
},
|
|
358197
358238
|
},
|
|
358239
|
+
additionalProperties: false,
|
|
358198
358240
|
required: ['external_secrets'],
|
|
358199
358241
|
},
|
|
358200
358242
|
},
|
|
@@ -358234,6 +358276,7 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
|
358234
358276
|
$ref: 'firestartr.dev://github/GithubOrgWebhookClaim',
|
|
358235
358277
|
},
|
|
358236
358278
|
},
|
|
358279
|
+
additionalProperties: false,
|
|
358237
358280
|
},
|
|
358238
358281
|
},
|
|
358239
358282
|
required: ['owner'],
|
|
@@ -358258,6 +358301,15 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
|
358258
358301
|
{
|
|
358259
358302
|
type: 'object',
|
|
358260
358303
|
properties: {
|
|
358304
|
+
name: {
|
|
358305
|
+
type: 'string',
|
|
358306
|
+
},
|
|
358307
|
+
tfStateKey: {
|
|
358308
|
+
$ref: 'firestartr.dev://common/TerraformStateKey',
|
|
358309
|
+
},
|
|
358310
|
+
sync: {
|
|
358311
|
+
$ref: 'firestartr.dev://common/FirestartrGithubSync',
|
|
358312
|
+
},
|
|
358261
358313
|
privacy: {
|
|
358262
358314
|
type: 'string',
|
|
358263
358315
|
enum: ['closed', 'secret'],
|
|
@@ -358269,6 +358321,7 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
|
358269
358321
|
$ref: 'firestartr.dev://common/ClaimName',
|
|
358270
358322
|
},
|
|
358271
358323
|
},
|
|
358324
|
+
additionalProperties: false,
|
|
358272
358325
|
required: ['org', 'privacy'],
|
|
358273
358326
|
},
|
|
358274
358327
|
],
|
|
@@ -358293,6 +358346,15 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
|
358293
358346
|
{
|
|
358294
358347
|
type: 'object',
|
|
358295
358348
|
properties: {
|
|
358349
|
+
name: {
|
|
358350
|
+
type: 'string',
|
|
358351
|
+
},
|
|
358352
|
+
tfStateKey: {
|
|
358353
|
+
$ref: 'firestartr.dev://common/TerraformStateKey',
|
|
358354
|
+
},
|
|
358355
|
+
sync: {
|
|
358356
|
+
$ref: 'firestartr.dev://common/FirestartrGithubSync',
|
|
358357
|
+
},
|
|
358296
358358
|
role: {
|
|
358297
358359
|
type: 'string',
|
|
358298
358360
|
enum: ['admin', 'member'],
|
|
@@ -358301,6 +358363,7 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
|
358301
358363
|
$ref: 'firestartr.dev://common/ClaimName',
|
|
358302
358364
|
},
|
|
358303
358365
|
},
|
|
358366
|
+
additionalProperties: false,
|
|
358304
358367
|
required: ['org', 'role'],
|
|
358305
358368
|
},
|
|
358306
358369
|
],
|
|
@@ -358331,14 +358394,125 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
|
358331
358394
|
type: 'string',
|
|
358332
358395
|
description: 'The github repo name',
|
|
358333
358396
|
},
|
|
358397
|
+
tfStateKey: {
|
|
358398
|
+
$ref: 'firestartr.dev://common/TerraformStateKey',
|
|
358399
|
+
},
|
|
358334
358400
|
orgPermissions: {
|
|
358335
358401
|
type: 'string',
|
|
358336
358402
|
description: 'The level of org Permission',
|
|
358337
358403
|
},
|
|
358404
|
+
sync: {
|
|
358405
|
+
$ref: 'firestartr.dev://common/FirestartrGithubSync',
|
|
358406
|
+
},
|
|
358407
|
+
technology: {
|
|
358408
|
+
type: 'object',
|
|
358409
|
+
properties: {
|
|
358410
|
+
stack: { type: 'string' },
|
|
358411
|
+
version: { type: 'string' },
|
|
358412
|
+
},
|
|
358413
|
+
additionalProperties: false,
|
|
358414
|
+
required: ['stack', 'version'],
|
|
358415
|
+
},
|
|
358416
|
+
defaultBranch: {
|
|
358417
|
+
type: 'string',
|
|
358418
|
+
},
|
|
358419
|
+
branchStrategy: {
|
|
358420
|
+
type: 'object',
|
|
358421
|
+
description: 'A branch strategy for a claim',
|
|
358422
|
+
properties: {
|
|
358423
|
+
name: {
|
|
358424
|
+
type: 'string',
|
|
358425
|
+
},
|
|
358426
|
+
defaultBranch: {
|
|
358427
|
+
type: 'string',
|
|
358428
|
+
},
|
|
358429
|
+
},
|
|
358430
|
+
additionalProperties: false,
|
|
358431
|
+
required: ['name'],
|
|
358432
|
+
},
|
|
358433
|
+
additionalBranches: {
|
|
358434
|
+
type: 'array',
|
|
358435
|
+
items: {
|
|
358436
|
+
type: 'object',
|
|
358437
|
+
properties: {
|
|
358438
|
+
name: { type: 'string' },
|
|
358439
|
+
orphan: { type: 'boolean' },
|
|
358440
|
+
},
|
|
358441
|
+
additionalProperties: false,
|
|
358442
|
+
required: ['name', 'orphan'],
|
|
358443
|
+
},
|
|
358444
|
+
},
|
|
358445
|
+
actions: {
|
|
358446
|
+
type: 'object',
|
|
358447
|
+
description: 'Actions configuration',
|
|
358448
|
+
properties: {
|
|
358449
|
+
oidc: {
|
|
358450
|
+
type: 'object',
|
|
358451
|
+
properties: {
|
|
358452
|
+
useDefault: { type: 'boolean' },
|
|
358453
|
+
includeClaimKeys: {
|
|
358454
|
+
type: 'array',
|
|
358455
|
+
items: { type: 'string' },
|
|
358456
|
+
},
|
|
358457
|
+
},
|
|
358458
|
+
additionalProperties: false,
|
|
358459
|
+
},
|
|
358460
|
+
},
|
|
358461
|
+
additionalProperties: false,
|
|
358462
|
+
required: ['oidc'],
|
|
358463
|
+
},
|
|
358338
358464
|
archiveOnDestroy: {
|
|
358339
358465
|
type: 'boolean',
|
|
358340
358466
|
description: 'whether this repo should be archived when the claim is deleted',
|
|
358341
358467
|
},
|
|
358468
|
+
allowMergeCommit: {
|
|
358469
|
+
type: 'boolean',
|
|
358470
|
+
},
|
|
358471
|
+
allowSquashMerge: {
|
|
358472
|
+
type: 'boolean',
|
|
358473
|
+
},
|
|
358474
|
+
allowRebaseMerge: {
|
|
358475
|
+
type: 'boolean',
|
|
358476
|
+
},
|
|
358477
|
+
allowAutoMerge: {
|
|
358478
|
+
type: 'boolean',
|
|
358479
|
+
},
|
|
358480
|
+
deleteBranchOnMerge: {
|
|
358481
|
+
type: 'boolean',
|
|
358482
|
+
},
|
|
358483
|
+
autoInit: {
|
|
358484
|
+
type: 'boolean',
|
|
358485
|
+
},
|
|
358486
|
+
allowUpdateBranch: {
|
|
358487
|
+
type: 'boolean',
|
|
358488
|
+
},
|
|
358489
|
+
hasIssues: {
|
|
358490
|
+
type: 'boolean',
|
|
358491
|
+
},
|
|
358492
|
+
hasWiki: {
|
|
358493
|
+
type: 'boolean',
|
|
358494
|
+
},
|
|
358495
|
+
pages: {
|
|
358496
|
+
type: 'object',
|
|
358497
|
+
properties: {
|
|
358498
|
+
cname: { type: 'string' },
|
|
358499
|
+
source: {
|
|
358500
|
+
type: 'object',
|
|
358501
|
+
properties: {
|
|
358502
|
+
branch: { type: 'string' },
|
|
358503
|
+
path: { type: 'string' },
|
|
358504
|
+
},
|
|
358505
|
+
additionalProperties: false,
|
|
358506
|
+
},
|
|
358507
|
+
},
|
|
358508
|
+
additionalProperties: false,
|
|
358509
|
+
},
|
|
358510
|
+
additionalRules: {
|
|
358511
|
+
type: 'array',
|
|
358512
|
+
items: {
|
|
358513
|
+
$ref: 'firestartr.dev://common/FirestartrGithubRules',
|
|
358514
|
+
},
|
|
358515
|
+
},
|
|
358342
358516
|
visibility: {
|
|
358343
358517
|
type: 'string',
|
|
358344
358518
|
enum: ['private', 'public', 'internal'],
|
|
@@ -358367,8 +358541,14 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
|
358367
358541
|
pattern: '^[a-z0-9][a-z0-9-]*$',
|
|
358368
358542
|
},
|
|
358369
358543
|
},
|
|
358544
|
+
overrides: {
|
|
358545
|
+
type: 'object',
|
|
358546
|
+
properties: {},
|
|
358547
|
+
additionalProperties: true,
|
|
358548
|
+
},
|
|
358370
358549
|
},
|
|
358371
|
-
|
|
358550
|
+
additionalProperties: false,
|
|
358551
|
+
required: ['visibility', 'org', 'branchStrategy'],
|
|
358372
358552
|
},
|
|
358373
358553
|
],
|
|
358374
358554
|
},
|
|
@@ -358390,6 +358570,12 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
|
358390
358570
|
{
|
|
358391
358571
|
type: 'object',
|
|
358392
358572
|
properties: {
|
|
358573
|
+
name: {
|
|
358574
|
+
type: 'string',
|
|
358575
|
+
},
|
|
358576
|
+
tfStateKey: {
|
|
358577
|
+
$ref: 'firestartr.dev://common/TerraformStateKey',
|
|
358578
|
+
},
|
|
358393
358579
|
orgName: {
|
|
358394
358580
|
$ref: 'firestartr.dev://common/ClaimName',
|
|
358395
358581
|
},
|
|
@@ -358420,9 +358606,11 @@ const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createReq
|
|
|
358420
358606
|
},
|
|
358421
358607
|
},
|
|
358422
358608
|
},
|
|
358609
|
+
additionalProperties: false,
|
|
358423
358610
|
required: ['url', 'contentType', 'events', 'secretRef'],
|
|
358424
358611
|
},
|
|
358425
358612
|
},
|
|
358613
|
+
additionalProperties: false,
|
|
358426
358614
|
required: ['orgName', 'webhook'],
|
|
358427
358615
|
},
|
|
358428
358616
|
],
|
|
@@ -358626,6 +358814,9 @@ const GithubSchemas = [
|
|
|
358626
358814
|
name: {
|
|
358627
358815
|
type: 'string',
|
|
358628
358816
|
},
|
|
358817
|
+
tfStateKey: {
|
|
358818
|
+
$ref: 'firestartr.dev://common/TerraformStateKey',
|
|
358819
|
+
},
|
|
358629
358820
|
source: {
|
|
358630
358821
|
type: 'string',
|
|
358631
358822
|
enum: ['remote', 'inline', 'Remote', 'Inline'],
|
|
@@ -358717,6 +358908,7 @@ const GithubSchemas = [
|
|
|
358717
358908
|
additionalProperties: false,
|
|
358718
358909
|
},
|
|
358719
358910
|
},
|
|
358911
|
+
additionalProperties: false,
|
|
358720
358912
|
required: ['values', 'context', 'source', 'name'],
|
|
358721
358913
|
},
|
|
358722
358914
|
],
|
|
@@ -358849,6 +359041,7 @@ const ArgoCDSchemas = [argocd_schema];
|
|
|
358849
359041
|
enum: ['SecretStore', 'ClusterSecretStore'],
|
|
358850
359042
|
},
|
|
358851
359043
|
},
|
|
359044
|
+
additionalProperties: false,
|
|
358852
359045
|
required: ['name'],
|
|
358853
359046
|
},
|
|
358854
359047
|
ExternalSecretsSection: {
|
|
@@ -358884,6 +359077,9 @@ const ArgoCDSchemas = [argocd_schema];
|
|
|
358884
359077
|
template: { type: 'object' },
|
|
358885
359078
|
secretName: { type: 'string' },
|
|
358886
359079
|
refreshInterval: { type: 'string' },
|
|
359080
|
+
updatePolicy: { type: 'string' },
|
|
359081
|
+
deletionPolicy: { type: 'string' },
|
|
359082
|
+
conversionStrategy: { type: 'string' },
|
|
358887
359083
|
generator: {
|
|
358888
359084
|
type: 'object',
|
|
358889
359085
|
properties: {
|
|
@@ -358906,19 +359102,15 @@ const ArgoCDSchemas = [argocd_schema];
|
|
|
358906
359102
|
'Grafana',
|
|
358907
359103
|
],
|
|
358908
359104
|
},
|
|
358909
|
-
apiVersion: {
|
|
358910
|
-
|
|
358911
|
-
},
|
|
358912
|
-
conversionStrategy: {
|
|
358913
|
-
type: 'string',
|
|
358914
|
-
},
|
|
358915
|
-
outputKey: {
|
|
358916
|
-
type: 'string',
|
|
358917
|
-
},
|
|
359105
|
+
apiVersion: { type: 'string' },
|
|
359106
|
+
conversionStrategy: { type: 'string' },
|
|
359107
|
+
outputKey: { type: 'string' },
|
|
358918
359108
|
},
|
|
359109
|
+
additionalProperties: false,
|
|
358919
359110
|
required: ['name'],
|
|
358920
359111
|
},
|
|
358921
359112
|
},
|
|
359113
|
+
additionalProperties: false,
|
|
358922
359114
|
required: ['secretName', 'generator'],
|
|
358923
359115
|
},
|
|
358924
359116
|
},
|
|
@@ -366104,7 +366296,7 @@ function importedsRefsWalker(renderClaim) {
|
|
|
366104
366296
|
// the property can be another object, an array, or a primitive value
|
|
366105
366297
|
// has a function to resolve
|
|
366106
366298
|
// has to be an array of functions with
|
|
366107
|
-
// the following signature: (solver:
|
|
366299
|
+
// the following signature: (solver: (type: string, value: string) => Promise<string>) => Promise<void>
|
|
366108
366300
|
const symbolsToResolve = [];
|
|
366109
366301
|
walk(renderClaim.claim, symbolsToResolve, renderClaim);
|
|
366110
366302
|
return symbolsToResolve;
|
|
@@ -366132,15 +366324,15 @@ function walkObject(obj, symbolsToResolve, renderClaim) {
|
|
|
366132
366324
|
continue;
|
|
366133
366325
|
}
|
|
366134
366326
|
const type = match.groups?.type;
|
|
366135
|
-
const
|
|
366327
|
+
const capturedKey = key;
|
|
366136
366328
|
if (type) {
|
|
366137
366329
|
cdk8s_renderer_src_logger.info(`Found an imported-ref in the claim with key ${key} and value ${value}. This will be resolved later.`);
|
|
366138
366330
|
symbolsToResolve.push(async (solver) => {
|
|
366139
|
-
const resolvedValue = await solver(type, match.groups?.value);
|
|
366331
|
+
const resolvedValue = await solver(type, match.groups?.value ?? '');
|
|
366140
366332
|
cdk8s_renderer_src_logger.info(`Resolved imported-ref with key ${key} and value ${value} to ${resolvedValue} in path ${renderClaim.claimPath}`);
|
|
366141
|
-
obj[
|
|
366333
|
+
obj[capturedKey] = resolvedValue;
|
|
366142
366334
|
if (!renderClaim.claimPath) {
|
|
366143
|
-
throw new Error(
|
|
366335
|
+
throw new Error(`claimPath is required to write the claim after resolving imported refs in ${capturedKey}`);
|
|
366144
366336
|
}
|
|
366145
366337
|
await catalog_common.io.writeClaim(renderClaim.claim, renderClaim.claimPath);
|
|
366146
366338
|
});
|
|
@@ -366162,12 +366354,15 @@ function walkArray(arr, symbolsToResolve, renderClaim) {
|
|
|
366162
366354
|
cdk8s_renderer_src_logger.info(`Found an imported-ref in the claim with value ${value}. This will be resolved later.`);
|
|
366163
366355
|
const type = match.groups?.type;
|
|
366164
366356
|
if (type) {
|
|
366165
|
-
const
|
|
366357
|
+
const capturedIndex = i;
|
|
366166
366358
|
symbolsToResolve.push(async (solver) => {
|
|
366167
|
-
const resolvedValue = await solver(type, match.groups?.value);
|
|
366359
|
+
const resolvedValue = await solver(type, match.groups?.value ?? '');
|
|
366168
366360
|
cdk8s_renderer_src_logger.info(`Resolved imported-ref with value ${value} to ${resolvedValue} in path ${renderClaim.claimPath}`);
|
|
366169
|
-
arr[
|
|
366170
|
-
|
|
366361
|
+
arr[capturedIndex] = resolvedValue;
|
|
366362
|
+
if (!renderClaim.claimPath) {
|
|
366363
|
+
throw new Error(`claimPath is required to write the claim after resolving imported refs in ${capturedIndex}`);
|
|
366364
|
+
}
|
|
366365
|
+
await catalog_common.io.writeClaim(renderClaim.claim, renderClaim.claimPath);
|
|
366171
366366
|
});
|
|
366172
366367
|
}
|
|
366173
366368
|
}
|
|
@@ -366182,6 +366377,8 @@ function walkArray(arr, symbolsToResolve, renderClaim) {
|
|
|
366182
366377
|
|
|
366183
366378
|
|
|
366184
366379
|
|
|
366380
|
+
|
|
366381
|
+
|
|
366185
366382
|
/*
|
|
366186
366383
|
* Function called when rendering from the importer class.
|
|
366187
366384
|
*
|
|
@@ -366195,6 +366392,17 @@ function walkArray(arr, symbolsToResolve, renderClaim) {
|
|
|
366195
366392
|
*
|
|
366196
366393
|
*/
|
|
366197
366394
|
async function renderFromImports(rClaims, crs = {}, catalogOutputDir = '/tmp/.catalog', crOutputDir = '/tmp/.resources') {
|
|
366395
|
+
// Apply claim defaults (same as runRenderer path does via loadClaim/patchClaim)
|
|
366396
|
+
try {
|
|
366397
|
+
const defaults = loadClaimDefaults();
|
|
366398
|
+
for (const renderClaim of Object.values(rClaims)) {
|
|
366399
|
+
renderClaim.claim = loader_patchClaim(renderClaim.claim, defaults);
|
|
366400
|
+
validateClaim(renderClaim.claim);
|
|
366401
|
+
}
|
|
366402
|
+
}
|
|
366403
|
+
catch (e) {
|
|
366404
|
+
cdk8s_renderer_src_logger.warn(`Could not apply claim defaults: ${e.message}`);
|
|
366405
|
+
}
|
|
366198
366406
|
// type: is the kind of the claim
|
|
366199
366407
|
// value: is the imported-ref (the name in Github, can be with special characters, spaces, etc)
|
|
366200
366408
|
const fSolver = (type, value) => {
|
|
@@ -366779,7 +366987,7 @@ class MemberGithubDecanter extends GithubDecanter {
|
|
|
366779
366987
|
this.claim = {
|
|
366780
366988
|
kind: this.claimKind,
|
|
366781
366989
|
version: this.VERSION(),
|
|
366782
|
-
name: this.data.memberDetails.login,
|
|
366990
|
+
name: this.data.memberDetails.login.toLowerCase(),
|
|
366783
366991
|
profile: {
|
|
366784
366992
|
displayName: this.data.memberDetails.login,
|
|
366785
366993
|
email: this.data.memberDetails.email
|
|
@@ -366836,10 +367044,26 @@ MemberCollectionGithubDecanter.collectionKind = 'gh-members';
|
|
|
366836
367044
|
applyCollectionMixins(MemberCollectionGithubDecanter);
|
|
366837
367045
|
/* harmony default export */ const github_member_collection = (MemberCollectionGithubDecanter);
|
|
366838
367046
|
|
|
367047
|
+
;// CONCATENATED MODULE: ../importer/src/utils/nomicon.ts
|
|
367048
|
+
function transformRepoName(repoName) {
|
|
367049
|
+
// Convert to lowercase
|
|
367050
|
+
let transformedName = repoName.toLowerCase();
|
|
367051
|
+
const specialCharsRegex = /[._]/g;
|
|
367052
|
+
if (specialCharsRegex.test(transformedName)) {
|
|
367053
|
+
transformedName = transformedName.replace(/[._]/g, '');
|
|
367054
|
+
// we add a random 2 letter suffix
|
|
367055
|
+
return (transformedName + '-imp-.' + Math.random().toString(36).substring(2, 4));
|
|
367056
|
+
}
|
|
367057
|
+
else {
|
|
367058
|
+
return transformedName;
|
|
367059
|
+
}
|
|
367060
|
+
}
|
|
367061
|
+
|
|
366839
367062
|
;// CONCATENATED MODULE: ../importer/src/decanter/gh/github_repo.ts
|
|
366840
367063
|
|
|
366841
367064
|
|
|
366842
367065
|
|
|
367066
|
+
|
|
366843
367067
|
const TYPE_MAP = {
|
|
366844
367068
|
User: 'user',
|
|
366845
367069
|
Team: 'group',
|
|
@@ -366857,7 +367081,7 @@ class RepoGithubDecanter extends GithubDecanter {
|
|
|
366857
367081
|
version: this.VERSION(),
|
|
366858
367082
|
type: 'service',
|
|
366859
367083
|
lifecycle: 'production',
|
|
366860
|
-
name: this.data.repoDetails.name,
|
|
367084
|
+
name: transformRepoName(this.data.repoDetails.name),
|
|
366861
367085
|
};
|
|
366862
367086
|
}
|
|
366863
367087
|
__decantProviders() {
|
|
@@ -366919,7 +367143,7 @@ class RepoGithubDecanter extends GithubDecanter {
|
|
|
366919
367143
|
const outsideMaintainers = this.data.teamsAndMembers.outsideMembers
|
|
366920
367144
|
.filter((member) => member.role === 'maintain')
|
|
366921
367145
|
.map((member) => {
|
|
366922
|
-
return `collaborator:${member.name}`;
|
|
367146
|
+
return `collaborator:${member.name.toLowerCase()}`;
|
|
366923
367147
|
});
|
|
366924
367148
|
const teamMaintainers = this.data.teamsAndMembers.teams
|
|
366925
367149
|
.filter((team) => team.role === 'maintain')
|
|
@@ -366944,7 +367168,7 @@ class RepoGithubDecanter extends GithubDecanter {
|
|
|
366944
367168
|
const outsideAdmins = this.data.teamsAndMembers.outsideMembers
|
|
366945
367169
|
.filter((member) => member.role === 'admin')
|
|
366946
367170
|
.map((member) => {
|
|
366947
|
-
return `collaborator:${member.name}`;
|
|
367171
|
+
return `collaborator:${member.name.toLowerCase()}`;
|
|
366948
367172
|
});
|
|
366949
367173
|
const teamAdmins = this.data.teamsAndMembers.teams
|
|
366950
367174
|
.filter((team) => team.role === 'admin')
|
|
@@ -366953,13 +367177,6 @@ class RepoGithubDecanter extends GithubDecanter {
|
|
|
366953
367177
|
});
|
|
366954
367178
|
const admins = directAdmins.concat(outsideAdmins).concat(teamAdmins);
|
|
366955
367179
|
const overrides = {};
|
|
366956
|
-
if (admins && admins.length > 0) {
|
|
366957
|
-
this.__patchClaim({
|
|
366958
|
-
op: 'add',
|
|
366959
|
-
value: admins[0],
|
|
366960
|
-
path: '/owner',
|
|
366961
|
-
});
|
|
366962
|
-
}
|
|
366963
367180
|
if (admins && admins.length > 1) {
|
|
366964
367181
|
overrides['additionalAdmins'] = [];
|
|
366965
367182
|
for (let i = 1; i < admins.length; i++) {
|
|
@@ -366979,7 +367196,7 @@ class RepoGithubDecanter extends GithubDecanter {
|
|
|
366979
367196
|
const outsideWriters = this.data.teamsAndMembers.outsideMembers
|
|
366980
367197
|
.filter((member) => member.role === 'push')
|
|
366981
367198
|
.map((member) => {
|
|
366982
|
-
return `collaborator:${member.name}`;
|
|
367199
|
+
return `collaborator:${member.name.toLowerCase()}`;
|
|
366983
367200
|
});
|
|
366984
367201
|
const teamWriters = this.data.teamsAndMembers.teams
|
|
366985
367202
|
.filter((team) => ['push', 'write'].includes(team.role))
|
|
@@ -367003,7 +367220,7 @@ class RepoGithubDecanter extends GithubDecanter {
|
|
|
367003
367220
|
const outsideReaders = this.data.teamsAndMembers.outsideMembers
|
|
367004
367221
|
.filter((member) => member.role === 'pull')
|
|
367005
367222
|
.map((member) => {
|
|
367006
|
-
return `collaborator:${member.name}`;
|
|
367223
|
+
return `collaborator:${member.name.toLowerCase()}`;
|
|
367007
367224
|
});
|
|
367008
367225
|
const teamReaders = this.data.teamsAndMembers.teams
|
|
367009
367226
|
.filter((team) => ['pull', 'read'].includes(team.role))
|
|
@@ -367686,6 +367903,25 @@ function definitions_getPluralFromKind(kind) {
|
|
|
367686
367903
|
const plural = Object.keys(kindPluralMap).find((key) => kindPluralMap[key] === kind);
|
|
367687
367904
|
return plural;
|
|
367688
367905
|
}
|
|
367906
|
+
const DAY_SECONDS = 24 * 60 * 60;
|
|
367907
|
+
const TIMEOUTS = {
|
|
367908
|
+
// expressed in seconds
|
|
367909
|
+
RENAMED: DAY_SECONDS,
|
|
367910
|
+
UPDATED: DAY_SECONDS,
|
|
367911
|
+
CREATED: DAY_SECONDS,
|
|
367912
|
+
RETRY: 120 * 60,
|
|
367913
|
+
MARKED_TO_DELETION: DAY_SECONDS,
|
|
367914
|
+
SYNC: DAY_SECONDS,
|
|
367915
|
+
NOTHING: 10,
|
|
367916
|
+
};
|
|
367917
|
+
function getTimeoutForOperation(operation) {
|
|
367918
|
+
if (operation in TIMEOUTS) {
|
|
367919
|
+
return TIMEOUTS[operation];
|
|
367920
|
+
}
|
|
367921
|
+
else {
|
|
367922
|
+
throw new Error(`getTimeoutForOperation: Unknown operation: ${operation}`);
|
|
367923
|
+
}
|
|
367924
|
+
}
|
|
367689
367925
|
|
|
367690
367926
|
;// CONCATENATED MODULE: ../operator/src/pr-annotation.ts
|
|
367691
367927
|
|
|
@@ -369197,6 +369433,19 @@ function enqueue(pluralKind, workItem, queue, compute, syncCtl, retryCtl) {
|
|
|
369197
369433
|
itemPath: () => informer_itemPath(pluralKind, workItem.item),
|
|
369198
369434
|
error: () => retryCtl.errorReconciling(informer_itemPath(pluralKind, workItem.item)),
|
|
369199
369435
|
success: () => retryCtl.successReconciling(informer_itemPath(pluralKind, workItem.item)),
|
|
369436
|
+
recommendedTimeout: () => {
|
|
369437
|
+
const customTimeoutAnnotation = catalog_common.generic.getFirestartrAnnotation('test-custom-timeout');
|
|
369438
|
+
let customTimeout = null;
|
|
369439
|
+
if ('annotations' in workItem.item.metadata &&
|
|
369440
|
+
customTimeoutAnnotation in workItem.item.metadata.annotations &&
|
|
369441
|
+
!isNaN(parseInt(workItem.item.metadata.annotations[customTimeoutAnnotation]))) {
|
|
369442
|
+
customTimeout = parseInt(workItem.item.metadata.annotations[customTimeoutAnnotation]);
|
|
369443
|
+
}
|
|
369444
|
+
else {
|
|
369445
|
+
customTimeout = getTimeoutForOperation(workItem.operation);
|
|
369446
|
+
}
|
|
369447
|
+
return customTimeout;
|
|
369448
|
+
},
|
|
369200
369449
|
needsBlocking: (item, operation) => {
|
|
369201
369450
|
if (kindsWithDependants.indexOf(item.kind) === -1) {
|
|
369202
369451
|
return false;
|
|
@@ -370049,16 +370298,6 @@ function getQueueMetrics() {
|
|
|
370049
370298
|
// "FirestartrGithubRepositoryFeature": 1,
|
|
370050
370299
|
// "FirestartrTerraformWorkspacePlan": 1,
|
|
370051
370300
|
// }
|
|
370052
|
-
const TIMEOUTS = {
|
|
370053
|
-
// expressed in seconds
|
|
370054
|
-
RENAMED: 30 * 60,
|
|
370055
|
-
UPDATED: 60 * 60,
|
|
370056
|
-
CREATED: 60 * 60,
|
|
370057
|
-
RETRY: 60 * 60,
|
|
370058
|
-
MARKED_TO_DELETION: 60 * 60,
|
|
370059
|
-
SYNC: 60 * 60,
|
|
370060
|
-
NOTHING: 10,
|
|
370061
|
-
};
|
|
370062
370301
|
let INIT = false;
|
|
370063
370302
|
/**
|
|
370064
370303
|
* Pushes a WorkItem to the queue
|
|
@@ -370096,27 +370335,12 @@ async function processItem_loop() {
|
|
|
370096
370335
|
if (w) {
|
|
370097
370336
|
const logMessage = `${new Date().toISOString()} : Processing OPERATION: ${w.operation} ITEM: ${w.item.kind}/${w.item.metadata.name}`;
|
|
370098
370337
|
catalog_common.io.writeLogFile('process_item', logMessage);
|
|
370099
|
-
const timeout = createTimeout(w);
|
|
370100
370338
|
operator_src_logger.info(`The processor is currently handling a '${w.operation}' operation for item '${w.item.kind}/${w.item.metadata.name}' in namespace '${w.item.metadata.namespace}'. The current work status is '${w.workStatus}'.`);
|
|
370101
370339
|
await runWorkItem(w);
|
|
370102
|
-
clearTimeout(timeout);
|
|
370103
370340
|
}
|
|
370104
370341
|
await processItem_wait();
|
|
370105
370342
|
}
|
|
370106
370343
|
}
|
|
370107
|
-
/**
|
|
370108
|
-
* Creates a timeout for a workItem
|
|
370109
|
-
*
|
|
370110
|
-
*
|
|
370111
|
-
**/
|
|
370112
|
-
function createTimeout(w) {
|
|
370113
|
-
return setTimeout(() => {
|
|
370114
|
-
//throw new Error('Timeout on workitem ' + w);
|
|
370115
|
-
console.error('Timeout on workitem %O', w);
|
|
370116
|
-
operator_src_logger.error(`The processor timed out while handling a '${w.operation}' operation for item '${w.item.kind}/${w.item.metadata.name}' in namespace '${w.item.metadata.namespace}'. The current work status is '${w.workStatus}'.`);
|
|
370117
|
-
process.exit(1);
|
|
370118
|
-
}, TIMEOUTS[w.operation] * 1000);
|
|
370119
|
-
}
|
|
370120
370344
|
/**
|
|
370121
370345
|
* Sorts the queue based on the operation type
|
|
370122
370346
|
* @param {WorkItem[]} queue - store of WorkItems
|
|
@@ -370408,7 +370632,7 @@ function provisionCodeowners(scope, repo, branchDefault, fsGithubRepository) {
|
|
|
370408
370632
|
const config = {
|
|
370409
370633
|
dependsOn: [repo, branchDefault],
|
|
370410
370634
|
branch: fsGithubRepository.spec.repo.defaultBranch,
|
|
370411
|
-
commitMessage: '
|
|
370635
|
+
commitMessage: 'ci: provision CODEOWNERS file',
|
|
370412
370636
|
content: fsGithubRepository.spec.repo.codeowners,
|
|
370413
370637
|
file: '.github/CODEOWNERS',
|
|
370414
370638
|
overwriteOnCreate: true,
|
|
@@ -370714,7 +370938,7 @@ function provisionFeatureFiles(scope, feature) {
|
|
|
370714
370938
|
: {};
|
|
370715
370939
|
const repoConfig = {
|
|
370716
370940
|
branch: file.targetBranch || defaultBranchName,
|
|
370717
|
-
commitMessage: `
|
|
370941
|
+
commitMessage: `ci: ${feature.spec.type} ${feature.spec.version}`,
|
|
370718
370942
|
content: cdktf_lib.Fn.base64decode(file.content),
|
|
370719
370943
|
file: file.path,
|
|
370720
370944
|
repository: feature.resolveRef(feature.spec.repositoryTarget.ref),
|
|
@@ -373105,11 +373329,82 @@ class TFPlanItemVersion extends TFPlanItem {
|
|
|
373105
373329
|
|
|
373106
373330
|
/* harmony default export */ const terraform_provisioner_src_logger = (catalog_common.logger);
|
|
373107
373331
|
|
|
373332
|
+
;// CONCATENATED MODULE: ../terraform_provisioner/src/process_handler.ts
|
|
373333
|
+
|
|
373334
|
+
const GRACE_PERIOD = 60 * 2; // 2 min
|
|
373335
|
+
const HARD_RESET_PERIOD = 10; // 10 sec
|
|
373336
|
+
function processHandler(processToHandle, ctl, onTimedOut) {
|
|
373337
|
+
let gracefulResetId;
|
|
373338
|
+
let hardResetId;
|
|
373339
|
+
let callerNotified = false;
|
|
373340
|
+
let timedOut = false;
|
|
373341
|
+
const safeKill = (signal) => {
|
|
373342
|
+
try {
|
|
373343
|
+
const sent = processToHandle.kill(signal);
|
|
373344
|
+
if (!sent) {
|
|
373345
|
+
throw new Error(`Failed to send signal ${signal} to the process`);
|
|
373346
|
+
}
|
|
373347
|
+
}
|
|
373348
|
+
catch (error) {
|
|
373349
|
+
terraform_provisioner_src_logger.error(`FATAL: timeout signal ${signal} could not be delivered to the process: ${error}`);
|
|
373350
|
+
if (!callerNotified) {
|
|
373351
|
+
ctl.processKilled(false);
|
|
373352
|
+
callerNotified = true;
|
|
373353
|
+
}
|
|
373354
|
+
}
|
|
373355
|
+
};
|
|
373356
|
+
const terminateId = setTimeout(() => {
|
|
373357
|
+
// we take control of the process
|
|
373358
|
+
onTimedOut();
|
|
373359
|
+
timedOut = true;
|
|
373360
|
+
// send sigInt
|
|
373361
|
+
terraform_provisioner_src_logger.error(`Terraform process has not exited after initial timeout of ${ctl.hardTimeout} seconds, sending SIGINT...`);
|
|
373362
|
+
safeKill('SIGINT');
|
|
373363
|
+
// grace period
|
|
373364
|
+
gracefulResetId = setTimeout(() => {
|
|
373365
|
+
terraform_provisioner_src_logger.error(`Terraform process has not exited after SIGINT grace period of ${GRACE_PERIOD} seconds (total elapsed ~${ctl.hardTimeout + GRACE_PERIOD} seconds), sending SIGTERM...`);
|
|
373366
|
+
safeKill('SIGTERM');
|
|
373367
|
+
// hard reset period
|
|
373368
|
+
hardResetId = setTimeout(() => {
|
|
373369
|
+
terraform_provisioner_src_logger.error(`Terraform process has not exited after SIGTERM hard reset period of ${HARD_RESET_PERIOD} seconds (total elapsed ~${ctl.hardTimeout + GRACE_PERIOD + HARD_RESET_PERIOD} seconds), sending SIGKILL...`);
|
|
373370
|
+
safeKill('SIGKILL');
|
|
373371
|
+
setTimeout(() => {
|
|
373372
|
+
// we send if the process was killed or not to the caller
|
|
373373
|
+
if (!callerNotified) {
|
|
373374
|
+
ctl.processKilled(processToHandle.killed);
|
|
373375
|
+
callerNotified = true;
|
|
373376
|
+
}
|
|
373377
|
+
}, 10 * 1000);
|
|
373378
|
+
}, HARD_RESET_PERIOD * 1000);
|
|
373379
|
+
}, GRACE_PERIOD * 1000);
|
|
373380
|
+
}, ctl.hardTimeout * 1000);
|
|
373381
|
+
processToHandle.on('exit', () => {
|
|
373382
|
+
// the process has exited
|
|
373383
|
+
// let's clear all the timeouts
|
|
373384
|
+
if (terminateId) {
|
|
373385
|
+
clearTimeout(terminateId);
|
|
373386
|
+
}
|
|
373387
|
+
if (gracefulResetId) {
|
|
373388
|
+
clearTimeout(gracefulResetId);
|
|
373389
|
+
}
|
|
373390
|
+
if (hardResetId) {
|
|
373391
|
+
clearTimeout(hardResetId);
|
|
373392
|
+
}
|
|
373393
|
+
// we inform the caller
|
|
373394
|
+
// if the process exited and the timeout control has kicked-off
|
|
373395
|
+
if (!callerNotified && timedOut) {
|
|
373396
|
+
ctl.processKilled(true);
|
|
373397
|
+
callerNotified = true;
|
|
373398
|
+
}
|
|
373399
|
+
});
|
|
373400
|
+
}
|
|
373401
|
+
|
|
373108
373402
|
;// CONCATENATED MODULE: ../terraform_provisioner/src/utils.ts
|
|
373109
373403
|
|
|
373110
373404
|
|
|
373111
373405
|
|
|
373112
373406
|
|
|
373407
|
+
|
|
373113
373408
|
async function utils_validate(path, secrets) {
|
|
373114
373409
|
return await tfExec(path, ['validate'], secrets);
|
|
373115
373410
|
}
|
|
@@ -373119,28 +373414,28 @@ async function init(path, secrets, stream) {
|
|
|
373119
373414
|
async function initFromModule(path, source, secrets, stream) {
|
|
373120
373415
|
return tfExec(path, ['init', `-from-module=${source}`], secrets, [], stream);
|
|
373121
373416
|
}
|
|
373122
|
-
async function plan(path, secrets, format, args = ['plan'], stream) {
|
|
373417
|
+
async function plan(path, secrets, format, args = ['plan'], stream, ctl) {
|
|
373123
373418
|
terraform_provisioner_src_logger.info(`Running terraform plan with ${format} in path ${path}`);
|
|
373124
|
-
const plan = await tfExec(path, args.concat(format === 'json' ? ['-json'] : []), secrets, ['-input=false'], stream);
|
|
373419
|
+
const plan = await tfExec(path, args.concat(format === 'json' ? ['-json'] : []), secrets, ['-input=false'], stream, ctl);
|
|
373125
373420
|
if (format === 'json') {
|
|
373126
373421
|
const tfPlan = planGet(plan);
|
|
373127
373422
|
return tfPlan;
|
|
373128
373423
|
}
|
|
373129
373424
|
return plan;
|
|
373130
373425
|
}
|
|
373131
|
-
async function apply(path, secrets, stream) {
|
|
373426
|
+
async function apply(path, secrets, stream, ctl) {
|
|
373132
373427
|
terraform_provisioner_src_logger.debug(`Running terraform apply in path ${path}`);
|
|
373133
|
-
return await tfExec(path, ['apply', '-auto-approve'], secrets, ['-input=false'], stream);
|
|
373428
|
+
return await tfExec(path, ['apply', '-auto-approve'], secrets, ['-input=false'], stream, ctl);
|
|
373134
373429
|
}
|
|
373135
|
-
async function destroy(path, secrets, stream) {
|
|
373430
|
+
async function destroy(path, secrets, stream, ctl) {
|
|
373136
373431
|
terraform_provisioner_src_logger.debug(`Running terraform destroy in path ${path}`);
|
|
373137
|
-
return await tfExec(path, ['destroy', '-auto-approve'], secrets, ['-input=false'], stream);
|
|
373432
|
+
return await tfExec(path, ['destroy', '-auto-approve'], secrets, ['-input=false'], stream, ctl);
|
|
373138
373433
|
}
|
|
373139
373434
|
async function output(path, secrets) {
|
|
373140
373435
|
terraform_provisioner_src_logger.debug(`Running terraform output in path ${path}`);
|
|
373141
373436
|
return await tfExec(path, ['output', '-json'], secrets, []);
|
|
373142
373437
|
}
|
|
373143
|
-
async function tfExec(path, args, secrets, extraArgs = ['-input=false'], stream) {
|
|
373438
|
+
async function tfExec(path, args, secrets, extraArgs = ['-input=false'], stream, ctl) {
|
|
373144
373439
|
return new Promise((ok, ko) => {
|
|
373145
373440
|
const tfProcess = (0,external_child_process_.spawn)('tofu', args.concat(extraArgs), {
|
|
373146
373441
|
cwd: path,
|
|
@@ -373150,6 +373445,7 @@ async function tfExec(path, args, secrets, extraArgs = ['-input=false'], stream)
|
|
|
373150
373445
|
let flagStdoutEnd = false;
|
|
373151
373446
|
let flagStderrEnd = false;
|
|
373152
373447
|
let outputErrors = '';
|
|
373448
|
+
let processTimeout = false;
|
|
373153
373449
|
tfProcess.stdout.on('data', (log) => {
|
|
373154
373450
|
const line = catalog_common.io.stripAnsi(log.toString());
|
|
373155
373451
|
output += line;
|
|
@@ -373170,12 +373466,21 @@ async function tfExec(path, args, secrets, extraArgs = ['-input=false'], stream)
|
|
|
373170
373466
|
});
|
|
373171
373467
|
tfProcess.on('exit', async (code) => {
|
|
373172
373468
|
let retryCount = 0;
|
|
373173
|
-
while (
|
|
373469
|
+
while (!flagStdoutEnd && !flagStderrEnd && retryCount < 10) {
|
|
373174
373470
|
retryCount++;
|
|
373175
373471
|
await catalog_common.generic.sleep(500);
|
|
373176
373472
|
}
|
|
373473
|
+
// this process has been killed/terminated
|
|
373474
|
+
// by timeout (not in our control)
|
|
373475
|
+
if (processTimeout) {
|
|
373476
|
+
terraform_provisioner_src_logger.error(`Terraform output ${path}: ${[output, outputErrors].join('')}`);
|
|
373477
|
+
ko(catalog_common.generic.buildCommandExecutionError([output, outputErrors, '\n<PROCESS TIMEOUT>'].join(''), catalog_common.generic.normalizeExitCode(code), args.concat(extraArgs), {
|
|
373478
|
+
errorName: 'TerraformCommandError',
|
|
373479
|
+
label: 'Terraform command',
|
|
373480
|
+
}));
|
|
373481
|
+
return;
|
|
373482
|
+
}
|
|
373177
373483
|
if (code !== 0) {
|
|
373178
|
-
terraform_provisioner_src_logger.error(`Terraform output ${path}: ${output + outputErrors}`);
|
|
373179
373484
|
terraform_provisioner_src_logger.error(`Terraform output ${path}: ${[output, outputErrors].join('')}`);
|
|
373180
373485
|
ko(catalog_common.generic.buildCommandExecutionError([output, outputErrors].join(''), catalog_common.generic.normalizeExitCode(code), args.concat(extraArgs), {
|
|
373181
373486
|
errorName: 'TerraformCommandError',
|
|
@@ -373187,6 +373492,13 @@ async function tfExec(path, args, secrets, extraArgs = ['-input=false'], stream)
|
|
|
373187
373492
|
ok(output);
|
|
373188
373493
|
}
|
|
373189
373494
|
});
|
|
373495
|
+
if (ctl) {
|
|
373496
|
+
void processHandler(tfProcess, ctl, () => {
|
|
373497
|
+
// callback to be called by the process handler
|
|
373498
|
+
// we set on our flag to avoid sending our own messages
|
|
373499
|
+
processTimeout = true;
|
|
373500
|
+
});
|
|
373501
|
+
}
|
|
373190
373502
|
});
|
|
373191
373503
|
}
|
|
373192
373504
|
async function configureGit(ghToken) {
|
|
@@ -373675,6 +373987,15 @@ class project_tf_TFProjectManager {
|
|
|
373675
373987
|
}
|
|
373676
373988
|
this.secrets = ctx.secrets;
|
|
373677
373989
|
}
|
|
373990
|
+
set ctl(ctl) {
|
|
373991
|
+
this._ctl = ctl;
|
|
373992
|
+
}
|
|
373993
|
+
get ctl() {
|
|
373994
|
+
return this._ctl;
|
|
373995
|
+
}
|
|
373996
|
+
getOutput() {
|
|
373997
|
+
return this.tfOutput;
|
|
373998
|
+
}
|
|
373678
373999
|
setStreamCallbacks(fnData, fnEnd, reopen = true) {
|
|
373679
374000
|
if (reopen || !this.stream)
|
|
373680
374001
|
this.stream = new external_stream_.PassThrough();
|
|
@@ -373683,9 +374004,6 @@ class project_tf_TFProjectManager {
|
|
|
373683
374004
|
});
|
|
373684
374005
|
this.stream.on('end', fnEnd);
|
|
373685
374006
|
}
|
|
373686
|
-
getOutput() {
|
|
373687
|
-
return this.tfOutput;
|
|
373688
|
-
}
|
|
373689
374007
|
async build() {
|
|
373690
374008
|
await this.mainTfWriter.render();
|
|
373691
374009
|
this.mainTfWriter.writeToTerraformProject(external_path_.join(this.projectPath, 'firestartr-main.tf'));
|
|
@@ -373712,7 +374030,7 @@ class project_tf_TFProjectManager {
|
|
|
373712
374030
|
await this.__init();
|
|
373713
374031
|
if (format === 'json')
|
|
373714
374032
|
this.tfOutput = null;
|
|
373715
|
-
this.tfOutput = await plan(this.projectPath, this.secrets, format, ['plan'], this.stream);
|
|
374033
|
+
this.tfOutput = await plan(this.projectPath, this.secrets, format, ['plan'], this.stream, this.ctl);
|
|
373716
374034
|
if (this.stream)
|
|
373717
374035
|
this.stream.end();
|
|
373718
374036
|
}
|
|
@@ -373720,17 +374038,17 @@ class project_tf_TFProjectManager {
|
|
|
373720
374038
|
await this.__init();
|
|
373721
374039
|
if (format === 'json')
|
|
373722
374040
|
this.tfOutput = null;
|
|
373723
|
-
this.tfOutput = await plan(this.projectPath, this.secrets, format, ['plan', '-destroy'], this.stream);
|
|
374041
|
+
this.tfOutput = await plan(this.projectPath, this.secrets, format, ['plan', '-destroy'], this.stream, this.ctl);
|
|
373724
374042
|
}
|
|
373725
374043
|
async apply() {
|
|
373726
374044
|
await this.__init();
|
|
373727
|
-
this.tfOutput += await apply(this.projectPath, this.secrets, this.stream);
|
|
374045
|
+
this.tfOutput += await apply(this.projectPath, this.secrets, this.stream, this.ctl);
|
|
373728
374046
|
if (this.stream)
|
|
373729
374047
|
this.stream.end();
|
|
373730
374048
|
}
|
|
373731
374049
|
async destroy() {
|
|
373732
374050
|
await this.__init();
|
|
373733
|
-
this.tfOutput += await destroy(this.projectPath, this.secrets, this.stream);
|
|
374051
|
+
this.tfOutput += await destroy(this.projectPath, this.secrets, this.stream, this.ctl);
|
|
373734
374052
|
if (this.stream)
|
|
373735
374053
|
this.stream.end();
|
|
373736
374054
|
}
|
|
@@ -373842,6 +374160,12 @@ class TFProjectManagerRemote {
|
|
|
373842
374160
|
}
|
|
373843
374161
|
this.tfVarsJsonWriter = new WriterTfVarsJson(ctx.values, ctx.references);
|
|
373844
374162
|
}
|
|
374163
|
+
set ctl(ctl) {
|
|
374164
|
+
this._ctl = ctl;
|
|
374165
|
+
}
|
|
374166
|
+
get ctl() {
|
|
374167
|
+
return this._ctl;
|
|
374168
|
+
}
|
|
373845
374169
|
getOutput() {
|
|
373846
374170
|
return this.tfOutput;
|
|
373847
374171
|
}
|
|
@@ -373890,23 +374214,23 @@ insteadOf = https://github.com`);
|
|
|
373890
374214
|
async plan(format) {
|
|
373891
374215
|
await this.__init();
|
|
373892
374216
|
if (format === 'json') {
|
|
373893
|
-
this.tfOutput = await plan(this.projectPath, this.secrets, format, ['plan'], this.stream);
|
|
374217
|
+
this.tfOutput = await plan(this.projectPath, this.secrets, format, ['plan'], this.stream, this.ctl);
|
|
373894
374218
|
}
|
|
373895
374219
|
else {
|
|
373896
|
-
this.tfOutput += await plan(this.projectPath, this.secrets, format, ['plan'], this.stream);
|
|
374220
|
+
this.tfOutput += await plan(this.projectPath, this.secrets, format, ['plan'], this.stream, this.ctl);
|
|
373897
374221
|
}
|
|
373898
374222
|
if (this.stream)
|
|
373899
374223
|
this.stream.end();
|
|
373900
374224
|
}
|
|
373901
374225
|
async apply() {
|
|
373902
374226
|
await this.__init();
|
|
373903
|
-
this.tfOutput += await apply(this.projectPath, this.secrets, this.stream);
|
|
374227
|
+
this.tfOutput += await apply(this.projectPath, this.secrets, this.stream, this.ctl);
|
|
373904
374228
|
if (this.stream)
|
|
373905
374229
|
this.stream.end();
|
|
373906
374230
|
}
|
|
373907
374231
|
async destroy() {
|
|
373908
374232
|
await this.__init();
|
|
373909
|
-
this.tfOutput += await destroy(this.projectPath, this.secrets, this.stream);
|
|
374233
|
+
this.tfOutput += await destroy(this.projectPath, this.secrets, this.stream, this.ctl);
|
|
373910
374234
|
if (this.stream)
|
|
373911
374235
|
this.stream.end();
|
|
373912
374236
|
}
|
|
@@ -373955,7 +374279,7 @@ async function run() {
|
|
|
373955
374279
|
await execCommand(command, tfProject);
|
|
373956
374280
|
}
|
|
373957
374281
|
// Programatic API
|
|
373958
|
-
async function runTerraformProvisioner(context, command = 'init', streaming) {
|
|
374282
|
+
async function runTerraformProvisioner(context, command = 'init', streaming, ctl) {
|
|
373959
374283
|
terraform_provisioner_src_logger.info(`Running command ${command} on a ${context.type} project`);
|
|
373960
374284
|
validateContext(context);
|
|
373961
374285
|
let tfProject = {};
|
|
@@ -373968,6 +374292,9 @@ async function runTerraformProvisioner(context, command = 'init', streaming) {
|
|
|
373968
374292
|
if (streaming) {
|
|
373969
374293
|
tfProject.setStreamCallbacks(streaming.fnData, streaming.fnEnd);
|
|
373970
374294
|
}
|
|
374295
|
+
if (ctl) {
|
|
374296
|
+
tfProject.ctl = ctl;
|
|
374297
|
+
}
|
|
373971
374298
|
const output = await execCommand(command, tfProject);
|
|
373972
374299
|
return output;
|
|
373973
374300
|
}
|
|
@@ -374212,7 +374539,17 @@ async function* doPlanJSONFormat(item, op, handler, setResult = function (_r) {
|
|
|
374212
374539
|
if (item.metadata.annotations['firestartr.dev/last-state-pr'] || false) {
|
|
374213
374540
|
await addPlanStatusCheck(item.metadata.annotations['firestartr.dev/last-state-pr'], 'Terraform plan in progress...');
|
|
374214
374541
|
}
|
|
374215
|
-
const tfPlan = await runTerraformProvisioner(context, planType
|
|
374542
|
+
const tfPlan = await runTerraformProvisioner(context, planType, null, {
|
|
374543
|
+
hardTimeout: handler.recommendedTimeout(),
|
|
374544
|
+
processKilled: (killed) => {
|
|
374545
|
+
if (killed) {
|
|
374546
|
+
operator_src_logger.error(`The Terraform process for item '${item.kind}/${item.metadata.name}' was killed due to a timeout.`);
|
|
374547
|
+
}
|
|
374548
|
+
else {
|
|
374549
|
+
operator_src_logger.error(`PANIC!!: The Terraform process for item '${item.kind}/${item.metadata.name}' could not be killed`);
|
|
374550
|
+
}
|
|
374551
|
+
},
|
|
374552
|
+
});
|
|
374216
374553
|
if (tfPlan.summary.hasChanges()) {
|
|
374217
374554
|
yield {
|
|
374218
374555
|
item,
|
|
@@ -374499,7 +374836,17 @@ async function* process_operation_markedToDeletion(item, op, handler) {
|
|
|
374499
374836
|
}
|
|
374500
374837
|
const deps = await handler.resolveReferences();
|
|
374501
374838
|
const context = buildProvisionerContext(item, deps);
|
|
374502
|
-
const destroyOutput = await runTerraformProvisioner(context, 'destroy'
|
|
374839
|
+
const destroyOutput = await runTerraformProvisioner(context, 'destroy', null, {
|
|
374840
|
+
hardTimeout: handler.recommendedTimeout(),
|
|
374841
|
+
processKilled: (killed) => {
|
|
374842
|
+
if (killed) {
|
|
374843
|
+
operator_src_logger.error(`The Terraform process for item '${item.kind}/${item.metadata.name}' was killed due to a timeout.`);
|
|
374844
|
+
}
|
|
374845
|
+
else {
|
|
374846
|
+
operator_src_logger.error(`PANIC!!: The Terraform process for item '${item.kind}/${item.metadata.name}' could not be killed`);
|
|
374847
|
+
}
|
|
374848
|
+
},
|
|
374849
|
+
});
|
|
374503
374850
|
yield {
|
|
374504
374851
|
item,
|
|
374505
374852
|
reason: op,
|
|
@@ -374610,7 +374957,17 @@ async function* process_operation_doApply(item, op, handler) {
|
|
|
374610
374957
|
const deps = await handler.resolveReferences();
|
|
374611
374958
|
operator_src_logger.info(`The Terraform processor is applying and assessing dependencies for item '${item.kind}/${item.metadata.name}' with dependencies: '${deps}'.`);
|
|
374612
374959
|
const context = buildProvisionerContext(item, deps);
|
|
374613
|
-
const applyOutput = await runTerraformProvisioner(context, 'apply', checkRunCtl
|
|
374960
|
+
const applyOutput = await runTerraformProvisioner(context, 'apply', checkRunCtl, {
|
|
374961
|
+
hardTimeout: handler.recommendedTimeout(),
|
|
374962
|
+
processKilled: (killed) => {
|
|
374963
|
+
if (killed) {
|
|
374964
|
+
operator_src_logger.error(`The Terraform process for item '${item.kind}/${item.metadata.name}' was killed due to a timeout.`);
|
|
374965
|
+
}
|
|
374966
|
+
else {
|
|
374967
|
+
operator_src_logger.error(`PANIC!!: The Terraform process for item '${item.kind}/${item.metadata.name}' could not be killed`);
|
|
374968
|
+
}
|
|
374969
|
+
},
|
|
374970
|
+
});
|
|
374614
374971
|
const terraformOutputJson = await runTerraformProvisioner(context, 'output');
|
|
374615
374972
|
if (!terraformOutputJson) {
|
|
374616
374973
|
throw new Error(`Terraform output is empty for ${item.kind}/${item.metadata.name}`);
|
|
@@ -376749,9 +377106,9 @@ const crs_analyzerSubcommand = {
|
|
|
376749
377106
|
};
|
|
376750
377107
|
|
|
376751
377108
|
;// CONCATENATED MODULE: ./package.json
|
|
376752
|
-
const package_namespaceObject = JSON.parse('{"i8":"1.59.0-snapshot-
|
|
377109
|
+
const package_namespaceObject = JSON.parse('{"i8":"1.59.0-snapshot-16"}');
|
|
376753
377110
|
;// CONCATENATED MODULE: ../../package.json
|
|
376754
|
-
const package_namespaceObject_1 = {"i8":"1.
|
|
377111
|
+
const package_namespaceObject_1 = {"i8":"1.59.3"};
|
|
376755
377112
|
;// CONCATENATED MODULE: ./src/subcommands/index.ts
|
|
376756
377113
|
|
|
376757
377114
|
|