-
Notifications
You must be signed in to change notification settings - Fork 118
Conversation
0f603fd
to
19f98f9
Compare
Rebased... Some feedback would be appreciated... |
@rickard-von-essen Apologies for the extremely delayed response. Can you change |
@samuelkarp no problem, I'll update this tomorrow. |
The most recent |
@rickard-von-essen Thanks. We need to keep ecs-init on Go 1.6 for now, so we'll need to still use |
Yes, brb |
Last version that doesn't depend on |
19f98f9
to
e2a47f1
Compare
ecs-init/docker/docker.go
Outdated
@@ -94,7 +96,7 @@ func (c *Client) IsAgentImageLoaded() (bool, error) { | |||
|
|||
// LoadImage loads an io.Reader into Docker | |||
func (c *Client) LoadImage(image io.Reader) error { | |||
return c.docker.LoadImage(godocker.LoadImageOptions{image}) | |||
return c.docker.LoadImage(godocker.LoadImageOptions{image, 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.
I put context.Background()
here or do you want context.TODO()
instead?
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.
context.TODO()
seems more appropriate here.
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.
Fixed!
a070c48
to
5e50777
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.
Code looks pretty good, just one minor change and we need to test this across different Docker versions and configurations before merging.
ecs-init/docker/docker_test.go
Outdated
@@ -94,7 +96,7 @@ func TestLoadImage(t *testing.T) { | |||
|
|||
mockDocker := NewMockdockerclient(mockCtrl) | |||
|
|||
mockDocker.EXPECT().LoadImage(godocker.LoadImageOptions{nil}) | |||
mockDocker.EXPECT().LoadImage(godocker.LoadImageOptions{nil, 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.
Looks like this should expect either context.TODO()
or gomock.Any()
instead of 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.
Fixed
This add support for UsernsMode but doesn't use "context" introduced in Go 1.7 . github.com/fsouza/go-dockerclient => c342fd4c3d69bdc9767083cc61d11756e7323b64
5e50777
to
8d70d2f
Compare
Code looks good, we just need to test this now. |
When is this scheduled to be released as an RPM? It looks like docker-1.12.6-1.17.amzn1.x86_64 and ecs-init-1.14.0-2.amzn1.x86_64 are the latest. |
Just to give an update here: I tested this with Docker 1.12.6 on Amazon Linux and saw that it was working correctly (inspecting showed me |
Merged. Thank you @rickard-von-essen! |
If you start your docker daemon with
--userns-remap=<val>
docker will map users inside containers to other uids on the host. Most notably this makes uid 0 inside a container != uid 0 on the host.ECS agent needs access to the host network but you can't set
--network host
when you haveuserns-remap
. By setting--userns host
the ECS agent is started without userns remapping. This flag was added in Docker 1.11.This required a update of the
go-dockerclient
.