From 877456c5c7fad7458fb37e02c7a408a2a9c13d54 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 1 Apr 2014 12:43:23 -0400 Subject: docker does not allow @ in container names --- Propellor/Property/Docker.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Propellor/Property/Docker.hs') diff --git a/Propellor/Property/Docker.hs b/Propellor/Property/Docker.hs index dd4f1924..69d589cb 100644 --- a/Propellor/Property/Docker.hs +++ b/Propellor/Property/Docker.hs @@ -42,7 +42,8 @@ fromContainerized l = map get l type Image = String -- | A short descriptive name for a container. --- Should not contain whitespace or other unusual characters. +-- Should not contain whitespace or other unusual characters, +-- only [a-zA-Z0-9_.-] are allowed type ContainerName = String -- | A container is identified by its name, and the host @@ -51,13 +52,13 @@ data ContainerId = ContainerId HostName ContainerName deriving (Read, Show, Eq) toContainerId :: String -> Maybe ContainerId -toContainerId s = case separate (== '@') s of +toContainerId s = case separate (== '.') s of (cn, hn) | null hn || null cn -> Nothing | otherwise -> Just $ ContainerId hn cn fromContainerId :: ContainerId -> String -fromContainerId (ContainerId hn cn) = cn++"@"++hn +fromContainerId (ContainerId hn cn) = cn++"."++hn data Container = Container Image [Containerized Property] -- cgit v1.2.3