@firestartr/cli 1.45.0-snapshot-17 → 1.45.0
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 +194 -119
- package/build/packages/cdk8s_renderer/src/claims/base/schemas/component.schema.d.ts +6 -0
- package/build/packages/cdk8s_renderer/src/claims/base/schemas/index.d.ts +12 -0
- package/build/packages/cdk8s_renderer/src/claims/base/schemas/tfworkspace.schema.d.ts +6 -0
- package/build/packages/cdk8s_renderer/src/loader/lazy_loader.d.ts +1 -0
- package/build/packages/cdk8s_renderer/src/loader/loader.d.ts +1 -1
- package/build/packages/cdk8s_renderer/src/renderer/renderer.d.ts +1 -1
- package/build/packages/cdk8s_renderer/src/utils/claimUtils.d.ts +3 -0
- package/package.json +1 -1
package/build/index.js
CHANGED
|
@@ -262633,8 +262633,8 @@ function sleep(ms) {
|
|
|
262633
262633
|
}
|
|
262634
262634
|
|
|
262635
262635
|
// EXTERNAL MODULE: ../../node_modules/lodash/lodash.js
|
|
262636
|
-
var
|
|
262637
|
-
var lodash_default = /*#__PURE__*/__nccwpck_require__.n(
|
|
262636
|
+
var lodash_lodash = __nccwpck_require__(78018);
|
|
262637
|
+
var lodash_default = /*#__PURE__*/__nccwpck_require__.n(lodash_lodash);
|
|
262638
262638
|
;// CONCATENATED MODULE: ../catalog_common/src/generic/name.ts
|
|
262639
262639
|
|
|
262640
262640
|
|
|
@@ -270521,7 +270521,7 @@ function helperCTX(patch) {
|
|
|
270521
270521
|
|
|
270522
270522
|
|
|
270523
270523
|
|
|
270524
|
-
class
|
|
270524
|
+
class uuid_UUIDInitializer extends InitializerPatches {
|
|
270525
270525
|
constructor() {
|
|
270526
270526
|
super(...arguments);
|
|
270527
270527
|
this.applicableProviders = ['github', 'terraform'];
|
|
@@ -270530,9 +270530,9 @@ class UUIDInitializer extends InitializerPatches {
|
|
|
270530
270530
|
return true;
|
|
270531
270531
|
}
|
|
270532
270532
|
async __patches(claim, previousCR) {
|
|
270533
|
-
if (
|
|
270533
|
+
if (uuid_UUIDInitializer.applicableKinds.indexOf(claim.kind) === -1) {
|
|
270534
270534
|
throw new InitializerError(`${claim.name} is of kind ${claim.kind}, which is not allowed. ` +
|
|
270535
|
-
`Allowed kinds: ${
|
|
270535
|
+
`Allowed kinds: ${uuid_UUIDInitializer.applicableKinds}`);
|
|
270536
270536
|
}
|
|
270537
270537
|
const uuid = false;
|
|
270538
270538
|
const fBuildWriteConnectionSecretToRef = (cr, crKind) => {
|
|
@@ -270569,7 +270569,7 @@ class UUIDInitializer extends InitializerPatches {
|
|
|
270569
270569
|
];
|
|
270570
270570
|
}
|
|
270571
270571
|
}
|
|
270572
|
-
|
|
270572
|
+
uuid_UUIDInitializer.applicableKinds = [
|
|
270573
270573
|
'GroupClaim',
|
|
270574
270574
|
'UserClaim',
|
|
270575
270575
|
'ComponentClaim',
|
|
@@ -270640,7 +270640,7 @@ class NormalizerError extends Error {
|
|
|
270640
270640
|
|
|
270641
270641
|
|
|
270642
270642
|
|
|
270643
|
-
class
|
|
270643
|
+
class name_NameNormalizer extends Normalizer {
|
|
270644
270644
|
constructor() {
|
|
270645
270645
|
super(...arguments);
|
|
270646
270646
|
this.applicableProviders = ['all'];
|
|
@@ -270668,11 +270668,11 @@ class NameNormalizer extends Normalizer {
|
|
|
270668
270668
|
const provider = helperCTX(this).provider;
|
|
270669
270669
|
const annotation = catalog_common.generic.getFirestartrAnnotation('external-name');
|
|
270670
270670
|
const providerName = claim.providers[provider].name;
|
|
270671
|
-
if (previousCR && !
|
|
270671
|
+
if (previousCR && !lodash_lodash.isEmpty(previousCR)) {
|
|
270672
270672
|
cr.metadata.annotations[annotation] = providerName;
|
|
270673
270673
|
cr.metadata.name = previousCR.metadata.name;
|
|
270674
270674
|
if (previousCR.writeConnectionSecretToRef &&
|
|
270675
|
-
!
|
|
270675
|
+
!lodash_lodash.isEmpty(previousCR.writeConnectionSecretToRef)) {
|
|
270676
270676
|
cr.writeConnectionSecretToRef.name =
|
|
270677
270677
|
previousCR.writeConnectionSecretToRef.name;
|
|
270678
270678
|
}
|
|
@@ -271061,7 +271061,7 @@ class GlobalDefault extends DefaultSection {
|
|
|
271061
271061
|
* - __getDesiredPatches(): a list of fast-json-patch patches
|
|
271062
271062
|
*
|
|
271063
271063
|
*/
|
|
271064
|
-
class
|
|
271064
|
+
class initializer_InitializerDefault extends DefaultSection {
|
|
271065
271065
|
constructor(data) {
|
|
271066
271066
|
super();
|
|
271067
271067
|
this.applicableProviders = ['github'];
|
|
@@ -271124,7 +271124,7 @@ class InitializerDefault extends DefaultSection {
|
|
|
271124
271124
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/initializers/claimRef.ts
|
|
271125
271125
|
|
|
271126
271126
|
|
|
271127
|
-
class
|
|
271127
|
+
class claimRef_InitializerClaimRef extends InitializerPatches {
|
|
271128
271128
|
constructor() {
|
|
271129
271129
|
super(...arguments);
|
|
271130
271130
|
this.applicableProviders = ['github', 'terraform'];
|
|
@@ -271155,7 +271155,7 @@ class InitializerClaimRef extends InitializerPatches {
|
|
|
271155
271155
|
];
|
|
271156
271156
|
}
|
|
271157
271157
|
}
|
|
271158
|
-
|
|
271158
|
+
claimRef_InitializerClaimRef.applicableKinds = [
|
|
271159
271159
|
'GroupClaim',
|
|
271160
271160
|
'UserClaim',
|
|
271161
271161
|
'ComponentClaim',
|
|
@@ -271475,13 +271475,13 @@ function setPath(pathName, pathValue) {
|
|
|
271475
271475
|
__PATH_VARIABLES[pathName] = pathValue;
|
|
271476
271476
|
}
|
|
271477
271477
|
let renamesEnabled = false;
|
|
271478
|
-
function
|
|
271478
|
+
function config_getRenamesEnabled() {
|
|
271479
271479
|
return renamesEnabled;
|
|
271480
271480
|
}
|
|
271481
271481
|
function setRenamesEnabled(enabled) {
|
|
271482
271482
|
renamesEnabled = enabled;
|
|
271483
271483
|
}
|
|
271484
|
-
var
|
|
271484
|
+
var config_AllowedProviders;
|
|
271485
271485
|
(function (AllowedProviders) {
|
|
271486
271486
|
AllowedProviders["all"] = "all";
|
|
271487
271487
|
AllowedProviders["github"] = "github";
|
|
@@ -271490,7 +271490,7 @@ var AllowedProviders;
|
|
|
271490
271490
|
AllowedProviders["catalog"] = "catalog";
|
|
271491
271491
|
AllowedProviders["argocd"] = "argocd";
|
|
271492
271492
|
AllowedProviders["externalSecrets"] = "externalSecrets";
|
|
271493
|
-
})(
|
|
271493
|
+
})(config_AllowedProviders || (config_AllowedProviders = {}));
|
|
271494
271494
|
let configuredProvider = null;
|
|
271495
271495
|
function configureProvider(provider) {
|
|
271496
271496
|
if (configuredProvider)
|
|
@@ -271502,21 +271502,21 @@ class ConfigError extends Error {
|
|
|
271502
271502
|
super(`${errorType}: ${message}`);
|
|
271503
271503
|
}
|
|
271504
271504
|
}
|
|
271505
|
-
function getSelectedKindClaimCrMap(provider =
|
|
271505
|
+
function getSelectedKindClaimCrMap(provider = config_getConfiguredProvider().toString()) {
|
|
271506
271506
|
return PROVIDER_CLAIM_CR_MAP[provider.toString()];
|
|
271507
271507
|
}
|
|
271508
|
-
function
|
|
271508
|
+
function config_getConfiguredProvider() {
|
|
271509
271509
|
if (!configuredProvider)
|
|
271510
271510
|
throw new ConfigError('Provider config error', 'No provider configured, please call configureProvider()');
|
|
271511
271511
|
return configuredProvider;
|
|
271512
271512
|
}
|
|
271513
271513
|
const PROVIDER_CLAIM_CR_MAP = {
|
|
271514
|
-
[
|
|
271514
|
+
[config_AllowedProviders.github.toString()]: {
|
|
271515
271515
|
GroupClaim: 'FirestartrGithubGroup',
|
|
271516
271516
|
UserClaim: 'FirestartrGithubMembership',
|
|
271517
271517
|
ComponentClaim: 'FirestartrGithubRepository',
|
|
271518
271518
|
},
|
|
271519
|
-
[
|
|
271519
|
+
[config_AllowedProviders.catalog.toString()]: {
|
|
271520
271520
|
GroupClaim: 'Group',
|
|
271521
271521
|
UserClaim: 'User',
|
|
271522
271522
|
ComponentClaim: 'Component',
|
|
@@ -271538,7 +271538,7 @@ function configurePathsForRendering() {
|
|
|
271538
271538
|
const configPath = '/tmp/defaults';
|
|
271539
271539
|
createInitializers(configPath);
|
|
271540
271540
|
createExpanders(configPath);
|
|
271541
|
-
configureProvider(
|
|
271541
|
+
configureProvider(config_AllowedProviders.all);
|
|
271542
271542
|
setPath('initializers', configPath);
|
|
271543
271543
|
setPath('crs', '/tmp/resources_from_main_branch');
|
|
271544
271544
|
setPath('globals', configPath);
|
|
@@ -272285,18 +272285,18 @@ PolicyInitializer.applicableKinds = ['TFWorkspaceClaim'];
|
|
|
272285
272285
|
|
|
272286
272286
|
|
|
272287
272287
|
const INITIALIZERS = [
|
|
272288
|
-
|
|
272289
|
-
|
|
272288
|
+
uuid_UUIDInitializer,
|
|
272289
|
+
claimRef_InitializerClaimRef,
|
|
272290
272290
|
BackstageInitializer,
|
|
272291
272291
|
PolicyInitializer,
|
|
272292
272292
|
SyncerInitializer,
|
|
272293
272293
|
];
|
|
272294
272294
|
const INITIALIZERS_BY_FILE_NAME = {
|
|
272295
272295
|
[TechnologyInitializer.FILE_NAME()]: TechnologyInitializer,
|
|
272296
|
-
defaults_github_repository:
|
|
272297
|
-
defaults_github_membership:
|
|
272298
|
-
defaults_github_group:
|
|
272299
|
-
defaults_github_orgwebhook:
|
|
272296
|
+
defaults_github_repository: initializer_InitializerDefault,
|
|
272297
|
+
defaults_github_membership: initializer_InitializerDefault,
|
|
272298
|
+
defaults_github_group: initializer_InitializerDefault,
|
|
272299
|
+
defaults_github_orgwebhook: initializer_InitializerDefault,
|
|
272300
272300
|
};
|
|
272301
272301
|
const SCHEMAS_BY_INITIALIZER_NAME = {
|
|
272302
272302
|
[TechnologyInitializer.FILE_NAME()]: technologies,
|
|
@@ -272547,6 +272547,10 @@ class FirestartrAllClaim {
|
|
|
272547
272547
|
type: 'string',
|
|
272548
272548
|
pattern: '^system:.+$',
|
|
272549
272549
|
},
|
|
272550
|
+
owner: {
|
|
272551
|
+
type: 'string',
|
|
272552
|
+
pattern: '^[^:]+:[^:]+$',
|
|
272553
|
+
},
|
|
272550
272554
|
providers: {
|
|
272551
272555
|
type: 'object',
|
|
272552
272556
|
properties: {
|
|
@@ -272556,6 +272560,7 @@ class FirestartrAllClaim {
|
|
|
272556
272560
|
},
|
|
272557
272561
|
},
|
|
272558
272562
|
},
|
|
272563
|
+
required: ['owner'],
|
|
272559
272564
|
additionalProperties: true,
|
|
272560
272565
|
},
|
|
272561
272566
|
],
|
|
@@ -272643,6 +272648,10 @@ class FirestartrAllClaim {
|
|
|
272643
272648
|
type: 'string',
|
|
272644
272649
|
pattern: '^system:.+$',
|
|
272645
272650
|
},
|
|
272651
|
+
owner: {
|
|
272652
|
+
type: 'string',
|
|
272653
|
+
pattern: '^[^:]+:[^:]+$',
|
|
272654
|
+
},
|
|
272646
272655
|
providers: {
|
|
272647
272656
|
type: 'object',
|
|
272648
272657
|
properties: {
|
|
@@ -272653,6 +272662,7 @@ class FirestartrAllClaim {
|
|
|
272653
272662
|
required: ['terraform'],
|
|
272654
272663
|
},
|
|
272655
272664
|
},
|
|
272665
|
+
required: ['owner'],
|
|
272656
272666
|
additionalProperties: true,
|
|
272657
272667
|
},
|
|
272658
272668
|
],
|
|
@@ -273652,7 +273662,7 @@ function validatek8sLimits(moduleContent) {
|
|
|
273652
273662
|
|
|
273653
273663
|
|
|
273654
273664
|
const NORMALIZERS = [
|
|
273655
|
-
|
|
273665
|
+
name_NameNormalizer,
|
|
273656
273666
|
RefValuesNormalizer,
|
|
273657
273667
|
TFWorkspaceNormalizer,
|
|
273658
273668
|
RevisionNormalizer,
|
|
@@ -273717,6 +273727,7 @@ function extractAllRefs(claimData) {
|
|
|
273717
273727
|
break;
|
|
273718
273728
|
}
|
|
273719
273729
|
}
|
|
273730
|
+
refsExtractor_log(`Refs for ${parsedClaim.kind}-${parsedClaim.name}: ${[...new Set(refs)].join(',')}`);
|
|
273720
273731
|
return [...new Set(refs)];
|
|
273721
273732
|
}
|
|
273722
273733
|
function extractVirtualRefs(parsedClaim) {
|
|
@@ -273925,9 +273936,14 @@ async function loadClaim(claimRef, org, defaults = loadClaimDefaults(), patchCla
|
|
|
273925
273936
|
}
|
|
273926
273937
|
return result;
|
|
273927
273938
|
}
|
|
273928
|
-
|
|
273929
|
-
|
|
273930
|
-
|
|
273939
|
+
let LoadedClaims = {};
|
|
273940
|
+
let VisitedClaims = {};
|
|
273941
|
+
let DuplicatedClaims = {};
|
|
273942
|
+
function resetLazyLoader() {
|
|
273943
|
+
LoadedClaims = {};
|
|
273944
|
+
VisitedClaims = {};
|
|
273945
|
+
DuplicatedClaims = {};
|
|
273946
|
+
}
|
|
273931
273947
|
async function lazyGetClaim(kind, name, org, cwd) {
|
|
273932
273948
|
const indice = `${kind}-${name}`;
|
|
273933
273949
|
lazy_loader_log(`Lazy loading ${kind}-${name} with index ${indice}`);
|
|
@@ -273951,6 +273967,7 @@ async function getClaimsByName(name, cwd = '.') {
|
|
|
273951
273967
|
const handler = (0,external_node_child_process_namespaceObject.spawn)('grep', ['-r', '-l', '--include=*', '-E', `name: "?${name}"?`, '.'], {
|
|
273952
273968
|
cwd: cwd,
|
|
273953
273969
|
});
|
|
273970
|
+
lazy_loader_log(`Running ${['grep', '-r', '-l', '--include', '-E', 'name: "' + name + '"?', '.'].join(' ')}`);
|
|
273954
273971
|
const entradas = [];
|
|
273955
273972
|
const chunks = [];
|
|
273956
273973
|
handler.stdout.on('data', (data) => {
|
|
@@ -274008,13 +274025,13 @@ async function loadRawClaim(entry) {
|
|
|
274008
274025
|
async function setVirtualClaimAdditionalData(renderedData, claim, claimRef) {
|
|
274009
274026
|
const virtualClaim = getVirtualClaim(claim.kind, claim.name);
|
|
274010
274027
|
renderedData[claimRef]['initializers'] = [
|
|
274011
|
-
new
|
|
274012
|
-
new
|
|
274013
|
-
new
|
|
274028
|
+
new uuid_UUIDInitializer(claim),
|
|
274029
|
+
new claimRef_InitializerClaimRef(),
|
|
274030
|
+
new initializer_InitializerDefault(virtualClaim.getDefaultConfig()),
|
|
274014
274031
|
];
|
|
274015
274032
|
renderedData[claimRef]['globals'] = [];
|
|
274016
274033
|
renderedData[claimRef]['overrides'] = [];
|
|
274017
|
-
renderedData[claimRef]['normalizers'] = [new
|
|
274034
|
+
renderedData[claimRef]['normalizers'] = [new name_NameNormalizer()];
|
|
274018
274035
|
return renderedData;
|
|
274019
274036
|
}
|
|
274020
274037
|
async function setNonVirtualClaimAdditionalData(renderedData, claim, claimRef, loadInitializers, loadGlobals, loadOverrides, loadNormalizers) {
|
|
@@ -274217,19 +274234,19 @@ async function loadInitializers(claim, initializersPath = config_getPath('initia
|
|
|
274217
274234
|
* · The claim's applicable initializers, globals and overrides
|
|
274218
274235
|
*
|
|
274219
274236
|
*/
|
|
274220
|
-
async function loadClaims(claimsPath =
|
|
274237
|
+
async function loadClaims(claimsPath = getPath('claims')) {
|
|
274221
274238
|
const result = {};
|
|
274222
274239
|
const defaultsClaims = loadClaimDefaults();
|
|
274223
|
-
await
|
|
274240
|
+
await crawl(claimsPath, (entry) => {
|
|
274224
274241
|
return isYamlFile.test(entry);
|
|
274225
274242
|
}, async (entry, data) => {
|
|
274226
|
-
const claim = loader_patchClaim(
|
|
274243
|
+
const claim = loader_patchClaim(common.io.fromYaml(data), defaultsClaims);
|
|
274227
274244
|
if (!('kind' in claim && 'name' in claim)) {
|
|
274228
274245
|
throw new Error(`Invalid claim file ${entry}`);
|
|
274229
274246
|
}
|
|
274230
274247
|
try {
|
|
274231
|
-
validateClaim(claim,
|
|
274232
|
-
await optionalValidation(claim);
|
|
274248
|
+
ClaimValidation.validateClaim(claim, claims[`${claim.kind}Schema`]);
|
|
274249
|
+
await ClaimValidation.optionalValidation(claim);
|
|
274233
274250
|
}
|
|
274234
274251
|
catch (err) {
|
|
274235
274252
|
throw new Error(`Validating ${claim.kind + '-' + claim.name}: ${JSON.stringify(err, null, 2)}`);
|
|
@@ -274326,7 +274343,7 @@ async function loadRenames(claims, crs) {
|
|
|
274326
274343
|
if (!anyCr?.metadata?.annotations)
|
|
274327
274344
|
continue;
|
|
274328
274345
|
// if the annotation is a claimRef
|
|
274329
|
-
const annotationName =
|
|
274346
|
+
const annotationName = common.generic.getFirestartrAnnotation('claim-ref');
|
|
274330
274347
|
const annotations = anyCr?.metadata?.annotations || {};
|
|
274331
274348
|
if (annotationName in annotations) {
|
|
274332
274349
|
const claimRef = anyCr.metadata.annotations[annotationName];
|
|
@@ -274408,7 +274425,7 @@ async function loadClaimsList(claimRefList, claimsPath = config_getPath('claims'
|
|
|
274408
274425
|
crs: {},
|
|
274409
274426
|
};
|
|
274410
274427
|
const defaults = loadClaimDefaults();
|
|
274411
|
-
for (const claimRef of claimRefList) {
|
|
274428
|
+
for await (const claimRef of claimRefList) {
|
|
274412
274429
|
const renderedClaimData = await loadClaim(claimRef, getOrg(), defaults, loader_patchClaim, loadInitializers, loadGlobals, loadOverrides, loadNormalizers, claimsPath);
|
|
274413
274430
|
data.renderClaims = lodash_default().merge(data.renderClaims, renderedClaimData);
|
|
274414
274431
|
}
|
|
@@ -274427,7 +274444,7 @@ function getOrg() {
|
|
|
274427
274444
|
|
|
274428
274445
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/wellKnownStructures.ts
|
|
274429
274446
|
|
|
274430
|
-
function
|
|
274447
|
+
function wellKnownStructures_isCollaborator(struc) {
|
|
274431
274448
|
return hasProperties(struc, ['collaborator', 'role']);
|
|
274432
274449
|
}
|
|
274433
274450
|
function hasProperties(struc, properties) {
|
|
@@ -274439,7 +274456,7 @@ function hasProperties(struc, properties) {
|
|
|
274439
274456
|
return true;
|
|
274440
274457
|
}
|
|
274441
274458
|
function hasProperty(struc, property) {
|
|
274442
|
-
return
|
|
274459
|
+
return lodash.has(struc, property);
|
|
274443
274460
|
}
|
|
274444
274461
|
|
|
274445
274462
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/references.ts
|
|
@@ -274531,7 +274548,7 @@ Check the following Claims to ensure that the tfStateKey is unique:
|
|
|
274531
274548
|
function validateReferencesInCR(cr, crs) {
|
|
274532
274549
|
if (isCatalogEntity(cr)) {
|
|
274533
274550
|
if (getConfiguredProvider() === AllowedProviders.catalog) {
|
|
274534
|
-
validateCatalogEntities(cr, crs);
|
|
274551
|
+
//validateCatalogEntities(cr, crs);
|
|
274535
274552
|
//console.log(`Skip validation ${cr.name}`);
|
|
274536
274553
|
}
|
|
274537
274554
|
}
|
|
@@ -274562,7 +274579,7 @@ function throwIfRefNotFoundInCatalog(crs, refObj, refStr, crStr) {
|
|
|
274562
274579
|
*/
|
|
274563
274580
|
function validateNonCatalogEntities(cr, crs) {
|
|
274564
274581
|
for (const rel of references_WELL_KNOWN_RELATIONS[cr.kind] || []) {
|
|
274565
|
-
const propertyRef =
|
|
274582
|
+
const propertyRef = _.get(cr, rel);
|
|
274566
274583
|
if (!propertyRef) {
|
|
274567
274584
|
throw new Error(`CR ${cr.kind} ${cr.metadata.name} does not have property ${rel}`);
|
|
274568
274585
|
}
|
|
@@ -274592,8 +274609,8 @@ function validateNonCatalogEntities(cr, crs) {
|
|
|
274592
274609
|
*/
|
|
274593
274610
|
function validateCatalogEntities(cr, crs) {
|
|
274594
274611
|
for (const rel of WELL_KNOWN_RELATIONS_CATALOG[cr.kind]) {
|
|
274595
|
-
if (
|
|
274596
|
-
const refObject =
|
|
274612
|
+
if (_.has(cr, rel)) {
|
|
274613
|
+
const refObject = _.get(cr, rel);
|
|
274597
274614
|
const catalogEntityName = extractNameCatalogEntity(cr);
|
|
274598
274615
|
if (!Array.isArray(refObject)) {
|
|
274599
274616
|
const propertyRef = createCatalogEntityPropertyRef(refObject);
|
|
@@ -276131,6 +276148,10 @@ const KINDS_CR_MAP = {
|
|
|
276131
276148
|
};
|
|
276132
276149
|
|
|
276133
276150
|
|
|
276151
|
+
|
|
276152
|
+
|
|
276153
|
+
|
|
276154
|
+
const claimUtils_log = src_default()('firestartr:utils:path-resolver');
|
|
276134
276155
|
function resolveStringReference(reference) {
|
|
276135
276156
|
const referenceElements = reference.split(':');
|
|
276136
276157
|
const actualKind = KINDS_CR_MAP[referenceElements[0]];
|
|
@@ -276139,6 +276160,11 @@ function resolveStringReference(reference) {
|
|
|
276139
276160
|
name: referenceElements[1],
|
|
276140
276161
|
};
|
|
276141
276162
|
}
|
|
276163
|
+
async function* claimsRefListAsGenerator(refs) {
|
|
276164
|
+
for (const ref of refs) {
|
|
276165
|
+
yield ref;
|
|
276166
|
+
}
|
|
276167
|
+
}
|
|
276142
276168
|
// Given a fileList "<file1>,<file2>....<fileN>"
|
|
276143
276169
|
// It parses the files an returns a list of references
|
|
276144
276170
|
// in the form of <kind>-<name>
|
|
@@ -276147,8 +276173,8 @@ function resolveClaimFilesList(claimRefsList) {
|
|
|
276147
276173
|
const refList = [];
|
|
276148
276174
|
for (const file of fileList) {
|
|
276149
276175
|
try {
|
|
276150
|
-
const data =
|
|
276151
|
-
const claim =
|
|
276176
|
+
const data = fs.readFileSync(file, 'utf-8');
|
|
276177
|
+
const claim = common.io.fromYaml(data);
|
|
276152
276178
|
if (!('kind' in claim && 'name' in claim)) {
|
|
276153
276179
|
throw 'Invalid claim file, has not kind and/or name';
|
|
276154
276180
|
}
|
|
@@ -276163,6 +276189,66 @@ function resolveClaimFilesList(claimRefsList) {
|
|
|
276163
276189
|
}
|
|
276164
276190
|
return refList;
|
|
276165
276191
|
}
|
|
276192
|
+
// This function receives an array of entries (dirs or files)
|
|
276193
|
+
// it returns a generator able to be used in a loop
|
|
276194
|
+
// under the form: for await (const claimRef of resolveClaimRefsGenerator){}
|
|
276195
|
+
// If dirs are passed, it resolves them recursively
|
|
276196
|
+
async function* resolveClaimEntries(claimRefsList) {
|
|
276197
|
+
claimUtils_log(`Resolving ${claimRefsList.join(',')}`);
|
|
276198
|
+
for (const claimEntry of claimRefsList) {
|
|
276199
|
+
try {
|
|
276200
|
+
const claimEntryStats = await (0,promises_namespaceObject.stat)(claimEntry);
|
|
276201
|
+
if (claimEntryStats.isDirectory()) {
|
|
276202
|
+
yield* resolveDirEntries(claimEntry);
|
|
276203
|
+
}
|
|
276204
|
+
else if (claimEntryStats.isFile()) {
|
|
276205
|
+
claimUtils_log(`Sending entry ${resolveClaimFileRef(claimEntry)} (${claimEntry})`);
|
|
276206
|
+
yield resolveClaimFileRef(claimEntry);
|
|
276207
|
+
}
|
|
276208
|
+
}
|
|
276209
|
+
catch (err) {
|
|
276210
|
+
throw new Error(`Error processing: ${claimEntry}: ${err}`);
|
|
276211
|
+
}
|
|
276212
|
+
}
|
|
276213
|
+
}
|
|
276214
|
+
// this function recursively searches for files
|
|
276215
|
+
// it returns a generator that yields claimRefs
|
|
276216
|
+
async function* resolveDirEntries(dir) {
|
|
276217
|
+
let entries = [];
|
|
276218
|
+
try {
|
|
276219
|
+
entries = await (0,promises_namespaceObject.readdir)(dir, { withFileTypes: true });
|
|
276220
|
+
}
|
|
276221
|
+
catch (err) {
|
|
276222
|
+
throw new Error(`Reading dir: ${dir}: ${err}`);
|
|
276223
|
+
}
|
|
276224
|
+
for (const entry of entries) {
|
|
276225
|
+
const fullPath = external_path_default().join(dir, entry.name);
|
|
276226
|
+
if (entry.isDirectory()) {
|
|
276227
|
+
yield* resolveDirEntries(fullPath);
|
|
276228
|
+
}
|
|
276229
|
+
else if (entry.isFile() && entry.name.match(/\.yaml$|\.yml$/)) {
|
|
276230
|
+
const claimRef = await resolveClaimFileRef(fullPath);
|
|
276231
|
+
claimUtils_log(`Sending entry ${claimRef} (${fullPath})`);
|
|
276232
|
+
yield claimRef;
|
|
276233
|
+
}
|
|
276234
|
+
}
|
|
276235
|
+
}
|
|
276236
|
+
async function resolveClaimFileRef(claimFile) {
|
|
276237
|
+
try {
|
|
276238
|
+
const data = await external_fs_default().promises.readFile(claimFile, 'utf-8');
|
|
276239
|
+
const claim = catalog_common.io.fromYaml(data);
|
|
276240
|
+
if (!('kind' in claim && 'name' in claim)) {
|
|
276241
|
+
throw new Error('Invalid claim file has not kind and/or name');
|
|
276242
|
+
}
|
|
276243
|
+
else {
|
|
276244
|
+
const claimRef = `${claim.kind}-${claim.name}`;
|
|
276245
|
+
return claimRef;
|
|
276246
|
+
}
|
|
276247
|
+
}
|
|
276248
|
+
catch (err) {
|
|
276249
|
+
throw new Error(`Error: file ${claimFile}: ${err}`);
|
|
276250
|
+
}
|
|
276251
|
+
}
|
|
276166
276252
|
|
|
276167
276253
|
;// CONCATENATED MODULE: ../cdk8s_renderer/imports/firestartr.dev.ts
|
|
276168
276254
|
// generated by cdk8s
|
|
@@ -279522,9 +279608,9 @@ async function renderClaims(catalogScope, firestartrScope, data) {
|
|
|
279522
279608
|
for (const renderClaims of sortedKinds) {
|
|
279523
279609
|
for (const claimKey of Object.keys(renderClaims)) {
|
|
279524
279610
|
const claim = renderClaims[claimKey].claim;
|
|
279525
|
-
const configuredProvider =
|
|
279611
|
+
const configuredProvider = config_getConfiguredProvider().toString();
|
|
279526
279612
|
let providers = Object.keys(claim.providers);
|
|
279527
|
-
if (configuredProvider !==
|
|
279613
|
+
if (configuredProvider !== config_AllowedProviders.all.toString()) {
|
|
279528
279614
|
providers = providers.filter((provider) => provider === configuredProvider);
|
|
279529
279615
|
}
|
|
279530
279616
|
const previousCR = getPreviousCRfromClaim(claim, crs);
|
|
@@ -279571,12 +279657,12 @@ async function renderClaim(catalogScope, firestartrScope, claim, patches, previo
|
|
|
279571
279657
|
}
|
|
279572
279658
|
const renderPatches = patches.filter((patch) => !patch.isPostPatch);
|
|
279573
279659
|
const postPatches = patches.filter((patch) => patch.isPostPatch);
|
|
279574
|
-
const provider =
|
|
279575
|
-
const loadGithub = (provider ===
|
|
279576
|
-
provider ===
|
|
279577
|
-
provider ===
|
|
279660
|
+
const provider = config_getConfiguredProvider();
|
|
279661
|
+
const loadGithub = (provider === config_AllowedProviders.all ||
|
|
279662
|
+
provider === config_AllowedProviders.catalog ||
|
|
279663
|
+
provider === config_AllowedProviders.github) &&
|
|
279578
279664
|
'github' in claim.providers;
|
|
279579
|
-
const loadCatalog = provider ===
|
|
279665
|
+
const loadCatalog = provider === config_AllowedProviders.all || provider === config_AllowedProviders.catalog;
|
|
279580
279666
|
switch (claim.kind) {
|
|
279581
279667
|
case 'DomainClaim':
|
|
279582
279668
|
if (loadCatalog) {
|
|
@@ -279614,8 +279700,8 @@ async function renderClaim(catalogScope, firestartrScope, claim, patches, previo
|
|
|
279614
279700
|
break;
|
|
279615
279701
|
case 'TFWorkspaceClaim':
|
|
279616
279702
|
if (claim.providers.terraform &&
|
|
279617
|
-
(provider ===
|
|
279618
|
-
provider ===
|
|
279703
|
+
(provider === config_AllowedProviders.terraform ||
|
|
279704
|
+
provider === config_AllowedProviders.all)) {
|
|
279619
279705
|
firestartrEntity = new charts.TFWorkspaceChart(firestartrScope, `terraform-${chartId}`, firestartrId, claim, renderPatches);
|
|
279620
279706
|
}
|
|
279621
279707
|
if (loadCatalog) {
|
|
@@ -279624,9 +279710,9 @@ async function renderClaim(catalogScope, firestartrScope, claim, patches, previo
|
|
|
279624
279710
|
break;
|
|
279625
279711
|
case 'SecretsClaim':
|
|
279626
279712
|
if (claim.providers.external_secrets &&
|
|
279627
|
-
(provider ===
|
|
279628
|
-
provider ===
|
|
279629
|
-
provider ===
|
|
279713
|
+
(provider === config_AllowedProviders.externalSecrets ||
|
|
279714
|
+
provider === config_AllowedProviders.terraform ||
|
|
279715
|
+
provider === config_AllowedProviders.all)) {
|
|
279630
279716
|
firestartrEntity = new charts.SecretsChart(firestartrScope, chartId, firestartrId, claim, []);
|
|
279631
279717
|
}
|
|
279632
279718
|
if (loadCatalog) {
|
|
@@ -279635,8 +279721,8 @@ async function renderClaim(catalogScope, firestartrScope, claim, patches, previo
|
|
|
279635
279721
|
break;
|
|
279636
279722
|
case 'ArgoDeployClaim':
|
|
279637
279723
|
if (claim.providers.argocd &&
|
|
279638
|
-
(provider ===
|
|
279639
|
-
provider ===
|
|
279724
|
+
(provider === config_AllowedProviders.argocd ||
|
|
279725
|
+
provider === config_AllowedProviders.all)) {
|
|
279640
279726
|
firestartrEntity = new charts.ArgoDeployChart(firestartrScope, `argocd-${chartId}`, firestartrId, claim, renderPatches);
|
|
279641
279727
|
}
|
|
279642
279728
|
if (loadCatalog) {
|
|
@@ -279701,18 +279787,12 @@ async function renderClaim(catalogScope, firestartrScope, claim, patches, previo
|
|
|
279701
279787
|
* rendered firestartr-all group
|
|
279702
279788
|
*
|
|
279703
279789
|
*/
|
|
279704
|
-
async function renderer_render(catalogScope, firestartrScope, activateReferentialIntegrityValidation = true, claimList
|
|
279705
|
-
|
|
279706
|
-
if (claimList.length > 0) {
|
|
279707
|
-
data = await loadClaimsList(claimList);
|
|
279708
|
-
}
|
|
279709
|
-
else {
|
|
279710
|
-
data = await loadAll();
|
|
279711
|
-
}
|
|
279790
|
+
async function renderer_render(catalogScope, firestartrScope, activateReferentialIntegrityValidation = true, claimList) {
|
|
279791
|
+
const data = await loadClaimsList(claimList);
|
|
279712
279792
|
const result = await renderClaims(catalogScope, firestartrScope, data);
|
|
279713
|
-
if (activateReferentialIntegrityValidation) {
|
|
279714
|
-
|
|
279715
|
-
}
|
|
279793
|
+
//if (activateReferentialIntegrityValidation) {
|
|
279794
|
+
// validateReferentialIntegrity(result);
|
|
279795
|
+
//}
|
|
279716
279796
|
validateTfStateKeyUniqueness(result);
|
|
279717
279797
|
return result;
|
|
279718
279798
|
}
|
|
@@ -279726,6 +279806,8 @@ async function renderer_render(catalogScope, firestartrScope, activateReferentia
|
|
|
279726
279806
|
|
|
279727
279807
|
|
|
279728
279808
|
|
|
279809
|
+
|
|
279810
|
+
|
|
279729
279811
|
const MAIN_BRANCH_OUTPUT_DIR = '/tmp/resources_from_main_branch';
|
|
279730
279812
|
const PR_BRANCH_OUTPUT_DIR = '/tmp/resources_from_pr_branch';
|
|
279731
279813
|
/**
|
|
@@ -279774,9 +279856,10 @@ async function getAffectedRepositories(claimPathFromMain, claimPathFromPR, wetRe
|
|
|
279774
279856
|
yamlOutputType: lib.YamlOutputType.FILE_PER_RESOURCE,
|
|
279775
279857
|
});
|
|
279776
279858
|
// Render the main branch
|
|
279777
|
-
const renderFromMainBranch = await renderer_render(mainBranchCatalogApp, mainBranchFirestartrApp);
|
|
279859
|
+
const renderFromMainBranch = await renderer_render(mainBranchCatalogApp, mainBranchFirestartrApp, true, await resolveClaimEntries([claimPathFromMain]));
|
|
279778
279860
|
mainBranchFirestartrApp.synth();
|
|
279779
279861
|
emptyRenderedClaims();
|
|
279862
|
+
resetLazyLoader();
|
|
279780
279863
|
// Change the claims path to the PR branch
|
|
279781
279864
|
setPath('claims', claimPathFromPR);
|
|
279782
279865
|
const app2 = new lib.App({
|
|
@@ -279785,7 +279868,7 @@ async function getAffectedRepositories(claimPathFromMain, claimPathFromPR, wetRe
|
|
|
279785
279868
|
yamlOutputType: lib.YamlOutputType.FILE_PER_RESOURCE,
|
|
279786
279869
|
});
|
|
279787
279870
|
// Render the PR branch
|
|
279788
|
-
const renderFromPRBranch = await renderer_render(new lib.App(), app2);
|
|
279871
|
+
const renderFromPRBranch = await renderer_render(new lib.App(), app2, true, await resolveClaimEntries([claimPathFromPR]));
|
|
279789
279872
|
app2.synth();
|
|
279790
279873
|
// Iterate over the resources from the main branch
|
|
279791
279874
|
for (const key of Object.keys(renderFromMainBranch)) {
|
|
@@ -279886,7 +279969,7 @@ async function runComparer(claimPathFromMain, claimPathFromPR, claimsDefaultsPat
|
|
|
279886
279969
|
const renderer_log = src_default()('firestartr:operator:cmd:tfworkspaces-renderer');
|
|
279887
279970
|
async function renderTfWorkspace(claim, firestartrId, resolveRef, namespace) {
|
|
279888
279971
|
const app = new lib.App();
|
|
279889
|
-
const initializers = [new
|
|
279972
|
+
const initializers = [new uuid_UUIDInitializer(), new claimRef_InitializerClaimRef()];
|
|
279890
279973
|
const previousCR = await resolveRef('TFWorkspace', claim.name, namespace);
|
|
279891
279974
|
if (previousCR) {
|
|
279892
279975
|
renderer_log(`💊 Previous CR found for ${claim.name} in ${namespace} with tfStateKey ${previousCR.spec.firestartr.tfStateKey}`);
|
|
@@ -279896,7 +279979,7 @@ async function renderTfWorkspace(claim, firestartrId, resolveRef, namespace) {
|
|
|
279896
279979
|
}
|
|
279897
279980
|
const refValuesNormalizer = new RefValuesNormalizer();
|
|
279898
279981
|
refValuesNormalizer.rsClaimRef = (kind, name) => resolveRef(kind, name, namespace);
|
|
279899
|
-
const normalizers = [refValuesNormalizer, new
|
|
279982
|
+
const normalizers = [refValuesNormalizer, new name_NameNormalizer()];
|
|
279900
279983
|
let totalPatches = [];
|
|
279901
279984
|
for (const normalizer of normalizers) {
|
|
279902
279985
|
const patches = await normalizer.patches(claim, previousCR);
|
|
@@ -279995,7 +280078,7 @@ async function addLastStateAndLastClaimAnnotations(filePath, lastStatePRLink, la
|
|
|
279995
280078
|
INITIALIZERS: INITIALIZERS,
|
|
279996
280079
|
INITIALIZERS_BY_FILE_NAME: INITIALIZERS_BY_FILE_NAME,
|
|
279997
280080
|
NORMALIZERS: NORMALIZERS,
|
|
279998
|
-
AllowedProviders:
|
|
280081
|
+
AllowedProviders: config_AllowedProviders,
|
|
279999
280082
|
runComparer: runComparer,
|
|
280000
280083
|
isCatalogEntity: isCatalogEntity,
|
|
280001
280084
|
loadCRs: loadCRs,
|
|
@@ -280038,12 +280121,17 @@ async function runRenderer(globalsPath, initializersPath, claimsPath, crsPath, c
|
|
|
280038
280121
|
outputFileExtension: '.yaml',
|
|
280039
280122
|
yamlOutputType: lib.YamlOutputType.FILE_PER_RESOURCE,
|
|
280040
280123
|
});
|
|
280041
|
-
let claimRefsList =
|
|
280124
|
+
let claimRefsList = null;
|
|
280042
280125
|
if (claimRefs) {
|
|
280043
|
-
claimRefsList = claimRefs.replace(/\s/g, '').split(',');
|
|
280126
|
+
claimRefsList = await claimsRefListAsGenerator(claimRefs.replace(/\s/g, '').split(','));
|
|
280044
280127
|
}
|
|
280045
280128
|
else if (claimFilesList) {
|
|
280046
|
-
claimRefsList =
|
|
280129
|
+
claimRefsList = await resolveClaimEntries(claimFilesList.replace(/\s/g, '').split(','));
|
|
280130
|
+
}
|
|
280131
|
+
else {
|
|
280132
|
+
// in case nothing is passed
|
|
280133
|
+
// the system takes everything defined in the claims path
|
|
280134
|
+
claimRefsList = await resolveClaimEntries([claimsPath]);
|
|
280047
280135
|
}
|
|
280048
280136
|
try {
|
|
280049
280137
|
await renderer_render(catalogApp, firestartrApp, validateReferentialIntegrity === 'enabled' ? true : false, claimRefsList);
|
|
@@ -280124,10 +280212,10 @@ class Decanter {
|
|
|
280124
280212
|
this.data = data;
|
|
280125
280213
|
}
|
|
280126
280214
|
async __adaptInitializerTfStateKey() {
|
|
280127
|
-
return new
|
|
280215
|
+
return new uuid_UUIDInitializer();
|
|
280128
280216
|
}
|
|
280129
280217
|
async __adaptInitializerClaimRef() {
|
|
280130
|
-
return new
|
|
280218
|
+
return new claimRef_InitializerClaimRef();
|
|
280131
280219
|
}
|
|
280132
280220
|
async __adaptInitializerImport() {
|
|
280133
280221
|
return new ImportInitializer();
|
|
@@ -280211,7 +280299,7 @@ class Decanter {
|
|
|
280211
280299
|
initializers,
|
|
280212
280300
|
globals: [],
|
|
280213
280301
|
overrides,
|
|
280214
|
-
normalizers: [new
|
|
280302
|
+
normalizers: [new name_NameNormalizer()],
|
|
280215
280303
|
},
|
|
280216
280304
|
};
|
|
280217
280305
|
return adapted;
|
|
@@ -280242,7 +280330,7 @@ class GithubDecanter extends decanter_base {
|
|
|
280242
280330
|
this.org = org;
|
|
280243
280331
|
}
|
|
280244
280332
|
__adaptClaimRef() {
|
|
280245
|
-
return new
|
|
280333
|
+
return new claimRef_InitializerClaimRef();
|
|
280246
280334
|
}
|
|
280247
280335
|
}
|
|
280248
280336
|
|
|
@@ -280327,7 +280415,7 @@ class GroupGithubDecanter extends GithubDecanter {
|
|
|
280327
280415
|
},
|
|
280328
280416
|
},
|
|
280329
280417
|
};
|
|
280330
|
-
return new
|
|
280418
|
+
return new initializer_InitializerDefault(adapterBase);
|
|
280331
280419
|
}
|
|
280332
280420
|
__validateKind(cr) {
|
|
280333
280421
|
return true;
|
|
@@ -280482,7 +280570,7 @@ class MemberGithubDecanter extends GithubDecanter {
|
|
|
280482
280570
|
},
|
|
280483
280571
|
},
|
|
280484
280572
|
};
|
|
280485
|
-
return new
|
|
280573
|
+
return new initializer_InitializerDefault(adapterBase);
|
|
280486
280574
|
}
|
|
280487
280575
|
}
|
|
280488
280576
|
|
|
@@ -280531,7 +280619,7 @@ class RepoGithubDecanter extends GithubDecanter {
|
|
|
280531
280619
|
version: this.VERSION(),
|
|
280532
280620
|
type: 'service',
|
|
280533
280621
|
lifecycle: 'production',
|
|
280534
|
-
system:
|
|
280622
|
+
system: `system:${this.org}-system`,
|
|
280535
280623
|
name: this.data.repoDetails.name,
|
|
280536
280624
|
};
|
|
280537
280625
|
}
|
|
@@ -280821,7 +280909,7 @@ class RepoGithubDecanter extends GithubDecanter {
|
|
|
280821
280909
|
},
|
|
280822
280910
|
},
|
|
280823
280911
|
};
|
|
280824
|
-
return new
|
|
280912
|
+
return new initializer_InitializerDefault(adapterBase);
|
|
280825
280913
|
}
|
|
280826
280914
|
async __adaptOverriderRepo(_claim) {
|
|
280827
280915
|
return new GithubRepositoryOverrider();
|
|
@@ -281071,7 +281159,7 @@ function compileReg(value) {
|
|
|
281071
281159
|
// gh-group: 'FirestartrGithubGroup',
|
|
281072
281160
|
// gh-repo: 'FirestartrGithubRepository',
|
|
281073
281161
|
// }
|
|
281074
|
-
async function runImporter(force, generateDefaults, skipPlan, claimsPath, crsPath, configPath, claimsDefaultsPath, org, filters, provider =
|
|
281162
|
+
async function runImporter(force, generateDefaults, skipPlan, claimsPath, crsPath, configPath, claimsDefaultsPath, org, filters, provider = config_AllowedProviders.all) {
|
|
281075
281163
|
configureProvider(provider);
|
|
281076
281164
|
let generatedFilters = [];
|
|
281077
281165
|
//gh-repo,REGEXP=.*vite.*
|
|
@@ -281166,7 +281254,7 @@ function generateClaimsDefaults(org, defaultsPath) {
|
|
|
281166
281254
|
version: '1.0',
|
|
281167
281255
|
type: 'service',
|
|
281168
281256
|
lifecycle: 'production',
|
|
281169
|
-
system: 'firestartr-test-system',
|
|
281257
|
+
system: 'system:firestartr-test-system',
|
|
281170
281258
|
maintainedBy: [],
|
|
281171
281259
|
platformOwner: `group:${org}-all`,
|
|
281172
281260
|
providers: {
|
|
@@ -281813,7 +281901,6 @@ async function writePlanInGithubPR(prUrl, planText) {
|
|
|
281813
281901
|
}
|
|
281814
281902
|
async function addApplyCommitStatus(cr, state, targetURL = '', description = '', context = '') {
|
|
281815
281903
|
try {
|
|
281816
|
-
await addCommitStatusToHeadCommit(cr.metadata.annotations['firestartr.dev/last-claim-pr'], state, targetURL, description, context);
|
|
281817
281904
|
await addCommitStatusToPrMergeCommit(cr.metadata.annotations['firestartr.dev/last-state-pr'], state, targetURL, description, context);
|
|
281818
281905
|
}
|
|
281819
281906
|
catch (e) {
|
|
@@ -281855,12 +281942,6 @@ async function addCommitStatusToPrMergeCommit(prAnnotationValue, state, targetUR
|
|
|
281855
281942
|
fDebug(`Adding commit status to ${prAnnotationValue} for owner ${owner}, repo ${repo} and SHA ${branchSha}`);
|
|
281856
281943
|
await github_0.repo.addCommitStatus(state, branchSha, repo, owner, targetURL, description, context);
|
|
281857
281944
|
}
|
|
281858
|
-
async function addCommitStatusToHeadCommit(prAnnotationValue, state, targetURL, description, context) {
|
|
281859
|
-
const { owner, repo, prNumber } = catalog_common.generic.getOwnerRepoPrNumberFromAnnotationValue(prAnnotationValue);
|
|
281860
|
-
const branchSha = await github_0.pulls.getPrLastCommitSHA(prNumber, repo, owner);
|
|
281861
|
-
fDebug(`Adding commit status to ${prAnnotationValue} for owner ${owner}, repo ${repo} and SHA ${branchSha}`);
|
|
281862
|
-
await github_0.repo.addCommitStatus(state, branchSha, repo, owner, targetURL, description, context);
|
|
281863
|
-
}
|
|
281864
281945
|
async function getLastStatePrInfo(cr) {
|
|
281865
281946
|
try {
|
|
281866
281947
|
const prInfo = cr.metadata.annotations['firestartr.dev/last-state-pr'];
|
|
@@ -285123,8 +285204,7 @@ async function* doApply(item, op, handler) {
|
|
|
285123
285204
|
}
|
|
285124
285205
|
const deps = await handler.resolveReferences();
|
|
285125
285206
|
cdktf_log('Item %s has the following dependencies: %O', item.metadata.name, deps);
|
|
285126
|
-
if (
|
|
285127
|
-
(item.metadata.annotations['firestartr.dev/last-state-pr'] || false)) {
|
|
285207
|
+
if (item.metadata.annotations['firestartr.dev/last-state-pr'] || false) {
|
|
285128
285208
|
await addApplyCommitStatus(item, 'pending', catalog_common.generic.getPrLinkFromAnnotationValue(item.metadata.annotations['firestartr.dev/last-state-pr']), 'Performing apply operation...', `Terraform Apply ${item.metadata.name}`);
|
|
285129
285209
|
}
|
|
285130
285210
|
const applyOutput = await provisioner.runProvisioner({
|
|
@@ -285160,8 +285240,7 @@ async function* doApply(item, op, handler) {
|
|
|
285160
285240
|
message: 'doApply',
|
|
285161
285241
|
};
|
|
285162
285242
|
await handler.writeTerraformOutputInTfResult(item, output);
|
|
285163
|
-
if (
|
|
285164
|
-
(item.metadata.annotations['firestartr.dev/last-state-pr'] || false)) {
|
|
285243
|
+
if (item.metadata.annotations['firestartr.dev/last-state-pr'] || false) {
|
|
285165
285244
|
await addApplyCommitStatus(item, 'success', catalog_common.generic.getPrLinkFromAnnotationValue(item.metadata.annotations['firestartr.dev/last-state-pr']), 'Apply operation completed', `Terraform Apply ${item.metadata.name}`);
|
|
285166
285245
|
}
|
|
285167
285246
|
handler.success();
|
|
@@ -285197,8 +285276,7 @@ async function* doApply(item, op, handler) {
|
|
|
285197
285276
|
status: 'False',
|
|
285198
285277
|
message: error.toString(),
|
|
285199
285278
|
};
|
|
285200
|
-
if (
|
|
285201
|
-
(item.metadata.annotations['firestartr.dev/last-state-pr'] || false)) {
|
|
285279
|
+
if (item.metadata.annotations['firestartr.dev/last-state-pr'] || false) {
|
|
285202
285280
|
await addApplyCommitStatus(item, 'failure', catalog_common.generic.getPrLinkFromAnnotationValue(item.metadata.annotations['firestartr.dev/last-state-pr']), 'Apply operation failed', `Terraform Apply ${item.metadata.name}`);
|
|
285203
285281
|
}
|
|
285204
285282
|
handler.error();
|
|
@@ -286534,8 +286612,7 @@ async function* process_operation_doApply(item, op, handler) {
|
|
|
286534
286612
|
const deps = await handler.resolveReferences();
|
|
286535
286613
|
process_operation_log('Item %s has the following dependencies: %O', item.metadata.name, deps);
|
|
286536
286614
|
const context = buildProvisionerContext(item, deps);
|
|
286537
|
-
if (
|
|
286538
|
-
(item.metadata.annotations['firestartr.dev/last-state-pr'] || false)) {
|
|
286615
|
+
if (item.metadata.annotations['firestartr.dev/last-state-pr'] || false) {
|
|
286539
286616
|
await addApplyCommitStatus(item, 'pending', catalog_common.generic.getPrLinkFromAnnotationValue(item.metadata.annotations['firestartr.dev/last-state-pr']), 'Performing apply operation...', `Terraform Apply ${item.metadata.name}`);
|
|
286540
286617
|
}
|
|
286541
286618
|
const applyOutput = await runTerraformProvisioner(context, 'apply');
|
|
@@ -286570,8 +286647,7 @@ async function* process_operation_doApply(item, op, handler) {
|
|
|
286570
286647
|
message: 'doApply',
|
|
286571
286648
|
};
|
|
286572
286649
|
await handler.writeTerraformOutputInTfResult(item, output);
|
|
286573
|
-
if (
|
|
286574
|
-
(item.metadata.annotations['firestartr.dev/last-state-pr'] || false)) {
|
|
286650
|
+
if (item.metadata.annotations['firestartr.dev/last-state-pr'] || false) {
|
|
286575
286651
|
await addApplyCommitStatus(item, 'success', catalog_common.generic.getPrLinkFromAnnotationValue(item.metadata.annotations['firestartr.dev/last-state-pr']), 'Apply operation completed', `Terraform Apply ${item.metadata.name}`);
|
|
286576
286652
|
}
|
|
286577
286653
|
handler.success();
|
|
@@ -286601,8 +286677,7 @@ async function* process_operation_doApply(item, op, handler) {
|
|
|
286601
286677
|
status: 'False',
|
|
286602
286678
|
message: JSON.stringify(e),
|
|
286603
286679
|
};
|
|
286604
|
-
if (
|
|
286605
|
-
(item.metadata.annotations['firestartr.dev/last-state-pr'] || false)) {
|
|
286680
|
+
if (item.metadata.annotations['firestartr.dev/last-state-pr'] || false) {
|
|
286606
286681
|
await addApplyCommitStatus(item, 'failure', catalog_common.generic.getPrLinkFromAnnotationValue(item.metadata.annotations['firestartr.dev/last-state-pr']), 'Apply operation failed', `Terraform Apply ${item.metadata.name}`);
|
|
286607
286682
|
}
|
|
286608
286683
|
handler.error();
|
|
@@ -286845,27 +286920,27 @@ function getErrorOutputMessage(cr, key, ref) {
|
|
|
286845
286920
|
return `
|
|
286846
286921
|
|
|
286847
286922
|
❌ No output ${key} found in secret '${ref.secret.metadata.name}' .
|
|
286848
|
-
|
|
286923
|
+
|
|
286849
286924
|
❗❕ Your terraform project has not the output '${key}' .
|
|
286850
|
-
|
|
286925
|
+
|
|
286851
286926
|
Maybe you forgot to add it or your reference is wrong.
|
|
286852
|
-
|
|
286927
|
+
|
|
286853
286928
|
🔗 Terraform project: ${cr.spec.module}
|
|
286854
|
-
|
|
286929
|
+
|
|
286855
286930
|
🖹 Output example:
|
|
286856
|
-
|
|
286931
|
+
|
|
286857
286932
|
... your terraform code ...
|
|
286858
|
-
|
|
286933
|
+
|
|
286859
286934
|
# missing output
|
|
286860
286935
|
output '${key}' {
|
|
286861
286936
|
value = <your_value>
|
|
286862
286937
|
}
|
|
286863
|
-
|
|
286938
|
+
|
|
286864
286939
|
`;
|
|
286865
286940
|
}
|
|
286866
286941
|
else if (cr.spec.source === 'Inline') {
|
|
286867
286942
|
return `❗❕ Could not find output '${key}' in inline module:
|
|
286868
|
-
|
|
286943
|
+
|
|
286869
286944
|
${cr.spec.module}
|
|
286870
286945
|
`;
|
|
286871
286946
|
}
|
|
@@ -10,6 +10,7 @@ declare const _default: {
|
|
|
10
10
|
$ref: string;
|
|
11
11
|
type?: undefined;
|
|
12
12
|
properties?: undefined;
|
|
13
|
+
required?: undefined;
|
|
13
14
|
additionalProperties?: undefined;
|
|
14
15
|
} | {
|
|
15
16
|
type: string;
|
|
@@ -18,6 +19,10 @@ declare const _default: {
|
|
|
18
19
|
type: string;
|
|
19
20
|
pattern: string;
|
|
20
21
|
};
|
|
22
|
+
owner: {
|
|
23
|
+
type: string;
|
|
24
|
+
pattern: string;
|
|
25
|
+
};
|
|
21
26
|
providers: {
|
|
22
27
|
type: string;
|
|
23
28
|
properties: {
|
|
@@ -27,6 +32,7 @@ declare const _default: {
|
|
|
27
32
|
};
|
|
28
33
|
};
|
|
29
34
|
};
|
|
35
|
+
required: string[];
|
|
30
36
|
additionalProperties: boolean;
|
|
31
37
|
$ref?: undefined;
|
|
32
38
|
})[];
|
|
@@ -142,6 +142,7 @@ declare const schemas: {
|
|
|
142
142
|
$ref: string;
|
|
143
143
|
type?: undefined;
|
|
144
144
|
properties?: undefined;
|
|
145
|
+
required?: undefined;
|
|
145
146
|
additionalProperties?: undefined;
|
|
146
147
|
} | {
|
|
147
148
|
type: string;
|
|
@@ -150,6 +151,10 @@ declare const schemas: {
|
|
|
150
151
|
type: string;
|
|
151
152
|
pattern: string;
|
|
152
153
|
};
|
|
154
|
+
owner: {
|
|
155
|
+
type: string;
|
|
156
|
+
pattern: string;
|
|
157
|
+
};
|
|
153
158
|
providers: {
|
|
154
159
|
type: string;
|
|
155
160
|
properties: {
|
|
@@ -159,6 +164,7 @@ declare const schemas: {
|
|
|
159
164
|
};
|
|
160
165
|
};
|
|
161
166
|
};
|
|
167
|
+
required: string[];
|
|
162
168
|
additionalProperties: boolean;
|
|
163
169
|
$ref?: undefined;
|
|
164
170
|
})[];
|
|
@@ -237,6 +243,7 @@ declare const schemas: {
|
|
|
237
243
|
$ref: string;
|
|
238
244
|
type?: undefined;
|
|
239
245
|
properties?: undefined;
|
|
246
|
+
required?: undefined;
|
|
240
247
|
additionalProperties?: undefined;
|
|
241
248
|
} | {
|
|
242
249
|
type: string;
|
|
@@ -248,6 +255,10 @@ declare const schemas: {
|
|
|
248
255
|
type: string;
|
|
249
256
|
pattern: string;
|
|
250
257
|
};
|
|
258
|
+
owner: {
|
|
259
|
+
type: string;
|
|
260
|
+
pattern: string;
|
|
261
|
+
};
|
|
251
262
|
providers: {
|
|
252
263
|
type: string;
|
|
253
264
|
properties: {
|
|
@@ -258,6 +269,7 @@ declare const schemas: {
|
|
|
258
269
|
required: string[];
|
|
259
270
|
};
|
|
260
271
|
};
|
|
272
|
+
required: string[];
|
|
261
273
|
additionalProperties: boolean;
|
|
262
274
|
$ref?: undefined;
|
|
263
275
|
})[];
|
|
@@ -10,6 +10,7 @@ declare const _default: {
|
|
|
10
10
|
$ref: string;
|
|
11
11
|
type?: undefined;
|
|
12
12
|
properties?: undefined;
|
|
13
|
+
required?: undefined;
|
|
13
14
|
additionalProperties?: undefined;
|
|
14
15
|
} | {
|
|
15
16
|
type: string;
|
|
@@ -21,6 +22,10 @@ declare const _default: {
|
|
|
21
22
|
type: string;
|
|
22
23
|
pattern: string;
|
|
23
24
|
};
|
|
25
|
+
owner: {
|
|
26
|
+
type: string;
|
|
27
|
+
pattern: string;
|
|
28
|
+
};
|
|
24
29
|
providers: {
|
|
25
30
|
type: string;
|
|
26
31
|
properties: {
|
|
@@ -31,6 +36,7 @@ declare const _default: {
|
|
|
31
36
|
required: string[];
|
|
32
37
|
};
|
|
33
38
|
};
|
|
39
|
+
required: string[];
|
|
34
40
|
additionalProperties: boolean;
|
|
35
41
|
$ref?: undefined;
|
|
36
42
|
})[];
|
|
@@ -3,3 +3,4 @@ import { GlobalSection } from '../globals/base';
|
|
|
3
3
|
import { OverriderPatches } from '../overriders/base';
|
|
4
4
|
import { Normalizer } from '../normalizers/base';
|
|
5
5
|
export declare function loadClaim(claimRef: string, org: string, defaults: any, patchClaim: (claim: any, defaults: any) => any, loadInitializers: (claim: any) => Promise<InitializerPatches[]>, loadGlobals: (claim: any) => Promise<GlobalSection[]>, loadOverrides: (claim: any) => OverriderPatches[], loadNormalizers: (claim: any, path: string) => Promise<Normalizer[]>, cwd?: string, existingRefs?: any): Promise<any>;
|
|
6
|
+
export declare function resetLazyLoader(): void;
|
|
@@ -39,7 +39,7 @@ export declare function loadAll(): Promise<{
|
|
|
39
39
|
crs: any;
|
|
40
40
|
renames?: IRenameResult[];
|
|
41
41
|
}>;
|
|
42
|
-
export declare function loadClaimsList(claimRefList: string
|
|
42
|
+
export declare function loadClaimsList(claimRefList: AsyncGenerator<string, void, unknown>, claimsPath?: string): Promise<{
|
|
43
43
|
renderClaims: RenderClaims;
|
|
44
44
|
crs: any;
|
|
45
45
|
renames?: IRenameResult[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Construct } from 'constructs';
|
|
2
2
|
import { RenderedCrMap } from './types';
|
|
3
|
-
export declare function render(catalogScope: Construct, firestartrScope: Construct, activateReferentialIntegrityValidation
|
|
3
|
+
export declare function render(catalogScope: Construct, firestartrScope: Construct, activateReferentialIntegrityValidation: boolean, claimList: AsyncGenerator<string, void, unknown>): Promise<RenderedCrMap>;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export declare function resolveStringReference(reference: string): any;
|
|
2
|
+
export declare function claimsRefListAsGenerator(refs: string[]): AsyncGenerator<string, void, unknown>;
|
|
2
3
|
export declare function resolveClaimFilesList(claimRefsList: string): string[];
|
|
4
|
+
export declare function resolveClaimEntries(claimRefsList: string[]): AsyncGenerator<string, void, unknown>;
|
|
5
|
+
export declare function resolveClaimFileRef(claimFile: string): Promise<string>;
|