builder: more experimental/windows validation

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 577732f655fc95396b8c2b9a45747c5c95760755
Component: engine
This commit is contained in:
Tonis Tiigi
2018-06-10 10:05:30 -07:00
parent d23b97504d
commit d75f0ca946
2 changed files with 15 additions and 1 deletions
@@ -244,6 +244,10 @@ func (br *buildRouter) postBuild(ctx context.Context, w http.ResponseWriter, r *
return progress.NewProgressReader(in, progressOutput, r.ContentLength, "Downloading context", buildOptions.RemoteContext)
}
if buildOptions.Version == types.BuilderBuildKit && !br.daemon.HasExperimental() {
return errdefs.InvalidParameter(errors.New("buildkit is only supported with experimental mode"))
}
wantAux := versions.GreaterThanOrEqualTo(version, "1.30")
imgID, err := br.backend.Build(ctx, backend.BuildConfig{
@@ -1,11 +1,21 @@
package buildkit
import (
"context"
"errors"
"io"
"github.com/moby/buildkit/cache"
"github.com/moby/buildkit/executor"
)
func newExecutor(_ string) (executor.Executor, error) {
return nil, errors.New("buildkit executor not implemented for windows")
return &winExecutor{}, nil
}
type winExecutor struct {
}
func (e *winExecutor) Exec(ctx context.Context, meta executor.Meta, rootfs cache.Mountable, mounts []executor.Mount, stdin io.ReadCloser, stdout, stderr io.WriteCloser) error {
return errors.New("buildkit executor not implemented for windows")
}