docker does not allow @ in container names
This commit is contained in:
parent
1af0cb35b6
commit
877456c5c7
|
@ -42,7 +42,8 @@ fromContainerized l = map get l
|
||||||
type Image = String
|
type Image = String
|
||||||
|
|
||||||
-- | A short descriptive name for a container.
|
-- | 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
|
type ContainerName = String
|
||||||
|
|
||||||
-- | A container is identified by its name, and the host
|
-- | A container is identified by its name, and the host
|
||||||
|
@ -51,13 +52,13 @@ data ContainerId = ContainerId HostName ContainerName
|
||||||
deriving (Read, Show, Eq)
|
deriving (Read, Show, Eq)
|
||||||
|
|
||||||
toContainerId :: String -> Maybe ContainerId
|
toContainerId :: String -> Maybe ContainerId
|
||||||
toContainerId s = case separate (== '@') s of
|
toContainerId s = case separate (== '.') s of
|
||||||
(cn, hn)
|
(cn, hn)
|
||||||
| null hn || null cn -> Nothing
|
| null hn || null cn -> Nothing
|
||||||
| otherwise -> Just $ ContainerId hn cn
|
| otherwise -> Just $ ContainerId hn cn
|
||||||
|
|
||||||
fromContainerId :: ContainerId -> String
|
fromContainerId :: ContainerId -> String
|
||||||
fromContainerId (ContainerId hn cn) = cn++"@"++hn
|
fromContainerId (ContainerId hn cn) = cn++"."++hn
|
||||||
|
|
||||||
data Container = Container Image [Containerized Property]
|
data Container = Container Image [Containerized Property]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue