        (into [])))
 
 (defn ->service-secrets
-  [service]
-  (->> (get-in service [:Spec :TaskTemplate :ContainerSpec :Secrets])
+  [service-spec]
+  (->> (get-in service-spec [:TaskTemplate :ContainerSpec :Secrets])
        (map (fn [s] {:secretName (:SecretName s)}))
        (into [])))
 
 (defn ->service-deployment
-  [service]
-  (let [update-config (get-in service [:Spec :UpdateConfig])]
+  [service-spec]
+  (let [update-config (:UpdateConfig service-spec)]
     {:parallelism   (or (:Parallelism update-config) 1)
      :delay         (or (:Delay update-config) 0)
      :failureAction (or (:FailureAction update-config) "pause")}))


(defn ->service
  [service tasks nodes networks]
  (let [service-mode (str/lower-case (name (first (keys (get-in service [:Spec :Mode])))))
        service-name (get-in service [:Spec :Name])
        service-id (get service :ID)
        service-tasks (filter #(= (:ServiceID %) service-id) tasks)
        replicas (get-in service [:Spec :Mode :Replicated :Replicas])
        replicas-running (->service-replicas-running service-tasks)
        image (get-in service [:Spec :TaskTemplate :ContainerSpec :Image])
        image-info (str/split image #"@")
        image-name (first image-info)
        image-digest (second image-info)

       (into [])))

(defn ->service-variables
  [service-spec]
  (->> (get-in service-spec [:TaskTemplate :ContainerSpec :Env])
       (map (fn [p]
              (let [variable (str/split p #"=")]
                {:name  (first variable)
