Skip to content

Commit 60e3ebe

Browse files
fix(supervisor): type worker pod annotations as Record<string, string>
@kubernetes/client-node@1.0.0 tightened V1ObjectMeta.annotations from 'unknown' to 'Record<string, string>'. The parsed JSON from the KUBERNETES_WORKER_POD_ANNOTATIONS env var lands as 'unknown' which now fails TS2322 at the assignment site. Cast (or validate) at the parse boundary. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 8b5734e commit 60e3ebe

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

apps/supervisor/src/workloadManager/kubernetes.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,11 @@ export class KubernetesWorkloadManager implements WorkloadManager {
118118
"app.kubernetes.io/component": "create",
119119
},
120120
...(Object.keys(env.KUBERNETES_WORKER_POD_ANNOTATIONS).length > 0
121-
? { annotations: { ...env.KUBERNETES_WORKER_POD_ANNOTATIONS } }
121+
? {
122+
annotations: {
123+
...env.KUBERNETES_WORKER_POD_ANNOTATIONS,
124+
} as Record<string, string>,
125+
}
122126
: {}),
123127
},
124128
spec: {

0 commit comments

Comments
 (0)