mirror of
https://github.com/containers/podman.git
synced 2025-06-24 03:08:13 +08:00
Fix possible panic with podman build --iidfile
Make sure we check for errors before trying to write the iidfile. [NO TESTS NEEDED] Ref #9594 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
This commit is contained in:
@ -265,6 +265,9 @@ func build(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
report, err := registry.ImageEngine().Build(registry.GetContext(), containerFiles, *apiBuildOpts)
|
report, err := registry.ImageEngine().Build(registry.GetContext(), containerFiles, *apiBuildOpts)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
if cmd.Flag("iidfile").Changed {
|
if cmd.Flag("iidfile").Changed {
|
||||||
f, err := os.Create(buildOpts.Iidfile)
|
f, err := os.Create(buildOpts.Iidfile)
|
||||||
@ -276,7 +279,7 @@ func build(cmd *cobra.Command, args []string) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return err
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// buildFlagsWrapperToOptions converts the local build flags to the build options used
|
// buildFlagsWrapperToOptions converts the local build flags to the build options used
|
||||||
|
Reference in New Issue
Block a user