Skip to content

Commit

Permalink
fix: child image should be rebuildable
Browse files Browse the repository at this point in the history
The Filter function constructs a completely new graph were unmodified images
are discarded. I suppose it was done to have a (very) smaller graph to improve
(a little) performance.

Unfortunately, we need info on all direct parents images when rebuilding, at
least to properly amend the FROM line to be able to pull the right parent
image. Thus this refacto broke completely rebuild of every image with at least
one not-to-rebuild parent.

I fix this quickly by avoiding the Filter function altogether which is too
complicated for our sake and does not really improves the performances.

Fixes be5509e
  • Loading branch information
joulaud committed Jan 10, 2025
1 parent 40c866c commit 7ef5705
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/dib/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ func (p *Builder) rebuildGraph(
buildArgs map[string]string,
) {
p.Graph.
Filter(
func(node *dag.Node) bool {
return node.Image.NeedsRebuild || node.Image.NeedsTests
}).
WalkParallel(
func(node *dag.Node) {
img := node.Image
if !(img.NeedsRebuild || img.NeedsTests) {
img.RebuildFailed = false
return
}
buildReport := report.BuildReport{Image: *img}

// Return if any parent build failed
Expand Down

0 comments on commit 7ef5705

Please sign in to comment.