5926b302e5
The adapter was calling onSpawn({ pid: -1 }) as a sentinel value for
K8s Jobs (which run out-of-process), then the server's orphan reaper
was checking isProcessAlive(-1) which always returns false, causing
legitimate runs to be reaped as 'process_lost'.
Using process.pid (the Paperclip server's own PID) is always alive
while the adapter runs in-process, preventing false reaping.
Fixes FAR-116.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
41 lines
1.8 KiB
TypeScript
41 lines
1.8 KiB
TypeScript
import * as k8s from "@kubernetes/client-node";
|
|
/**
|
|
* Cached self-pod introspection result. Queried once on first execute(),
|
|
* then reused for all subsequent Job builds so every Job inherits the
|
|
* Deployment's image, imagePullSecrets, DNS config, and PVC claim.
|
|
*/
|
|
export interface SelfPodSecretVolume {
|
|
volumeName: string;
|
|
secretName: string;
|
|
mountPath: string;
|
|
defaultMode: number | undefined;
|
|
}
|
|
export interface SelfPodInfo {
|
|
namespace: string;
|
|
image: string;
|
|
imagePullSecrets: Array<{
|
|
name: string;
|
|
}>;
|
|
dnsConfig: k8s.V1PodDNSConfig | undefined;
|
|
pvcClaimName: string | null;
|
|
secretVolumes: SelfPodSecretVolume[];
|
|
/** Env vars inherited from the Deployment container (literal name/value pairs). */
|
|
inheritedEnv: Record<string, string>;
|
|
/** Env vars with valueFrom (secretKeyRef, configMapKeyRef, etc.) from the Deployment container. */
|
|
inheritedEnvValueFrom: k8s.V1EnvVar[];
|
|
/** envFrom sources (secretRef, configMapRef) from the Deployment container. */
|
|
inheritedEnvFrom: k8s.V1EnvFromSource[];
|
|
}
|
|
export declare function getBatchApi(kubeconfigPath?: string): k8s.BatchV1Api;
|
|
export declare function getCoreApi(kubeconfigPath?: string): k8s.CoreV1Api;
|
|
export declare function getAuthzApi(kubeconfigPath?: string): k8s.AuthorizationV1Api;
|
|
export declare function getLogApi(kubeconfigPath?: string): k8s.Log;
|
|
/**
|
|
* Query the K8s API for our own pod spec and cache the result.
|
|
* Extracts image, imagePullSecrets, dnsConfig, PVC claim name,
|
|
* and environment variables to forward to Job pods.
|
|
*/
|
|
export declare function getSelfPodInfo(kubeconfigPath?: string): Promise<SelfPodInfo>;
|
|
/** Reset cached state — useful for tests. */
|
|
export declare function resetCache(): void;
|
|
//# sourceMappingURL=k8s-client.d.ts.map
|