Skip to content

Commit

Permalink
remove unnecessary checks
Browse files Browse the repository at this point in the history
  • Loading branch information
oclaussen committed Feb 7, 2019
1 parent 1381557 commit b5a545e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
10 changes: 0 additions & 10 deletions pkg/image/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}
Expand All @@ -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 == "" {
Expand Down
8 changes: 0 additions & 8 deletions pkg/image/image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b5a545e

Please sign in to comment.