Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker: restore "from env" behavior, and perform API version negotiation #270

Merged
merged 3 commits into from
Aug 20, 2019

Conversation

thaJeztah
Copy link
Contributor

@thaJeztah thaJeztah commented Aug 17, 2019

This should help with #254 (and #252), where CI failed because the travis was running an older Docker version.

if err != nil {
return nil, err
}
c.NegotiateAPIVersion(context.TODO())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be passed as an option to NewClientWithOpts after updating to a more recent client that has the WithAPIVersionNegotiation option (added in moby/moby#39032), but that's only a small improvement, and I wanted to keep the diff small

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the dockerclient.WithAPIVersionNegotiation option instead if it's not too much work to update the docker client version we're currently pinned to.

Copy link
Member

@dhui dhui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

if err != nil {
return nil, err
}
c.NegotiateAPIVersion(context.TODO())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use the dockerclient.WithAPIVersionNegotiation option instead if it's not too much work to update the docker client version we're currently pinned to.

@thaJeztah thaJeztah force-pushed the docker_api_version_negotiation branch from dfc35e9 to 841161a Compare August 17, 2019 21:25
@thaJeztah
Copy link
Contributor Author

Updated 👍

@thaJeztah
Copy link
Contributor Author

oh, looks like I need to rebase, as it's showing as outdated

commit c31948c replaced the deprecated
`dockerclient.NewEnvClient` with `dockerclient.NewClientWithOpts`, but
did not add the `FromEnv` option to keep  the old behavior.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
This helps in situations where the daemon is older than
the API client. API version negotiation checks the maximum
supported API version by the daemon, and downgrades to that
API version if needed.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the docker_api_version_negotiation branch from 841161a to 014d1ba Compare August 18, 2019 10:56
@thaJeztah
Copy link
Contributor Author

done

@dhui
Copy link
Member

dhui commented Aug 19, 2019

FYI, these changes won't take affect since they're against a deprecated unused package. The package has been left around since it was publicly available. I'll still merge the PR since it's still useful as a reference 😉

@dhui
Copy link
Member

dhui commented Aug 19, 2019

Builds have been fix, could you rebase/merge?

Edit: Apparently I have the ability to merge to your repo/branch, so I took the liberty to do so

@coveralls
Copy link

coveralls commented Aug 19, 2019

Pull Request Test Coverage Report for Build 515

  • 0 of 4 (0.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.03%) to 50.987%

Changes Missing Coverage Covered Lines Changed/Added Lines %
testing/docker.go 0 4 0.0%
Totals Coverage Status
Change from base Build 514: -0.03%
Covered Lines: 2324
Relevant Lines: 4558

💛 - Coveralls

@dhui dhui merged commit d5960ad into golang-migrate:master Aug 20, 2019
@thaJeztah thaJeztah deleted the docker_api_version_negotiation branch August 20, 2019 16:16
@thaJeztah
Copy link
Contributor Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants