signalk-container 1.6.0 → 1.8.0-beta.1
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/AGENTS.md +22 -0
- package/README.md +21 -16
- package/dist/containers.d.ts +120 -5
- package/dist/containers.d.ts.map +1 -1
- package/dist/containers.js +414 -153
- package/dist/containers.js.map +1 -1
- package/dist/doctor.d.ts +42 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +65 -0
- package/dist/doctor.js.map +1 -0
- package/dist/index.d.ts +117 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +502 -78
- package/dist/index.js.map +1 -1
- package/dist/jobs.d.ts +2 -41
- package/dist/jobs.d.ts.map +1 -1
- package/dist/jobs.js +23 -104
- package/dist/jobs.js.map +1 -1
- package/dist/log-stream-broker.d.ts +84 -0
- package/dist/log-stream-broker.d.ts.map +1 -0
- package/dist/log-stream-broker.js +174 -0
- package/dist/log-stream-broker.js.map +1 -0
- package/dist/manifest/atomicWrite.d.ts +16 -0
- package/dist/manifest/atomicWrite.d.ts.map +1 -0
- package/dist/manifest/atomicWrite.js +100 -0
- package/dist/manifest/atomicWrite.js.map +1 -0
- package/dist/manifest/resolver.d.ts +33 -0
- package/dist/manifest/resolver.d.ts.map +1 -0
- package/dist/manifest/resolver.js +52 -0
- package/dist/manifest/resolver.js.map +1 -0
- package/dist/manifest/schema.d.ts +53 -0
- package/dist/manifest/schema.d.ts.map +1 -0
- package/dist/manifest/schema.js +47 -0
- package/dist/manifest/schema.js.map +1 -0
- package/dist/manifest/store.d.ts +45 -0
- package/dist/manifest/store.d.ts.map +1 -0
- package/dist/manifest/store.js +220 -0
- package/dist/manifest/store.js.map +1 -0
- package/dist/resources.d.ts +1 -1
- package/dist/resources.d.ts.map +1 -1
- package/dist/resources.js +9 -19
- package/dist/resources.js.map +1 -1
- package/dist/runtime.d.ts +128 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +233 -20
- package/dist/runtime.js.map +1 -1
- package/dist/types.d.ts +255 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -2
- package/dist/updates/cache.d.ts +1 -1
- package/dist/updates/cache.d.ts.map +1 -1
- package/dist/updates/cache.js +8 -13
- package/dist/updates/cache.js.map +1 -1
- package/dist/updates/offline.js +1 -4
- package/dist/updates/offline.js.map +1 -1
- package/dist/updates/routes.d.ts +1 -1
- package/dist/updates/routes.d.ts.map +1 -1
- package/dist/updates/routes.js +1 -4
- package/dist/updates/routes.js.map +1 -1
- package/dist/updates/semver.js +1 -4
- package/dist/updates/semver.js.map +1 -1
- package/dist/updates/service.d.ts +5 -5
- package/dist/updates/service.d.ts.map +1 -1
- package/dist/updates/service.js +12 -17
- package/dist/updates/service.js.map +1 -1
- package/dist/updates/sources.d.ts +1 -1
- package/dist/updates/sources.d.ts.map +1 -1
- package/dist/updates/sources.js +2 -6
- package/dist/updates/sources.js.map +1 -1
- package/dist/updates/tagClassifier.d.ts +1 -1
- package/dist/updates/tagClassifier.d.ts.map +1 -1
- package/dist/updates/tagClassifier.js +1 -4
- package/dist/updates/tagClassifier.js.map +1 -1
- package/dist/updates/types.d.ts +1 -1
- package/dist/updates/types.d.ts.map +1 -1
- package/dist/updates/types.js +1 -2
- package/doc/plugin-developer-guide.md +156 -0
- package/doc/screenshots/signalk-container-3.png +0 -0
- package/package.json +16 -10
- package/public/chunks/_virtual_mf-localSharedImportMap___mfe_internal__signalk_container-BmrRsGF5.js +1 -0
- package/public/chunks/dist-oj8URvh5.js +4 -0
- package/public/chunks/hostInit-qNQhWMu1.js +1 -0
- package/public/chunks/preload-helper-CM6grPkN.js +1 -0
- package/public/chunks/virtualExposes-CjK-c_Lg.js +1 -0
- package/public/configpanel-entry.js +5 -0
- package/public/remoteEntry.js +1 -1
- package/public/540.js +0 -2
- package/public/540.js.LICENSE.txt +0 -9
- package/public/805.js +0 -1
- package/public/main.js +0 -1
- package/webpack.config.js +0 -43
package/AGENTS.md
CHANGED
|
@@ -57,6 +57,28 @@ These are non-obvious rules baked into the runtime layer. Breaking them produces
|
|
|
57
57
|
|
|
58
58
|
Named volumes (source without leading `/`) always pass through; `ifMissing` only applies to host paths. `volumeSource()` in `containers.ts` is the single narrower from the union back to bare-string for the two call sites that consume `config.volumes` after classification (`buildRunArgs`, `diffContainerConfig`).
|
|
59
59
|
|
|
60
|
+
### Container log streaming
|
|
61
|
+
|
|
62
|
+
Three-layer structure (`src/runtime.ts` → `src/containers.ts` → `src/log-stream-broker.ts`):
|
|
63
|
+
|
|
64
|
+
1. `spawnRuntimeStreaming` (`src/runtime.ts`) — primitive that wraps `child_process.spawn(podman/docker, args)` with a `stop()` handle and a `makeLineSplitter`-fed `onLine` callback. Used for any long-running runtime command that needs streaming output; `tailContainerLogs` is its only current caller. Returns synchronously with a stop-handle — unlike `execRuntimeLong` which awaits process exit.
|
|
65
|
+
2. `tailContainerLogs` (`src/containers.ts`) — thin helper that composes `["logs", "-f", "--tail", N, prefixedName(name)]` and delegates to `spawnRuntimeStreaming`. `getContainerLogs` is the one-shot sibling (no `-f`, returns a `string[]`).
|
|
66
|
+
3. `LogStreamBroker` (`src/log-stream-broker.ts`) — per-container fan-out. First subscribe spawns the tail; last unsubscribe stops it. On tail exit with subscribers still attached the broker auto-respawns with exponential backoff (constants `RESPAWN_DELAY_MS` / `MAX_RESPAWN_DELAY_MS`); a delivered line resets the counter. This is what lets SSE-only consumers recover from auto-recreate or daemon glitches without waiting for a fresh subscribe call. Brokers are keyed by container name on the wrapper and auto-recreate cancels the prior subscription before installing a new one.
|
|
67
|
+
|
|
68
|
+
Consumer surfaces:
|
|
69
|
+
|
|
70
|
+
- `EnsureRunningOptions.onContainerLog` — plugin authors wire it into `app.debug`.
|
|
71
|
+
- `GET /api/containers/:name/logs/stream` — Server-Sent Events. Frames are `data: <line>\n\n`; `event: end` fires on container removal / plugin stop. Heartbeats keep reverse-proxy idle timeouts at bay. Client disconnect unsubscribes and ref-counts the broker down.
|
|
72
|
+
- `GET /api/containers/:name/logs?tail=N&since=ts` — one-shot, used by the UI for initial backfill before opening the SSE stream.
|
|
73
|
+
|
|
74
|
+
Lifecycle:
|
|
75
|
+
|
|
76
|
+
- `containers.remove(name)` and `plugin.stop()` force-close brokers; SSE clients get a final `event: end` frame.
|
|
77
|
+
- `safeInvokeContainerLog` mirrors `safeInvokeVolumeIssue` — sync throws and async rejections from plugin handlers route to `app.error` and never propagate.
|
|
78
|
+
- Combined stdout+stderr (matches `podman logs <name>` semantics). Per-stream separation is out of scope for v1.
|
|
79
|
+
|
|
80
|
+
See `src/runtime.ts`, `src/containers.ts`, `src/log-stream-broker.ts`, and the tests in `src/test/` for exact timing and lifecycle mechanics.
|
|
81
|
+
|
|
60
82
|
### Podman image qualification
|
|
61
83
|
|
|
62
84
|
`qualifyImage("foo/bar:tag", podmanRuntime)` prefixes `docker.io/` when needed (podman requires fully qualified names unless `unqualified-search-registries` is set). Docker passes through. Use this everywhere we feed an image string to a runtime command.
|
package/README.md
CHANGED
|
@@ -19,6 +19,7 @@ Instead of each plugin implementing its own container orchestration, they delega
|
|
|
19
19
|
- **Zero-config container service connectivity** -- `signalkAccessiblePorts` lets the SignalK process connect back to a service running inside a managed container (e.g. an HTTP or TCP server). signalk-container picks the right networking strategy automatically — port binding on the host loopback for bare-metal deployments, or a shared Docker network with DNS for containerised ones. No host ports are exposed unnecessarily.
|
|
20
20
|
- **SELinux support** -- `:Z` volume flags for Podman bind mounts on Fedora/RHEL; named volumes are handled correctly (`:Z` is not applied)
|
|
21
21
|
- **Per-volume host-source policy** -- volumes accept `{ source, ifMissing: "skip" | "abort" }` for user-managed (USB drives, NFS) or deployment-required (TLS certs) mounts. Plugins subscribe to `onVolumeIssue` events for `'skipped'`, `'aborted'`, and `'recovered'` actions; signalk-container auto-recreates the container when a previously-missing source reappears. See the [developer guide](doc/plugin-developer-guide.md#optional-and-required-volumes).
|
|
22
|
+
- **Container log streaming** -- click **Logs** on any managed-container card to open a live-streaming popup of the container's stdout+stderr (combined, the same shape `podman logs <name>` produces). Plugin authors can also wire `onContainerLog` in `ensureRunning` options to forward the same stream into their plugin's `app.debug` channel — visible in the Signal K server log when debug is enabled. Multiple subscribers share a single underlying tail process. See the [developer guide](doc/plugin-developer-guide.md#streaming-container-logs-into-your-plugins-debug-channel).
|
|
22
23
|
- **Podman image qualification** -- automatically prefixes `docker.io/` for short image names
|
|
23
24
|
- **Cross-plugin API** -- other plugins use `globalThis.__signalk_containerManager`
|
|
24
25
|
|
|
@@ -41,7 +42,8 @@ The plugin embeds a React config panel in the Signal K Admin UI (via Module Fede
|
|
|
41
42
|
### Managed Containers (one card per running or stopped container)
|
|
42
43
|
|
|
43
44
|
- Container name, image, state, and port mappings
|
|
44
|
-
- **Start** / **Stop** / **Remove** buttons appropriate to the current state
|
|
45
|
+
- **Start** / **Stop** / **Logs** / **Remove** buttons appropriate to the current state
|
|
46
|
+
- **Logs** opens a live-streaming popup of the container's combined stdout/stderr — works for both running and stopped containers
|
|
45
47
|
- **Current effective resource limits** shown as compact badges (e.g. `1.5 CPU · 512m · 200 PIDs`)
|
|
46
48
|
- **Override active** amber badge when the user has configured a resource override for the container
|
|
47
49
|
- **Updates row** (when the consumer plugin has registered with the update service):
|
|
@@ -125,6 +127,7 @@ See [doc/plugin-developer-guide.md](doc/plugin-developer-guide.md) for the full
|
|
|
125
127
|
| `remove(name)` | Stop and remove a container |
|
|
126
128
|
| `getState(name)` | Returns `running`, `stopped`, `missing`, or `no-runtime` |
|
|
127
129
|
| `runJob(config)` | Execute a one-shot container job |
|
|
130
|
+
| `getLogs(name, options?)` | One-shot fetch of the last N lines of a container's combined stdout+stderr log. `tail` defaults to 200, max 10000; `since` is unix-epoch seconds |
|
|
128
131
|
| `prune()` | Remove dangling images |
|
|
129
132
|
| `listContainers()` | List all `sk-` prefixed containers |
|
|
130
133
|
| `execInContainer(name, command)` | Run a command inside a running container |
|
|
@@ -146,21 +149,23 @@ See [doc/plugin-developer-guide.md](doc/plugin-developer-guide.md) for the full
|
|
|
146
149
|
|
|
147
150
|
All mounted at `/plugins/signalk-container/api/`:
|
|
148
151
|
|
|
149
|
-
| Method | Path
|
|
150
|
-
| ------ |
|
|
151
|
-
| GET | `/runtime`
|
|
152
|
-
| GET | `/containers`
|
|
153
|
-
| GET | `/containers/:name/state`
|
|
154
|
-
| POST | `/containers/:name/start`
|
|
155
|
-
| POST | `/containers/:name/stop`
|
|
156
|
-
| POST | `/containers/:name/remove`
|
|
157
|
-
|
|
|
158
|
-
| GET | `/
|
|
159
|
-
|
|
|
160
|
-
|
|
|
161
|
-
| GET | `/
|
|
162
|
-
| POST | `/
|
|
163
|
-
|
|
|
152
|
+
| Method | Path | Description |
|
|
153
|
+
| ------ | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
154
|
+
| GET | `/runtime` | Detected runtime info |
|
|
155
|
+
| GET | `/containers` | List managed containers |
|
|
156
|
+
| GET | `/containers/:name/state` | Container state |
|
|
157
|
+
| POST | `/containers/:name/start` | Start a stopped container |
|
|
158
|
+
| POST | `/containers/:name/stop` | Stop a running container |
|
|
159
|
+
| POST | `/containers/:name/remove` | Stop and remove a container |
|
|
160
|
+
| GET | `/containers/:name/logs?tail=N&since=ts` | Last N lines of the container's combined stdout+stderr log (one-shot). `tail` defaults 200, max 10000 |
|
|
161
|
+
| GET | `/containers/:name/logs/stream` | Server-Sent Events stream of live log lines. Closes when the container is removed or the client disconnects |
|
|
162
|
+
| POST | `/prune` | Prune dangling images |
|
|
163
|
+
| GET | `/updates` | List last update-check results |
|
|
164
|
+
| GET | `/updates/:pluginId` | Last update-check result for one plugin |
|
|
165
|
+
| POST | `/updates/:pluginId/check` | Force a fresh update check (HTTP 200 even when offline) |
|
|
166
|
+
| GET | `/containers/:name/resources` | Effective resource limits + user override |
|
|
167
|
+
| POST | `/containers/:name/resources` | Apply new resource limits (live or recreate). Body is a `ContainerResourceLimits` diff against the consumer plugin's default. |
|
|
168
|
+
| DELETE | `/containers/:name/resources` | Clear any user override and restore the consumer plugin's pristine default limits to the running container. |
|
|
164
169
|
|
|
165
170
|
## Configuration
|
|
166
171
|
|
package/dist/containers.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ContainerConfig, ContainerInfo, ContainerRuntimeInfo, ContainerState, HealthCheckOptions, VolumeIssue, VolumeSpec } from "./types";
|
|
1
|
+
import { ContainerConfig, ContainerInfo, ContainerRuntimeInfo, ContainerState, HealthCheckOptions, VolumeIssue, VolumeSpec } from "./types.js";
|
|
2
|
+
import { StreamingProcessHandle, spawnRuntimeStreaming } from "./runtime.js";
|
|
2
3
|
/**
|
|
3
4
|
* Build the value for a `-v <source>:<dest>[:flags]` argument with the
|
|
4
5
|
* correct SELinux relabel suffix for the runtime.
|
|
@@ -98,6 +99,73 @@ export declare function collectRecoveredVolumes(prior: {
|
|
|
98
99
|
* the message instead of writing to `app.error`.
|
|
99
100
|
*/
|
|
100
101
|
export declare function safeInvokeVolumeIssue(handler: ((event: VolumeIssue) => void | Promise<void>) | undefined, event: VolumeIssue, reportError: (err: unknown) => void): void;
|
|
102
|
+
/**
|
|
103
|
+
* Invoke an `onContainerLog` callback safely. Synchronous throws AND
|
|
104
|
+
* rejected promises both route to `reportError`, so handler bugs (in
|
|
105
|
+
* either flavour) never escape as unhandled rejections. Same shape
|
|
106
|
+
* and rationale as `safeInvokeVolumeIssue` — see that helper's
|
|
107
|
+
* doc for why the `try { Promise.resolve(...).catch(...) }` dance
|
|
108
|
+
* is needed.
|
|
109
|
+
*/
|
|
110
|
+
export declare function safeInvokeContainerLog(handler: ((line: string) => void | Promise<void>) | undefined, line: string, reportError: (err: unknown) => void): void;
|
|
111
|
+
/**
|
|
112
|
+
* Spawn `podman logs -f --tail=N sk-<name>` (or `docker logs -f`)
|
|
113
|
+
* and emit each line to `onLine`. Returns a stop-handle; the caller
|
|
114
|
+
* manages lifecycle (start after the container is running; stop on
|
|
115
|
+
* remove or recreate).
|
|
116
|
+
*
|
|
117
|
+
* `startTail` controls history-backfill on attach. Default 0 →
|
|
118
|
+
* only live lines after attach. Set to e.g. 100 for "last 100 +
|
|
119
|
+
* live" semantics. Both runtime CLIs accept `--tail` identically.
|
|
120
|
+
*
|
|
121
|
+
* `spawn` is exposed for tests (defaults to `spawnRuntimeStreaming`).
|
|
122
|
+
*/
|
|
123
|
+
export declare function tailContainerLogs(runtime: ContainerRuntimeInfo, name: string, onLine: (line: string) => void, options?: {
|
|
124
|
+
startTail?: number;
|
|
125
|
+
onError?: (msg: string) => void;
|
|
126
|
+
onExit?: (code: number | null) => void;
|
|
127
|
+
spawn?: typeof spawnRuntimeStreaming;
|
|
128
|
+
}): StreamingProcessHandle;
|
|
129
|
+
/** Upper bound for `--tail N` accepted at the public boundary. */
|
|
130
|
+
export declare const MAX_TAIL = 10000;
|
|
131
|
+
/**
|
|
132
|
+
* Validate an optional unsigned-integer query parameter (e.g.
|
|
133
|
+
* `?tail=200`, `?since=1700000000`) at the public REST boundary.
|
|
134
|
+
* Returns `{ value }` on success (or `undefined` when the input
|
|
135
|
+
* was omitted/empty) and `{ error }` with a human-readable
|
|
136
|
+
* message for non-integer, negative, or non-finite inputs.
|
|
137
|
+
*
|
|
138
|
+
* Used by the `/logs` route to reject malformed inputs with 400
|
|
139
|
+
* instead of forwarding silently-coerced values to runtime-facing
|
|
140
|
+
* logic. Exported so the parser is testable in isolation.
|
|
141
|
+
*/
|
|
142
|
+
export declare function parsePositiveIntQuery(raw: unknown, field: string): {
|
|
143
|
+
value: number | undefined;
|
|
144
|
+
error?: string;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Capture the last `tail` lines of a managed container's stdout
|
|
148
|
+
* and stderr via `podman logs --tail <N>` (no `-f`). Returns the
|
|
149
|
+
* array of lines. Caps `tail` at 10000 to prevent runaway-buffer
|
|
150
|
+
* requests against very chatty containers; `since` is a unix-epoch-
|
|
151
|
+
* seconds filter passed through to the runtime.
|
|
152
|
+
*
|
|
153
|
+
* Ordering caveat: `execFile` reads the runtime's stdout and stderr
|
|
154
|
+
* into separate buffers — the OS-level chronological interleave
|
|
155
|
+
* between the two is lost before we see them. We return stdout
|
|
156
|
+
* lines (in order) followed by stderr lines (in order); a stderr
|
|
157
|
+
* line the container actually emitted between two stdout lines
|
|
158
|
+
* will appear after the stdout chunk. This is a known limitation
|
|
159
|
+
* of one-shot capture; per-line `--timestamps` parsing would be
|
|
160
|
+
* the only way to reconstruct true chronology and is out of scope.
|
|
161
|
+
*
|
|
162
|
+
* Used both by the `GET /containers/:name/logs` REST route and by
|
|
163
|
+
* `ContainerManagerApi.getLogs` for in-process consumer-plugin calls.
|
|
164
|
+
*/
|
|
165
|
+
export declare function getContainerLogs(runtime: ContainerRuntimeInfo, name: string, options?: {
|
|
166
|
+
tail?: number;
|
|
167
|
+
since?: number;
|
|
168
|
+
}, exec?: ExecFn): Promise<string[]>;
|
|
101
169
|
export declare function qualifyImage(image: string, runtime: ContainerRuntimeInfo): string;
|
|
102
170
|
export declare function imageExists(runtime: ContainerRuntimeInfo, image: string, exec?: ExecFn): Promise<boolean>;
|
|
103
171
|
/**
|
|
@@ -109,14 +177,42 @@ export declare function imageExists(runtime: ContainerRuntimeInfo, image: string
|
|
|
109
177
|
* pulled image, or a container name to inspect the image a running
|
|
110
178
|
* container is using.
|
|
111
179
|
*/
|
|
112
|
-
export declare function getImageDigest(runtime: ContainerRuntimeInfo, imageOrContainer: string): Promise<string | null>;
|
|
180
|
+
export declare function getImageDigest(runtime: ContainerRuntimeInfo, imageOrContainer: string, exec?: ExecFn): Promise<string | null>;
|
|
181
|
+
/**
|
|
182
|
+
* Return the first RepoDigest for an image reference, as
|
|
183
|
+
* `sha256:<hex>` (without the `image@` prefix). This is the
|
|
184
|
+
* *manifest* digest — what consumer plugins and CI tools speak —
|
|
185
|
+
* distinct from the local image ID returned by `getImageDigest`.
|
|
186
|
+
*
|
|
187
|
+
* Returns null when the image has no RepoDigests, which happens for:
|
|
188
|
+
* - locally-built images never pushed to a registry
|
|
189
|
+
* - images side-loaded via `podman load` from a tarball
|
|
190
|
+
*
|
|
191
|
+
* The resolver falls back to a `local:<image-id>` synthetic identity
|
|
192
|
+
* in that case so the manifest entry still round-trips.
|
|
193
|
+
*/
|
|
194
|
+
export declare function getRepoDigest(runtime: ContainerRuntimeInfo, image: string, exec?: ExecFn): Promise<string | null>;
|
|
195
|
+
/**
|
|
196
|
+
* Return the digest of the image a *running* container is actually
|
|
197
|
+
* using, in the form `sha256:<hex>` or `local:<image-id>`.
|
|
198
|
+
*
|
|
199
|
+
* Distinct from "what `image:tag` resolves to right now": if someone
|
|
200
|
+
* `podman pull`'d the image after the container started, the local
|
|
201
|
+
* tag moved but the container is still on the old bits. This walks
|
|
202
|
+
* from the container's image-id (immutable for its lifetime) to its
|
|
203
|
+
* RepoDigests.
|
|
204
|
+
*
|
|
205
|
+
* Returns null if the container doesn't exist or the runtime can't
|
|
206
|
+
* read its image-id.
|
|
207
|
+
*/
|
|
208
|
+
export declare function getLiveContainerDigest(runtime: ContainerRuntimeInfo, containerName: string, exec?: ExecFn): Promise<string | null>;
|
|
113
209
|
export declare function pullImage(runtime: ContainerRuntimeInfo, image: string, onProgress?: (msg: string) => void): Promise<void>;
|
|
114
210
|
export declare function getContainerState(runtime: ContainerRuntimeInfo, name: string, exec?: ExecFn): Promise<ContainerState>;
|
|
115
211
|
/**
|
|
116
212
|
* Type alias matching `ExecRuntimeFn` in resources.ts; declared
|
|
117
213
|
* locally so containers.ts doesn't have to depend on resources.ts.
|
|
118
214
|
*/
|
|
119
|
-
type ExecFn = (runtime: ContainerRuntimeInfo, args: string[]) => Promise<{
|
|
215
|
+
export type ExecFn = (runtime: ContainerRuntimeInfo, args: string[]) => Promise<{
|
|
120
216
|
stdout: string;
|
|
121
217
|
stderr: string;
|
|
122
218
|
exitCode: number;
|
|
@@ -143,7 +239,7 @@ type ExecFn = (runtime: ContainerRuntimeInfo, args: string[]) => Promise<{
|
|
|
143
239
|
*
|
|
144
240
|
* `exec` defaults to the production execRuntime; tests pass a stub.
|
|
145
241
|
*/
|
|
146
|
-
export declare function getLiveResources(runtime: ContainerRuntimeInfo, name: string, exec?: ExecFn): Promise<import("./types").ContainerResourceLimits>;
|
|
242
|
+
export declare function getLiveResources(runtime: ContainerRuntimeInfo, name: string, exec?: ExecFn): Promise<import("./types.js").ContainerResourceLimits>;
|
|
147
243
|
/**
|
|
148
244
|
* One host-side endpoint for a single container port. Mirror of the
|
|
149
245
|
* `{ HostIp, HostPort }` shape that podman/docker emit under
|
|
@@ -195,6 +291,13 @@ export declare function getActualPortBindings(runtime: ContainerRuntimeInfo, nam
|
|
|
195
291
|
export interface LiveContainerConfig {
|
|
196
292
|
image: string;
|
|
197
293
|
tag: string;
|
|
294
|
+
/**
|
|
295
|
+
* Set when the live `Config.Image` was a digest-pinned reference
|
|
296
|
+
* (`image@sha256:...`). `tag` then holds whatever the runtime
|
|
297
|
+
* reports alongside (typically the empty string or `"latest"`); the
|
|
298
|
+
* authoritative comparison should use `digest`.
|
|
299
|
+
*/
|
|
300
|
+
digest: string | null;
|
|
198
301
|
command: string[] | null;
|
|
199
302
|
networkMode: string;
|
|
200
303
|
env: Map<string, string>;
|
|
@@ -203,6 +306,19 @@ export interface LiveContainerConfig {
|
|
|
203
306
|
container: string;
|
|
204
307
|
}>;
|
|
205
308
|
portBindings: Map<string, PortBinding[]>;
|
|
309
|
+
extraHosts: Map<string, string>;
|
|
310
|
+
/**
|
|
311
|
+
* Effective `--user` spec from `.Config.User`. Empty string when the
|
|
312
|
+
* container was created without `--user` (image USER, typically root).
|
|
313
|
+
* Drift detection compares this against the expected mapping derived
|
|
314
|
+
* from the requested `ContainerConfig.user` and the runtime's host
|
|
315
|
+
* UID/GID.
|
|
316
|
+
*
|
|
317
|
+
* Note: `--userns=keep-id` doesn't surface in `.Config.User`; recreating
|
|
318
|
+
* on `user` drift handles the practical case (Podman picks up the
|
|
319
|
+
* keep-id flag on the new run).
|
|
320
|
+
*/
|
|
321
|
+
user: string;
|
|
206
322
|
}
|
|
207
323
|
/**
|
|
208
324
|
* Read the live equivalent of `ContainerConfig`'s recreate-requiring fields
|
|
@@ -477,5 +593,4 @@ export declare function findAvailablePort(preferred: number): Promise<number>;
|
|
|
477
593
|
*/
|
|
478
594
|
export declare function resolveSignalkNetworks(runtime: ContainerRuntimeInfo, debug?: (msg: string) => void): Promise<string[] | null>;
|
|
479
595
|
export declare function waitForReady(url: string, timeoutMs?: number, intervalMs?: number): Promise<void>;
|
|
480
|
-
export {};
|
|
481
596
|
//# sourceMappingURL=containers.d.ts.map
|
package/dist/containers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containers.d.ts","sourceRoot":"","sources":["../src/containers.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,UAAU,EACX,MAAM,
|
|
1
|
+
{"version":3,"file":"containers.d.ts","sourceRoot":"","sources":["../src/containers.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,UAAU,EACX,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,sBAAsB,EAItB,qBAAqB,EAEtB,MAAM,cAAc,CAAC;AAWtB;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,oBAAoB,EAC7B,QAAQ,GAAE,OAAe,GACxB,MAAM,CAOR;AAcD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC,GAAG,SAAS,EACxD,KAAK,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAoB,GAC5C;IACD,IAAI,EAAE,MAAM,CAAC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