propellor spin
This commit is contained in:
parent
bbca48d44b
commit
b9e7721db0
|
@ -236,15 +236,24 @@ runningContainer cid@(ContainerId hn cn) image containerprops = containerDesc ci
|
||||||
oldimage <- fromMaybe image <$> commitContainer cid
|
oldimage <- fromMaybe image <$> commitContainer cid
|
||||||
void $ removeContainer cid
|
void $ removeContainer cid
|
||||||
go oldimage
|
go oldimage
|
||||||
else go image
|
else do
|
||||||
|
ifM (elem cid <$> listContainers AllContainers)
|
||||||
|
( do
|
||||||
|
-- Contaner may be stopped, or
|
||||||
|
-- may not exist.
|
||||||
|
void $ stopContainer cid
|
||||||
|
oldimage <- fromMaybe image <$> commitContainer cid
|
||||||
|
void $ removeContainer cid
|
||||||
|
go oldimage
|
||||||
|
, go image
|
||||||
|
)
|
||||||
where
|
where
|
||||||
ident = ContainerIdent image hn cn runps
|
ident = ContainerIdent image hn cn runps
|
||||||
|
|
||||||
getrunningident :: IO (Maybe ContainerIdent)
|
getrunningident :: IO (Maybe ContainerIdent)
|
||||||
getrunningident = catchDefaultIO Nothing $
|
getrunningident = simpleShClient (namedPipe cid) "cat" [propellorIdent] $ \rs -> do
|
||||||
simpleShClient (namedPipe cid) "cat" [propellorIdent] $ \rs -> do
|
print (rs, extractident rs)
|
||||||
print (rs, extractident rs)
|
return $ extractident rs
|
||||||
return $ extractident rs
|
|
||||||
|
|
||||||
extractident :: [Resp] -> Maybe ContainerIdent
|
extractident :: [Resp] -> Maybe ContainerIdent
|
||||||
extractident = headMaybe . catMaybes . map (readish :: String -> Maybe ContainerIdent) . catMaybes . map getStdout
|
extractident = headMaybe . catMaybes . map (readish :: String -> Maybe ContainerIdent) . catMaybes . map getStdout
|
||||||
|
|
Loading…
Reference in New Issue