pepr 0.54.0 → 0.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "!src/fixtures/**",
17
17
  "!dist/**/*.test.d.ts*"
18
18
  ],
19
- "version": "0.54.0",
19
+ "version": "0.55.0",
20
20
  "main": "dist/lib.js",
21
21
  "types": "dist/lib.d.ts",
22
22
  "scripts": {
@@ -49,21 +49,21 @@
49
49
  "test:upgrade:upstream": "npm run cluster:k3d && npm run cluster:k3d:import-upstream && vitest run integration/cluster/upgrade.test.ts"
50
50
  },
51
51
  "dependencies": {
52
- "@types/ramda": "0.31.0",
52
+ "@types/ramda": "0.31.1",
53
53
  "command-line-args": "^6.0.1",
54
- "commander": "14.0.0",
54
+ "commander": "14.0.1",
55
55
  "express": "5.1.0",
56
56
  "fast-json-patch": "3.1.1",
57
57
  "heredoc": "^1.3.1",
58
58
  "http-status-codes": "^2.3.0",
59
59
  "json-pointer": "^0.6.2",
60
- "kubernetes-fluent-client": "3.10.1",
61
- "pino": "9.7.0",
60
+ "kubernetes-fluent-client": "3.10.3",
61
+ "pino": "9.9.5",
62
62
  "pino-pretty": "13.1.1",
63
63
  "prom-client": "15.1.3",
64
64
  "quicktype-core": "^23.2.6",
65
65
  "ramda": "0.31.3",
66
- "ts-morph": "^26.0.0"
66
+ "ts-morph": "^27.0.0"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@commitlint/cli": "19.8.1",
@@ -23,8 +23,9 @@ export default function (program: Command): void {
23
23
  .command("update")
24
24
  .description("Update this Pepr module. Not recommended for prod as it may change files.")
25
25
  .option("-s, --skip-template-update", "Do not update template files")
26
+ .option("-y, --yes", "Skip confirmation prompt")
26
27
  .action(async opts => {
27
- if (!opts.skipTemplateUpdate) {
28
+ if (!opts.skipTemplateUpdate && !opts.yes) {
28
29
  const { confirm } = await prompt({
29
30
  type: "confirm",
30
31
  name: "confirm",
@@ -231,9 +231,9 @@ export class Capability implements CapabilityExport {
231
231
  const log = (message: string, cbString: string): void => {
232
232
  const filteredObj = pickBy(isNotEmpty, binding.filters);
233
233
 
234
- Log.info(`${message} configured for ${binding.event}`, prefix);
235
- Log.info(filteredObj, prefix);
236
- Log.debug(cbString, prefix);
234
+ Log.info({ prefix }, `${message} configured for ${binding.event}`);
235
+ Log.info({ prefix }, JSON.stringify(filteredObj));
236
+ Log.debug({ prefix }, cbString);
237
237
  };
238
238
 
239
239
  function Validate(validateCallback: ValidateAction<T>): ValidateActionChain<T> {
@@ -376,49 +376,49 @@ export class Capability implements CapabilityExport {
376
376
  }
377
377
 
378
378
  function InNamespace(...namespaces: string[]): BindingWithName<T> {
379
- Log.debug(`Add namespaces filter ${namespaces}`, prefix);
379
+ Log.debug({ prefix }, `Add namespaces filter ${namespaces}`);
380
380
  binding.filters.namespaces.push(...namespaces);
381
381
  return { ...commonChain, WithName, WithNameRegex };
382
382
  }
383
383
 
384
384
  function InNamespaceRegex(...namespaces: RegExp[]): BindingWithName<T> {
385
- Log.debug(`Add regex namespaces filter ${namespaces}`, prefix);
385
+ Log.debug({ prefix }, `Add regex namespaces filter ${namespaces}`);
386
386
  binding.filters.regexNamespaces.push(...namespaces.map(regex => regex.source));
387
387
  return { ...commonChain, WithName, WithNameRegex };
388
388
  }
389
389
 
390
390
  function WithDeletionTimestamp(): BindingFilter<T> {
391
- Log.debug("Add deletionTimestamp filter");
391
+ Log.debug({ prefix }, "Add deletionTimestamp filter");
392
392
  binding.filters.deletionTimestamp = true;
393
393
  return commonChain;
394
394
  }
395
395
 
396
396
  function WithNameRegex(regexName: RegExp): BindingFilter<T> {
397
- Log.debug(`Add regex name filter ${regexName}`, prefix);
397
+ Log.debug({ prefix }, `Add regex name filter ${regexName}`);
398
398
  binding.filters.regexName = regexName.source;
399
399
  return commonChain;
400
400
  }
401
401
 
402
402
  function WithName(name: string): BindingFilter<T> {
403
- Log.debug(`Add name filter ${name}`, prefix);
403
+ Log.debug({ prefix }, `Add name filter ${name}`);
404
404
  binding.filters.name = name;
405
405
  return commonChain;
406
406
  }
407
407
 
408
408
  function WithLabel(key: string, value = ""): BindingFilter<T> {
409
- Log.debug(`Add label filter ${key}=${value}`, prefix);
409
+ Log.debug({ prefix }, `Add label filter ${key}=${value}`);
410
410
  binding.filters.labels[key] = value;
411
411
  return commonChain;
412
412
  }
413
413
 
414
414
  function WithAnnotation(key: string, value = ""): BindingFilter<T> {
415
- Log.debug(`Add annotation filter ${key}=${value}`, prefix);
415
+ Log.debug({ prefix }, `Add annotation filter ${key}=${value}`);
416
416
  binding.filters.annotations[key] = value;
417
417
  return commonChain;
418
418
  }
419
419
 
420
420
  function Alias(alias: string): CommonChainType {
421
- Log.debug(`Adding prefix alias ${alias}`, prefix);
421
+ Log.debug({ prefix }, `Adding prefix alias ${alias}`);
422
422
  binding.alias = alias;
423
423
  return commonChain;
424
424
  }
@@ -116,7 +116,7 @@ export class Queue<K extends KubernetesObject> {
116
116
 
117
117
  element.resolve();
118
118
  } catch (e) {
119
- Log.debug(`Error reconciling ${element.item.metadata!.name}`, { error: e });
119
+ Log.debug({ error: e }, `Error reconciling ${element.item.metadata!.name}`);
120
120
  element.reject(e);
121
121
  } finally {
122
122
  Log.debug(this.stats(), "Queue stats - shift");
@@ -30,7 +30,7 @@ const queues: Record<string, Queue<KubernetesObject>> = {};
30
30
  */
31
31
  export function queueKey(obj: KubernetesObject): string {
32
32
  const options = ["kind", "kindNs", "kindNsName", "global"];
33
- const d3fault = "kind";
33
+ const d3fault = "kindNsName";
34
34
 
35
35
  let strat = process.env.PEPR_RECONCILE_STRATEGY || d3fault;
36
36
  strat = options.includes(strat) ? strat : d3fault;
@@ -69,7 +69,7 @@ export class MetricsCollector {
69
69
  { name, help, labelNames }: Omit<MetricArgs, "registers">,
70
70
  ): void => {
71
71
  if (collection.has(this.#getMetricName(name))) {
72
- Log.debug(`Metric for ${name} already exists`, loggingPrefix);
72
+ Log.debug({ loggingPrefix }, `Metric for ${name} already exists`);
73
73
  return;
74
74
  }
75
75
 
@@ -66,7 +66,7 @@ When(a.Namespace)
66
66
  });
67
67
  } catch (error) {
68
68
  // You can use the Log object to log messages to the Pepr controller pod
69
- Log.error(error, "Failed to apply ConfigMap using server-side apply.");
69
+ Log.error({ error }, "Failed to apply ConfigMap using server-side apply.");
70
70
  }
71
71
 
72
72
  // You can share data between actions using the Store, including between different types of actions
@@ -139,7 +139,7 @@ When(a.ConfigMap)
139
139
  })
140
140
  .Watch((cm, phase) => {
141
141
  // This Watch Action will watch the ConfigMap after it has been persisted to the cluster
142
- Log.info(cm, `ConfigMap was ${phase} with the name example-2`);
142
+ Log.info({ cm }, `ConfigMap was ${phase} with the name example-2`);
143
143
  });
144
144
 
145
145
  /**
@@ -310,9 +310,7 @@ When(a.ConfigMap)
310
310
  },
311
311
  });
312
312
  } catch (error) {
313
- Log.error(error, "Failed to apply ConfigMap using server-side apply.", {
314
- cm,
315
- });
313
+ Log.error({ error, cm }, "Failed to apply ConfigMap using server-side apply.");
316
314
  }
317
315
  }
318
316
 
@@ -454,5 +452,5 @@ When(UnicornKind)
454
452
  * A callback function that is called once the Pepr Store is fully loaded.
455
453
  */
456
454
  Store.onReady(data => {
457
- Log.info(data, "Pepr Store Ready");
455
+ Log.info({ data }, "Pepr Store Ready");
458
456
  });