   (dc/delete-service service-id))
 
 (defn create-dockerhub-service
-  [service secrets]
-  (let [auth-config (->> (get-in service [:registry :user])
-                         (dockeruser-by-username)
+  [service dockeruser-id secrets]
+  (let [auth-config (->> (cc/dockeruser dockeruser-id)
                          (dmo/->auth-config))]
     (->> (dmo/->service-image service)
          (dmo/->service service secrets)
          (dc/create-service auth-config))))
 
 (defn create-registry-service
-  [service registry-name secrets]
-  (let [registry (registry-by-name registry-name)
+  [service registry-id secrets]
+  (let [registry (cc/registry registry-id)
         auth-config (dmo/->auth-config registry)]
     (->> (dmo/->service-image-registry service registry)
          (dmo/->service service secrets)

  (->> (cmo/->password password)
       (cc/change-password user)))

;;; Registry API

(defn registries
  []
  (-> (cc/registries)
      (cmi/->registries)))

(defn registries-list
  []
  (->> (registries)
       (map :name)
       (into [])))


  (-> (cc/registry registry-id)
      (cmi/->registry)))

(defn registry-exist?
  [registry]
  (cc/registry-exist? registry))

(defn registry-valid?
  [registry]
