@firestartr/cli 1.59.0-snapshot-1 → 1.59.0-snapshot-3

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
@@ -367130,7 +367130,7 @@ async function setPreviousCRs(resourcesPath) {
367130
367130
  }
367131
367131
  previousCRs = alreadyImportedCrs;
367132
367132
  }
367133
- async function importGithubGitopsRepository(org, skipPlan, claimsPath, resourcesPath, configPath, filters = [], needsReImport) {
367133
+ async function importGithubGitopsRepository(org, skipPlan, claimsPath, resourcesPath, configPath, filters = [], needsReImport, force) {
367134
367134
  await setPreviousCRs(resourcesPath);
367135
367135
  configurePaths(randomFolder, '/tmp/tmp-resources', // Not used, but required by renderer
367136
367136
  configPath);
@@ -367157,9 +367157,9 @@ async function importGithubGitopsRepository(org, skipPlan, claimsPath, resources
367157
367157
  crs[key] = cr;
367158
367158
  }
367159
367159
  }
367160
- await moveCRsAndClaims(crs, org, claimsPath, resourcesPath);
367160
+ await moveCRsAndClaims(crs, org, claimsPath, resourcesPath, force);
367161
367161
  }
367162
- async function moveCRsAndClaims(crs, org, claimsPath, resourcesPath) {
367162
+ async function moveCRsAndClaims(crs, org, claimsPath, resourcesPath, force) {
367163
367163
  const importedResources = [];
367164
367164
  const failedImportedResources = [];
367165
367165
  for (const k of Object.keys(crs)) {
@@ -367167,7 +367167,8 @@ async function moveCRsAndClaims(crs, org, claimsPath, resourcesPath) {
367167
367167
  importer_src_logger.info(`⚡ SKIP IMPORT: CR is a catalog entity, skipping import with kind: ${crs[k].kind} and name: ${crs[k].metadata.name}`);
367168
367168
  continue;
367169
367169
  }
367170
- else if (previousCRs[`${crs[k].kind}-${crs[k].metadata.annotations[catalog_common.generic.getFirestartrAnnotation('external-name')]}`]) {
367170
+ else if (previousCRs[`${crs[k].kind}-${crs[k].metadata.annotations[catalog_common.generic.getFirestartrAnnotation('external-name')]}`] &&
367171
+ !force) {
367171
367172
  importer_src_logger.info(`⚡ SKIP IMPORT: CR already exists on disk, skipping import with kind: ${crs[k].kind} and name: ${crs[k].metadata.name}`);
367172
367173
  continue;
367173
367174
  }
@@ -367335,7 +367336,7 @@ async function runImporter(force, skipPlan, claimsPath, crsPath, configPath, cla
367335
367336
  //gh-repo,REGEXP=.*vite.*
367336
367337
  cdk8s_renderer.setPath('claimsDefaults', claimsDefaultsPath);
367337
367338
  generatedFilters = buildFilters(filters, force, crsPath, generatedFilters);
367338
- await importGithubGitopsRepository(org, skipPlan, claimsPath, crsPath, configPath, generatedFilters, needsReimport);
367339
+ await importGithubGitopsRepository(org, skipPlan, claimsPath, crsPath, configPath, generatedFilters, needsReimport, force);
367339
367340
  }
367340
367341
  function buildFilters(filters, force, crsPath, generatedFilters) {
367341
367342
  filters.push('all,FUNCTION=fCheckCRExistsOnDisk');
@@ -367344,6 +367345,7 @@ function buildFilters(filters, force, crsPath, generatedFilters) {
367344
367345
  */
367345
367346
  generatedFilters = filtersBuilder(createSkipFilters(filters || []), {
367346
367347
  fCheckCRExistsOnDisk: async function (collectionKind, name) {
367348
+ console.log(`Name ${name} && ${force}`);
367347
367349
  if (force)
367348
367350
  return true;
367349
367351
  else {
@@ -374173,13 +374175,25 @@ class EntityGHRepo extends base_Entity {
374173
374175
  id: this.cr.name,
374174
374176
  },
374175
374177
  });
374176
- for (const file of this.document.config.files) {
374178
+ // we cannot ensure the files exist, thus we need to check
374179
+ // it they exist before importing them
374180
+ //for (const file of this.document.config.files) {
374181
+ // this.patchImportData({
374182
+ // op: PatchOperations.add,
374183
+ // path: '/imports/-',
374184
+ // value: {
374185
+ // to: `github_repository_file.this["${file.file}__${file.branch}"]`,
374186
+ // id: `${this.cr.name}:${file.file}:${file.branch}`,
374187
+ // },
374188
+ // });
374189
+ //}
374190
+ for (const variable of this.document.config.variables) {
374177
374191
  this.patchImportData({
374178
374192
  op: PatchOperations.add,
374179
374193
  path: '/imports/-',
374180
374194
  value: {
374181
- to: `github_repository_file.this["${file.file}__${file.branch}"]`,
374182
- id: `${this.cr.name}:${file.file}:${file.branch}`,
374195
+ to: `github_actions_variable.this["${variable.variableName}"]`,
374196
+ id: `${this.cr.name}:${variable.variableName}`,
374183
374197
  },
374184
374198
  });
374185
374199
  }
@@ -378379,7 +378393,7 @@ const crs_analyzerSubcommand = {
378379
378393
  };
378380
378394
 
378381
378395
  ;// CONCATENATED MODULE: ./package.json
378382
- const package_namespaceObject = JSON.parse('{"i8":"1.59.0-snapshot-1"}');
378396
+ const package_namespaceObject = JSON.parse('{"i8":"1.59.0-snapshot-3"}');
378383
378397
  ;// CONCATENATED MODULE: ../../package.json
378384
378398
  const package_namespaceObject_1 = {"i8":"1.58.0"};
378385
378399
  ;// CONCATENATED MODULE: ./src/subcommands/index.ts
@@ -10,7 +10,7 @@ export declare const collections: {
10
10
  };
11
11
  export declare function isInPreviousCRs(kind: string, name: string): boolean;
12
12
  export declare function setPreviousCRs(resourcesPath: string): Promise<void>;
13
- export declare function importGithubGitopsRepository(org: string, skipPlan: boolean, claimsPath: string, resourcesPath: string, configPath: string, filters: CollectionFilter[], needsReImport: boolean): Promise<void>;
13
+ export declare function importGithubGitopsRepository(org: string, skipPlan: boolean, claimsPath: string, resourcesPath: string, configPath: string, filters: CollectionFilter[], needsReImport: boolean, force: boolean): Promise<void>;
14
14
  export declare function getPreviousCrs(crsPath: string): Promise<void>;
15
15
  declare const _default: {
16
16
  importGithubGitopsRepository: typeof importGithubGitopsRepository;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "1.59.0-snapshot-1",
3
+ "version": "1.59.0-snapshot-3",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",