paratix 0.7.0 → 0.9.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/README.md +1 -1
- package/dist/{chunk-IUY5BJHA.js → chunk-47PTUZZR.js} +2 -2
- package/dist/{chunk-D4CS2GCH.js → chunk-7Y2RBVG4.js} +143 -49
- package/dist/chunk-7Y2RBVG4.js.map +1 -0
- package/dist/{chunk-JJRF37BP.js → chunk-NRDLYHJL.js} +5 -2
- package/dist/chunk-NRDLYHJL.js.map +1 -0
- package/dist/cli.js +8 -5
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/modules/index.d.ts +1 -1
- package/dist/modules/index.js +2 -2
- package/dist/{user-BJMqDePy.d.ts → user-B9lkXr0X.d.ts} +114 -84
- package/llm-guide.md +28 -8
- package/package.json +1 -1
- package/dist/chunk-D4CS2GCH.js.map +0 -1
- package/dist/chunk-JJRF37BP.js.map +0 -1
- /package/dist/{chunk-IUY5BJHA.js.map → chunk-47PTUZZR.js.map} +0 -0
package/README.md
CHANGED
|
@@ -104,7 +104,7 @@ Signals are deferred side effects such as `service.reload(...)` or `service.rest
|
|
|
104
104
|
|
|
105
105
|
For Podman-native services, Paratix now also includes `quadlet.container(...)`. It writes a `.container` file under `/etc/containers/systemd`, reloads systemd when the content changes, and works cleanly with `service.enabled(...)` and `service.running(...)` for the generated service.
|
|
106
106
|
|
|
107
|
-
When you need a targeted image refresh outside the normal deploy flow, `quadlet.updateImage(...)` pulls exactly one image, reuses existing Podman registry auth on the host, optionally supports `authFile`, and only restarts the generated service when the pull actually downloaded a newer image. Changed runs now also print the new
|
|
107
|
+
When you need a targeted image refresh outside the normal deploy flow, `quadlet.updateImage(...)` pulls exactly one image, reuses existing Podman registry auth on the host, optionally supports `authFile`, and only restarts the generated service when the pull actually downloaded a newer image. Changed runs now also print the new registry digest in parentheses in the CLI output, with a local image ID fallback when no repo digest is available.
|
|
108
108
|
|
|
109
109
|
### Guards
|
|
110
110
|
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
CommandError,
|
|
3
3
|
assertValidModuleMetaEntries,
|
|
4
4
|
mergeEnvironmentFromMeta
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-NRDLYHJL.js";
|
|
6
6
|
|
|
7
7
|
// src/output.ts
|
|
8
8
|
import pc from "picocolors";
|
|
@@ -492,4 +492,4 @@ export {
|
|
|
492
492
|
printSummary,
|
|
493
493
|
runSignalModules
|
|
494
494
|
};
|
|
495
|
-
//# sourceMappingURL=chunk-
|
|
495
|
+
//# sourceMappingURL=chunk-47PTUZZR.js.map
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
shellQuote,
|
|
10
10
|
sshdPortMeta,
|
|
11
11
|
validateMode
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NRDLYHJL.js";
|
|
13
13
|
|
|
14
14
|
// src/moduleFailure.ts
|
|
15
15
|
function firstNonEmptyLine(text) {
|
|
@@ -173,6 +173,11 @@ async function setFlag(ssh2, flagName) {
|
|
|
173
173
|
// src/modules/apt.ts
|
|
174
174
|
var NONINTERACTIVE = "DEBIAN_FRONTEND=noninteractive";
|
|
175
175
|
var APT_REPOSITORY_MODE = "0644";
|
|
176
|
+
var APT_BASE_EXEC_OPTS = { ignoreExitCode: true, silent: true };
|
|
177
|
+
function aptExecOptions(options) {
|
|
178
|
+
if (options?.timeout === void 0) return APT_BASE_EXEC_OPTS;
|
|
179
|
+
return { ...APT_BASE_EXEC_OPTS, timeout: options.timeout };
|
|
180
|
+
}
|
|
176
181
|
var PPA_PREFIX = "ppa:";
|
|
177
182
|
function parseDebconfOutput(stdout) {
|
|
178
183
|
const values = {};
|
|
@@ -292,30 +297,31 @@ var apt = {
|
|
|
292
297
|
* Run `apt-get update && apt-get dist-upgrade` once per dated flag.
|
|
293
298
|
* Performs a full distribution upgrade with dependency resolution.
|
|
294
299
|
*
|
|
300
|
+
* The pipeline is split into three separate SSH commands so that each step
|
|
301
|
+
* gets its own timeout window and produces a precise failure label.
|
|
302
|
+
*
|
|
295
303
|
* @param date - A date string used as the idempotency key (e.g. `"2024-01-15"`).
|
|
304
|
+
* @param options - Optional per-call overrides (e.g. SSH command `timeout`).
|
|
305
|
+
* The same `timeout` is applied to every step of the dist-upgrade pipeline.
|
|
296
306
|
* @returns A Module that performs the dist-upgrade.
|
|
307
|
+
*
|
|
308
|
+
* @example
|
|
309
|
+
* apt.distUpgrade("2024-01-15")
|
|
310
|
+
* apt.distUpgrade("2024-01-15", { timeout: 900_000 })
|
|
297
311
|
*/
|
|
298
|
-
distUpgrade(date) {
|
|
312
|
+
distUpgrade(date, options) {
|
|
299
313
|
const flagName = `apt-dist-upgrade-${date}`;
|
|
300
314
|
return {
|
|
301
315
|
async apply(ssh2) {
|
|
302
316
|
if (!ssh2) return failed(`[apt.distUpgrade] SSH connection is required for ${date}`);
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
silent: true
|
|
306
|
-
});
|
|
317
|
+
const pipelineOptions = aptExecOptions(options);
|
|
318
|
+
const update = await ssh2.exec(`${NONINTERACTIVE} apt-get update`, pipelineOptions);
|
|
307
319
|
if (update.code !== 0)
|
|
308
320
|
return failedCommand("[apt.distUpgrade] apt-get update failed", update);
|
|
309
|
-
const configure = await ssh2.exec(`${NONINTERACTIVE} dpkg --configure -a`,
|
|
310
|
-
ignoreExitCode: true,
|
|
311
|
-
silent: true
|
|
312
|
-
});
|
|
321
|
+
const configure = await ssh2.exec(`${NONINTERACTIVE} dpkg --configure -a`, pipelineOptions);
|
|
313
322
|
if (configure.code !== 0)
|
|
314
323
|
return failedCommand("[apt.distUpgrade] dpkg --configure -a failed", configure);
|
|
315
|
-
const upgrade = await ssh2.exec(`${NONINTERACTIVE} apt-get dist-upgrade -y`,
|
|
316
|
-
ignoreExitCode: true,
|
|
317
|
-
silent: true
|
|
318
|
-
});
|
|
324
|
+
const upgrade = await ssh2.exec(`${NONINTERACTIVE} apt-get dist-upgrade -y`, pipelineOptions);
|
|
319
325
|
if (upgrade.code !== 0)
|
|
320
326
|
return failedCommand("[apt.distUpgrade] apt-get dist-upgrade failed", upgrade);
|
|
321
327
|
await setVersionedFlag(ssh2, flagName, "apt-dist-upgrade-");
|
|
@@ -3137,6 +3143,22 @@ var op = {
|
|
|
3137
3143
|
|
|
3138
3144
|
// src/modules/package.ts
|
|
3139
3145
|
var EXEC_OPTS6 = { ignoreExitCode: true, silent: true };
|
|
3146
|
+
function execOptions(options) {
|
|
3147
|
+
if (options?.timeout === void 0) return EXEC_OPTS6;
|
|
3148
|
+
return { ...EXEC_OPTS6, timeout: options.timeout };
|
|
3149
|
+
}
|
|
3150
|
+
function splitPackagesAndOptions(values) {
|
|
3151
|
+
const packages = [];
|
|
3152
|
+
let options;
|
|
3153
|
+
for (const [index, value] of values.entries()) {
|
|
3154
|
+
if (typeof value === "string") {
|
|
3155
|
+
packages.push(value);
|
|
3156
|
+
} else if (index === values.length - 1) {
|
|
3157
|
+
options = value;
|
|
3158
|
+
}
|
|
3159
|
+
}
|
|
3160
|
+
return { options, packages };
|
|
3161
|
+
}
|
|
3140
3162
|
var pmCache = /* @__PURE__ */ new WeakMap();
|
|
3141
3163
|
var INSTALL_COMMANDS = {
|
|
3142
3164
|
apk: (pkgs) => `apk add ${pkgs}`,
|
|
@@ -3157,10 +3179,14 @@ var UPDATE_COMMANDS = {
|
|
|
3157
3179
|
yum: "yum makecache"
|
|
3158
3180
|
};
|
|
3159
3181
|
var UPGRADE_COMMANDS = {
|
|
3160
|
-
apk: "apk update
|
|
3161
|
-
apt:
|
|
3162
|
-
|
|
3163
|
-
|
|
3182
|
+
apk: ["apk update", "apk upgrade"],
|
|
3183
|
+
apt: [
|
|
3184
|
+
"DEBIAN_FRONTEND=noninteractive dpkg --configure -a",
|
|
3185
|
+
"DEBIAN_FRONTEND=noninteractive apt-get update",
|
|
3186
|
+
"DEBIAN_FRONTEND=noninteractive apt-get upgrade -y"
|
|
3187
|
+
],
|
|
3188
|
+
dnf: ["dnf upgrade -y"],
|
|
3189
|
+
yum: ["yum update -y"]
|
|
3164
3190
|
};
|
|
3165
3191
|
function missingPackageManager(moduleName) {
|
|
3166
3192
|
return failed(`[${moduleName}] No supported package manager found (apt, dnf, yum, apk)`);
|
|
@@ -3200,13 +3226,19 @@ var pkg = {
|
|
|
3200
3226
|
* The check phase queries the package database for each package individually;
|
|
3201
3227
|
* the remove command is only executed when at least one package is present.
|
|
3202
3228
|
*
|
|
3203
|
-
*
|
|
3229
|
+
* Pass an `UpgradeOptions` object as the last argument to override the SSH
|
|
3230
|
+
* timeout for slow remove operations.
|
|
3231
|
+
*
|
|
3232
|
+
* @param packagesAndOptions - One or more package names, optionally followed
|
|
3233
|
+
* by an `UpgradeOptions` object as the last argument.
|
|
3204
3234
|
* @returns A Module that removes the packages if any are present.
|
|
3205
3235
|
*
|
|
3206
3236
|
* @example
|
|
3207
3237
|
* pkg.absent("vim", "nano")
|
|
3238
|
+
* pkg.absent("vim", "nano", { timeout: 600_000 })
|
|
3208
3239
|
*/
|
|
3209
|
-
absent(...
|
|
3240
|
+
absent(...packagesAndOptions) {
|
|
3241
|
+
const { options, packages } = splitPackagesAndOptions(packagesAndOptions);
|
|
3210
3242
|
if (packages.length === 0) {
|
|
3211
3243
|
throw new Error("package.absent: at least one package name is required");
|
|
3212
3244
|
}
|
|
@@ -3217,7 +3249,7 @@ var pkg = {
|
|
|
3217
3249
|
const pm = await detectPackageManager(ssh2);
|
|
3218
3250
|
if (!pm) return missingPackageManager(`package.absent: ${packages.join(", ")}`);
|
|
3219
3251
|
const quoted = packages.map((p) => shellQuote(p)).join(" ");
|
|
3220
|
-
const result = await ssh2.exec(REMOVE_COMMANDS[pm](quoted),
|
|
3252
|
+
const result = await ssh2.exec(REMOVE_COMMANDS[pm](quoted), execOptions(options));
|
|
3221
3253
|
if (result.code !== 0) {
|
|
3222
3254
|
return failedCommand(
|
|
3223
3255
|
`[package.absent: ${packages.join(", ")}] package removal failed`,
|
|
@@ -3244,13 +3276,19 @@ var pkg = {
|
|
|
3244
3276
|
* The check phase queries the package database for each package individually;
|
|
3245
3277
|
* the install command is only executed when at least one package is missing.
|
|
3246
3278
|
*
|
|
3247
|
-
*
|
|
3279
|
+
* Pass an `UpgradeOptions` object as the last argument to override the SSH
|
|
3280
|
+
* timeout for slow install operations.
|
|
3281
|
+
*
|
|
3282
|
+
* @param packagesAndOptions - One or more package names, optionally followed
|
|
3283
|
+
* by an `UpgradeOptions` object as the last argument.
|
|
3248
3284
|
* @returns A Module that installs missing packages.
|
|
3249
3285
|
*
|
|
3250
3286
|
* @example
|
|
3251
3287
|
* pkg.installed("git", "curl", "unzip")
|
|
3288
|
+
* pkg.installed("texlive-full", { timeout: 900_000 })
|
|
3252
3289
|
*/
|
|
3253
|
-
installed(...
|
|
3290
|
+
installed(...packagesAndOptions) {
|
|
3291
|
+
const { options, packages } = splitPackagesAndOptions(packagesAndOptions);
|
|
3254
3292
|
if (packages.length === 0) {
|
|
3255
3293
|
throw new Error("package.installed: at least one package name is required");
|
|
3256
3294
|
}
|
|
@@ -3262,7 +3300,7 @@ var pkg = {
|
|
|
3262
3300
|
const pm = await detectPackageManager(ssh2);
|
|
3263
3301
|
if (!pm) return missingPackageManager(`package.installed: ${packages.join(", ")}`);
|
|
3264
3302
|
const quoted = packages.map((p) => shellQuote(p)).join(" ");
|
|
3265
|
-
const result = await ssh2.exec(INSTALL_COMMANDS[pm](quoted),
|
|
3303
|
+
const result = await ssh2.exec(INSTALL_COMMANDS[pm](quoted), execOptions(options));
|
|
3266
3304
|
if (result.code !== 0) {
|
|
3267
3305
|
return failedCommand(
|
|
3268
3306
|
`[package.installed: ${packages.join(", ")}] package installation failed`,
|
|
@@ -3292,19 +3330,21 @@ var pkg = {
|
|
|
3292
3330
|
* value invalidates all previous flags for this operation.
|
|
3293
3331
|
*
|
|
3294
3332
|
* @param date - A date string used as the idempotency key (e.g. `"2024-01-15"`).
|
|
3333
|
+
* @param options - Optional per-call overrides (e.g. SSH command `timeout`).
|
|
3295
3334
|
* @returns A Module that refreshes package lists.
|
|
3296
3335
|
*
|
|
3297
3336
|
* @example
|
|
3298
3337
|
* pkg.update("2024-01-15")
|
|
3338
|
+
* pkg.update("2024-01-15", { timeout: 600_000 })
|
|
3299
3339
|
*/
|
|
3300
|
-
update(date) {
|
|
3340
|
+
update(date, options) {
|
|
3301
3341
|
const flagName = `package-update-${date}`;
|
|
3302
3342
|
return {
|
|
3303
3343
|
async apply(ssh2) {
|
|
3304
3344
|
if (!ssh2) return failed(`[package.update: ${date}] SSH connection is required`);
|
|
3305
3345
|
const pm = await detectPackageManager(ssh2);
|
|
3306
3346
|
if (!pm) return missingPackageManager(`package.update: ${date}`);
|
|
3307
|
-
const result = await ssh2.exec(UPDATE_COMMANDS[pm],
|
|
3347
|
+
const result = await ssh2.exec(UPDATE_COMMANDS[pm], execOptions(options));
|
|
3308
3348
|
if (result.code !== 0) {
|
|
3309
3349
|
return failedCommand(`[package.update: ${date}] package index refresh failed`, result);
|
|
3310
3350
|
}
|
|
@@ -3326,27 +3366,34 @@ var pkg = {
|
|
|
3326
3366
|
* reports `"ok"` without running the upgrade again. Changing `date` to a new
|
|
3327
3367
|
* value invalidates all previous flags for this operation.
|
|
3328
3368
|
*
|
|
3329
|
-
* On apt systems this runs `
|
|
3330
|
-
* `
|
|
3369
|
+
* On apt systems this runs `dpkg --configure -a`, `apt-get update`, and
|
|
3370
|
+
* `apt-get upgrade -y` as three separate commands (each subject to its own
|
|
3371
|
+
* SSH `timeout`). For full dependency resolution use `apt.distUpgrade`.
|
|
3331
3372
|
*
|
|
3332
3373
|
* @param date - A date string used as the idempotency key (e.g. `"2024-01-15"`).
|
|
3374
|
+
* @param options - Optional per-call overrides (e.g. SSH command `timeout`).
|
|
3375
|
+
* The same `timeout` is applied to every step of the upgrade pipeline.
|
|
3333
3376
|
* @returns A Module that upgrades all packages.
|
|
3334
3377
|
*
|
|
3335
3378
|
* @example
|
|
3336
3379
|
* pkg.upgrade("2024-01-15")
|
|
3380
|
+
* pkg.upgrade("2024-01-15", { timeout: 900_000 })
|
|
3337
3381
|
*
|
|
3338
3382
|
* @see apt.distUpgrade
|
|
3339
3383
|
*/
|
|
3340
|
-
upgrade(date) {
|
|
3384
|
+
upgrade(date, options) {
|
|
3341
3385
|
const flagName = `package-upgrade-${date}`;
|
|
3342
3386
|
return {
|
|
3343
3387
|
async apply(ssh2) {
|
|
3344
3388
|
if (!ssh2) return failed(`[package.upgrade: ${date}] SSH connection is required`);
|
|
3345
3389
|
const pm = await detectPackageManager(ssh2);
|
|
3346
3390
|
if (!pm) return missingPackageManager(`package.upgrade: ${date}`);
|
|
3347
|
-
const
|
|
3348
|
-
|
|
3349
|
-
|
|
3391
|
+
const pipelineOptions = execOptions(options);
|
|
3392
|
+
for (const command2 of UPGRADE_COMMANDS[pm]) {
|
|
3393
|
+
const result = await ssh2.exec(command2, pipelineOptions);
|
|
3394
|
+
if (result.code !== 0) {
|
|
3395
|
+
return failedCommand(`[package.upgrade: ${date}] package upgrade failed`, result);
|
|
3396
|
+
}
|
|
3350
3397
|
}
|
|
3351
3398
|
await setVersionedFlag(ssh2, flagName, "package-upgrade-");
|
|
3352
3399
|
return { status: "changed" };
|
|
@@ -3522,12 +3569,6 @@ function buildQuadletImagePullCommand(options) {
|
|
|
3522
3569
|
const authFileFlag = options.authFile == null ? "" : ` --authfile ${shellQuoteForQuadlet(options.authFile)}`;
|
|
3523
3570
|
return `podman pull${authFileFlag} ${shellQuoteForQuadlet(options.image)} 2>&1`;
|
|
3524
3571
|
}
|
|
3525
|
-
function buildQuadletImageInspectCommand(image) {
|
|
3526
|
-
return `podman image inspect --format '{{.Id}}' ${shellQuoteForQuadlet(image)}`;
|
|
3527
|
-
}
|
|
3528
|
-
function formatQuadletImageIdDetail(imageId) {
|
|
3529
|
-
return `(${imageId})`;
|
|
3530
|
-
}
|
|
3531
3572
|
function getQuadletContainerFilePath(name) {
|
|
3532
3573
|
return `${CONTAINERS_SYSTEMD_DIRECTORY}/${name}.container`;
|
|
3533
3574
|
}
|
|
@@ -3537,13 +3578,6 @@ function getQuadletContainerServiceName(options) {
|
|
|
3537
3578
|
function quadletPullOutputIndicatesChange(output) {
|
|
3538
3579
|
return QUADLET_PULL_CHANGED_OUTPUT_PATTERNS.some((pattern) => output.includes(pattern));
|
|
3539
3580
|
}
|
|
3540
|
-
function readQuadletImageIdFromInspectOutput(output) {
|
|
3541
|
-
for (const line of output.split("\n")) {
|
|
3542
|
-
const trimmed = line.trim();
|
|
3543
|
-
if (trimmed.length > 0) return trimmed;
|
|
3544
|
-
}
|
|
3545
|
-
return null;
|
|
3546
|
-
}
|
|
3547
3581
|
var UNIT_NAME_PATTERN2 = new RegExp("^[\\w@.\\-]+$", "v");
|
|
3548
3582
|
function validateQuadletName(name) {
|
|
3549
3583
|
if (!UNIT_NAME_PATTERN2.test(name)) {
|
|
@@ -3555,6 +3589,62 @@ function shellQuoteForQuadlet(value) {
|
|
|
3555
3589
|
return `'${value.replaceAll("'", escapedQuote)}'`;
|
|
3556
3590
|
}
|
|
3557
3591
|
|
|
3592
|
+
// src/modules/quadletImageInspectHelpers.ts
|
|
3593
|
+
function shellQuoteForQuadletImageInspect(value) {
|
|
3594
|
+
const escapedQuote = "'\\''";
|
|
3595
|
+
return `'${value.replaceAll("'", escapedQuote)}'`;
|
|
3596
|
+
}
|
|
3597
|
+
function buildQuadletImageInspectCommand(image) {
|
|
3598
|
+
return `podman image inspect ${shellQuoteForQuadletImageInspect(image)}`;
|
|
3599
|
+
}
|
|
3600
|
+
function formatQuadletImageIdentifierDetail(imageIdentifier) {
|
|
3601
|
+
return `(${imageIdentifier})`;
|
|
3602
|
+
}
|
|
3603
|
+
function readQuadletImageIdentifierFromInspectOutput(image, output) {
|
|
3604
|
+
const parsed = parseQuadletImageInspectOutput(output);
|
|
3605
|
+
if (parsed == null) return null;
|
|
3606
|
+
const repoDigest = findQuadletRepoDigest(image, parsed.repoDigests);
|
|
3607
|
+
return repoDigest ?? parsed.id;
|
|
3608
|
+
}
|
|
3609
|
+
function findQuadletRepoDigest(image, repoDigests) {
|
|
3610
|
+
const repository = getQuadletImageRepository(image);
|
|
3611
|
+
for (const repoDigest of repoDigests) {
|
|
3612
|
+
const separatorIndex = repoDigest.indexOf("@");
|
|
3613
|
+
if (separatorIndex === -1) continue;
|
|
3614
|
+
const repo = repoDigest.slice(0, separatorIndex);
|
|
3615
|
+
const digest = repoDigest.slice(separatorIndex + 1);
|
|
3616
|
+
if (repo === repository && digest.length > 0) return digest;
|
|
3617
|
+
}
|
|
3618
|
+
return null;
|
|
3619
|
+
}
|
|
3620
|
+
function getQuadletImageRepository(image) {
|
|
3621
|
+
const digestSeparatorIndex = image.indexOf("@");
|
|
3622
|
+
if (digestSeparatorIndex !== -1) return image.slice(0, digestSeparatorIndex);
|
|
3623
|
+
const lastSlashIndex = image.lastIndexOf("/");
|
|
3624
|
+
const lastColonIndex = image.lastIndexOf(":");
|
|
3625
|
+
return lastColonIndex > lastSlashIndex ? image.slice(0, lastColonIndex) : image;
|
|
3626
|
+
}
|
|
3627
|
+
function parseQuadletImageInspectOutput(output) {
|
|
3628
|
+
try {
|
|
3629
|
+
const parsed = JSON.parse(output);
|
|
3630
|
+
if (!Array.isArray(parsed) || parsed.length === 0) return null;
|
|
3631
|
+
const [firstEntry] = parsed;
|
|
3632
|
+
if (!isQuadletInspectEntry(firstEntry)) return null;
|
|
3633
|
+
const repoDigests = Array.isArray(firstEntry.RepoDigests) ? firstEntry.RepoDigests : [];
|
|
3634
|
+
return {
|
|
3635
|
+
id: typeof firstEntry.Id === "string" && firstEntry.Id.length > 0 ? firstEntry.Id : null,
|
|
3636
|
+
repoDigests: repoDigests.filter(
|
|
3637
|
+
(entry) => typeof entry === "string" && entry.length > 0
|
|
3638
|
+
)
|
|
3639
|
+
};
|
|
3640
|
+
} catch {
|
|
3641
|
+
return null;
|
|
3642
|
+
}
|
|
3643
|
+
}
|
|
3644
|
+
function isQuadletInspectEntry(value) {
|
|
3645
|
+
return value != null && typeof value === "object";
|
|
3646
|
+
}
|
|
3647
|
+
|
|
3558
3648
|
// src/modules/quadlet.ts
|
|
3559
3649
|
var CONTAINERS_SYSTEMD_DIRECTORY_COMMAND = "mkdir -p '/etc/containers/systemd'";
|
|
3560
3650
|
var QUADLET_FILE_MODE = "0644";
|
|
@@ -3612,10 +3702,13 @@ async function inspectQuadletImageId(parameters) {
|
|
|
3612
3702
|
inspectResult
|
|
3613
3703
|
);
|
|
3614
3704
|
}
|
|
3615
|
-
const imageId =
|
|
3705
|
+
const imageId = readQuadletImageIdentifierFromInspectOutput(
|
|
3706
|
+
parameters.image,
|
|
3707
|
+
inspectResult.stdout
|
|
3708
|
+
);
|
|
3616
3709
|
if (imageId == null) {
|
|
3617
3710
|
return failed(
|
|
3618
|
-
`[quadlet.updateImage: ${parameters.name}] podman image inspect returned no image ID`
|
|
3711
|
+
`[quadlet.updateImage: ${parameters.name}] podman image inspect returned no digest or image ID`
|
|
3619
3712
|
);
|
|
3620
3713
|
}
|
|
3621
3714
|
return imageId;
|
|
@@ -3628,7 +3721,7 @@ async function restartQuadletService(parameters) {
|
|
|
3628
3721
|
silent: true
|
|
3629
3722
|
}
|
|
3630
3723
|
);
|
|
3631
|
-
return restartResult.code === 0 ? { detail:
|
|
3724
|
+
return restartResult.code === 0 ? { detail: formatQuadletImageIdentifierDetail(parameters.imageId), status: "changed" } : failedCommand(
|
|
3632
3725
|
`[quadlet.updateImage: ${parameters.name}] systemctl restart failed`,
|
|
3633
3726
|
restartResult
|
|
3634
3727
|
);
|
|
@@ -3699,6 +3792,7 @@ var quadlet = {
|
|
|
3699
3792
|
async apply(ssh2) {
|
|
3700
3793
|
if (!ssh2) return failed(`[quadlet.updateImage: ${options.name}] SSH connection is required`);
|
|
3701
3794
|
return applyQuadletImageUpdate({
|
|
3795
|
+
image: options.image,
|
|
3702
3796
|
inspectCommand,
|
|
3703
3797
|
name: options.name,
|
|
3704
3798
|
pullCommand,
|
|
@@ -5794,4 +5888,4 @@ export {
|
|
|
5794
5888
|
ufw,
|
|
5795
5889
|
user
|
|
5796
5890
|
};
|
|
5797
|
-
//# sourceMappingURL=chunk-
|
|
5891
|
+
//# sourceMappingURL=chunk-7Y2RBVG4.js.map
|