@firestartr/cli 2.6.1 → 2.6.2

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.
Files changed (2) hide show
  1. package/build/index.js +40 -11
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -293108,17 +293108,46 @@ async function updateSyncTransition(itemPath, reason, lastSyncTime, nextSyncTime
293108
293108
  }
293109
293109
  async function updateRetryStatusInCR(pluralKind, namespace, name, retryCount, nextRetryTime) {
293110
293110
  const itemPath = `${namespace}/${pluralKind}/${name}`;
293111
- const item = await getItemByItemPath(itemPath);
293112
- if (!('status' in item) || item.status === null)
293113
- item.status = {};
293114
- item.status.retryCount = retryCount;
293115
- if (nextRetryTime) {
293116
- item.status.nextRetryTime = nextRetryTime;
293111
+ try {
293112
+ const item = await getItemByItemPath(itemPath);
293113
+ if (!('status' in item) || item.status === null)
293114
+ item.status = {};
293115
+ item.status.retryCount = retryCount;
293116
+ if (nextRetryTime) {
293117
+ item.status.nextRetryTime = nextRetryTime;
293118
+ }
293119
+ else {
293120
+ delete item.status.nextRetryTime;
293121
+ }
293122
+ await writePrioritizedStatus(pluralKind, namespace, item);
293117
293123
  }
293118
- else {
293119
- delete item.status.nextRetryTime;
293124
+ catch (e) {
293125
+ if (isKubernetesNotFoundError(e)) {
293126
+ operator_src_logger.info(`Skipping retry status update for '${itemPath}' because the custom resource was not found.`);
293127
+ return;
293128
+ }
293129
+ throw e;
293120
293130
  }
293121
- await writePrioritizedStatus(pluralKind, namespace, item);
293131
+ }
293132
+ function isKubernetesNotFoundError(error) {
293133
+ if (typeof error === 'string') {
293134
+ return isNotFoundMessage(error);
293135
+ }
293136
+ if (!error || typeof error !== 'object') {
293137
+ return false;
293138
+ }
293139
+ const k8sError = error;
293140
+ return (k8sError.code === 404 ||
293141
+ k8sError.status === 404 ||
293142
+ k8sError.statusCode === 404 ||
293143
+ k8sError.response?.status === 404 ||
293144
+ k8sError.response?.statusCode === 404 ||
293145
+ k8sError.body?.code === 404 ||
293146
+ k8sError.body?.reason === 'NotFound' ||
293147
+ isNotFoundMessage(k8sError.message));
293148
+ }
293149
+ function isNotFoundMessage(message) {
293150
+ return typeof message === 'string' && /\bnot\s*found\b/i.test(message);
293122
293151
  }
293123
293152
  async function writePrioritizedStatus(kind, namespace, item) {
293124
293153
  setHighPriorityStatus(item);
@@ -303529,9 +303558,9 @@ const crs_analyzerSubcommand = {
303529
303558
  };
303530
303559
 
303531
303560
  ;// CONCATENATED MODULE: ./package.json
303532
- const package_namespaceObject = {"i8":"2.6.1"};
303561
+ const package_namespaceObject = {"i8":"2.6.2"};
303533
303562
  ;// CONCATENATED MODULE: ../../package.json
303534
- const package_namespaceObject_1 = {"i8":"2.6.1"};
303563
+ const package_namespaceObject_1 = {"i8":"2.6.2"};
303535
303564
  ;// CONCATENATED MODULE: ./src/subcommands/index.ts
303536
303565
 
303537
303566
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestartr/cli",
3
- "version": "2.6.1",
3
+ "version": "2.6.2",
4
4
  "private": false,
5
5
  "description": "Commandline tool",
6
6
  "main": "build/main.js",