Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
Gross hack
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Crosby committed Mar 22, 2022
1 parent 3a747a1 commit cbe92f5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions scheduler/src/cook/kubernetes/api.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1581,7 +1581,15 @@
(when use-checkpoint-injection?
(let [{:keys [command]} checkpoint-container
container (V1Container.)
resources (V1ResourceRequirements.)]
resources (V1ResourceRequirements.)
; Gross hack becuase init containers are running in the wrong order, fetch the tickets early.
ticket-volumemount
(doto (V1VolumeMount.)
(.setName "kerberos-ticket-volume")
(.setMountPath "/var/secret")
(.readOnly true))
]

; container
(.setName container cook-container-name-for-checkpoint-injection)
(.setImage container image)
Expand All @@ -1590,7 +1598,8 @@
(.setWorkingDir container init-container-workdir)
(.setEnv container main-env-vars)
(.setVolumeMounts container (filterv some? (concat [(init-container-workdir-volume-mount-fn false)
(scratch-space-volume-mount-fn false)]
(scratch-space-volume-mount-fn false)
ticket-volumemount]
init-container-checkpoint-volume-mounts)))
(set-mem-cpu-resources resources total-memory-request total-memory-limit total-cpu-request total-cpu-limit)
(.setResources container resources)
Expand Down

0 comments on commit cbe92f5

Please sign in to comment.