client: don't clear frontend attributes to send to server

Originally, for a Build, we avoided sending any of the FrontendAttrs to
the main Solve call, and sent them all to the sub-Solve calls.

However, when we added attestations, we had to add an additional Filter,
to ensure those args were sent to both locations. While unintuitive,
there wasn't logical location to put them, which would have applied to
the entire build. This pattern has become fairly common, for instances
where the buildkit backend can provide a fallback when the frontend does
not support a specified option, for example, with SOURCE_DATE_EPOCH.

This means that this filtering must be updated for each instance -
instead of this, we can remove the filtering entirely, which should
provide for easier upgrade paths going forwards.

Signed-off-by: Justin Chadwell <me@jedevc.com>
This commit is contained in:
Justin Chadwell
2022-11-25 17:21:41 +00:00
parent 1050795af1
commit 8edf57d0a1

View File

@@ -4,7 +4,6 @@ import (
"context"
"github.com/moby/buildkit/client/buildid"
"github.com/moby/buildkit/frontend/attestations"
gateway "github.com/moby/buildkit/frontend/gateway/client"
"github.com/moby/buildkit/frontend/gateway/grpcclient"
gatewayapi "github.com/moby/buildkit/frontend/gateway/pb"
@@ -24,7 +23,6 @@ func (c *Client) Build(ctx context.Context, opt SolveOpt, product string, buildF
feOpts := opt.FrontendAttrs
opt.Frontend = ""
opt.FrontendAttrs = attestations.Filter(opt.FrontendAttrs)
if product == "" {
product = apicaps.ExportedProduct