@firestartr/cli 1.39.3-SNAPSHOT → 1.39.3-SNAPSHOT2
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
CHANGED
|
@@ -287108,6 +287108,7 @@ const kindMap = {
|
|
|
287108
287108
|
user: 'UserClaim',
|
|
287109
287109
|
group: 'GroupClaim',
|
|
287110
287110
|
system: 'SystemClaim',
|
|
287111
|
+
secret: 'SecretsClaim',
|
|
287111
287112
|
};
|
|
287112
287113
|
function extractRefs(renderClaims, kind) {
|
|
287113
287114
|
const result = {};
|
|
@@ -287191,6 +287192,7 @@ function getClaimReferences(claim) {
|
|
|
287191
287192
|
const listItemRegex = catalog_common.types.regex.YAMLListItemRegex;
|
|
287192
287193
|
const inlineListRegex = catalog_common.types.regex.YAMLInlineListRegex;
|
|
287193
287194
|
const valueRegex = catalog_common.types.regex.GenericRefRegex;
|
|
287195
|
+
const secretRegex = catalog_common.types.regex.SecretRefRegex;
|
|
287194
287196
|
const refs = [];
|
|
287195
287197
|
let multilineMargin = -1;
|
|
287196
287198
|
for (const line of claim.split('\n')) {
|
|
@@ -287225,6 +287227,16 @@ function getClaimReferences(claim) {
|
|
|
287225
287227
|
refs.push(resolveFirestartrRef(ref));
|
|
287226
287228
|
}
|
|
287227
287229
|
}
|
|
287230
|
+
else if (lineValue.match(secretRegex)) {
|
|
287231
|
+
lineValue = lineValue
|
|
287232
|
+
.replace(/"/g, '')
|
|
287233
|
+
.replace(/'/g, '')
|
|
287234
|
+
.replace(/\$/g, '')
|
|
287235
|
+
.replace(/\{/g, '')
|
|
287236
|
+
.replace(/\s/g, '');
|
|
287237
|
+
const secretRef = lineValue.split('.')[0];
|
|
287238
|
+
refs.push(resolveFirestartrRef(secretRef));
|
|
287239
|
+
}
|
|
287228
287240
|
else if (lineValue.match(multilineRegex)) {
|
|
287229
287241
|
multilineMargin = line.length - line.trimStart().length;
|
|
287230
287242
|
}
|
|
@@ -297949,7 +297961,7 @@ async function publishApply(item, applyOutput, kind) {
|
|
|
297949
297961
|
const dividedOutput = github_0.pulls.divideCommentIntoChunks(applyOutput, 250);
|
|
297950
297962
|
let currentCommentNo = 1;
|
|
297951
297963
|
for (const commentContent of dividedOutput) {
|
|
297952
|
-
const comment = `<h1>
|
|
297964
|
+
const comment = `<h1>
|
|
297953
297965
|
<img width="25" src="https://static-00.iconduck.com/assets.00/file-type-terraform-icon-1821x2048-mbxeegff.png"> Terraform apply
|
|
297954
297966
|
</h1>
|
|
297955
297967
|
<p><b>${kind}: </b>${item.metadata.name}</p>
|
|
@@ -298016,8 +298028,8 @@ async function publishPlan(item, planOutput, prNumber, repo, org) {
|
|
|
298016
298028
|
try {
|
|
298017
298029
|
const dividedOutput = github_0.pulls.divideCommentIntoChunks(planOutput, 250);
|
|
298018
298030
|
let currentCommentNo = 1;
|
|
298019
|
-
|
|
298020
|
-
const comment = `<h1>
|
|
298031
|
+
for (const commentContent of dividedOutput) {
|
|
298032
|
+
const comment = `<h1>
|
|
298021
298033
|
<img width="25" src="https://static-00.iconduck.com/assets.00/file-type-terraform-icon-1821x2048-mbxeegff.png"> Terraform plan
|
|
298022
298034
|
</h1>
|
|
298023
298035
|
<p><b>TFWorkspace: </b>${item.metadata.name}</p>
|
|
@@ -298031,7 +298043,7 @@ ${commentContent}
|
|
|
298031
298043
|
</details>`;
|
|
298032
298044
|
await github_0.pulls.commentInPR(comment, prNumber, repo, org);
|
|
298033
298045
|
currentCommentNo += 1;
|
|
298034
|
-
}
|
|
298046
|
+
}
|
|
298035
298047
|
}
|
|
298036
298048
|
catch (e) {
|
|
298037
298049
|
console.error(e);
|
|
@@ -300532,27 +300544,27 @@ function processOperationPlan_getErrorOutputMessage(cr, key, ref) {
|
|
|
300532
300544
|
return `
|
|
300533
300545
|
|
|
300534
300546
|
❌ No output ${key} found in secret "${ref.secret.metadata.name}" .
|
|
300535
|
-
|
|
300547
|
+
|
|
300536
300548
|
❗❕ Your terraform project has not the output "${key}" .
|
|
300537
|
-
|
|
300549
|
+
|
|
300538
300550
|
Maybe you forgot to add it or your reference is wrong.
|
|
300539
|
-
|
|
300551
|
+
|
|
300540
300552
|
🔗 Terraform project: ${cr.spec.module}
|
|
300541
|
-
|
|
300553
|
+
|
|
300542
300554
|
🖹 Output example:
|
|
300543
|
-
|
|
300555
|
+
|
|
300544
300556
|
... your terraform code ...
|
|
300545
|
-
|
|
300557
|
+
|
|
300546
300558
|
# missing output
|
|
300547
300559
|
output "${key}" {
|
|
300548
300560
|
value = <your_value>
|
|
300549
300561
|
}
|
|
300550
|
-
|
|
300562
|
+
|
|
300551
300563
|
`;
|
|
300552
300564
|
}
|
|
300553
300565
|
else if (cr.spec.source === 'Inline') {
|
|
300554
300566
|
return `❗❕ Could not find output '${key}' in inline module:
|
|
300555
|
-
|
|
300567
|
+
|
|
300556
300568
|
${cr.spec.module}
|
|
300557
300569
|
`;
|
|
300558
300570
|
}
|
|
@@ -300576,22 +300588,22 @@ async function processOperationPlan_publishPlan(item, planOutput) {
|
|
|
300576
300588
|
throw new Error('No repo found in CR');
|
|
300577
300589
|
const dividedOutput = github_0.pulls.divideCommentIntoChunks(planOutput, 250);
|
|
300578
300590
|
let currentCommentNo = 1;
|
|
300579
|
-
|
|
300580
|
-
const comment = `<h1>
|
|
300591
|
+
for (const commentContent of dividedOutput) {
|
|
300592
|
+
const comment = `<h1>
|
|
300581
300593
|
<img width="25" src="https://static-00.iconduck.com/assets.00/file-type-terraform-icon-1821x2048-mbxeegff.png"> Terraform plan
|
|
300582
300594
|
</h1>
|
|
300583
300595
|
<p><b>TFWorkspace: </b>${item.metadata.name}</p>
|
|
300584
|
-
|
|
300596
|
+
|
|
300585
300597
|
<details id=github>
|
|
300586
300598
|
<summary>PLAN LOGS ${dividedOutput.length > 1 ? '(Part ' + currentCommentNo + ')' : ''}</summary>
|
|
300587
|
-
|
|
300599
|
+
|
|
300588
300600
|
\`\`\`shell
|
|
300589
300601
|
${commentContent}
|
|
300590
300602
|
\`\`\`
|
|
300591
300603
|
</details>`;
|
|
300592
300604
|
await github_0.pulls.commentInPR(comment, parseInt(prNumber), repo, org);
|
|
300593
300605
|
currentCommentNo += 1;
|
|
300594
|
-
}
|
|
300606
|
+
}
|
|
300595
300607
|
}
|
|
300596
300608
|
catch (e) {
|
|
300597
300609
|
console.error(e);
|
|
@@ -300838,10 +300850,10 @@ async function tfWorkspacePlan(opts) {
|
|
|
300838
300850
|
await addPlanStatusCheck(pull, tfOutput, 'completed');
|
|
300839
300851
|
}
|
|
300840
300852
|
catch (e) {
|
|
300841
|
-
tfworkspaceplans_fDebug(`Error: ${e}`, 'error');
|
|
300842
|
-
await addPlanStatusCheck(pull, e, 'completed', true);
|
|
300853
|
+
tfworkspaceplans_fDebug(`Error: ${e.message}`, 'error');
|
|
300854
|
+
await addPlanStatusCheck(pull, e.message, 'completed', true);
|
|
300843
300855
|
tfworkspaceplans_fDebug('Publishing plan');
|
|
300844
|
-
await publishPlan(cr, e, prNumber, repo, owner);
|
|
300856
|
+
await publishPlan(cr, e.message, prNumber, repo, owner);
|
|
300845
300857
|
}
|
|
300846
300858
|
}
|
|
300847
300859
|
function getCommandByStatus(status) {
|
|
@@ -300948,7 +300960,7 @@ async function tfPlanner(claimFilePath, claim, namespace, debug, jobTtl, cmd = '
|
|
|
300948
300960
|
job.spec = new client.V1JobSpec();
|
|
300949
300961
|
if (jobTtl)
|
|
300950
300962
|
job.spec.ttlSecondsAfterFinished = jobTtl;
|
|
300951
|
-
job.spec.template = controllerDeploy.spec
|
|
300963
|
+
job.spec.template = controllerDeploy.body.spec
|
|
300952
300964
|
.template;
|
|
300953
300965
|
job.spec.template.spec.containers[0].command = [
|
|
300954
300966
|
'sh',
|
|
@@ -428,7 +428,7 @@ export declare function getBranch(repo: string, branch: string, owner?: string):
|
|
|
428
428
|
verified_at: string;
|
|
429
429
|
};
|
|
430
430
|
};
|
|
431
|
-
author:
|
|
431
|
+
author: {
|
|
432
432
|
name?: string;
|
|
433
433
|
email?: string;
|
|
434
434
|
login: string;
|
|
@@ -451,8 +451,8 @@ export declare function getBranch(repo: string, branch: string, owner?: string):
|
|
|
451
451
|
site_admin: boolean;
|
|
452
452
|
starred_at?: string;
|
|
453
453
|
user_view_type?: string;
|
|
454
|
-
}
|
|
455
|
-
committer:
|
|
454
|
+
} | Record<string, never>;
|
|
455
|
+
committer: {
|
|
456
456
|
name?: string;
|
|
457
457
|
email?: string;
|
|
458
458
|
login: string;
|
|
@@ -475,7 +475,7 @@ export declare function getBranch(repo: string, branch: string, owner?: string):
|
|
|
475
475
|
site_admin: boolean;
|
|
476
476
|
starred_at?: string;
|
|
477
477
|
user_view_type?: string;
|
|
478
|
-
}
|
|
478
|
+
} | Record<string, never>;
|
|
479
479
|
parents: {
|
|
480
480
|
sha: string;
|
|
481
481
|
url: string;
|