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

stage1/fly: respect runtimeApp App's MountPoints #2852

Merged
merged 4 commits into from Jul 7, 2016

Conversation

Projects
None yet
6 participants
@steveeJ
Contributor

steveeJ commented Jun 30, 2016

Fixes #2846.

I'm not positive that all the implementation of the different App types and MountPoints really reflect the specs, but this change reproduces what stage1-coreos does.

/cc @iaguis

@euank

This comment has been minimized.

Show comment
Hide comment
@euank

euank Jun 30, 2016

Member

Should this logic live in stage1/init/common/mount.go (or does it already in the form of GenerateMounts?) so that the code is shared?

Member

euank commented Jun 30, 2016

Should this logic live in stage1/init/common/mount.go (or does it already in the form of GenerateMounts?) so that the code is shared?

@steveeJ

This comment has been minimized.

Show comment
Hide comment
@steveeJ

steveeJ Jun 30, 2016

Contributor

Should this logic live in stage1/init/common/mount.go (or does it already in the form of GenerateMounts?) so that the code is shared?

I'll look into that after we have tests in place on all ends so I can prevent breakage.

Contributor

steveeJ commented Jun 30, 2016

Should this logic live in stage1/init/common/mount.go (or does it already in the form of GenerateMounts?) so that the code is shared?

I'll look into that after we have tests in place on all ends so I can prevent breakage.

@steveeJ steveeJ removed the needs/tests label Jun 30, 2016

@euank

This comment has been minimized.

Show comment
Hide comment
@euank

euank Jun 30, 2016

Member

This doesn't fix all differences between mounts in coreos and fly. For example, duplicate container targets in coreos are handled (with the first one winning), while here it ends up with a rather odd error.

For example:

$ rkt run \
  --volume a,kind=host,source=/etc/resolv.conf \
  --mount volume=a,target=/etc/resolv.conf \
  --volume b,kind=host,source=/etc/hosts \
  --mount volume=b,target=/etc/resolv.conf \
  --stage1-path=.../stage1-fly.aci quay.io/coreos/alpine-sh --exec=/bin/sh  -- -c 'cat /etc/resolv.conf'
run: can't evaluate mounts: missing mount for volume "b"

The above prints out the contents of the host /etc/resolv.conf with stage1-coreos, but errors out as above with fly.

I can file a separate issue if you'd like, or we can handle that here. Switching to the common/mounts.go code does fix this.

Member

euank commented Jun 30, 2016

This doesn't fix all differences between mounts in coreos and fly. For example, duplicate container targets in coreos are handled (with the first one winning), while here it ends up with a rather odd error.

For example:

$ rkt run \
  --volume a,kind=host,source=/etc/resolv.conf \
  --mount volume=a,target=/etc/resolv.conf \
  --volume b,kind=host,source=/etc/hosts \
  --mount volume=b,target=/etc/resolv.conf \
  --stage1-path=.../stage1-fly.aci quay.io/coreos/alpine-sh --exec=/bin/sh  -- -c 'cat /etc/resolv.conf'
run: can't evaluate mounts: missing mount for volume "b"

The above prints out the contents of the host /etc/resolv.conf with stage1-coreos, but errors out as above with fly.

I can file a separate issue if you'd like, or we can handle that here. Switching to the common/mounts.go code does fix this.

Show outdated Hide outdated stage1_fly/run/main.go Outdated
Show outdated Hide outdated stage1_fly/run/main.go Outdated
@steveeJ

This comment has been minimized.

Show comment
Hide comment
@steveeJ

steveeJ Jun 30, 2016

Contributor

I can file a separate issue if you'd like, or we can handle that here. Switching to the common/mounts.go code does fix this.

Please file a separate issue since this is not a regression related to this PR or the issue it's handling.

Contributor

steveeJ commented Jun 30, 2016

I can file a separate issue if you'd like, or we can handle that here. Switching to the common/mounts.go code does fix this.

Please file a separate issue since this is not a regression related to this PR or the issue it's handling.

Show outdated Hide outdated tests/rkt_fly_test.go Outdated
@iaguis

This comment has been minimized.

Show comment
Hide comment
@iaguis

iaguis Jul 5, 2016

Member

I'll look into that after we have tests in place on all ends so I can prevent breakage.

Is this something you can do now that we have tests? Maybe we can do it in a follow-up?

Member

iaguis commented Jul 5, 2016

I'll look into that after we have tests in place on all ends so I can prevent breakage.

Is this something you can do now that we have tests? Maybe we can do it in a follow-up?

Show outdated Hide outdated stage1_fly/run/main.go Outdated
@steveeJ

This comment has been minimized.

Show comment
Hide comment
@steveeJ

steveeJ Jul 6, 2016

Contributor

Is this something you can do now that we have tests? Maybe we can do it in a follow-up?

I'd tackle this with a follow-up, there is more to do than just to refactor as I talked through OOB with @euank last week.

Contributor

steveeJ commented Jul 6, 2016

Is this something you can do now that we have tests? Maybe we can do it in a follow-up?

I'd tackle this with a follow-up, there is more to do than just to refactor as I talked through OOB with @euank last week.

@steveeJ steveeJ added this to the v1.10.0 milestone Jul 6, 2016

steveeJ added some commits Jun 30, 2016

stage1/fly: respect runtimeApp App's MountPoints
* Fixes a bug where MountPoints from the PodManifest App's weren't
  processed
* Refactor code and add comments

@steveeJ steveeJ referenced this pull request Jul 7, 2016

Merged

add support for recursive volume/mounts #2880

12 of 15 tasks complete

@tmrts tmrts self-assigned this Jul 7, 2016

func addMountPoints(namedVolumeMounts map[types.ACName]volumeMountTuple, mountpoints []types.MountPoint) error {
for _, mp := range mountpoints {
tuple, exists := namedVolumeMounts[mp.Name]
switch {

This comment has been minimized.

@tmrts

tmrts Jul 7, 2016

Contributor

Minor nit for future reference, you can use switch tuple, exists := namedVolumeMounts[mp.Name]; {

@tmrts

tmrts Jul 7, 2016

Contributor

Minor nit for future reference, you can use switch tuple, exists := namedVolumeMounts[mp.Name]; {

@tmrts

This comment has been minimized.

Show comment
Hide comment
@tmrts

tmrts Jul 7, 2016

Contributor

Building the PR, I investigated the #2846 and couldn't reproduce the bug, LGTM

Contributor

tmrts commented Jul 7, 2016

Building the PR, I investigated the #2846 and couldn't reproduce the bug, LGTM

@tmrts tmrts added the reviewed/lgtm label Jul 7, 2016

@tmrts tmrts merged commit 2d29e5f into rkt:master Jul 7, 2016

8 checks passed

Jenkins Build finished.
Details
Jenkins (debian-8, coreos flavor) Success!
Details
Jenkins (fedora-22, coreos flavor) Success!
Details
Jenkins (fedora-23, coreos flavor) Success!
Details
Jenkins (fedora-24, coreos flavor) Success!
Details
Jenkins (fedora-24, fly flavor) Success!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
semaphoreci The build passed on Semaphore.
Details

@steveeJ steveeJ deleted the steveeJ:rkt-fly-mounts branch Jul 11, 2016

@lucab lucab unassigned tmrts Apr 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment