@highstate/restic 0.9.10 → 0.9.12
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 +10 -9
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/job-pair.ts +11 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@highstate/restic",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -20,15 +20,15 @@
|
|
|
20
20
|
"build": "highstate build"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@highstate/common": "^0.9.
|
|
24
|
-
"@highstate/k8s": "^0.9.
|
|
25
|
-
"@highstate/library": "^0.9.
|
|
26
|
-
"@highstate/pulumi": "^0.9.
|
|
23
|
+
"@highstate/common": "^0.9.12",
|
|
24
|
+
"@highstate/k8s": "^0.9.12",
|
|
25
|
+
"@highstate/library": "^0.9.12",
|
|
26
|
+
"@highstate/pulumi": "^0.9.12",
|
|
27
27
|
"@pulumi/kubernetes": "^4.18.0",
|
|
28
28
|
"remeda": "^2.21.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@highstate/cli": "^0.9.
|
|
31
|
+
"@highstate/cli": "^0.9.12"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "071ace10161f3fcc4e21b75a502e47cfd6e738a6"
|
|
34
34
|
}
|
package/src/job-pair.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { batch } from "@pulumi/kubernetes"
|
|
|
4
4
|
import {
|
|
5
5
|
createScriptContainer,
|
|
6
6
|
CronJob,
|
|
7
|
+
getProvider,
|
|
7
8
|
Job,
|
|
8
9
|
ScriptBundle,
|
|
9
10
|
Secret,
|
|
@@ -124,7 +125,7 @@ export class BackupJobPair extends ComponentResource {
|
|
|
124
125
|
|
|
125
126
|
constructor(
|
|
126
127
|
private readonly name: string,
|
|
127
|
-
args: BackupJobPairArgs,
|
|
128
|
+
private readonly args: BackupJobPairArgs,
|
|
128
129
|
private readonly opts?: ComponentResourceOptions,
|
|
129
130
|
) {
|
|
130
131
|
super("highstate:restic:BackupJobPair", name, args, opts)
|
|
@@ -168,14 +169,14 @@ export class BackupJobPair extends ComponentResource {
|
|
|
168
169
|
`,
|
|
169
170
|
},
|
|
170
171
|
|
|
171
|
-
allowedEndpoints: [
|
|
172
|
-
"rclone.org:443",
|
|
173
|
-
"downloads.rclone.org:443",
|
|
174
|
-
...(args.allowedEndpoints ?? []),
|
|
175
|
-
...(args.resticRepo.remoteEndpoints ?? []),
|
|
176
|
-
],
|
|
172
|
+
allowedEndpoints: ["rclone.org:443", "downloads.rclone.org:443"],
|
|
177
173
|
},
|
|
178
174
|
|
|
175
|
+
allowedEndpoints: [
|
|
176
|
+
...(args.allowedEndpoints ?? []),
|
|
177
|
+
...(args.resticRepo.remoteEndpoints ?? []),
|
|
178
|
+
],
|
|
179
|
+
|
|
179
180
|
environment: {
|
|
180
181
|
RESTIC_REPOSITORY: `rclone:${args.resticRepo.remoteName}:${repositoryPath}`,
|
|
181
182
|
RESTIC_PASSWORD_FILE: "/credentials/password",
|
|
@@ -276,7 +277,7 @@ export class BackupJobPair extends ComponentResource {
|
|
|
276
277
|
const invokedTrigger = triggers.find(trigger => trigger.name === triggerName)
|
|
277
278
|
|
|
278
279
|
if (invokedTrigger) {
|
|
279
|
-
this.createBackupOnDestroyJob()
|
|
280
|
+
void this.createBackupOnDestroyJob()
|
|
280
281
|
return
|
|
281
282
|
}
|
|
282
283
|
|
|
@@ -290,7 +291,7 @@ export class BackupJobPair extends ComponentResource {
|
|
|
290
291
|
}
|
|
291
292
|
}
|
|
292
293
|
|
|
293
|
-
private createBackupOnDestroyJob(): void {
|
|
294
|
+
private async createBackupOnDestroyJob(): Promise<void> {
|
|
294
295
|
new batch.v1.Job(
|
|
295
296
|
`${this.name}-backup-on-destroy`,
|
|
296
297
|
{
|
|
@@ -300,7 +301,7 @@ export class BackupJobPair extends ComponentResource {
|
|
|
300
301
|
},
|
|
301
302
|
spec: this.backupJob.cronJob.spec.jobTemplate.spec,
|
|
302
303
|
},
|
|
303
|
-
{ ...this.opts, parent: this },
|
|
304
|
+
{ ...this.opts, parent: this, provider: await getProvider(this.args.cluster) },
|
|
304
305
|
)
|
|
305
306
|
}
|
|
306
307
|
}
|