@highstate/restic 0.9.8 → 0.9.10

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "sourceHashes": {
3
- "./dist/index.js": "89aa763d7ecb7bcbc281fd325cd20cbc8b18a2750847969b31966e4de0ed7a97",
4
- "./dist/repo/index.js": "94984771a19ba80aaa2d9a30319b357153015252a1ef8834324ba3097bf8afe9"
3
+ "./dist/index.js": "1610a5acb7fc1e922d3121c831b882ff287ac0cf2749bceefdb69d39f39201ce",
4
+ "./dist/repo/index.js": "710d064bd08ed46062ec95e3181eef9edcce42e7db06af5011a1dafc94f2209a"
5
5
  }
6
6
  }
package/dist/index.js CHANGED
@@ -4508,7 +4508,7 @@ var require_core2 = __commonJS({
4508
4508
  Object.defineProperty(exports, "__esModule", { value: true });
4509
4509
  var id_1 = require_id();
4510
4510
  var ref_1 = require_ref();
4511
- var core2 = [
4511
+ var core = [
4512
4512
  "$schema",
4513
4513
  "$id",
4514
4514
  "$defs",
@@ -4518,7 +4518,7 @@ var require_core2 = __commonJS({
4518
4518
  id_1.default,
4519
4519
  ref_1.default
4520
4520
  ];
4521
- exports.default = core2;
4521
+ exports.default = core;
4522
4522
  }
4523
4523
  });
4524
4524
 
@@ -6394,20 +6394,25 @@ var require_ajv = __commonJS({
6394
6394
  });
6395
6395
 
6396
6396
  // src/job-pair.ts
6397
- import { batch, core } from "@pulumi/kubernetes";
6397
+ import { batch } from "@pulumi/kubernetes";
6398
6398
  import {
6399
6399
  createScriptContainer,
6400
6400
  CronJob,
6401
6401
  Job,
6402
- mapMetadata,
6403
- ScriptBundle
6402
+ ScriptBundle,
6403
+ Secret
6404
6404
  } from "@highstate/k8s";
6405
6405
  import {
6406
6406
  ComponentResource,
6407
+ getUnitInstanceName,
6407
6408
  normalize,
6408
6409
  output
6409
6410
  } from "@highstate/pulumi";
6410
6411
 
6412
+ // ../contract/dist/index.js
6413
+ import { mapValues as mapValues3 } from "remeda";
6414
+ import { mapValues as mapValues2 } from "remeda";
6415
+
6411
6416
  // ../../node_modules/@sinclair/typebox/build/esm/type/guard/value.mjs
6412
6417
  var value_exports = {};
6413
6418
  __export(value_exports, {
@@ -9021,6 +9026,7 @@ var Type = type_exports2;
9021
9026
 
9022
9027
  // ../contract/dist/index.js
9023
9028
  var import_ajv = __toESM(require_ajv(), 1);
9029
+ import { isNonNullish, mapValues, pickBy } from "remeda";
9024
9030
  var boundaryInput = Symbol("boundaryInput");
9025
9031
  function text(strings, ...values) {
9026
9032
  const stringValues = values.map(String);
@@ -9145,12 +9151,13 @@ var BackupJobPair = class extends ComponentResource {
9145
9151
  this.name = name;
9146
9152
  this.opts = opts;
9147
9153
  this.credentials = output(args).apply((args2) => {
9148
- return new core.v1.Secret(
9154
+ return Secret.create(
9149
9155
  `${name}-backup-credentials`,
9150
9156
  {
9151
- metadata: mapMetadata(args2, `${name}-backup-credentials`),
9157
+ namespace: args2.namespace,
9158
+ cluster: args2.cluster,
9152
9159
  stringData: {
9153
- password: args2.resticRepo.password,
9160
+ password: args2.backupPassword,
9154
9161
  "rclone.conf": args2.resticRepo.rcloneConfig
9155
9162
  }
9156
9163
  },
@@ -9158,6 +9165,7 @@ var BackupJobPair = class extends ComponentResource {
9158
9165
  );
9159
9166
  });
9160
9167
  const environment = output(args).apply((args2) => {
9168
+ const repositoryPath = args2.resticRepo.pathPattern.replace(/\$clusterName/g, args2.cluster.name).replace(/\$appName/g, name).replace(/\$unitName/g, getUnitInstanceName());
9161
9169
  return {
9162
9170
  alpine: {
9163
9171
  packages: ["rclone"]
@@ -9180,7 +9188,7 @@ var BackupJobPair = class extends ComponentResource {
9180
9188
  ]
9181
9189
  },
9182
9190
  environment: {
9183
- RESTIC_REPOSITORY: `rclone:${args2.resticRepo.remoteName}:${args2.resticRepo.basePath}/${args2.cluster.name}/${name}`,
9191
+ RESTIC_REPOSITORY: `rclone:${args2.resticRepo.remoteName}:${repositoryPath}`,
9184
9192
  RESTIC_PASSWORD_FILE: "/credentials/password",
9185
9193
  RESTIC_HOSTNAME: "default",
9186
9194
  RCLONE_CONFIG: "/credentials/rclone.conf",
@@ -9229,7 +9237,8 @@ var BackupJobPair = class extends ComponentResource {
9229
9237
  ...args2.restoreContainer,
9230
9238
  main: "restore.sh",
9231
9239
  bundle: this.scriptBundle
9232
- })
9240
+ }),
9241
+ backoffLimit: 2
9233
9242
  },
9234
9243
  { ...opts, parent: this }
9235
9244
  );
@@ -9249,12 +9258,7 @@ var BackupJobPair = class extends ComponentResource {
9249
9258
  concurrencyPolicy: "Forbid",
9250
9259
  jobTemplate: {
9251
9260
  spec: {
9252
- backoffLimit: 1,
9253
- template: {
9254
- spec: {
9255
- restartPolicy: "Never"
9256
- }
9257
- }
9261
+ backoffLimit: 2
9258
9262
  }
9259
9263
  }
9260
9264
  },