diff options
Diffstat (limited to 'pkg/specgenutil')
-rw-r--r-- | pkg/specgenutil/specgen.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkg/specgenutil/specgen.go b/pkg/specgenutil/specgen.go index 6a6397257..7636ea103 100644 --- a/pkg/specgenutil/specgen.go +++ b/pkg/specgenutil/specgen.go @@ -392,6 +392,17 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *entities.ContainerCreateOptions } s.Annotations = annotations + if len(c.StorageOpts) > 0 { + opts := make(map[string]string, len(c.StorageOpts)) + for _, opt := range c.StorageOpts { + split := strings.SplitN(opt, "=", 2) + if len(split) != 2 { + return errors.Errorf("storage-opt must be formatted KEY=VALUE") + } + opts[split[0]] = split[1] + } + s.StorageOpts = opts + } s.WorkDir = c.Workdir if c.Entrypoint != nil { entrypoint := []string{} |