mirror of https://github.com/containers/podman.git
create: move validate after setting default ns
validate the configuration only after we set the default namespaces. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
81c7a2444c
commit
36039a38ea
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue