moby / buildkit

concurrent, cache-efficient, and Dockerfile-agnostic builder toolkit
https://github.com/moby/moby/issues/34227
Apache License 2.0
7.85k stars 1.09k forks source link

history: fix empty Exporters attribute #5017

Closed crazy-max closed 3 weeks ago

crazy-max commented 3 weeks ago

Since multiple exporters support https://github.com/moby/buildkit/pull/4134 in BuildKit 0.13, Record.Exporters is not set anymore.

This is related to the Type and Attrs fields not being set in the llbsolver.ExporterRequest: https://github.com/moby/buildkit/pull/4134/files#diff-0397d42d692ad676389ccf4b5a1126a3976ef69d4342b8423a6bbb51d21a9181L458-L459

But this is used when we want to set the Exporters for the build history: https://github.com/moby/buildkit/blob/eed17a45c62b2d6e26273e4ead7e177fb7022338/solver/llbsolver/solver.go#L176

To fix this, I have updated the exporter.ExporterInstance interface to expose attributes and name of the exporter. Also removes Type and Attrs fields ExporterRequest that don't seem used anymore.

jedevc commented 3 weeks ago

Ahhh nice catch! Looks like I got the results correctly added to the history record, but for some reason didn't think to get the right exporters attr.

Thanks! :pray: :tada: