summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkg/specgen/generate/container_create.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/pkg/specgen/generate/container_create.go b/pkg/specgen/generate/container_create.go
index 1be77d315..369c64e1f 100644
--- a/pkg/specgen/generate/container_create.go
+++ b/pkg/specgen/generate/container_create.go
@@ -15,9 +15,6 @@ import (
// MakeContainer creates a container based on the SpecGenerator
func MakeContainer(rt *libpod.Runtime, s *specgen.SpecGenerator) (*libpod.Container, error) {
- if err := s.Validate(); err != nil {
- return nil, errors.Wrap(err, "invalid config provided")
- }
rtc, err := rt.GetConfig()
if err != nil {
return nil, err
@@ -94,6 +91,10 @@ func MakeContainer(rt *libpod.Runtime, s *specgen.SpecGenerator) (*libpod.Contai
options = append(options, libpod.WithRootFSFromImage(newImage.ID(), s.Image, s.RawImageName))
+ if err := s.Validate(); err != nil {
+ return nil, errors.Wrap(err, "invalid config provided")
+ }
+
runtimeSpec, err := SpecGenToOCI(s, rt, newImage)
if err != nil {
return nil, err