control: make sure sending nil cache options does not panic

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
Tonis Tiigi
2025-04-17 10:33:53 -07:00
parent b85a5b102c
commit 3cabacf36e

View File

@@ -376,6 +376,9 @@ func (c *Controller) Solve(ctx context.Context, req *controlapi.SolveRequest) (*
atomic.AddInt64(&c.buildCount, 1)
defer atomic.AddInt64(&c.buildCount, -1)
if req.Cache == nil {
req.Cache = &controlapi.CacheOptions{} // make sure cache options are initialized
}
translateLegacySolveRequest(req)
defer func() {