on master help sign in
Change the type of entrypoint to [Text]

Entrypoint can be an array of strings.

commitf73e3ba6f46479be890c2f4e60250c085a141373 authorKwang Yul Seo <kwangyul.seo@gmail.com> dateTue 6 Dec 2016, 02:44 (10 years ago) parenta61f9f9
1 file changed+6−4
src/Docker/Client/Types.hs+6−4
src/Docker/Client/Types.hs+6−4
@@ -93,6 +93,7 @@ import Data.Aeson (FromJSON, ToJSON, genericParseJSON,
9393import qualified Data.Aeson as JSON
9494import Data.Aeson.Types (defaultOptions, fieldLabelModifier)
9595import Data.Char (isAlphaNum, toUpper)
96+import Data.Foldable (asum)
9697import qualified Data.HashMap.Strict as HM
9798import Data.Monoid ((<>))
9899import Data.Scientific (floatingOrInteger)
@@ -623,7 +624,7 @@ defaultContainerConfig imageName = ContainerConfig {
623624 , cmd=[]
624625 , volumes=[]
625626 , workingDir=Nothing
626− , entrypoint=Nothing
627+ , entrypoint=[]
627628 , networkDisabled=Nothing
628629 , macAddress=Nothing
629630 , labels=[]
@@ -1362,7 +1363,7 @@ data ContainerConfig = ContainerConfig {
13621363 , image :: Text
13631364 , volumes :: [Volume]
13641365 , workingDir :: Maybe FilePath
1365− , entrypoint :: Maybe Text -- Can be null?
1366+ , entrypoint :: [Text]
13661367 , networkDisabled :: Maybe Bool -- Note: Should we expand the JSON instance and take away the Maybe? Null is False?
13671368 , macAddress :: Maybe Text
13681369 -- , onBuild :: Maybe Text -- For 1.24, only see this in the inspect response.
@@ -1391,7 +1392,9 @@ instance FromJSON ContainerConfig where
13911392 image <- o .: "Image"
13921393 volumes <- o .: "Volumes"
13931394 workingDir <- o .:? "WorkingDir"
1394− entrypoint <- o .:? "Entrypoint"
1395+ entrypoint <- asum [ o .:? "Entrypoint" .!= []
1396+ , (:[]) <$> o .: "Entrypoint"
1397+ ]
13951398 networkDisabled <- o .:? "networkDisabled"
13961399 macAddress <- o .:? "MacAddress"
13971400 labels <- o .:? "Labels" .!= []
@@ -1422,4 +1425,3 @@ toJsonKeyVal vs getKey getVal = JSON.Object $ foldl f HM.empty vs
14221425-- | Helper function that return an empty dictionary "{}"
14231426emptyJsonObject :: JSON.Value
14241427emptyJsonObject = JSON.Object HM.empty
1425−