diff --git a/package.json b/package.json index 3323ab6..bbe7d23 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@farhoodliquor/paperclip-adapter-opencode-k8s", - "version": "0.1.5", + "version": "0.1.6", "description": "Paperclip adapter plugin that runs OpenCode agents as Kubernetes Jobs", "license": "MIT", "type": "module", diff --git a/src/server/k8s-client.ts b/src/server/k8s-client.ts index 9f62571..2cc0a1d 100644 --- a/src/server/k8s-client.ts +++ b/src/server/k8s-client.ts @@ -20,20 +20,10 @@ export interface SelfPodInfo { dnsConfig: k8s.V1PodDNSConfig | undefined; pvcClaimName: string | null; secretVolumes: SelfPodSecretVolume[]; - /** Env vars inherited from the Deployment container. */ + /** Env vars read directly from the pod spec's container definition. */ inheritedEnv: Record; } -/** Keys forwarded from the Deployment container env into Job pods. */ -const INHERITED_ENV_KEYS = [ - "CLAUDE_CODE_USE_BEDROCK", - "AWS_REGION", - "AWS_BEARER_TOKEN_BEDROCK", - "ANTHROPIC_API_KEY", - "OPENAI_API_KEY", - "PAPERCLIP_API_URL", -]; - let cachedSelfPod: SelfPodInfo | null = null; /** @@ -141,13 +131,12 @@ export async function getSelfPodInfo(kubeconfigPath?: string): Promise = {}; - for (const key of INHERITED_ENV_KEYS) { - const value = process.env[key]; - if (value !== undefined) { - inheritedEnv[key] = value; - } + for (const envVar of mainContainer.env ?? []) { + if (envVar.value) inheritedEnv[envVar.name] = envVar.value; } cachedSelfPod = {