Skip to content

Commit

Permalink
Bump containers/buildah to v1.19.4
Browse files Browse the repository at this point in the history
Fix handling of --iidfile to happen on the client side.

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan authored and mheon committed Feb 18, 2021
1 parent 3d14b56 commit 566c8a4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
14 changes: 12 additions & 2 deletions cmd/podman/images/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,18 @@ func build(cmd *cobra.Command, args []string) error {
return err
}

_, err = registry.ImageEngine().Build(registry.GetContext(), containerFiles, *apiBuildOpts)
report, err := registry.ImageEngine().Build(registry.GetContext(), containerFiles, *apiBuildOpts)

if cmd.Flag("iidfile").Changed {
f, err := os.Create(buildOpts.Iidfile)
if err != nil {
return err
}
if _, err := f.WriteString("sha256:" + report.ID); err != nil {
return err
}
}

return err
}

Expand Down Expand Up @@ -468,7 +479,6 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil
ForceRmIntermediateCtrs: flags.ForceRm,
From: flags.From,
IDMappingOptions: idmappingOptions,
IIDFile: flags.Iidfile,
In: stdin,
Isolation: isolation,
Jobs: &flags.Jobs,
Expand Down
11 changes: 0 additions & 11 deletions pkg/domain/infra/tunnel/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,17 +349,6 @@ func (ir *ImageEngine) Build(_ context.Context, containerFiles []string, opts en
if err != nil {
return nil, err
}
// For remote clients, if the option for writing to a file was
// selected, we need to write to the *client's* filesystem.
if len(opts.IIDFile) > 0 {
f, err := os.Create(opts.IIDFile)
if err != nil {
return nil, err
}
if _, err := f.WriteString(report.ID); err != nil {
return nil, err
}
}
return report, nil
}

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ var _ = Describe("Podman build", func() {
inspect := podmanTest.Podman([]string{"inspect", string(id)})
inspect.WaitWithDefaultTimeout()
data := inspect.InspectImageJSON()
Expect(data[0].ID).To(Equal(string(id)))
Expect("sha256:" + data[0].ID).To(Equal(string(id)))
})

It("podman Test PATH in built image", func() {
Expand Down

0 comments on commit 566c8a4

Please sign in to comment.