Enable to restore build options from the server

Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
This commit is contained in:
Kohei Tokunaga
2023-04-15 15:38:05 +09:00
parent b3340cc7ba
commit ce48b1ae84
7 changed files with 329 additions and 142 deletions

View File

@ -200,6 +200,9 @@ func containerConfigFromResult(ctx context.Context, res *gateway.Result, c gatew
if res.Ref == nil {
return nil, errors.Errorf("no reference is registered")
}
if cfg.Initial {
return nil, errors.Errorf("starting from the container from the initial state of the step is supported only on the failed steps")
}
st, err := res.Ref.ToState()
if err != nil {
return nil, err
@ -284,6 +287,9 @@ func containerConfigFromError(solveErr *errdefs.SolveError, cfg controllerapi.In
var mounts []gateway.Mount
for i, mnt := range exec.Mounts {
rid := solveErr.Solve.MountIDs[i]
if cfg.Initial {
rid = solveErr.Solve.InputIDs[i]
}
mounts = append(mounts, gateway.Mount{
Selector: mnt.Selector,
Dest: mnt.Dest,