merge Route into Env, rebase dagger compute to use the new API

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi
2021-03-24 17:55:21 -07:00
committed by Solomon Hykes
parent 43b3af6fff
commit cba524eb0f
13 changed files with 578 additions and 772 deletions

View File

@@ -61,7 +61,7 @@ func NewClient(ctx context.Context, host string) (*Client, error) {
}
// FIXME: return completed *Env, instead of *compiler.Value
func (c *Client) Compute(ctx context.Context, env *Env) (*compiler.Value, error) {
func (c *Client) Up(ctx context.Context, env *Route) (*compiler.Value, error) {
lg := log.Ctx(ctx)
eg, gctx := errgroup.WithContext(ctx)
@@ -95,7 +95,7 @@ func (c *Client) Compute(ctx context.Context, env *Env) (*compiler.Value, error)
return out, compiler.Err(eg.Wait())
}
func (c *Client) buildfn(ctx context.Context, env *Env, ch chan *bk.SolveStatus, w io.WriteCloser) error {
func (c *Client) buildfn(ctx context.Context, env *Route, ch chan *bk.SolveStatus, w io.WriteCloser) error {
lg := log.Ctx(ctx)
// Scan local dirs to grant access
@@ -138,7 +138,7 @@ func (c *Client) buildfn(ctx context.Context, env *Env, ch chan *bk.SolveStatus,
// Compute output overlay
lg.Debug().Msg("computing env")
if err := env.Compute(ctx, s); err != nil {
if err := env.Up(ctx, s, nil); err != nil {
return nil, err
}