From b5a545e43ad36cb6f8094528fb03cb574a180802 Mon Sep 17 00:00:00 2001 From: Ole Claussen Date: Thu, 7 Feb 2019 17:10:02 +0100 Subject: [PATCH] remove unnecessary checks --- pkg/image/image.go | 10 ---------- pkg/image/image_test.go | 8 -------- 2 files changed, 18 deletions(-) diff --git a/pkg/image/image.go b/pkg/image/image.go index 232e06d..2d80e21 100644 --- a/pkg/image/image.go +++ b/pkg/image/image.go @@ -5,7 +5,6 @@ import ( "net" "github.com/docker/docker/api/types" - "github.com/docker/docker/api/types/versions" dodotypes "github.com/oclaussen/dodo/pkg/types" "github.com/pkg/errors" "golang.org/x/net/context" @@ -40,8 +39,6 @@ type ImageConfig struct { // Client represents a docker client that can do everything this package // needs type Client interface { - ClientVersion() string - Ping(context.Context) (types.Ping, error) DialSession(context.Context, string, map[string][]string) (net.Conn, error) ImageBuild(context.Context, io.Reader, types.ImageBuildOptions) (types.ImageBuildResponse, error) } @@ -51,13 +48,6 @@ func NewImage(client Client, authConfigs map[string]types.AuthConfig, config *Im if client == nil { return nil, errors.New("client may not be nil") } - ping, err := client.Ping(context.Background()) - if err != nil { - return nil, err - } - if !ping.Experimental || versions.LessThan(client.ClientVersion(), "1.31") { - return nil, errors.Errorf("buildkit not supported by daemon") - } // TODO: do this somewhere else if config.Context == "" { diff --git a/pkg/image/image_test.go b/pkg/image/image_test.go index 8d34b97..d1de464 100644 --- a/pkg/image/image_test.go +++ b/pkg/image/image_test.go @@ -27,14 +27,6 @@ type fakeImageClient struct { willBuildAs string } -func (client *fakeImageClient) ClientVersion() string { - return "1.39" -} - -func (client *fakeImageClient) Ping(_ context.Context) (types.Ping, error) { - return types.Ping{Experimental: true}, nil -} - func (client *fakeImageClient) DialSession( _ context.Context, _ string, _ map[string][]string, ) (net.Conn, error) {