8000 stage1: handle docker group semantics by iaguis · Pull Request #3792 · rkt/rkt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Feb 24, 2020. It is now read-only.

stage1: handle docker group semantics #3792

Merged
merged 1 commit into from
Sep 11, 2017

Conversation

iaguis
Copy link
Member
@iaguis iaguis commented Sep 8, 2017

Docker uses the UID as GID if you only specify the "user".

In that case, docker2aci sets the group name to the user name because
the appc spec requires both user and group to be set. This will fail
because that group name won't be found in /etc/group.

Let's detect if the image was converted from docker and set the GID to
the UID in that case.

// if the image was converted from docker and set the GID to the UID in
// that case.
img := p.Images[ra.Name.String()]
if ConvertedFromDocker(img) && img.App.User == img.App.Group {
Copy link
Member

Choose a reason for hiding this comment

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

is it correct if the user and group are not specified in the ACI image but in the pod spec? (see test "Set invalid non-numerical app group.")

Shouldn't you use ra.App.User == ra.App.Group instead?

=== RUN   TestPodManifest
--- FAIL: TestPodManifest (72.88s)
rkt_run_pod_manifest_test.go:1250: Expected "\"group2\" group not found" but not found: ExpectRegex didn't find regex '"group2" group not found'.

Copy link
Member Author

Choose a reason for hiding this comment

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

It then breaks when the app is run with --user=foo

Copy link
Member Author

Choose a reason for hiding this comment

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

We should check if the group in the pod spec is the same as the one in the image, it's only in that case that we want to emulate docker's behavior. If not, we assume the user wants what they mean (not docker's behavior).

Docker uses the UID as GID if you only specify the "user".

In that case, docker2aci sets the group name to the user name because
the appc spec requires both user and group to be set. This will fail
because that group name won't be found in /etc/group.

Let's detect if the image was converted from docker and set the GID to
the UID in that case.
@iaguis iaguis force-pushed the iaguis/handle-docker-group-semantics branch from 754d6e1 to 200bfdd Compare September 8, 2017 15:19
@iaguis
Copy link
Member Author
iaguis commented Sep 8, 2017

Updated.

@iaguis iaguis merged commit b429dc4 into rkt:master Sep 11, 2017
@iaguis iaguis deleted the iaguis/handle-docker-group-semantics branch January 9, 2018 12:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0