-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Replace docker check #3270
Replace docker check #3270
Conversation
95a8597
to
28be66f
Compare
28be66f
to
796d4f7
Compare
796d4f7
to
f159498
Compare
f159498
to
fa84b3e
Compare
fa84b3e
to
db947ed
Compare
db947ed
to
83de060
Compare
83de060
to
5b71afc
Compare
5b71afc
to
b514187
Compare
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.
LGTM - noted a few tiny things but I think this is ready to go after those are addressed.
agent/check_test.go
Outdated
}, | ||
"POST /exec/456/start": func(w http.ResponseWriter, r *http.Request) { | ||
w.WriteHeader(200) | ||
fmt.Fprint(w, "01234567890123456789OK") // more than 10 bytes |
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.
You probably meant "20 bytes" here, since that's the output buffer size for this test.
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.
Yes, was playing with 10 bytes but that bit me somewhere else. will fix.
agent/docker.go
Outdated
host = DefaultDockerHost | ||
} | ||
p := strings.SplitN(host, "://", 2) | ||
if len(p) == 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.
Since this can come from the outside I'd assert that it's equal to 2. If we have no split (len(p) == 0
) this will panic
down below.
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 don't think that len(p)
can ever be zero unless you specify 0
as the last argument. If the split string isn't found you get host
back.
agent/docker.go
Outdated
Cmd: cmd, | ||
} | ||
|
||
uri := fmt.Sprintf("/containers/%s/exec", containerID) |
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.
Maybe URL encode the containerID
to prevent shenanigans?
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.
sure.
This PR drops unused dependencies and rewrites the Docker health check without using the docker client. This removes about 1/3rd of our code base.
See #3254 #3257