@@ -26,6 +26,7 @@ data RunMountArg
2626 | MountArgReadOnly Bool
2727 | MountArgRequired Bool
2828 | MountArgSharing CacheSharing
29+ | MountArgSize Text
2930 | MountArgSource SourcePath
3031 | MountArgTarget TargetPath
3132 | MountArgType MountType
@@ -147,13 +148,15 @@ cacheMount args =
147148
148149tmpfsMount :: [RunMountArg ] -> Parser TmpOpts
149150tmpfsMount args =
150- case validArgs " tmpfs" required required args of
151+ case validArgs " tmpfs" allowed required args of
151152 Left e -> customError e
152153 Right as -> return $ foldr tmpOpts def as
153154 where
155+ allowed = Set. fromList [ " target" , " size" ]
154156 required = Set. singleton " target"
155157 tmpOpts :: RunMountArg -> TmpOpts -> TmpOpts
156158 tmpOpts (MountArgTarget path) t = t {tTarget = path}
159+ tmpOpts (MountArgSize size) t = t {tSize = Just size}
157160 tmpOpts invalid _ = error $ " unhandled " <> show invalid <> " please report this bug"
158161
159162secretMount :: [RunMountArg ] -> Parser SecretOpts
@@ -209,6 +212,7 @@ mountArgs =
209212 mountArgRelabel,
210213 mountArgRequired,
211214 mountArgSharing,
215+ mountArgSize,
212216 mountArgSource,
213217 mountArgTarget,
214218 mountArgType,
@@ -295,6 +299,9 @@ mountArgRequired = MountArgRequired <$> choice
295299mountArgSharing :: Parser RunMountArg
296300mountArgSharing = MountArgSharing <$> key " sharing" cacheSharing
297301
302+ mountArgSize :: (? esc :: Char ) => Parser RunMountArg
303+ mountArgSize = MountArgSize <$> key " size" stringArg
304+
298305mountArgSource :: (? esc :: Char ) => Parser RunMountArg
299306mountArgSource = do
300307 label " source=" $ choice [string " source=" , string " src=" ]
@@ -342,6 +349,7 @@ toArgName (MountArgMode _) = "mode"
342349toArgName (MountArgReadOnly _) = " ro"
343350toArgName (MountArgRequired _) = " required"
344351toArgName (MountArgSharing _) = " sharing"
352+ toArgName (MountArgSize _) = " size"
345353toArgName (MountArgSource _) = " source"
346354toArgName (MountArgTarget _) = " target"
347355toArgName (MountArgType _) = " type"
0 commit comments