Skip to content

Commit

Permalink
Fix request context directory
Browse files Browse the repository at this point in the history
  • Loading branch information
xprnio committed Jan 11, 2024
1 parent e533d08 commit 088b80b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions internal/docker/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,18 +83,24 @@ func CreateContext(opts RunImageOptions) (RunContext, error) {
return ctx, err
}

request, err := addContext(dir, "request.json", string(opts.RequestBody))
_, err = addContext(dir, "request.json", string(opts.RequestBody))
if err != nil {
return ctx, err
}

response, err := addContext(dir, "response.json", "{}")
_, err = addContext(dir, "response.json", "{}")
if err != nil {
return ctx, err
}

ctx.Dir = dir
ctx.Mounts = []mount.Mount{request, response}
ctx.Mounts = []mount.Mount{
{
Type: mount.TypeBind,
Source: dir,
Target: "/context",
},
}

return ctx, nil
}
Expand Down

0 comments on commit 088b80b

Please sign in to comment.