diff options
| author | Joey Hess <joey@kitenet.net> | 2014-04-01 12:43:23 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-04-01 12:44:07 -0400 |
| commit | 877456c5c7fad7458fb37e02c7a408a2a9c13d54 (patch) | |
| tree | 3fbfc4e23a286a4d3083d0adb8babec5a6a7c29e | |
| parent | 1af0cb35b691598b718a10c3de1b61692d4aafd6 (diff) | |
docker does not allow @ in container names
| -rw-r--r-- | Propellor/Property/Docker.hs | 7 |
1 files changed, 4 insertions, 3 deletions
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] |
