@rallycry/conveyor-k3 0.1.13 → 0.1.14

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/index.d.ts CHANGED
@@ -144,6 +144,8 @@ declare class ClusterDaemon {
144
144
  * against k3s's own settings before reporting it.
145
145
  */
146
146
  private isolation;
147
+ /** Whether the pod slice's CPU cap is in force, from the last reconcile. */
148
+ private cpuQuotaApplied;
147
149
  private timers;
148
150
  /** When the last store walk started, so one that failed is not retried on every reconcile. */
149
151
  private storeWalkStartedAt;
@@ -247,6 +249,12 @@ interface PruneResult {
247
249
  removed: number;
248
250
  bytesReclaimed: number;
249
251
  failures: string[];
252
+ /**
253
+ * Removals crictl stopped waiting for. containerd carries on deleting a
254
+ * multi-gigabyte image after crictl's deadline, so these are not failures:
255
+ * the next prune finds the image gone, or tries it again.
256
+ */
257
+ pending: string[];
250
258
  }
251
259
  /** Remove the stranded images. Individual failures are reported, not thrown. */
252
260
  declare function pruneStrandedImages(exec: Executor, inventory: ImageInventory, wantedImages: string[]): Promise<PruneResult>;
@@ -315,6 +323,8 @@ interface TelemetryState {
315
323
  isolation?: {
316
324
  applied: boolean;
317
325
  };
326
+ /** Present while a host-runtime machine's desired state reserves CPU. */
327
+ cpuQuotaApplied?: boolean | undefined;
318
328
  /**
319
329
  * The last measured size of k3s's containerd store. Null (or absent) until
320
330
  * the first measurement, and the heartbeat says null then: a 0 would read
@@ -424,6 +434,11 @@ interface ReconcileResult {
424
434
  isolation?: {
425
435
  applied: boolean;
426
436
  };
437
+ /**
438
+ * Whether the pod slice is hard-capped at the CPU the reserve leaves, on a
439
+ * host-runtime machine whose desired state reserves CPU. Undefined otherwise.
440
+ */
441
+ cpuQuotaApplied?: boolean;
427
442
  }
428
443
  declare function reconcile(ctx: ReconcileContext, desired: PersonalClusterDesiredState): Promise<ReconcileResult>;
429
444
 
@@ -553,11 +568,6 @@ declare function renderK3sDropIn(kubelet: PersonalClusterKubeletState, ownerConf
553
568
  options?: {
554
569
  disableComponents?: boolean;
555
570
  }): DropInRenderResult;
556
- /**
557
- * @deprecated Use {@link renderK3sDropIn}. Kept as a named alias because the
558
- * package exports it and a published CLI may still import it by this name.
559
- */
560
- declare const renderKubeletDropIn: typeof renderK3sDropIn;
561
571
 
562
572
  interface UnitRenderOptions {
563
573
  /** Absolute path to the installed `conveyor-k3` binary. */
@@ -732,27 +742,21 @@ interface UninstallResult {
732
742
  declare function uninstall(ports: UninstallPorts, options?: UninstallOptions): Promise<UninstallResult>;
733
743
 
734
744
  /**
735
- * `conveyor-k3 update` — the maintenance-window updater.
736
- *
737
- * Updates ride a systemd timer and NEVER runtime self-replacement. The agent
738
- * removed runtime self-update after the 2026-07-19 eviction outage; a daemon
739
- * that swaps its own binary mid-run has exactly the same failure shape. Here
740
- * the package is replaced by a separate oneshot unit, and the daemon is
741
- * restarted afterwards by systemd.
742
- *
743
- * Three independent pieces, each with its own decision:
744
- *
745
- * - **The package.** Installed at the EXACT version Conveyor's desired state
746
- * names, never `@latest` — the npm dist-tag is a root-execution channel on
747
- * every enrolled machine, so a compromised publish would reach them all
748
- * within a day. The daemon restarts only if the version actually moved.
749
- * - **cloudflared.** `cloudflared update` exits 11 to mean "updated"; that is
750
- * the only case that needs a tunnel restart.
751
- * - **k3s.** Only when the owner allowed it AND nothing of Conveyor's is
752
- * running. A k3s upgrade at the wrong moment interrupts someone's build, and
753
- * no upgrade is worth that.
745
+ * Who keeps this machine's cloudflared current.
746
+ *
747
+ * `cloudflared update` only works on a binary cloudflared installed itself. A
748
+ * package-manager build refuses: it prints "cloudflared was installed by a
749
+ * package manager" and exits 0 — the same exit as "already current". Read by
750
+ * exit code alone, such a machine reports a current cloudflared forever while
751
+ * apt (or nothing) is what actually updates it.
752
+ *
753
+ * The literal path lies, too. On a server where `/usr/local/bin/cloudflared`
754
+ * is a symlink to apt's `/usr/bin/cloudflared` there is ONE binary, owned by
755
+ * dpkg, so the owner check runs against the resolved path.
754
756
  */
755
757
 
758
+ type CloudflaredUpdater = "conveyor" | "package-manager";
759
+
756
760
  interface UpdatePorts {
757
761
  exec: Executor;
758
762
  log: (line: string) => void;
@@ -802,6 +806,8 @@ declare function decideK3sUpgrade(input: UpdateDecisionInput): K3sUpgradeDecisio
802
806
  interface UpdateResult {
803
807
  packageUpdated: boolean;
804
808
  cloudflaredUpdated: boolean;
809
+ /** Who keeps cloudflared current; null when this run could not tell. */
810
+ cloudflaredUpdater: CloudflaredUpdater | null;
805
811
  k3sUpgraded: boolean;
806
812
  notes: string[];
807
813
  }
@@ -1010,4 +1016,4 @@ declare function pathsForRoot(root: string, instance?: string): {
1010
1016
  };
1011
1017
  type HostPaths = ReturnType<typeof pathsForRoot>;
1012
1018
 
1013
- export { ClusterConnection, type ClusterConnectionConfig, ClusterDaemon, CommandError, type CrictlImage, DEFAULT_INSTANCE, type DaemonPorts, type Executor, type FileSystemPort$1 as FileSystemPort, type GuestDnsProvision, type GuestSrvRecord, HELP, type HostPaths, type ImageInventory, K3S_DISABLED_COMPONENTS, K3S_INSTALL_EXEC, type K3sUpgradeDecision, type MachineState, type NetworkEndpoint, type NetworkPolicy, type QemuNetworkPolicy, type ReconcileContext, type ReconcileResult, type RegistriesFile, type ResolvedNetwork, type ResolvedNetworkHost, type SRVLookup, type UninstallResult, type UnitRenderOptions, VERBS, type Verb, cloudflaredSrvRecords, collectHeartbeat, configuredAuthHosts, countRunningConveyorPods, createMemoryFileSystem, decideK3sUpgrade, hostPaths, isGloballyRoutableIPv4, isVerb, maximumGuestMemoryGiB, maximumGuestMemoryGiBWithin, meetsK3sMinimum, missingAuthHosts, nodeFileSystem, ownerConfiguredKeys, ownerConfiguredKubeletFlags, parseArgs, parseInstanceName, parseK3sVersion, parseRegistries, pruneStrandedImages, readImageInventory, readState, reconcile, registryAdd, registryList, renderAllUnits, renderGuestDnsProvision, renderK3sDropIn, renderKubeletDropIn, renderRegistryAuthSummary, resolveCloudflaredSrvRecords, resolveNetwork, rewriteQemuArgs, runOrThrow, runUpdate, selectStrandedImages, serializeRegistries, spawnExecutor, uninstall, upsertRegistryAuth, warmImages, writeState };
1019
+ export { ClusterConnection, type ClusterConnectionConfig, ClusterDaemon, CommandError, type CrictlImage, DEFAULT_INSTANCE, type DaemonPorts, type Executor, type FileSystemPort$1 as FileSystemPort, type GuestDnsProvision, type GuestSrvRecord, HELP, type HostPaths, type ImageInventory, K3S_DISABLED_COMPONENTS, K3S_INSTALL_EXEC, type K3sUpgradeDecision, type MachineState, type NetworkEndpoint, type NetworkPolicy, type QemuNetworkPolicy, type ReconcileContext, type ReconcileResult, type RegistriesFile, type ResolvedNetwork, type ResolvedNetworkHost, type SRVLookup, type UninstallResult, type UnitRenderOptions, VERBS, type Verb, cloudflaredSrvRecords, collectHeartbeat, configuredAuthHosts, countRunningConveyorPods, createMemoryFileSystem, decideK3sUpgrade, hostPaths, isGloballyRoutableIPv4, isVerb, maximumGuestMemoryGiB, maximumGuestMemoryGiBWithin, meetsK3sMinimum, missingAuthHosts, nodeFileSystem, ownerConfiguredKeys, ownerConfiguredKubeletFlags, parseArgs, parseInstanceName, parseK3sVersion, parseRegistries, pruneStrandedImages, readImageInventory, readState, reconcile, registryAdd, registryList, renderAllUnits, renderGuestDnsProvision, renderK3sDropIn, renderRegistryAuthSummary, resolveCloudflaredSrvRecords, resolveNetwork, rewriteQemuArgs, runOrThrow, runUpdate, selectStrandedImages, serializeRegistries, spawnExecutor, uninstall, upsertRegistryAuth, warmImages, writeState };