|
62 | 62 | (try |
63 | 63 | (if (:container definition) ;; synchronous call to container function |
64 | 64 | (let [function-call (cond-> (merge |
65 | | - (:container definition) |
66 | | - (dissoc defaults :functions) |
67 | | - {:command (interpolate-coll |
68 | | - (-> definition :container :command) |
69 | | - arg-context)} |
70 | | - ;; workdirs in a container definition will always override ones |
71 | | - ;; set in the metadata |
72 | | - (when-let [wd (or |
73 | | - (-> definition :container :workdir) |
74 | | - (:workdir defaults))] |
75 | | - {:workdir (first (interpolate arg-context wd))})) |
| 65 | + (:container definition) |
| 66 | + (dissoc defaults :functions) |
| 67 | + {:command (interpolate-coll |
| 68 | + (-> definition :container :command) |
| 69 | + arg-context)} |
| 70 | + (when (-> definition :container :mounts) |
| 71 | + {:mounts (->> (-> definition :container :mounts) |
| 72 | + (map (fn [s] (first (interpolate arg-context s)))) |
| 73 | + (into []))}) |
| 74 | + ;; workdirs in a container definition will always override ones |
| 75 | + ;; set in the metadata |
| 76 | + (when-let [wd (or |
| 77 | + (-> definition :container :workdir) |
| 78 | + (:workdir defaults))] |
| 79 | + {:workdir (first (interpolate arg-context wd))})) |
76 | 80 | (-> definition :stdin :file) (update-in [:stdin :file] (fn [s] (first (interpolate arg-context s)))))] |
77 | | - (jsonrpc/notify |
78 | | - :message |
79 | | - {:debug (format "function call %s" |
80 | | - (with-out-str |
81 | | - (pp/pprint (-> function-call |
82 | | - (update :jwt (fn [s] (if s "xxxxxxx" "not-set")))))))}) |
| 81 | + (jsonrpc/notify |
| 82 | + :message |
| 83 | + {:debug (format "function call %s" |
| 84 | + (with-out-str |
| 85 | + (pp/pprint (-> function-call |
| 86 | + (update :jwt (fn [s] (if s "xxxxxxx" "not-set")))))))}) |
83 | 87 | (trace/container-call (update function-call :jwt (fn [s] (if s "xxxxxxx" "not-set")))) |
84 | 88 | (let [{:keys [pty-output exit-code done] :as result} (docker/run-container function-call) |
85 | 89 | exit-code-fail? (if (false? (:check-exit-code definition)) |
|
0 commit comments