@highstate/restic 0.9.9 → 0.9.11
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/dist/highstate.manifest.json +2 -2
- package/dist/index.js +21 -23
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/job-pair.ts +20 -21
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sourceHashes": {
|
|
3
|
-
"./dist/index.js": "
|
|
4
|
-
"./dist/repo/index.js": "
|
|
3
|
+
"./dist/index.js": "f9da3911f3808736f0a79964975827b427c98edbfed49d73df06a03d29e8887b",
|
|
4
|
+
"./dist/repo/index.js": "eae9503041b83bd9224af9e6ab728f9628fee5ca1229661852c054d155eea376"
|
|
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
|
|
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 =
|
|
4521
|
+
exports.default = core;
|
|
4522
4522
|
}
|
|
4523
4523
|
});
|
|
4524
4524
|
|
|
@@ -6394,13 +6394,14 @@ var require_ajv = __commonJS({
|
|
|
6394
6394
|
});
|
|
6395
6395
|
|
|
6396
6396
|
// src/job-pair.ts
|
|
6397
|
-
import { batch
|
|
6397
|
+
import { batch } from "@pulumi/kubernetes";
|
|
6398
6398
|
import {
|
|
6399
6399
|
createScriptContainer,
|
|
6400
6400
|
CronJob,
|
|
6401
|
+
getProvider,
|
|
6401
6402
|
Job,
|
|
6402
|
-
|
|
6403
|
-
|
|
6403
|
+
ScriptBundle,
|
|
6404
|
+
Secret
|
|
6404
6405
|
} from "@highstate/k8s";
|
|
6405
6406
|
import {
|
|
6406
6407
|
ComponentResource,
|
|
@@ -9149,12 +9150,14 @@ var BackupJobPair = class extends ComponentResource {
|
|
|
9149
9150
|
constructor(name, args, opts) {
|
|
9150
9151
|
super("highstate:restic:BackupJobPair", name, args, opts);
|
|
9151
9152
|
this.name = name;
|
|
9153
|
+
this.args = args;
|
|
9152
9154
|
this.opts = opts;
|
|
9153
9155
|
this.credentials = output(args).apply((args2) => {
|
|
9154
|
-
return
|
|
9156
|
+
return Secret.create(
|
|
9155
9157
|
`${name}-backup-credentials`,
|
|
9156
9158
|
{
|
|
9157
|
-
|
|
9159
|
+
namespace: args2.namespace,
|
|
9160
|
+
cluster: args2.cluster,
|
|
9158
9161
|
stringData: {
|
|
9159
9162
|
password: args2.backupPassword,
|
|
9160
9163
|
"rclone.conf": args2.resticRepo.rcloneConfig
|
|
@@ -9179,13 +9182,12 @@ var BackupJobPair = class extends ComponentResource {
|
|
|
9179
9182
|
curl https://rclone.org/install.sh | bash
|
|
9180
9183
|
`
|
|
9181
9184
|
},
|
|
9182
|
-
allowedEndpoints: [
|
|
9183
|
-
"rclone.org:443",
|
|
9184
|
-
"downloads.rclone.org:443",
|
|
9185
|
-
...args2.allowedEndpoints ?? [],
|
|
9186
|
-
...args2.resticRepo.remoteEndpoints ?? []
|
|
9187
|
-
]
|
|
9185
|
+
allowedEndpoints: ["rclone.org:443", "downloads.rclone.org:443"]
|
|
9188
9186
|
},
|
|
9187
|
+
allowedEndpoints: [
|
|
9188
|
+
...args2.allowedEndpoints ?? [],
|
|
9189
|
+
...args2.resticRepo.remoteEndpoints ?? []
|
|
9190
|
+
],
|
|
9189
9191
|
environment: {
|
|
9190
9192
|
RESTIC_REPOSITORY: `rclone:${args2.resticRepo.remoteName}:${repositoryPath}`,
|
|
9191
9193
|
RESTIC_PASSWORD_FILE: "/credentials/password",
|
|
@@ -9236,7 +9238,8 @@ var BackupJobPair = class extends ComponentResource {
|
|
|
9236
9238
|
...args2.restoreContainer,
|
|
9237
9239
|
main: "restore.sh",
|
|
9238
9240
|
bundle: this.scriptBundle
|
|
9239
|
-
})
|
|
9241
|
+
}),
|
|
9242
|
+
backoffLimit: 2
|
|
9240
9243
|
},
|
|
9241
9244
|
{ ...opts, parent: this }
|
|
9242
9245
|
);
|
|
@@ -9256,12 +9259,7 @@ var BackupJobPair = class extends ComponentResource {
|
|
|
9256
9259
|
concurrencyPolicy: "Forbid",
|
|
9257
9260
|
jobTemplate: {
|
|
9258
9261
|
spec: {
|
|
9259
|
-
backoffLimit:
|
|
9260
|
-
template: {
|
|
9261
|
-
spec: {
|
|
9262
|
-
restartPolicy: "Never"
|
|
9263
|
-
}
|
|
9264
|
-
}
|
|
9262
|
+
backoffLimit: 2
|
|
9265
9263
|
}
|
|
9266
9264
|
}
|
|
9267
9265
|
},
|
|
@@ -9289,7 +9287,7 @@ var BackupJobPair = class extends ComponentResource {
|
|
|
9289
9287
|
const triggerName = `restic.backup-on-destroy.${this.name}`;
|
|
9290
9288
|
const invokedTrigger = triggers.find((trigger) => trigger.name === triggerName);
|
|
9291
9289
|
if (invokedTrigger) {
|
|
9292
|
-
this.createBackupOnDestroyJob();
|
|
9290
|
+
void this.createBackupOnDestroyJob();
|
|
9293
9291
|
return;
|
|
9294
9292
|
}
|
|
9295
9293
|
return {
|
|
@@ -9301,7 +9299,7 @@ var BackupJobPair = class extends ComponentResource {
|
|
|
9301
9299
|
}
|
|
9302
9300
|
};
|
|
9303
9301
|
}
|
|
9304
|
-
createBackupOnDestroyJob() {
|
|
9302
|
+
async createBackupOnDestroyJob() {
|
|
9305
9303
|
new batch.v1.Job(
|
|
9306
9304
|
`${this.name}-backup-on-destroy`,
|
|
9307
9305
|
{
|
|
@@ -9311,7 +9309,7 @@ var BackupJobPair = class extends ComponentResource {
|
|
|
9311
9309
|
},
|
|
9312
9310
|
spec: this.backupJob.cronJob.spec.jobTemplate.spec
|
|
9313
9311
|
},
|
|
9314
|
-
{ ...this.opts, parent: this }
|
|
9312
|
+
{ ...this.opts, parent: this, provider: await getProvider(this.args.cluster) }
|
|
9315
9313
|
);
|
|
9316
9314
|
}
|
|
9317
9315
|
};
|