diff options
author | Paul Holzinger <paul.holzinger@web.de> | 2021-03-03 14:37:23 +0100 |
---|---|---|
committer | Paul Holzinger <paul.holzinger@web.de> | 2021-03-03 14:46:53 +0100 |
commit | 4eed89acaa95cc1678bcfee69847e4dfd51290d1 (patch) | |
tree | fac654b7dc69e1fd5ebb67d4a0fd02167b531506 /cmd/podman/images/build.go | |
parent | aed632cb8ca4be2a57e8159041ef31829b3d2b2c (diff) | |
download | podman-4eed89acaa95cc1678bcfee69847e4dfd51290d1.tar.gz podman-4eed89acaa95cc1678bcfee69847e4dfd51290d1.tar.bz2 podman-4eed89acaa95cc1678bcfee69847e4dfd51290d1.zip |
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>
Diffstat (limited to 'cmd/podman/images/build.go')
-rw-r--r-- | cmd/podman/images/build.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go index 0e1c47399..de532ed78 100644 --- a/cmd/podman/images/build.go +++ b/cmd/podman/images/build.go @@ -265,6 +265,9 @@ func build(cmd *cobra.Command, args []string) error { } report, err := registry.ImageEngine().Build(registry.GetContext(), containerFiles, *apiBuildOpts) + if err != nil { + return err + } if cmd.Flag("iidfile").Changed { 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 |