Merge pull request #9595 from Luap99/fix-9594

Fix possible panic with podman build --iidfile
This commit is contained in:
OpenShift Merge Robot 2021-03-03 12:05:55 -05:00 committed by GitHub
commit 32b2e367b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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