@firestartr/cli 2.9.0 → 2.10.0-snapshot-org-secrets-1
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 +1281 -8
- package/build/packages/cdk8s_renderer/imports/firestartr.dev.d.ts +678 -0
- package/build/packages/cdk8s_renderer/src/charts/github/index.d.ts +2 -0
- package/build/packages/cdk8s_renderer/src/charts/github/orgSecretSectionChart.d.ts +8 -0
- package/build/packages/cdk8s_renderer/src/charts/github/orgVariableSectionChart.d.ts +8 -0
- package/build/packages/cdk8s_renderer/src/charts/index.d.ts +3 -1
- package/build/packages/cdk8s_renderer/src/claims/base/schemas/index.d.ts +123 -0
- package/build/packages/cdk8s_renderer/src/claims/github/index.d.ts +123 -0
- package/build/packages/cdk8s_renderer/src/claims/github/orgSecrets.schema.d.ts +55 -0
- package/build/packages/cdk8s_renderer/src/claims/github/orgSettings.d.ts +20 -0
- package/build/packages/cdk8s_renderer/src/claims/github/orgsettings.schema.d.ts +70 -0
- package/build/packages/cdk8s_renderer/src/renderer/claims-render.d.ts +1 -1
- package/build/packages/cdk8s_renderer/src/renderer/previous-crs-extractor.d.ts +1 -1
- package/build/packages/cdk8s_renderer/src/validations/githubOrgSecretSection.d.ts +4 -0
- package/build/packages/cdk8s_renderer/src/validations/githubOrgVariableSection.d.ts +4 -0
- package/build/packages/gh_provisioner/src/entities/ghorgvarsection/index.d.ts +8 -0
- package/build/packages/github/index.d.ts +1 -0
- package/build/packages/github/src/organization.d.ts +2 -0
- package/build/packages/github/src/with_profile.d.ts +1 -0
- package/package.json +3 -2
package/build/index.js
CHANGED
|
@@ -284613,6 +284613,17 @@ async function doPaginatedRequest(options) {
|
|
|
284613
284613
|
'Cache-Control': 'no-cache',
|
|
284614
284614
|
});
|
|
284615
284615
|
}
|
|
284616
|
+
async function getOrgVariable(org, variableName, octokit) {
|
|
284617
|
+
logger.info(`Getting org variable ${variableName} for org ${org}`);
|
|
284618
|
+
if (!octokit) {
|
|
284619
|
+
octokit = await getOctokitForOrg(org);
|
|
284620
|
+
}
|
|
284621
|
+
const response = await octokit.rest.actions.getOrgVariable({
|
|
284622
|
+
org,
|
|
284623
|
+
name: variableName,
|
|
284624
|
+
});
|
|
284625
|
+
return response.data;
|
|
284626
|
+
}
|
|
284616
284627
|
/* harmony default export */ const organization = ({
|
|
284617
284628
|
getRepositoryList,
|
|
284618
284629
|
getTeamList,
|
|
@@ -284623,6 +284634,7 @@ async function doPaginatedRequest(options) {
|
|
|
284623
284634
|
getOrgTeamsDirectAccess,
|
|
284624
284635
|
getOrgPlanName,
|
|
284625
284636
|
getWebhookList,
|
|
284637
|
+
getOrgVariable,
|
|
284626
284638
|
});
|
|
284627
284639
|
|
|
284628
284640
|
// EXTERNAL MODULE: external "fs"
|
|
@@ -286115,6 +286127,10 @@ function createFacade(profileName) {
|
|
|
286115
286127
|
const octokit = await getOctokitForOrg(orgName);
|
|
286116
286128
|
return getOrgPlanName(orgName, octokit);
|
|
286117
286129
|
},
|
|
286130
|
+
getOrgVariable: async (orgName, variableName) => {
|
|
286131
|
+
const octokit = await getOctokitForOrg(orgName);
|
|
286132
|
+
return getOrgVariable(orgName, variableName, octokit);
|
|
286133
|
+
},
|
|
286118
286134
|
},
|
|
286119
286135
|
repo: {
|
|
286120
286136
|
addStatusCheck: async (output, isFailure, headSha, name, status, repoName, owner) => {
|
|
@@ -319522,9 +319538,14 @@ class UUIDInitializer extends InitializerPatches {
|
|
|
319522
319538
|
},
|
|
319523
319539
|
apply(cr) {
|
|
319524
319540
|
const ctx = helperCTX(this);
|
|
319525
|
-
const
|
|
319526
|
-
|
|
319527
|
-
|
|
319541
|
+
const reusePrevious = previousCR && previousCR.kind === ctx.kind;
|
|
319542
|
+
const uuid = reusePrevious
|
|
319543
|
+
? previousCR?.spec?.firestartr?.tfStateKey ||
|
|
319544
|
+
claim.providers?.[ctx.provider]?.tfStateKey ||
|
|
319545
|
+
(0,wrapper.v4)()
|
|
319546
|
+
: cr.spec?.firestartr?.tfStateKey ||
|
|
319547
|
+
claim.providers?.[ctx.provider]?.tfStateKey ||
|
|
319548
|
+
(0,wrapper.v4)();
|
|
319528
319549
|
if (!cr.spec)
|
|
319529
319550
|
cr.spec = {};
|
|
319530
319551
|
if (!cr.spec.firestartr)
|
|
@@ -320066,6 +320087,7 @@ const ONE_WAY_DEFINITIONS = [
|
|
|
320066
320087
|
'/spec/vars',
|
|
320067
320088
|
'/spec/actions/oidc',
|
|
320068
320089
|
'/spec/repo/labels',
|
|
320090
|
+
'/spec/actionsVariables',
|
|
320069
320091
|
];
|
|
320070
320092
|
function applyOneWayDefs(crSpecs) {
|
|
320071
320093
|
const crSpecsClone = JSON.parse(JSON.stringify(crSpecs));
|
|
@@ -322061,6 +322083,42 @@ function extractAllRefs(claimData) {
|
|
|
322061
322083
|
refs.push(...secretsRefs);
|
|
322062
322084
|
break;
|
|
322063
322085
|
}
|
|
322086
|
+
case 'OrgSettingsClaim': {
|
|
322087
|
+
const actionsVariables = parsedClaim.providers?.github?.actions_variables;
|
|
322088
|
+
if (Array.isArray(actionsVariables)) {
|
|
322089
|
+
for (const variable of actionsVariables) {
|
|
322090
|
+
if (variable.visibility !== 'selected')
|
|
322091
|
+
continue;
|
|
322092
|
+
const selectedRepos = variable.selected_repositories;
|
|
322093
|
+
if (!Array.isArray(selectedRepos))
|
|
322094
|
+
continue;
|
|
322095
|
+
for (const repoRef of selectedRepos) {
|
|
322096
|
+
const match = repoRef.match(/^component:(.+)$/);
|
|
322097
|
+
if (match) {
|
|
322098
|
+
refs.push(`ComponentClaim-${match[1]}`);
|
|
322099
|
+
}
|
|
322100
|
+
}
|
|
322101
|
+
}
|
|
322102
|
+
}
|
|
322103
|
+
const orgSecrets = parsedClaim.providers?.github?.org_secrets;
|
|
322104
|
+
if (orgSecrets && typeof orgSecrets === 'object') {
|
|
322105
|
+
const secretRefRegex = /^ref:secretsclaim:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)$/;
|
|
322106
|
+
for (const section of ['actions', 'codespaces', 'dependabot']) {
|
|
322107
|
+
const secrets = orgSecrets[section];
|
|
322108
|
+
if (!Array.isArray(secrets))
|
|
322109
|
+
continue;
|
|
322110
|
+
for (const secret of secrets) {
|
|
322111
|
+
if (!secret.value)
|
|
322112
|
+
continue;
|
|
322113
|
+
const match = secret.value.match(secretRefRegex);
|
|
322114
|
+
if (match) {
|
|
322115
|
+
refs.push(`SecretsClaim-${match[1]}`);
|
|
322116
|
+
}
|
|
322117
|
+
}
|
|
322118
|
+
}
|
|
322119
|
+
}
|
|
322120
|
+
break;
|
|
322121
|
+
}
|
|
322064
322122
|
}
|
|
322065
322123
|
logger.info(`Refs for ${parsedClaim.kind}-${parsedClaim.name}: ${[...new Set(refs)].join(',')}`);
|
|
322066
322124
|
return [...new Set(refs)];
|
|
@@ -323187,6 +323245,73 @@ const organizationSettingsProperties = {
|
|
|
323187
323245
|
secret_scanning_push_protection_enabled_for_new_repositories: {
|
|
323188
323246
|
type: 'boolean',
|
|
323189
323247
|
},
|
|
323248
|
+
actions_variables: {
|
|
323249
|
+
type: 'array',
|
|
323250
|
+
items: {
|
|
323251
|
+
type: 'object',
|
|
323252
|
+
properties: {
|
|
323253
|
+
name: {
|
|
323254
|
+
type: 'string',
|
|
323255
|
+
pattern: '^[A-Za-z0-9_]+$',
|
|
323256
|
+
},
|
|
323257
|
+
value: {
|
|
323258
|
+
type: 'string',
|
|
323259
|
+
},
|
|
323260
|
+
visibility: {
|
|
323261
|
+
type: 'string',
|
|
323262
|
+
enum: ['all', 'private', 'selected'],
|
|
323263
|
+
},
|
|
323264
|
+
selected_repositories: {
|
|
323265
|
+
type: 'array',
|
|
323266
|
+
items: {
|
|
323267
|
+
$ref: 'firestartr.dev://common/FirestartrComponentRef',
|
|
323268
|
+
},
|
|
323269
|
+
},
|
|
323270
|
+
},
|
|
323271
|
+
required: ['name', 'value', 'visibility'],
|
|
323272
|
+
additionalProperties: false,
|
|
323273
|
+
allOf: [
|
|
323274
|
+
{
|
|
323275
|
+
if: {
|
|
323276
|
+
properties: {
|
|
323277
|
+
visibility: { const: 'selected' },
|
|
323278
|
+
},
|
|
323279
|
+
required: ['visibility'],
|
|
323280
|
+
},
|
|
323281
|
+
then: {},
|
|
323282
|
+
else: {
|
|
323283
|
+
properties: {
|
|
323284
|
+
selected_repositories: { type: 'array', maxItems: 0 },
|
|
323285
|
+
},
|
|
323286
|
+
},
|
|
323287
|
+
},
|
|
323288
|
+
],
|
|
323289
|
+
},
|
|
323290
|
+
},
|
|
323291
|
+
org_secrets: {
|
|
323292
|
+
type: 'object',
|
|
323293
|
+
properties: {
|
|
323294
|
+
actions: {
|
|
323295
|
+
type: 'array',
|
|
323296
|
+
items: {
|
|
323297
|
+
$ref: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323298
|
+
},
|
|
323299
|
+
},
|
|
323300
|
+
codespaces: {
|
|
323301
|
+
type: 'array',
|
|
323302
|
+
items: {
|
|
323303
|
+
$ref: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323304
|
+
},
|
|
323305
|
+
},
|
|
323306
|
+
dependabot: {
|
|
323307
|
+
type: 'array',
|
|
323308
|
+
items: {
|
|
323309
|
+
$ref: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323310
|
+
},
|
|
323311
|
+
},
|
|
323312
|
+
},
|
|
323313
|
+
additionalProperties: false,
|
|
323314
|
+
},
|
|
323190
323315
|
};
|
|
323191
323316
|
/* harmony default export */ const github_orgsettings_schema = ({
|
|
323192
323317
|
$schema: SCHEMA,
|
|
@@ -323374,6 +323499,63 @@ const organizationSettingsProperties = {
|
|
|
323374
323499
|
},
|
|
323375
323500
|
});
|
|
323376
323501
|
|
|
323502
|
+
;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/github/orgSecrets.schema.ts
|
|
323503
|
+
|
|
323504
|
+
/* harmony default export */ const orgSecrets_schema = ({
|
|
323505
|
+
$schema: SCHEMA,
|
|
323506
|
+
$id: 'GithubOrgClaimSecrets',
|
|
323507
|
+
definitions: {
|
|
323508
|
+
GithubOrgClaimSecrets: {
|
|
323509
|
+
$id: 'firestartr.dev://github/GithubOrgClaimSecrets',
|
|
323510
|
+
type: 'object',
|
|
323511
|
+
description: 'Organization-level GitHub Actions secrets',
|
|
323512
|
+
properties: {
|
|
323513
|
+
actions: {
|
|
323514
|
+
type: 'array',
|
|
323515
|
+
items: {
|
|
323516
|
+
$ref: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323517
|
+
},
|
|
323518
|
+
},
|
|
323519
|
+
codespaces: {
|
|
323520
|
+
type: 'array',
|
|
323521
|
+
items: {
|
|
323522
|
+
$ref: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323523
|
+
},
|
|
323524
|
+
},
|
|
323525
|
+
dependabot: {
|
|
323526
|
+
type: 'array',
|
|
323527
|
+
items: {
|
|
323528
|
+
$ref: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323529
|
+
},
|
|
323530
|
+
},
|
|
323531
|
+
},
|
|
323532
|
+
additionalProperties: false,
|
|
323533
|
+
},
|
|
323534
|
+
GithubOrgClaimSecretRef: {
|
|
323535
|
+
$id: 'firestartr.dev://github/GithubOrgClaimSecretRef',
|
|
323536
|
+
type: 'string',
|
|
323537
|
+
description: 'the reference of the secret',
|
|
323538
|
+
pattern: '^ref:secretsclaim:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)$',
|
|
323539
|
+
},
|
|
323540
|
+
GithubOrgClaimSecret: {
|
|
323541
|
+
$id: 'firestartr.dev://github/GithubOrgClaimSecret',
|
|
323542
|
+
type: 'object',
|
|
323543
|
+
description: 'An organization-level secret for GitHub Actions',
|
|
323544
|
+
properties: {
|
|
323545
|
+
name: {
|
|
323546
|
+
type: 'string',
|
|
323547
|
+
description: 'the name of the secret',
|
|
323548
|
+
},
|
|
323549
|
+
value: {
|
|
323550
|
+
$ref: 'firestartr.dev://github/GithubOrgClaimSecretRef',
|
|
323551
|
+
},
|
|
323552
|
+
},
|
|
323553
|
+
required: ['name', 'value'],
|
|
323554
|
+
additionalProperties: false,
|
|
323555
|
+
},
|
|
323556
|
+
},
|
|
323557
|
+
});
|
|
323558
|
+
|
|
323377
323559
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/github/index.ts
|
|
323378
323560
|
|
|
323379
323561
|
|
|
@@ -323383,6 +323565,7 @@ const organizationSettingsProperties = {
|
|
|
323383
323565
|
|
|
323384
323566
|
|
|
323385
323567
|
|
|
323568
|
+
|
|
323386
323569
|
const GithubSchemas = [
|
|
323387
323570
|
github_group_schema,
|
|
323388
323571
|
github_user_schema,
|
|
@@ -323392,6 +323575,7 @@ const GithubSchemas = [
|
|
|
323392
323575
|
github_orgsettings_schema,
|
|
323393
323576
|
component_secrets_vars_schema,
|
|
323394
323577
|
component_labels_schema,
|
|
323578
|
+
orgSecrets_schema,
|
|
323395
323579
|
];
|
|
323396
323580
|
|
|
323397
323581
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/claims/tfworkspaces/terraform.schema.ts
|
|
@@ -326538,7 +326722,7 @@ const VARIANT_OF_ANNOTATION = 'firestartr.dev/variant-of';
|
|
|
326538
326722
|
function isVariantCR(cr) {
|
|
326539
326723
|
return cr.metadata?.annotations?.[VARIANT_OF_ANNOTATION] !== undefined;
|
|
326540
326724
|
}
|
|
326541
|
-
function getPreviousCRfromClaim(claim, previousCRs) {
|
|
326725
|
+
function getPreviousCRfromClaim(claim, previousCRs, expectedKind) {
|
|
326542
326726
|
const previousCRsKeys = Object.keys(previousCRs);
|
|
326543
326727
|
const isVariantClaim = !!claim._parentClaimName;
|
|
326544
326728
|
for (const previousCRKey of previousCRsKeys) {
|
|
@@ -326547,6 +326731,8 @@ function getPreviousCRfromClaim(claim, previousCRs) {
|
|
|
326547
326731
|
continue;
|
|
326548
326732
|
if (isExcludedFromPreviousCR(previousCR.kind))
|
|
326549
326733
|
continue;
|
|
326734
|
+
if (expectedKind && previousCR.kind !== expectedKind)
|
|
326735
|
+
continue;
|
|
326550
326736
|
const crVariant = isVariantCR(previousCR);
|
|
326551
326737
|
if (isVariantClaim && !crVariant)
|
|
326552
326738
|
continue;
|
|
@@ -327303,6 +327489,361 @@ var FirestartrGithubMembershipSpecContextProviderRefKind;
|
|
|
327303
327489
|
/** FirestartrProviderConfig */
|
|
327304
327490
|
FirestartrGithubMembershipSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
|
|
327305
327491
|
})(FirestartrGithubMembershipSpecContextProviderRefKind || (FirestartrGithubMembershipSpecContextProviderRefKind = {}));
|
|
327492
|
+
/**
|
|
327493
|
+
* A resource to handle GitHub Organization Actions Secrets.
|
|
327494
|
+
*
|
|
327495
|
+
* @schema FirestartrGithubOrganizationSecretSection
|
|
327496
|
+
*/
|
|
327497
|
+
class FirestartrGithubOrganizationSecretSection extends lib.ApiObject {
|
|
327498
|
+
/**
|
|
327499
|
+
* Renders a Kubernetes manifest for "FirestartrGithubOrganizationSecretSection".
|
|
327500
|
+
*
|
|
327501
|
+
* This can be used to inline resource manifests inside other objects (e.g. as templates).
|
|
327502
|
+
*
|
|
327503
|
+
* @param props initialization props
|
|
327504
|
+
*/
|
|
327505
|
+
static manifest(props) {
|
|
327506
|
+
return {
|
|
327507
|
+
...FirestartrGithubOrganizationSecretSection.GVK,
|
|
327508
|
+
...toJson_FirestartrGithubOrganizationSecretSectionProps(props),
|
|
327509
|
+
};
|
|
327510
|
+
}
|
|
327511
|
+
/**
|
|
327512
|
+
* Defines a "FirestartrGithubOrganizationSecretSection" API object
|
|
327513
|
+
* @param scope the scope in which to define this object
|
|
327514
|
+
* @param id a scope-local name for the object
|
|
327515
|
+
* @param props initialization props
|
|
327516
|
+
*/
|
|
327517
|
+
constructor(scope, id, props) {
|
|
327518
|
+
super(scope, id, {
|
|
327519
|
+
...FirestartrGithubOrganizationSecretSection.GVK,
|
|
327520
|
+
...props,
|
|
327521
|
+
});
|
|
327522
|
+
}
|
|
327523
|
+
/**
|
|
327524
|
+
* Renders the object to Kubernetes JSON.
|
|
327525
|
+
*/
|
|
327526
|
+
toJson() {
|
|
327527
|
+
const resolved = super.toJson();
|
|
327528
|
+
return {
|
|
327529
|
+
...FirestartrGithubOrganizationSecretSection.GVK,
|
|
327530
|
+
...toJson_FirestartrGithubOrganizationSecretSectionProps(resolved),
|
|
327531
|
+
};
|
|
327532
|
+
}
|
|
327533
|
+
}
|
|
327534
|
+
/**
|
|
327535
|
+
* Returns the apiVersion and kind for "FirestartrGithubOrganizationSecretSection"
|
|
327536
|
+
*/
|
|
327537
|
+
FirestartrGithubOrganizationSecretSection.GVK = {
|
|
327538
|
+
apiVersion: 'firestartr.dev/v1',
|
|
327539
|
+
kind: 'FirestartrGithubOrganizationSecretSection',
|
|
327540
|
+
};
|
|
327541
|
+
|
|
327542
|
+
/**
|
|
327543
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionProps' to JSON representation.
|
|
327544
|
+
*/
|
|
327545
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327546
|
+
function toJson_FirestartrGithubOrganizationSecretSectionProps(obj) {
|
|
327547
|
+
if (obj === undefined) {
|
|
327548
|
+
return undefined;
|
|
327549
|
+
}
|
|
327550
|
+
const result = {
|
|
327551
|
+
'metadata': obj.metadata,
|
|
327552
|
+
'spec': toJson_FirestartrGithubOrganizationSecretSectionSpec(obj.spec),
|
|
327553
|
+
};
|
|
327554
|
+
// filter undefined values
|
|
327555
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327556
|
+
}
|
|
327557
|
+
/**
|
|
327558
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpec' to JSON representation.
|
|
327559
|
+
*/
|
|
327560
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327561
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpec(obj) {
|
|
327562
|
+
if (obj === undefined) {
|
|
327563
|
+
return undefined;
|
|
327564
|
+
}
|
|
327565
|
+
const result = {
|
|
327566
|
+
'org': obj.org,
|
|
327567
|
+
'secrets': toJson_FirestartrGithubOrganizationSecretSectionSpecSecrets(obj.secrets),
|
|
327568
|
+
'context': toJson_FirestartrGithubOrganizationSecretSectionSpecContext(obj.context),
|
|
327569
|
+
'firestartr': toJson_FirestartrGithubOrganizationSecretSectionSpecFirestartr(obj.firestartr),
|
|
327570
|
+
'writeConnectionSecretToRef': toJson_FirestartrGithubOrganizationSecretSectionSpecWriteConnectionSecretToRef(obj.writeConnectionSecretToRef),
|
|
327571
|
+
};
|
|
327572
|
+
// filter undefined values
|
|
327573
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327574
|
+
}
|
|
327575
|
+
/**
|
|
327576
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecrets' to JSON representation.
|
|
327577
|
+
*/
|
|
327578
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327579
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecrets(obj) {
|
|
327580
|
+
if (obj === undefined) {
|
|
327581
|
+
return undefined;
|
|
327582
|
+
}
|
|
327583
|
+
const result = {
|
|
327584
|
+
'actions': obj.actions?.map(y => toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsActions(y)),
|
|
327585
|
+
'codespaces': obj.codespaces?.map(y => toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsCodespaces(y)),
|
|
327586
|
+
'dependabot': obj.dependabot?.map(y => toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsDependabot(y)),
|
|
327587
|
+
};
|
|
327588
|
+
// filter undefined values
|
|
327589
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327590
|
+
}
|
|
327591
|
+
/**
|
|
327592
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecContext' to JSON representation.
|
|
327593
|
+
*/
|
|
327594
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327595
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecContext(obj) {
|
|
327596
|
+
if (obj === undefined) {
|
|
327597
|
+
return undefined;
|
|
327598
|
+
}
|
|
327599
|
+
const result = {
|
|
327600
|
+
'backend': toJson_FirestartrGithubOrganizationSecretSectionSpecContextBackend(obj.backend),
|
|
327601
|
+
'provider': toJson_FirestartrGithubOrganizationSecretSectionSpecContextProvider(obj.provider),
|
|
327602
|
+
};
|
|
327603
|
+
// filter undefined values
|
|
327604
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327605
|
+
}
|
|
327606
|
+
/**
|
|
327607
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecFirestartr' to JSON representation.
|
|
327608
|
+
*/
|
|
327609
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327610
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecFirestartr(obj) {
|
|
327611
|
+
if (obj === undefined) {
|
|
327612
|
+
return undefined;
|
|
327613
|
+
}
|
|
327614
|
+
const result = {
|
|
327615
|
+
'tfStateKey': obj.tfStateKey,
|
|
327616
|
+
};
|
|
327617
|
+
// filter undefined values
|
|
327618
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327619
|
+
}
|
|
327620
|
+
/**
|
|
327621
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecWriteConnectionSecretToRef' to JSON representation.
|
|
327622
|
+
*/
|
|
327623
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327624
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecWriteConnectionSecretToRef(obj) {
|
|
327625
|
+
if (obj === undefined) {
|
|
327626
|
+
return undefined;
|
|
327627
|
+
}
|
|
327628
|
+
const result = {
|
|
327629
|
+
'name': obj.name,
|
|
327630
|
+
'outputs': obj.outputs?.map(y => toJson_FirestartrGithubOrganizationSecretSectionSpecWriteConnectionSecretToRefOutputs(y)),
|
|
327631
|
+
};
|
|
327632
|
+
// filter undefined values
|
|
327633
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327634
|
+
}
|
|
327635
|
+
/**
|
|
327636
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsActions' to JSON representation.
|
|
327637
|
+
*/
|
|
327638
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327639
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsActions(obj) {
|
|
327640
|
+
if (obj === undefined) {
|
|
327641
|
+
return undefined;
|
|
327642
|
+
}
|
|
327643
|
+
const result = {
|
|
327644
|
+
'name': obj.name,
|
|
327645
|
+
'ref': toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRef(obj.ref),
|
|
327646
|
+
};
|
|
327647
|
+
// filter undefined values
|
|
327648
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327649
|
+
}
|
|
327650
|
+
/**
|
|
327651
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsCodespaces' to JSON representation.
|
|
327652
|
+
*/
|
|
327653
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327654
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsCodespaces(obj) {
|
|
327655
|
+
if (obj === undefined) {
|
|
327656
|
+
return undefined;
|
|
327657
|
+
}
|
|
327658
|
+
const result = {
|
|
327659
|
+
'name': obj.name,
|
|
327660
|
+
'ref': toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRef(obj.ref),
|
|
327661
|
+
};
|
|
327662
|
+
// filter undefined values
|
|
327663
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327664
|
+
}
|
|
327665
|
+
/**
|
|
327666
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsDependabot' to JSON representation.
|
|
327667
|
+
*/
|
|
327668
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327669
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsDependabot(obj) {
|
|
327670
|
+
if (obj === undefined) {
|
|
327671
|
+
return undefined;
|
|
327672
|
+
}
|
|
327673
|
+
const result = {
|
|
327674
|
+
'name': obj.name,
|
|
327675
|
+
'ref': toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRef(obj.ref),
|
|
327676
|
+
};
|
|
327677
|
+
// filter undefined values
|
|
327678
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327679
|
+
}
|
|
327680
|
+
/**
|
|
327681
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecContextBackend' to JSON representation.
|
|
327682
|
+
*/
|
|
327683
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327684
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecContextBackend(obj) {
|
|
327685
|
+
if (obj === undefined) {
|
|
327686
|
+
return undefined;
|
|
327687
|
+
}
|
|
327688
|
+
const result = {
|
|
327689
|
+
'ref': toJson_FirestartrGithubOrganizationSecretSectionSpecContextBackendRef(obj.ref),
|
|
327690
|
+
};
|
|
327691
|
+
// filter undefined values
|
|
327692
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327693
|
+
}
|
|
327694
|
+
/**
|
|
327695
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecContextProvider' to JSON representation.
|
|
327696
|
+
*/
|
|
327697
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327698
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecContextProvider(obj) {
|
|
327699
|
+
if (obj === undefined) {
|
|
327700
|
+
return undefined;
|
|
327701
|
+
}
|
|
327702
|
+
const result = {
|
|
327703
|
+
'ref': toJson_FirestartrGithubOrganizationSecretSectionSpecContextProviderRef(obj.ref),
|
|
327704
|
+
};
|
|
327705
|
+
// filter undefined values
|
|
327706
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327707
|
+
}
|
|
327708
|
+
/**
|
|
327709
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecWriteConnectionSecretToRefOutputs' to JSON representation.
|
|
327710
|
+
*/
|
|
327711
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327712
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecWriteConnectionSecretToRefOutputs(obj) {
|
|
327713
|
+
if (obj === undefined) {
|
|
327714
|
+
return undefined;
|
|
327715
|
+
}
|
|
327716
|
+
const result = {
|
|
327717
|
+
'key': obj.key,
|
|
327718
|
+
};
|
|
327719
|
+
// filter undefined values
|
|
327720
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327721
|
+
}
|
|
327722
|
+
/**
|
|
327723
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRef' to JSON representation.
|
|
327724
|
+
*/
|
|
327725
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327726
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRef(obj) {
|
|
327727
|
+
if (obj === undefined) {
|
|
327728
|
+
return undefined;
|
|
327729
|
+
}
|
|
327730
|
+
const result = {
|
|
327731
|
+
'kind': obj.kind,
|
|
327732
|
+
'name': obj.name,
|
|
327733
|
+
'key': obj.key,
|
|
327734
|
+
};
|
|
327735
|
+
// filter undefined values
|
|
327736
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327737
|
+
}
|
|
327738
|
+
/**
|
|
327739
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRef' to JSON representation.
|
|
327740
|
+
*/
|
|
327741
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327742
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRef(obj) {
|
|
327743
|
+
if (obj === undefined) {
|
|
327744
|
+
return undefined;
|
|
327745
|
+
}
|
|
327746
|
+
const result = {
|
|
327747
|
+
'kind': obj.kind,
|
|
327748
|
+
'name': obj.name,
|
|
327749
|
+
'key': obj.key,
|
|
327750
|
+
};
|
|
327751
|
+
// filter undefined values
|
|
327752
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327753
|
+
}
|
|
327754
|
+
/**
|
|
327755
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRef' to JSON representation.
|
|
327756
|
+
*/
|
|
327757
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327758
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRef(obj) {
|
|
327759
|
+
if (obj === undefined) {
|
|
327760
|
+
return undefined;
|
|
327761
|
+
}
|
|
327762
|
+
const result = {
|
|
327763
|
+
'kind': obj.kind,
|
|
327764
|
+
'name': obj.name,
|
|
327765
|
+
'key': obj.key,
|
|
327766
|
+
};
|
|
327767
|
+
// filter undefined values
|
|
327768
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327769
|
+
}
|
|
327770
|
+
/**
|
|
327771
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecContextBackendRef' to JSON representation.
|
|
327772
|
+
*/
|
|
327773
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327774
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecContextBackendRef(obj) {
|
|
327775
|
+
if (obj === undefined) {
|
|
327776
|
+
return undefined;
|
|
327777
|
+
}
|
|
327778
|
+
const result = {
|
|
327779
|
+
'kind': obj.kind,
|
|
327780
|
+
'name': obj.name,
|
|
327781
|
+
};
|
|
327782
|
+
// filter undefined values
|
|
327783
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327784
|
+
}
|
|
327785
|
+
/**
|
|
327786
|
+
* Converts an object of type 'FirestartrGithubOrganizationSecretSectionSpecContextProviderRef' to JSON representation.
|
|
327787
|
+
*/
|
|
327788
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327789
|
+
function toJson_FirestartrGithubOrganizationSecretSectionSpecContextProviderRef(obj) {
|
|
327790
|
+
if (obj === undefined) {
|
|
327791
|
+
return undefined;
|
|
327792
|
+
}
|
|
327793
|
+
const result = {
|
|
327794
|
+
'kind': obj.kind,
|
|
327795
|
+
'name': obj.name,
|
|
327796
|
+
};
|
|
327797
|
+
// filter undefined values
|
|
327798
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
327799
|
+
}
|
|
327800
|
+
/* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
327801
|
+
/**
|
|
327802
|
+
* The type of Kubernetes resource to reference.
|
|
327803
|
+
*
|
|
327804
|
+
* @schema FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind
|
|
327805
|
+
*/
|
|
327806
|
+
var FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind;
|
|
327807
|
+
(function (FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind) {
|
|
327808
|
+
/** Secret */
|
|
327809
|
+
FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind["SECRET"] = "Secret";
|
|
327810
|
+
})(FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind || (FirestartrGithubOrganizationSecretSectionSpecSecretsActionsRefKind = {}));
|
|
327811
|
+
/**
|
|
327812
|
+
* The type of Kubernetes resource to reference.
|
|
327813
|
+
*
|
|
327814
|
+
* @schema FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind
|
|
327815
|
+
*/
|
|
327816
|
+
var FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind;
|
|
327817
|
+
(function (FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind) {
|
|
327818
|
+
/** Secret */
|
|
327819
|
+
FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind["SECRET"] = "Secret";
|
|
327820
|
+
})(FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind || (FirestartrGithubOrganizationSecretSectionSpecSecretsCodespacesRefKind = {}));
|
|
327821
|
+
/**
|
|
327822
|
+
* The type of Kubernetes resource to reference.
|
|
327823
|
+
*
|
|
327824
|
+
* @schema FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind
|
|
327825
|
+
*/
|
|
327826
|
+
var FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind;
|
|
327827
|
+
(function (FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind) {
|
|
327828
|
+
/** Secret */
|
|
327829
|
+
FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind["SECRET"] = "Secret";
|
|
327830
|
+
})(FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind || (FirestartrGithubOrganizationSecretSectionSpecSecretsDependabotRefKind = {}));
|
|
327831
|
+
/**
|
|
327832
|
+
* @schema FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind
|
|
327833
|
+
*/
|
|
327834
|
+
var FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind;
|
|
327835
|
+
(function (FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind) {
|
|
327836
|
+
/** FirestartrProviderConfig */
|
|
327837
|
+
FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
|
|
327838
|
+
})(FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind || (FirestartrGithubOrganizationSecretSectionSpecContextBackendRefKind = {}));
|
|
327839
|
+
/**
|
|
327840
|
+
* @schema FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind
|
|
327841
|
+
*/
|
|
327842
|
+
var FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind;
|
|
327843
|
+
(function (FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind) {
|
|
327844
|
+
/** FirestartrProviderConfig */
|
|
327845
|
+
FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
|
|
327846
|
+
})(FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind || (FirestartrGithubOrganizationSecretSectionSpecContextProviderRefKind = {}));
|
|
327306
327847
|
/**
|
|
327307
327848
|
* A resource to handle GitHub Organization Settings.
|
|
327308
327849
|
*
|
|
@@ -327561,6 +328102,254 @@ var FirestartrGithubOrganizationSettingsSpecContextProviderRefKind;
|
|
|
327561
328102
|
/** FirestartrProviderConfig */
|
|
327562
328103
|
FirestartrGithubOrganizationSettingsSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
|
|
327563
328104
|
})(FirestartrGithubOrganizationSettingsSpecContextProviderRefKind || (FirestartrGithubOrganizationSettingsSpecContextProviderRefKind = {}));
|
|
328105
|
+
/**
|
|
328106
|
+
* A resource to handle GitHub Organization Actions Variables.
|
|
328107
|
+
*
|
|
328108
|
+
* @schema FirestartrGithubOrganizationVariableSection
|
|
328109
|
+
*/
|
|
328110
|
+
class FirestartrGithubOrganizationVariableSection extends lib.ApiObject {
|
|
328111
|
+
/**
|
|
328112
|
+
* Renders a Kubernetes manifest for "FirestartrGithubOrganizationVariableSection".
|
|
328113
|
+
*
|
|
328114
|
+
* This can be used to inline resource manifests inside other objects (e.g. as templates).
|
|
328115
|
+
*
|
|
328116
|
+
* @param props initialization props
|
|
328117
|
+
*/
|
|
328118
|
+
static manifest(props) {
|
|
328119
|
+
return {
|
|
328120
|
+
...FirestartrGithubOrganizationVariableSection.GVK,
|
|
328121
|
+
...toJson_FirestartrGithubOrganizationVariableSectionProps(props),
|
|
328122
|
+
};
|
|
328123
|
+
}
|
|
328124
|
+
/**
|
|
328125
|
+
* Defines a "FirestartrGithubOrganizationVariableSection" API object
|
|
328126
|
+
* @param scope the scope in which to define this object
|
|
328127
|
+
* @param id a scope-local name for the object
|
|
328128
|
+
* @param props initialization props
|
|
328129
|
+
*/
|
|
328130
|
+
constructor(scope, id, props) {
|
|
328131
|
+
super(scope, id, {
|
|
328132
|
+
...FirestartrGithubOrganizationVariableSection.GVK,
|
|
328133
|
+
...props,
|
|
328134
|
+
});
|
|
328135
|
+
}
|
|
328136
|
+
/**
|
|
328137
|
+
* Renders the object to Kubernetes JSON.
|
|
328138
|
+
*/
|
|
328139
|
+
toJson() {
|
|
328140
|
+
const resolved = super.toJson();
|
|
328141
|
+
return {
|
|
328142
|
+
...FirestartrGithubOrganizationVariableSection.GVK,
|
|
328143
|
+
...toJson_FirestartrGithubOrganizationVariableSectionProps(resolved),
|
|
328144
|
+
};
|
|
328145
|
+
}
|
|
328146
|
+
}
|
|
328147
|
+
/**
|
|
328148
|
+
* Returns the apiVersion and kind for "FirestartrGithubOrganizationVariableSection"
|
|
328149
|
+
*/
|
|
328150
|
+
FirestartrGithubOrganizationVariableSection.GVK = {
|
|
328151
|
+
apiVersion: 'firestartr.dev/v1',
|
|
328152
|
+
kind: 'FirestartrGithubOrganizationVariableSection',
|
|
328153
|
+
};
|
|
328154
|
+
|
|
328155
|
+
/**
|
|
328156
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionProps' to JSON representation.
|
|
328157
|
+
*/
|
|
328158
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328159
|
+
function toJson_FirestartrGithubOrganizationVariableSectionProps(obj) {
|
|
328160
|
+
if (obj === undefined) {
|
|
328161
|
+
return undefined;
|
|
328162
|
+
}
|
|
328163
|
+
const result = {
|
|
328164
|
+
'metadata': obj.metadata,
|
|
328165
|
+
'spec': toJson_FirestartrGithubOrganizationVariableSectionSpec(obj.spec),
|
|
328166
|
+
};
|
|
328167
|
+
// filter undefined values
|
|
328168
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328169
|
+
}
|
|
328170
|
+
/**
|
|
328171
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpec' to JSON representation.
|
|
328172
|
+
*/
|
|
328173
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328174
|
+
function toJson_FirestartrGithubOrganizationVariableSectionSpec(obj) {
|
|
328175
|
+
if (obj === undefined) {
|
|
328176
|
+
return undefined;
|
|
328177
|
+
}
|
|
328178
|
+
const result = {
|
|
328179
|
+
'org': obj.org,
|
|
328180
|
+
'actionsVariables': obj.actionsVariables?.map(y => toJson_FirestartrGithubOrganizationVariableSectionSpecActionsVariables(y)),
|
|
328181
|
+
'context': toJson_FirestartrGithubOrganizationVariableSectionSpecContext(obj.context),
|
|
328182
|
+
'firestartr': toJson_FirestartrGithubOrganizationVariableSectionSpecFirestartr(obj.firestartr),
|
|
328183
|
+
'writeConnectionSecretToRef': toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef(obj.writeConnectionSecretToRef),
|
|
328184
|
+
};
|
|
328185
|
+
// filter undefined values
|
|
328186
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328187
|
+
}
|
|
328188
|
+
/**
|
|
328189
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecActionsVariables' to JSON representation.
|
|
328190
|
+
*/
|
|
328191
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328192
|
+
function toJson_FirestartrGithubOrganizationVariableSectionSpecActionsVariables(obj) {
|
|
328193
|
+
if (obj === undefined) {
|
|
328194
|
+
return undefined;
|
|
328195
|
+
}
|
|
328196
|
+
const result = {
|
|
328197
|
+
'name': obj.name,
|
|
328198
|
+
'value': obj.value,
|
|
328199
|
+
'visibility': obj.visibility,
|
|
328200
|
+
'selectedRepositories': obj.selectedRepositories?.map(y => y),
|
|
328201
|
+
};
|
|
328202
|
+
// filter undefined values
|
|
328203
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328204
|
+
}
|
|
328205
|
+
/**
|
|
328206
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContext' to JSON representation.
|
|
328207
|
+
*/
|
|
328208
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328209
|
+
function toJson_FirestartrGithubOrganizationVariableSectionSpecContext(obj) {
|
|
328210
|
+
if (obj === undefined) {
|
|
328211
|
+
return undefined;
|
|
328212
|
+
}
|
|
328213
|
+
const result = {
|
|
328214
|
+
'backend': toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackend(obj.backend),
|
|
328215
|
+
'provider': toJson_FirestartrGithubOrganizationVariableSectionSpecContextProvider(obj.provider),
|
|
328216
|
+
};
|
|
328217
|
+
// filter undefined values
|
|
328218
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328219
|
+
}
|
|
328220
|
+
/**
|
|
328221
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecFirestartr' to JSON representation.
|
|
328222
|
+
*/
|
|
328223
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328224
|
+
function toJson_FirestartrGithubOrganizationVariableSectionSpecFirestartr(obj) {
|
|
328225
|
+
if (obj === undefined) {
|
|
328226
|
+
return undefined;
|
|
328227
|
+
}
|
|
328228
|
+
const result = {
|
|
328229
|
+
'tfStateKey': obj.tfStateKey,
|
|
328230
|
+
};
|
|
328231
|
+
// filter undefined values
|
|
328232
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328233
|
+
}
|
|
328234
|
+
/**
|
|
328235
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef' to JSON representation.
|
|
328236
|
+
*/
|
|
328237
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328238
|
+
function toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRef(obj) {
|
|
328239
|
+
if (obj === undefined) {
|
|
328240
|
+
return undefined;
|
|
328241
|
+
}
|
|
328242
|
+
const result = {
|
|
328243
|
+
'name': obj.name,
|
|
328244
|
+
'outputs': obj.outputs?.map(y => toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs(y)),
|
|
328245
|
+
};
|
|
328246
|
+
// filter undefined values
|
|
328247
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328248
|
+
}
|
|
328249
|
+
/* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328250
|
+
/**
|
|
328251
|
+
* Visibility of the variable
|
|
328252
|
+
*
|
|
328253
|
+
* @schema FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility
|
|
328254
|
+
*/
|
|
328255
|
+
var FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility;
|
|
328256
|
+
(function (FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility) {
|
|
328257
|
+
/** all */
|
|
328258
|
+
FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["ALL"] = "all";
|
|
328259
|
+
/** private */
|
|
328260
|
+
FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["PRIVATE"] = "private";
|
|
328261
|
+
/** selected */
|
|
328262
|
+
FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility["SELECTED"] = "selected";
|
|
328263
|
+
})(FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility || (FirestartrGithubOrganizationVariableSectionSpecActionsVariablesVisibility = {}));
|
|
328264
|
+
/**
|
|
328265
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextBackend' to JSON representation.
|
|
328266
|
+
*/
|
|
328267
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328268
|
+
function toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackend(obj) {
|
|
328269
|
+
if (obj === undefined) {
|
|
328270
|
+
return undefined;
|
|
328271
|
+
}
|
|
328272
|
+
const result = {
|
|
328273
|
+
'ref': toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackendRef(obj.ref),
|
|
328274
|
+
};
|
|
328275
|
+
// filter undefined values
|
|
328276
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328277
|
+
}
|
|
328278
|
+
/**
|
|
328279
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextProvider' to JSON representation.
|
|
328280
|
+
*/
|
|
328281
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328282
|
+
function toJson_FirestartrGithubOrganizationVariableSectionSpecContextProvider(obj) {
|
|
328283
|
+
if (obj === undefined) {
|
|
328284
|
+
return undefined;
|
|
328285
|
+
}
|
|
328286
|
+
const result = {
|
|
328287
|
+
'ref': toJson_FirestartrGithubOrganizationVariableSectionSpecContextProviderRef(obj.ref),
|
|
328288
|
+
};
|
|
328289
|
+
// filter undefined values
|
|
328290
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328291
|
+
}
|
|
328292
|
+
/**
|
|
328293
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs' to JSON representation.
|
|
328294
|
+
*/
|
|
328295
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328296
|
+
function toJson_FirestartrGithubOrganizationVariableSectionSpecWriteConnectionSecretToRefOutputs(obj) {
|
|
328297
|
+
if (obj === undefined) {
|
|
328298
|
+
return undefined;
|
|
328299
|
+
}
|
|
328300
|
+
const result = {
|
|
328301
|
+
'key': obj.key,
|
|
328302
|
+
};
|
|
328303
|
+
// filter undefined values
|
|
328304
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328305
|
+
}
|
|
328306
|
+
/**
|
|
328307
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextBackendRef' to JSON representation.
|
|
328308
|
+
*/
|
|
328309
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328310
|
+
function toJson_FirestartrGithubOrganizationVariableSectionSpecContextBackendRef(obj) {
|
|
328311
|
+
if (obj === undefined) {
|
|
328312
|
+
return undefined;
|
|
328313
|
+
}
|
|
328314
|
+
const result = {
|
|
328315
|
+
'kind': obj.kind,
|
|
328316
|
+
'name': obj.name,
|
|
328317
|
+
};
|
|
328318
|
+
// filter undefined values
|
|
328319
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328320
|
+
}
|
|
328321
|
+
/**
|
|
328322
|
+
* Converts an object of type 'FirestartrGithubOrganizationVariableSectionSpecContextProviderRef' to JSON representation.
|
|
328323
|
+
*/
|
|
328324
|
+
/* eslint-disable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328325
|
+
function toJson_FirestartrGithubOrganizationVariableSectionSpecContextProviderRef(obj) {
|
|
328326
|
+
if (obj === undefined) {
|
|
328327
|
+
return undefined;
|
|
328328
|
+
}
|
|
328329
|
+
const result = {
|
|
328330
|
+
'kind': obj.kind,
|
|
328331
|
+
'name': obj.name,
|
|
328332
|
+
};
|
|
328333
|
+
// filter undefined values
|
|
328334
|
+
return Object.entries(result).reduce((r, i) => (i[1] === undefined) ? r : ({ ...r, [i[0]]: i[1] }), {});
|
|
328335
|
+
}
|
|
328336
|
+
/* eslint-enable max-len, @stylistic/max-len, quote-props, @stylistic/quote-props */
|
|
328337
|
+
/**
|
|
328338
|
+
* @schema FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind
|
|
328339
|
+
*/
|
|
328340
|
+
var FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind;
|
|
328341
|
+
(function (FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind) {
|
|
328342
|
+
/** FirestartrProviderConfig */
|
|
328343
|
+
FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
|
|
328344
|
+
})(FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind || (FirestartrGithubOrganizationVariableSectionSpecContextBackendRefKind = {}));
|
|
328345
|
+
/**
|
|
328346
|
+
* @schema FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind
|
|
328347
|
+
*/
|
|
328348
|
+
var FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind;
|
|
328349
|
+
(function (FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind) {
|
|
328350
|
+
/** FirestartrProviderConfig */
|
|
328351
|
+
FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind["FIRESTARTR_PROVIDER_CONFIG"] = "FirestartrProviderConfig";
|
|
328352
|
+
})(FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind || (FirestartrGithubOrganizationVariableSectionSpecContextProviderRefKind = {}));
|
|
327564
328353
|
/**
|
|
327565
328354
|
* A resource to handle GitHub Organization Webhooks
|
|
327566
328355
|
*
|
|
@@ -330410,6 +331199,120 @@ class GithubOrgSettingsChart extends BaseGithubChart {
|
|
|
330410
331199
|
}
|
|
330411
331200
|
}
|
|
330412
331201
|
|
|
331202
|
+
;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/github/orgVariableSectionChart.ts
|
|
331203
|
+
|
|
331204
|
+
|
|
331205
|
+
|
|
331206
|
+
class GithubOrgVariableSectionChart extends BaseGithubChart {
|
|
331207
|
+
template() {
|
|
331208
|
+
const claim = this.get('claim');
|
|
331209
|
+
const firestartrId = this.get('firestartrId');
|
|
331210
|
+
const githubProvider = claim.providers.github;
|
|
331211
|
+
const actionsVariables = (githubProvider.actions_variables || []).map((v) => {
|
|
331212
|
+
const entry = {
|
|
331213
|
+
name: v.name,
|
|
331214
|
+
value: v.value,
|
|
331215
|
+
visibility: v.visibility,
|
|
331216
|
+
};
|
|
331217
|
+
if (v.selected_repositories && v.selected_repositories.length > 0) {
|
|
331218
|
+
entry.selectedRepositories = v.selected_repositories.map((ref) => {
|
|
331219
|
+
const match = ref.match(/^component:(.+)$/);
|
|
331220
|
+
if (!match) {
|
|
331221
|
+
throw new ChartRenderError('OrgSettingsClaim', claim.name, `Invalid component ref "${ref}" in selected_repositories. Expected format: component:<name>`);
|
|
331222
|
+
}
|
|
331223
|
+
const componentName = match[1];
|
|
331224
|
+
const resolvedCr = this.refResolver('ComponentClaim', componentName);
|
|
331225
|
+
const org = resolvedCr?.spec?.org;
|
|
331226
|
+
const repoName = resolvedCr?.metadata?.annotations?.['firestartr.dev/external-name'] || resolvedCr?.metadata?.name?.replace(/-[0-9a-f-]{36}$/, '');
|
|
331227
|
+
if (!org || !repoName) {
|
|
331228
|
+
throw new ChartRenderError('OrgSettingsClaim', claim.name, `Referenced component "${componentName}" has no GitHub provider configured`);
|
|
331229
|
+
}
|
|
331230
|
+
return `${org}/${repoName}`;
|
|
331231
|
+
});
|
|
331232
|
+
}
|
|
331233
|
+
return entry;
|
|
331234
|
+
});
|
|
331235
|
+
const template = {
|
|
331236
|
+
metadata: {
|
|
331237
|
+
name: githubProvider.name,
|
|
331238
|
+
},
|
|
331239
|
+
spec: {
|
|
331240
|
+
org: githubProvider.org,
|
|
331241
|
+
actionsVariables,
|
|
331242
|
+
firestartr: {
|
|
331243
|
+
tfStateKey: firestartrId,
|
|
331244
|
+
},
|
|
331245
|
+
writeConnectionSecretToRef: {
|
|
331246
|
+
name: `firestartrgithuborganizationvariablesection-${githubProvider.name}-outputs`.toLowerCase(),
|
|
331247
|
+
outputs: [{ key: 'managed_variables' }, { key: 'variable_ids' }],
|
|
331248
|
+
},
|
|
331249
|
+
},
|
|
331250
|
+
};
|
|
331251
|
+
return JSON.parse(JSON.stringify(template));
|
|
331252
|
+
}
|
|
331253
|
+
gvk() {
|
|
331254
|
+
return FirestartrGithubOrganizationVariableSection.GVK;
|
|
331255
|
+
}
|
|
331256
|
+
instanceApiObject(template) {
|
|
331257
|
+
return new FirestartrGithubOrganizationVariableSection(this, template.metadata.name, template);
|
|
331258
|
+
}
|
|
331259
|
+
}
|
|
331260
|
+
|
|
331261
|
+
;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/github/orgSecretSectionChart.ts
|
|
331262
|
+
|
|
331263
|
+
|
|
331264
|
+
class GithubOrgSecretSectionChart extends BaseGithubChart {
|
|
331265
|
+
template() {
|
|
331266
|
+
const claim = this.get('claim');
|
|
331267
|
+
const firestartrId = this.get('firestartrId');
|
|
331268
|
+
const githubProvider = claim.providers.github;
|
|
331269
|
+
const orgSecrets = githubProvider.org_secrets || {};
|
|
331270
|
+
const renderSecrets = (section) => {
|
|
331271
|
+
const secrets = orgSecrets[section];
|
|
331272
|
+
if (!Array.isArray(secrets))
|
|
331273
|
+
return [];
|
|
331274
|
+
return secrets.map((secret) => {
|
|
331275
|
+
const parts = secret.value.split(':');
|
|
331276
|
+
return {
|
|
331277
|
+
name: secret.name,
|
|
331278
|
+
ref: {
|
|
331279
|
+
kind: 'Secret',
|
|
331280
|
+
name: parts[2],
|
|
331281
|
+
key: parts[3],
|
|
331282
|
+
},
|
|
331283
|
+
};
|
|
331284
|
+
});
|
|
331285
|
+
};
|
|
331286
|
+
const template = {
|
|
331287
|
+
metadata: {
|
|
331288
|
+
name: `${githubProvider.name}-secrets`,
|
|
331289
|
+
},
|
|
331290
|
+
spec: {
|
|
331291
|
+
org: githubProvider.org,
|
|
331292
|
+
secrets: {
|
|
331293
|
+
actions: renderSecrets('actions'),
|
|
331294
|
+
codespaces: renderSecrets('codespaces'),
|
|
331295
|
+
dependabot: renderSecrets('dependabot'),
|
|
331296
|
+
},
|
|
331297
|
+
firestartr: {
|
|
331298
|
+
tfStateKey: firestartrId ? `${firestartrId}-secrets` : firestartrId,
|
|
331299
|
+
},
|
|
331300
|
+
writeConnectionSecretToRef: {
|
|
331301
|
+
name: `firestartrgithuborganizationsecretsection-${githubProvider.name}-outputs`.toLowerCase(),
|
|
331302
|
+
outputs: [{ key: 'managed_secrets' }, { key: 'secret_ids' }],
|
|
331303
|
+
},
|
|
331304
|
+
},
|
|
331305
|
+
};
|
|
331306
|
+
return JSON.parse(JSON.stringify(template));
|
|
331307
|
+
}
|
|
331308
|
+
gvk() {
|
|
331309
|
+
return FirestartrGithubOrganizationSecretSection.GVK;
|
|
331310
|
+
}
|
|
331311
|
+
instanceApiObject(template) {
|
|
331312
|
+
return new FirestartrGithubOrganizationSecretSection(this, template.metadata.name, template);
|
|
331313
|
+
}
|
|
331314
|
+
}
|
|
331315
|
+
|
|
330413
331316
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/github/index.ts
|
|
330414
331317
|
|
|
330415
331318
|
|
|
@@ -330417,6 +331320,8 @@ class GithubOrgSettingsChart extends BaseGithubChart {
|
|
|
330417
331320
|
|
|
330418
331321
|
|
|
330419
331322
|
|
|
331323
|
+
|
|
331324
|
+
|
|
330420
331325
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/charts/catalog/base.ts
|
|
330421
331326
|
|
|
330422
331327
|
class BaseCatalogChart extends BaseChart {
|
|
@@ -331164,6 +332069,8 @@ class SecretsChart extends BaseSecretsChart {
|
|
|
331164
332069
|
SecretsChart: SecretsChart,
|
|
331165
332070
|
GithubOrgWebhookChart: GithubOrgWebhookChart,
|
|
331166
332071
|
GithubOrgSettingsChart: GithubOrgSettingsChart,
|
|
332072
|
+
GithubOrgVariableSectionChart: GithubOrgVariableSectionChart,
|
|
332073
|
+
GithubOrgSecretSectionChart: GithubOrgSecretSectionChart,
|
|
331167
332074
|
});
|
|
331168
332075
|
|
|
331169
332076
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/renderer/claims-render.ts
|
|
@@ -331208,13 +332115,28 @@ async function renderClaims(catalogScope, firestartrScope, data) {
|
|
|
331208
332115
|
if (configuredProvider !== AllowedProviders.all.toString()) {
|
|
331209
332116
|
providers = providers.filter((provider) => provider === configuredProvider);
|
|
331210
332117
|
}
|
|
331211
|
-
const
|
|
332118
|
+
const expectedKind = claim.kind === 'OrgSettingsClaim'
|
|
332119
|
+
? 'FirestartrGithubOrganizationSettings'
|
|
332120
|
+
: undefined;
|
|
332121
|
+
const previousCR = getPreviousCRfromClaim(claim, crs, expectedKind);
|
|
332122
|
+
const variableSectionPreviousCR = claim.kind === 'OrgSettingsClaim'
|
|
332123
|
+
? getPreviousCRfromClaim({ kind: claim.kind, name: `${claim.name}-variable-section` }, crs, 'FirestartrGithubOrganizationVariableSection')
|
|
332124
|
+
: false;
|
|
332125
|
+
const secretSectionPreviousCR = claim.kind === 'OrgSettingsClaim'
|
|
332126
|
+
? getPreviousCRfromClaim({ kind: claim.kind, name: `${claim.name}-secret-section` }, crs, 'FirestartrGithubOrganizationSecretSection')
|
|
332127
|
+
: false;
|
|
331212
332128
|
const patches = await extractPatches(renderClaims[claimKey], previousCR);
|
|
332129
|
+
let variableSectionPatches = undefined;
|
|
332130
|
+
let secretSectionPatches = undefined;
|
|
332131
|
+
if (claim.kind === 'OrgSettingsClaim') {
|
|
332132
|
+
variableSectionPatches = await extractPatches(renderClaims[claimKey], variableSectionPreviousCR);
|
|
332133
|
+
secretSectionPatches = await extractPatches(renderClaims[claimKey], secretSectionPreviousCR);
|
|
332134
|
+
}
|
|
331213
332135
|
if (!previousCR) {
|
|
331214
332136
|
logger.debug(`No CR found for claim ${claimKey}, it will be rendered from scratch`);
|
|
331215
332137
|
}
|
|
331216
332138
|
const claimPath = renderClaims[claimKey].claimPath;
|
|
331217
|
-
const { firestartrEntity, extraCharts, catalogEntity } = await renderClaim(catalogScope, firestartrScope, claim, patches, previousCR, claimPath);
|
|
332139
|
+
const { firestartrEntity, extraCharts, catalogEntity } = await renderClaim(catalogScope, firestartrScope, claim, patches, previousCR, claimPath, variableSectionPreviousCR, variableSectionPatches, secretSectionPreviousCR, secretSectionPatches);
|
|
331218
332140
|
if (catalogEntity) {
|
|
331219
332141
|
result[`${catalogEntity.kind}-${catalogEntity.metadata.name}`] =
|
|
331220
332142
|
catalogEntity.toJson();
|
|
@@ -331243,7 +332165,7 @@ async function renderClaims(catalogScope, firestartrScope, data) {
|
|
|
331243
332165
|
}
|
|
331244
332166
|
return result;
|
|
331245
332167
|
}
|
|
331246
|
-
async function renderClaim(catalogScope, firestartrScope, claim, patches, previousCR = null, claimPath) {
|
|
332168
|
+
async function renderClaim(catalogScope, firestartrScope, claim, patches, previousCR = null, claimPath, variableSectionPreviousCR = false, variableSectionPatches, secretSectionPreviousCR = false, secretSectionPatches) {
|
|
331247
332169
|
let catalogEntity = undefined;
|
|
331248
332170
|
let firestartrEntity = undefined;
|
|
331249
332171
|
const extraCharts = [];
|
|
@@ -331391,6 +332313,48 @@ async function renderClaim(catalogScope, firestartrScope, claim, patches, previo
|
|
|
331391
332313
|
case 'OrgSettingsClaim':
|
|
331392
332314
|
if (loadGithub) {
|
|
331393
332315
|
firestartrEntity = new charts.GithubOrgSettingsChart(firestartrScope, `github-${chartId}`, firestartrId, claim, renderPatches);
|
|
332316
|
+
const variableSectionFirestartrId = variableSectionPreviousCR
|
|
332317
|
+
? variableSectionPreviousCR.spec?.firestartr?.tfStateKey
|
|
332318
|
+
: firestartrId
|
|
332319
|
+
? `${firestartrId}-variables`
|
|
332320
|
+
: null;
|
|
332321
|
+
const vsRenderPatches = variableSectionPatches
|
|
332322
|
+
? variableSectionPatches.filter((patch) => !patch.isPostPatch)
|
|
332323
|
+
: renderPatches;
|
|
332324
|
+
const vsPostPatches = variableSectionPatches
|
|
332325
|
+
? variableSectionPatches.filter((patch) => patch.isPostPatch)
|
|
332326
|
+
: postPatches;
|
|
332327
|
+
const variableSectionChart = new charts.GithubOrgVariableSectionChart(firestartrScope, `github-variables-${chartId}`, variableSectionFirestartrId, claim, vsRenderPatches);
|
|
332328
|
+
await variableSectionChart.render();
|
|
332329
|
+
const variableSectionObject = await variableSectionChart.postRenderer(vsPostPatches);
|
|
332330
|
+
extraCharts.push({
|
|
332331
|
+
claim: {
|
|
332332
|
+
kind: claim.kind,
|
|
332333
|
+
name: `${claim.name}-variable-section`,
|
|
332334
|
+
},
|
|
332335
|
+
chart: variableSectionObject,
|
|
332336
|
+
});
|
|
332337
|
+
const secretSectionFirestartrId = secretSectionPreviousCR
|
|
332338
|
+
? secretSectionPreviousCR.spec?.firestartr?.tfStateKey
|
|
332339
|
+
: firestartrId
|
|
332340
|
+
? `${firestartrId}-secrets`
|
|
332341
|
+
: null;
|
|
332342
|
+
const ssRenderPatches = secretSectionPatches
|
|
332343
|
+
? secretSectionPatches.filter((patch) => !patch.isPostPatch)
|
|
332344
|
+
: renderPatches;
|
|
332345
|
+
const ssPostPatches = secretSectionPatches
|
|
332346
|
+
? secretSectionPatches.filter((patch) => patch.isPostPatch)
|
|
332347
|
+
: postPatches;
|
|
332348
|
+
const secretSectionChart = new charts.GithubOrgSecretSectionChart(firestartrScope, `github-secrets-${chartId}`, secretSectionFirestartrId, claim, ssRenderPatches);
|
|
332349
|
+
await secretSectionChart.render();
|
|
332350
|
+
const secretSectionObject = await secretSectionChart.postRenderer(ssPostPatches);
|
|
332351
|
+
extraCharts.push({
|
|
332352
|
+
claim: {
|
|
332353
|
+
kind: claim.kind,
|
|
332354
|
+
name: `${claim.name}-secret-section`,
|
|
332355
|
+
},
|
|
332356
|
+
chart: secretSectionObject,
|
|
332357
|
+
});
|
|
331394
332358
|
}
|
|
331395
332359
|
break;
|
|
331396
332360
|
default:
|
|
@@ -331555,6 +332519,205 @@ function validateGithubOrgSettingsSingleton(crs) {
|
|
|
331555
332519
|
}
|
|
331556
332520
|
}
|
|
331557
332521
|
|
|
332522
|
+
;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/githubOrgVariableSection.ts
|
|
332523
|
+
const GITHUB_ORG_VARIABLE_SECTION_KIND = 'FirestartrGithubOrganizationVariableSection';
|
|
332524
|
+
const githubOrgVariableSection_FIRESTARTR_CLAIM_REF_ANNOTATION = 'firestartr.dev/claim-ref';
|
|
332525
|
+
const githubOrgVariableSection_CLAIM_REF_LABEL = 'claim-ref';
|
|
332526
|
+
const COMPONENT_REF_PATTERN = /^component:(.+)$/;
|
|
332527
|
+
function githubOrgVariableSection_formatResourceRef(name, claimRef) {
|
|
332528
|
+
return claimRef ? `${name} (claim: ${claimRef})` : name;
|
|
332529
|
+
}
|
|
332530
|
+
function validateGithubOrgVariableSectionSingleton(crs) {
|
|
332531
|
+
const refsByOrg = new Map();
|
|
332532
|
+
const seenClaimRefs = new Map();
|
|
332533
|
+
for (const crKey of Object.keys(crs)) {
|
|
332534
|
+
const cr = crs[crKey];
|
|
332535
|
+
if (cr.kind !== GITHUB_ORG_VARIABLE_SECTION_KIND)
|
|
332536
|
+
continue;
|
|
332537
|
+
const org = cr.spec?.org;
|
|
332538
|
+
if (typeof org !== 'string' || !org)
|
|
332539
|
+
continue;
|
|
332540
|
+
const name = cr.metadata?.name || crKey;
|
|
332541
|
+
const claimRef = cr.metadata?.annotations?.[githubOrgVariableSection_FIRESTARTR_CLAIM_REF_ANNOTATION] ||
|
|
332542
|
+
cr.metadata?.labels?.[githubOrgVariableSection_CLAIM_REF_LABEL];
|
|
332543
|
+
const normalizedOrg = org.toLowerCase();
|
|
332544
|
+
if (claimRef) {
|
|
332545
|
+
const seen = seenClaimRefs.get(normalizedOrg) || new Set();
|
|
332546
|
+
if (seen.has(claimRef))
|
|
332547
|
+
continue;
|
|
332548
|
+
seen.add(claimRef);
|
|
332549
|
+
seenClaimRefs.set(normalizedOrg, seen);
|
|
332550
|
+
}
|
|
332551
|
+
const refs = refsByOrg.get(normalizedOrg) || [];
|
|
332552
|
+
refs.push(githubOrgVariableSection_formatResourceRef(name, claimRef));
|
|
332553
|
+
refsByOrg.set(normalizedOrg, refs);
|
|
332554
|
+
}
|
|
332555
|
+
for (const [org, refs] of refsByOrg.entries()) {
|
|
332556
|
+
if (refs.length < 2)
|
|
332557
|
+
continue;
|
|
332558
|
+
throw new Error(`Duplicate ${GITHUB_ORG_VARIABLE_SECTION_KIND} resources found for GitHub organization "${org}": ${refs.join(', ')}`);
|
|
332559
|
+
}
|
|
332560
|
+
}
|
|
332561
|
+
function validateActionsVariablesUniqueness(crs) {
|
|
332562
|
+
for (const crKey of Object.keys(crs)) {
|
|
332563
|
+
const cr = crs[crKey];
|
|
332564
|
+
if (cr.kind !== GITHUB_ORG_VARIABLE_SECTION_KIND)
|
|
332565
|
+
continue;
|
|
332566
|
+
const actionsVariables = cr.spec?.actionsVariables;
|
|
332567
|
+
if (!Array.isArray(actionsVariables))
|
|
332568
|
+
continue;
|
|
332569
|
+
const names = new Set();
|
|
332570
|
+
for (const variable of actionsVariables) {
|
|
332571
|
+
const varName = variable?.name;
|
|
332572
|
+
if (!varName)
|
|
332573
|
+
continue;
|
|
332574
|
+
if (names.has(varName)) {
|
|
332575
|
+
const org = cr.spec?.org || 'unknown';
|
|
332576
|
+
throw new Error(`Duplicate action variable name "${varName}" found in ${GITHUB_ORG_VARIABLE_SECTION_KIND} for organization "${org}"`);
|
|
332577
|
+
}
|
|
332578
|
+
names.add(varName);
|
|
332579
|
+
}
|
|
332580
|
+
}
|
|
332581
|
+
}
|
|
332582
|
+
function validateActionsVariablesSelectedRepositories(renderClaims) {
|
|
332583
|
+
for (const claimKey of Object.keys(renderClaims)) {
|
|
332584
|
+
if (!claimKey.startsWith('OrgSettingsClaim-'))
|
|
332585
|
+
continue;
|
|
332586
|
+
const claimData = renderClaims[claimKey];
|
|
332587
|
+
const claim = claimData?.claim;
|
|
332588
|
+
const actionsVariables = claim?.providers?.github?.actions_variables;
|
|
332589
|
+
if (!Array.isArray(actionsVariables))
|
|
332590
|
+
continue;
|
|
332591
|
+
for (const variable of actionsVariables) {
|
|
332592
|
+
if (variable.visibility !== 'selected')
|
|
332593
|
+
continue;
|
|
332594
|
+
const selectedRepos = variable.selected_repositories;
|
|
332595
|
+
if (!Array.isArray(selectedRepos) || selectedRepos.length === 0)
|
|
332596
|
+
continue;
|
|
332597
|
+
for (const ref of selectedRepos) {
|
|
332598
|
+
const match = ref.match(COMPONENT_REF_PATTERN);
|
|
332599
|
+
if (!match)
|
|
332600
|
+
continue;
|
|
332601
|
+
const componentName = match[1];
|
|
332602
|
+
const expectedKey = `ComponentClaim-${componentName}`;
|
|
332603
|
+
if (!renderClaims[expectedKey]) {
|
|
332604
|
+
throw new Error(`CrossReference error: OrgSettingsClaim/${claim.name} references a non-existent component "${componentName}" in actions_variables.${variable.name}.selected_repositories`);
|
|
332605
|
+
}
|
|
332606
|
+
}
|
|
332607
|
+
}
|
|
332608
|
+
}
|
|
332609
|
+
}
|
|
332610
|
+
|
|
332611
|
+
;// CONCATENATED MODULE: ../cdk8s_renderer/src/validations/githubOrgSecretSection.ts
|
|
332612
|
+
const GITHUB_ORG_SECRET_SECTION_KIND = 'FirestartrGithubOrganizationSecretSection';
|
|
332613
|
+
const githubOrgSecretSection_FIRESTARTR_CLAIM_REF_ANNOTATION = 'firestartr.dev/claim-ref';
|
|
332614
|
+
const githubOrgSecretSection_CLAIM_REF_LABEL = 'claim-ref';
|
|
332615
|
+
const SECRETS_CLAIM_REF_PATTERN = /^ref:secretsclaim:([a-zA-Z0-9_-]+):([a-zA-Z0-9_-]+)$/;
|
|
332616
|
+
function githubOrgSecretSection_formatResourceRef(name, claimRef) {
|
|
332617
|
+
return claimRef ? `${name} (claim: ${claimRef})` : name;
|
|
332618
|
+
}
|
|
332619
|
+
function validateGithubOrgSecretSectionSingleton(crs) {
|
|
332620
|
+
const refsByOrg = new Map();
|
|
332621
|
+
const seenClaimRefs = new Map();
|
|
332622
|
+
for (const crKey of Object.keys(crs)) {
|
|
332623
|
+
const cr = crs[crKey];
|
|
332624
|
+
if (cr.kind !== GITHUB_ORG_SECRET_SECTION_KIND)
|
|
332625
|
+
continue;
|
|
332626
|
+
const org = cr.spec?.org;
|
|
332627
|
+
if (typeof org !== 'string' || !org)
|
|
332628
|
+
continue;
|
|
332629
|
+
const name = cr.metadata?.name || crKey;
|
|
332630
|
+
const claimRef = cr.metadata?.annotations?.[githubOrgSecretSection_FIRESTARTR_CLAIM_REF_ANNOTATION] ||
|
|
332631
|
+
cr.metadata?.labels?.[githubOrgSecretSection_CLAIM_REF_LABEL];
|
|
332632
|
+
const normalizedOrg = org.toLowerCase();
|
|
332633
|
+
if (claimRef) {
|
|
332634
|
+
const seen = seenClaimRefs.get(normalizedOrg) || new Set();
|
|
332635
|
+
if (seen.has(claimRef))
|
|
332636
|
+
continue;
|
|
332637
|
+
seen.add(claimRef);
|
|
332638
|
+
seenClaimRefs.set(normalizedOrg, seen);
|
|
332639
|
+
}
|
|
332640
|
+
const refs = refsByOrg.get(normalizedOrg) || [];
|
|
332641
|
+
refs.push(githubOrgSecretSection_formatResourceRef(name, claimRef));
|
|
332642
|
+
refsByOrg.set(normalizedOrg, refs);
|
|
332643
|
+
}
|
|
332644
|
+
for (const [org, refs] of refsByOrg.entries()) {
|
|
332645
|
+
if (refs.length < 2)
|
|
332646
|
+
continue;
|
|
332647
|
+
throw new Error(`Duplicate ${GITHUB_ORG_SECRET_SECTION_KIND} resources found for GitHub organization "${org}": ${refs.join(', ')}`);
|
|
332648
|
+
}
|
|
332649
|
+
}
|
|
332650
|
+
function validateSecretNamesUniqueness(crs) {
|
|
332651
|
+
for (const crKey of Object.keys(crs)) {
|
|
332652
|
+
const cr = crs[crKey];
|
|
332653
|
+
if (cr.kind !== GITHUB_ORG_SECRET_SECTION_KIND)
|
|
332654
|
+
continue;
|
|
332655
|
+
const secrets = cr.spec?.secrets;
|
|
332656
|
+
if (!secrets || typeof secrets !== 'object')
|
|
332657
|
+
continue;
|
|
332658
|
+
for (const section of ['actions', 'codespaces', 'dependabot']) {
|
|
332659
|
+
const sectionSecrets = secrets[section];
|
|
332660
|
+
if (!Array.isArray(sectionSecrets))
|
|
332661
|
+
continue;
|
|
332662
|
+
const names = new Set();
|
|
332663
|
+
for (const secret of sectionSecrets) {
|
|
332664
|
+
const secretName = secret?.name;
|
|
332665
|
+
if (!secretName)
|
|
332666
|
+
continue;
|
|
332667
|
+
if (names.has(secretName)) {
|
|
332668
|
+
const org = cr.spec?.org || 'unknown';
|
|
332669
|
+
throw new Error(`Duplicate secret name "${secretName}" found in ${section} section of ${GITHUB_ORG_SECRET_SECTION_KIND} for organization "${org}"`);
|
|
332670
|
+
}
|
|
332671
|
+
names.add(secretName);
|
|
332672
|
+
}
|
|
332673
|
+
}
|
|
332674
|
+
}
|
|
332675
|
+
}
|
|
332676
|
+
function validateOrgSecretsCrossReferences(renderClaims) {
|
|
332677
|
+
for (const claimKey of Object.keys(renderClaims)) {
|
|
332678
|
+
if (!claimKey.startsWith('OrgSettingsClaim-'))
|
|
332679
|
+
continue;
|
|
332680
|
+
const claimData = renderClaims[claimKey];
|
|
332681
|
+
const claim = claimData?.claim;
|
|
332682
|
+
const orgSecrets = claim?.providers?.github?.org_secrets;
|
|
332683
|
+
if (!orgSecrets || typeof orgSecrets !== 'object')
|
|
332684
|
+
continue;
|
|
332685
|
+
for (const section of ['actions', 'codespaces', 'dependabot']) {
|
|
332686
|
+
const secrets = orgSecrets[section];
|
|
332687
|
+
if (!Array.isArray(secrets))
|
|
332688
|
+
continue;
|
|
332689
|
+
for (const secret of secrets) {
|
|
332690
|
+
if (!secret.value)
|
|
332691
|
+
continue;
|
|
332692
|
+
const match = secret.value.match(SECRETS_CLAIM_REF_PATTERN);
|
|
332693
|
+
if (!match)
|
|
332694
|
+
continue;
|
|
332695
|
+
const [, secretClaimName, secretKey] = match;
|
|
332696
|
+
const expectedKey = `SecretsClaim-${secretClaimName}`;
|
|
332697
|
+
if (!renderClaims[expectedKey])
|
|
332698
|
+
continue;
|
|
332699
|
+
const secretClaim = renderClaims[expectedKey]?.claim;
|
|
332700
|
+
const externalSecrets = secretClaim?.providers?.external_secrets?.externalSecrets?.secrets;
|
|
332701
|
+
const pushSecrets = secretClaim?.providers?.external_secrets?.pushSecrets;
|
|
332702
|
+
let keyFound = false;
|
|
332703
|
+
if (Array.isArray(pushSecrets)) {
|
|
332704
|
+
keyFound =
|
|
332705
|
+
pushSecrets.find((s) => s.secretName === secretKey) !==
|
|
332706
|
+
undefined;
|
|
332707
|
+
}
|
|
332708
|
+
if (!keyFound && Array.isArray(externalSecrets)) {
|
|
332709
|
+
keyFound =
|
|
332710
|
+
externalSecrets.find((s) => s.secretName === secretKey) !==
|
|
332711
|
+
undefined;
|
|
332712
|
+
}
|
|
332713
|
+
if (!keyFound) {
|
|
332714
|
+
throw new Error(`CrossReference error: OrgSettingsClaim/${claim.name} references a non-existent secret key "${secretKey}" in SecretsClaim/${secretClaimName} via org_secrets.${section}.${secret.name}`);
|
|
332715
|
+
}
|
|
332716
|
+
}
|
|
332717
|
+
}
|
|
332718
|
+
}
|
|
332719
|
+
}
|
|
332720
|
+
|
|
331558
332721
|
;// CONCATENATED MODULE: ../cdk8s_renderer/src/renderer/renderer.ts
|
|
331559
332722
|
|
|
331560
332723
|
|
|
@@ -331565,6 +332728,8 @@ function validateGithubOrgSettingsSingleton(crs) {
|
|
|
331565
332728
|
|
|
331566
332729
|
|
|
331567
332730
|
|
|
332731
|
+
|
|
332732
|
+
|
|
331568
332733
|
/*
|
|
331569
332734
|
* Function called when rendering but not importing
|
|
331570
332735
|
*
|
|
@@ -331586,8 +332751,14 @@ async function renderer_render(catalogScope, firestartrScope, claimList) {
|
|
|
331586
332751
|
try {
|
|
331587
332752
|
validateSubReferences(data.renderClaims);
|
|
331588
332753
|
validateComponentPagesPath(data.renderClaims);
|
|
332754
|
+
validateActionsVariablesSelectedRepositories(data.renderClaims);
|
|
332755
|
+
validateOrgSecretsCrossReferences(data.renderClaims);
|
|
331589
332756
|
validateTfStateKeyUniqueness(result);
|
|
331590
332757
|
validateGithubOrgSettingsSingleton(fullCrSet);
|
|
332758
|
+
validateGithubOrgVariableSectionSingleton(fullCrSet);
|
|
332759
|
+
validateActionsVariablesUniqueness(result);
|
|
332760
|
+
validateGithubOrgSecretSectionSingleton(fullCrSet);
|
|
332761
|
+
validateSecretNamesUniqueness(result);
|
|
331591
332762
|
validateCrSizes(result);
|
|
331592
332763
|
validatePermissionsUniqueness(result);
|
|
331593
332764
|
}
|
|
@@ -333919,6 +335090,7 @@ const kindPluralMap = {
|
|
|
333919
335090
|
terraformmodules: 'FirestartrTerraformModule',
|
|
333920
335091
|
githuborgwebhooks: 'FirestartrGithubOrgWebhook',
|
|
333921
335092
|
githuborganizationsettings: 'FirestartrGithubOrganizationSettings',
|
|
335093
|
+
githuborganizationvariablesections: 'FirestartrGithubOrganizationVariableSection',
|
|
333922
335094
|
terraformworkspaces: 'FirestartrTerraformWorkspace',
|
|
333923
335095
|
terraformworkspaceplans: 'FirestartrTerraformWorkspacePlan',
|
|
333924
335096
|
providerconfigs: 'FirestartrProviderConfig',
|
|
@@ -335896,6 +337068,7 @@ const kindsWithFinalizer = [
|
|
|
335896
337068
|
'FirestartrGithubRepositoryFeature',
|
|
335897
337069
|
'FirestartrGithubOrgWebhook',
|
|
335898
337070
|
'FirestartrGithubOrganizationSettings',
|
|
337071
|
+
'FirestartrGithubOrganizationVariableSection',
|
|
335899
337072
|
'FirestartrGithubRepositorySecretsSection',
|
|
335900
337073
|
];
|
|
335901
337074
|
const kindsWithDependants = [
|
|
@@ -342437,6 +343610,10 @@ const MODULES = {
|
|
|
342437
343610
|
// github-org-settings-v0.1.0
|
|
342438
343611
|
ref: 'c30c5dfdaddf2bca9e966a726d45970c98576e9e',
|
|
342439
343612
|
},
|
|
343613
|
+
FirestartrGithubOrganizationVariableSection: {
|
|
343614
|
+
module: 'git::https://github.com/prefapp/tfm.git//modules/github-org-variables-section',
|
|
343615
|
+
ref: '79c1407',
|
|
343616
|
+
},
|
|
342440
343617
|
};
|
|
342441
343618
|
function getFirestartrDefaultTFM(kind) {
|
|
342442
343619
|
if (kind in MODULES) {
|
|
@@ -344239,6 +345416,94 @@ class EntityGHOrgSettings extends base_Entity {
|
|
|
344239
345416
|
}
|
|
344240
345417
|
}
|
|
344241
345418
|
|
|
345419
|
+
;// CONCATENATED MODULE: ../gh_provisioner/src/entities/ghorgvarsection/index.ts
|
|
345420
|
+
|
|
345421
|
+
|
|
345422
|
+
|
|
345423
|
+
class EntityGHOrgVarsSection extends base_Entity {
|
|
345424
|
+
constructor(artifact) {
|
|
345425
|
+
super(artifact, {
|
|
345426
|
+
config: {
|
|
345427
|
+
variables: {},
|
|
345428
|
+
},
|
|
345429
|
+
});
|
|
345430
|
+
}
|
|
345431
|
+
async loadResources(tfOp) {
|
|
345432
|
+
gh_provisioner_src_logger.info(`[gh-provisioner] running ${tfOp} on ${this.k8sId}`);
|
|
345433
|
+
try {
|
|
345434
|
+
const cr = this.cr;
|
|
345435
|
+
const actionsVariables = cr.spec.actionsVariables || [];
|
|
345436
|
+
const variables = {};
|
|
345437
|
+
for (const v of actionsVariables) {
|
|
345438
|
+
const entry = {
|
|
345439
|
+
value: v.value,
|
|
345440
|
+
visibility: v.visibility,
|
|
345441
|
+
};
|
|
345442
|
+
if (v.visibility === 'selected' && v.selectedRepositories) {
|
|
345443
|
+
entry.selectedRepositoryIds = v.selectedRepositories;
|
|
345444
|
+
}
|
|
345445
|
+
variables[v.name] = entry;
|
|
345446
|
+
}
|
|
345447
|
+
this.patchData({
|
|
345448
|
+
op: PatchOperations.replace,
|
|
345449
|
+
path: '/config/variables',
|
|
345450
|
+
value: variables,
|
|
345451
|
+
});
|
|
345452
|
+
if (tfOp === 'apply') {
|
|
345453
|
+
await this.adoptVariablesIfNeeded(actionsVariables);
|
|
345454
|
+
}
|
|
345455
|
+
gh_provisioner_src_logger.debug(`[gh-provisioner] ${this.k8sId} loaded its data`);
|
|
345456
|
+
}
|
|
345457
|
+
catch (err) {
|
|
345458
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
345459
|
+
gh_provisioner_src_logger.error(`[gh-provisioner] ${this.k8sId} error loading resources: ${message}`);
|
|
345460
|
+
throw new Error(`[gh-provisioner] ${this.k8sId} error loading resources: ${message}`);
|
|
345461
|
+
}
|
|
345462
|
+
}
|
|
345463
|
+
async adoptVariablesIfNeeded(declaredVars) {
|
|
345464
|
+
const cr = this.cr;
|
|
345465
|
+
const managedVariables = this.cr.fResolveSelfOutputs('managed_variables') || [];
|
|
345466
|
+
const declaredNames = declaredVars.map((v) => v.name);
|
|
345467
|
+
const newToModule = declaredNames.filter((name) => !managedVariables.includes(name));
|
|
345468
|
+
if (newToModule.length === 0) {
|
|
345469
|
+
gh_provisioner_src_logger.debug(`[gh-provisioner] ${this.k8sId} all declared variables are already managed, no adoption needed`);
|
|
345470
|
+
return;
|
|
345471
|
+
}
|
|
345472
|
+
if (managedVariables.length === 0) {
|
|
345473
|
+
gh_provisioner_src_logger.info(`[gh-provisioner] ${this.k8sId} no managed_variables output — first reconciliation, treating all ${newToModule.length} declared variable(s) as new to module`);
|
|
345474
|
+
}
|
|
345475
|
+
for (const varName of newToModule) {
|
|
345476
|
+
try {
|
|
345477
|
+
await this.runWithGithubProvider(async () => {
|
|
345478
|
+
await github["default"].org.getOrgVariable(cr.spec.org, varName);
|
|
345479
|
+
});
|
|
345480
|
+
gh_provisioner_src_logger.info(`[gh-provisioner] ${this.k8sId} adopting pre-existing variable '${varName}' on GitHub org '${cr.spec.org}'`);
|
|
345481
|
+
this.patchImportData({
|
|
345482
|
+
op: PatchOperations.add,
|
|
345483
|
+
path: '/imports/-',
|
|
345484
|
+
value: {
|
|
345485
|
+
to: `github_actions_organization_variable.this["${varName}"]`,
|
|
345486
|
+
id: varName,
|
|
345487
|
+
},
|
|
345488
|
+
});
|
|
345489
|
+
}
|
|
345490
|
+
catch (err) {
|
|
345491
|
+
if (err && err.status === 404) {
|
|
345492
|
+
gh_provisioner_src_logger.info(`[gh-provisioner] ${this.k8sId} variable '${varName}' not found on GitHub org '${cr.spec.org}' — will be created by TFM`);
|
|
345493
|
+
}
|
|
345494
|
+
else if (err && (err.status === 401 || err.status === 403)) {
|
|
345495
|
+
gh_provisioner_src_logger.warn(`[gh-provisioner] ${this.k8sId} token lacks scope to check variable '${varName}' on org '${cr.spec.org}' — skipping adoption gracefully`);
|
|
345496
|
+
}
|
|
345497
|
+
else {
|
|
345498
|
+
gh_provisioner_src_logger.error(`[gh-provisioner] ${this.k8sId} unexpected error checking variable '${varName}' on org '${cr.spec.org}': ${err instanceof Error ? err.message : String(err)}`);
|
|
345499
|
+
}
|
|
345500
|
+
}
|
|
345501
|
+
}
|
|
345502
|
+
}
|
|
345503
|
+
async postProvision(tfOp) { }
|
|
345504
|
+
async loadAddressesToImport() { }
|
|
345505
|
+
}
|
|
345506
|
+
|
|
344242
345507
|
;// CONCATENATED MODULE: ../gh_provisioner/src/entities/ghorgwebhook/index.ts
|
|
344243
345508
|
|
|
344244
345509
|
|
|
@@ -344315,6 +345580,7 @@ class EntityGHOrgWebHook extends base_Entity {
|
|
|
344315
345580
|
|
|
344316
345581
|
|
|
344317
345582
|
|
|
345583
|
+
|
|
344318
345584
|
function entities_getEntity(cr) {
|
|
344319
345585
|
const entityClass = getEntityClass(cr.kind);
|
|
344320
345586
|
return new entityClass(cr);
|
|
@@ -344335,6 +345601,8 @@ function getEntityClass(kind) {
|
|
|
344335
345601
|
return EntityGHOrgWebHook;
|
|
344336
345602
|
case 'FirestartrGithubOrganizationSettings':
|
|
344337
345603
|
return EntityGHOrgSettings;
|
|
345604
|
+
case 'FirestartrGithubOrganizationVariableSection':
|
|
345605
|
+
return EntityGHOrgVarsSection;
|
|
344338
345606
|
default:
|
|
344339
345607
|
throw new Error(`kind ${kind} has no entity associated`);
|
|
344340
345608
|
}
|
|
@@ -344748,6 +346016,7 @@ const GITHUB_RESOURCE_KINDS = [
|
|
|
344748
346016
|
'FirestartrGithubRepositorySecretsSection',
|
|
344749
346017
|
'FirestartrGithubOrgWebhook',
|
|
344750
346018
|
'FirestartrGithubOrganizationSettings',
|
|
346019
|
+
'FirestartrGithubOrganizationVariableSection',
|
|
344751
346020
|
];
|
|
344752
346021
|
const GITHUB_REPOSITORY_DEPENDENT_KINDS = [
|
|
344753
346022
|
'FirestartrGithubRepositoryFeature',
|
|
@@ -346006,6 +347275,9 @@ function isObserveModeActive() {
|
|
|
346006
347275
|
function runOperator(opts) {
|
|
346007
347276
|
const { ignoreLease, dummyExec, namespace, kindList, importMode, importModeSkipPlan, observeMode, withMetrics, } = opts;
|
|
346008
347277
|
const implementedKinds = filterImplementedKinds(kindList);
|
|
347278
|
+
operator_src_logger.info(`operator kindList: ${JSON.stringify(kindList)}`);
|
|
347279
|
+
operator_src_logger.info(`operator implementedKinds: ${JSON.stringify(implementedKinds)}`);
|
|
347280
|
+
operator_src_logger.info(`operator ignoring kinds: ${JSON.stringify(kindList.filter((k) => !implementedKinds.includes(k)))}`);
|
|
346009
347281
|
if (observeMode)
|
|
346010
347282
|
observeModeActive = true;
|
|
346011
347283
|
if (withMetrics)
|
|
@@ -346079,6 +347351,7 @@ const provisionImplementations = {
|
|
|
346079
347351
|
githubmemberships: process_operation_processOperation,
|
|
346080
347352
|
githuborgwebhooks: process_operation_processOperation,
|
|
346081
347353
|
githuborganizationsettings: process_operation_processOperation,
|
|
347354
|
+
githuborganizationvariablesections: process_operation_processOperation,
|
|
346082
347355
|
fsdummiesa: processFirestartrDummies,
|
|
346083
347356
|
fsdummiesb: processFirestartrDummies,
|
|
346084
347357
|
fsdummiesc: processFirestartrDummies,
|
|
@@ -524897,7 +526170,7 @@ const crsStatusSubcommand = {
|
|
|
524897
526170
|
};
|
|
524898
526171
|
|
|
524899
526172
|
;// CONCATENATED MODULE: ./package.json
|
|
524900
|
-
const package_namespaceObject = {"i8":"2.
|
|
526173
|
+
const package_namespaceObject = JSON.parse('{"i8":"2.10.0-snapshot-org-secrets-1"}');
|
|
524901
526174
|
;// CONCATENATED MODULE: ../../package.json
|
|
524902
526175
|
const package_namespaceObject_1 = {"i8":"2.9.0"};
|
|
524903
526176
|
// EXTERNAL MODULE: ../../node_modules/semver/index.js
|