Skip to content

Commit

Permalink
Negotiate docker client API version (#248)
Browse files Browse the repository at this point in the history
* deps

* Negotiate docker client API version
  • Loading branch information
nkubala committed Aug 1, 2018
1 parent 697ee0b commit 5f7b0e4
Show file tree
Hide file tree
Showing 376 changed files with 17,612 additions and 8,174 deletions.
114 changes: 67 additions & 47 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 13 additions & 27 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,13 @@
# Gopkg.toml example
#
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
# for detailed Gopkg.toml documentation.
#
# required = ["github.com/user/thing/cmd/thing"]
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
#
# [[constraint]]
# name = "github.com/user/project"
# version = "1.0.0"
#
# [[constraint]]
# name = "github.com/user/project2"
# branch = "dev"
# source = "github.com/myfork/project2"
#
# [[override]]
# name = "github.com/x/y"
# version = "2.4.0"
#

# Used for deep copy code generation and ko publish tests.
required = [
"k8s.io/code-generator/cmd/deepcopy-gen",
]

[prune]
go-tests = true
unused-packages = true
non-go = true

[[constraint]]
name = "k8s.io/code-generator"
version = "kubernetes-1.11.0"
Expand All @@ -45,6 +28,14 @@ required = [
name = "k8s.io/kubernetes"
version = "1.11.0"

[[constraint]]
name = "github.com/docker/docker"
revision = "71cd53e4a197b303c6ba086bd584ffd67a884281"

[[override]]
name = "github.com/docker/distribution"
revision = "83389a148052d74ac602f5f1d62f86ff2f3c4aa5"

[[constraint]]
name = "github.com/google/go-cmp"
version = "0.2.0"
Expand All @@ -54,8 +45,3 @@ required = [
[[constraint]]
name = "github.com/spf13/cobra"
revision = "615425954c3b0d9485a7027d4d451fdcdfdee84e"

[prune]
go-tests = true
unused-packages = true
non-go = true
7 changes: 6 additions & 1 deletion pkg/v1/daemon/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ type ImageSaver interface {

// This is a variable so we can override in tests.
var getImageSaver = func() (ImageSaver, error) {
return client.NewEnvClient()
cli, err := client.NewEnvClient()
if err != nil {
return nil, err
}
cli.NegotiateAPIVersion(context.Background())
return cli, nil
}

func saveImage(ref name.Reference) (io.ReadCloser, error) {
Expand Down
7 changes: 6 additions & 1 deletion pkg/v1/daemon/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ type ImageLoader interface {

// This is a variable so we can override in tests.
var GetImageLoader = func() (ImageLoader, error) {
return client.NewEnvClient()
cli, err := client.NewEnvClient()
if err != nil {
return nil, err
}
cli.NegotiateAPIVersion(context.Background())
return cli, nil
}

// WriteOptions are used to expose optional information to guide or
Expand Down
Loading

0 comments on commit 5f7b0e4

Please sign in to comment.