Skip to content

Commit

Permalink
k8s: Expose a Tailscale Secret on job pods
Browse files Browse the repository at this point in the history
  • Loading branch information
linosgian authored and benbz committed Feb 1, 2024
1 parent 7522e3f commit d0b4d61
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/k8s/src/hooks/prepare-job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export function createContainerSpec(
const request_memory = process.env.ACTIONS_POD_RESOURCE_REQUEST_MEMORY
const request_cpu = process.env.ACTIONS_POD_RESOURCE_REQUEST_CPU
const imagePullPolicy = process.env.ACTIONS_POD_IMAGE_PULL_POLICY
const tailscaleAuthSecret = process.env.ACTIONS_POD_TAILSCALE_SECRET
resources.requests = {
...(request_cpu != undefined) && {cpu: request_cpu},
...(request_memory != undefined) && {memory: request_memory},
Expand Down Expand Up @@ -240,6 +241,9 @@ export function createContainerSpec(
podContainer.env.push({ name: key, value: value as string })
}
}
if (tailscaleAuthSecret != undefined){
podContainer.env.push({ name: "AUTH_KEY", value: tailscaleAuthSecret })
}

podContainer.volumeMounts = containerVolumes(
container.userMountVolumes,
Expand Down

0 comments on commit d0b4d61

Please sign in to comment.