8000 stage1-fly: duplicate mounts are handled poorly · Issue #3663 · 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-fly: duplicate mounts are handled poorly #3663

Closed
euank opened this issue Apr 27, 2017 · 2 comments
Closed

stage1-fly: duplicate mounts are handled poorly #3663

euank opened this issue Apr 27, 2017 · 2 comments

Comments

@euank
8000 Copy link
Member
euank commented Apr 27, 2017

See coreos/bugs#1892, this is the issue to track the rkt fix for that.

Environment

rkt Version: 1.25.0
appc Version: 0.8.10
Go Version: go1.7.5
Go OS/Arch: linux/amd64
Features: -TPM +SDJOURNAL
--
Linux 4.9.24-coreos x86_64
--
NAME="Container Linux by CoreOS"
ID=coreos
VERSION=1353.6.0
VERSION_ID=1353.6.0
BUILD_ID=2017-04-25-0215
PRETTY_NAME="Container Linux by CoreOS 1353.6.0 (Ladybug)"
ANSI_COLOR="38;5;75"
HOME_URL="https://coreos.com/"
BUG_REPORT_URL="https://issues.coreos.com"
--
systemd 233
+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK -SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT -GNUTLS -ACL +XZ -LZ4 +SECCOMP +BLKID -ELFUTILS +KMOD -IDN default-hierarchy=legacy

What did you do?

# identical
$ echo -n "1. "; sudo rkt run --stage1-name=coreos.com/rkt/stage1-fly:1.25.0 --insecure-options=image,ondisk \
   --volume x,kind=host,source=/tmp \
   --mount volume=x,target=/tmp \
   --volume x,kind=host,source=/tmp \
   --mount volume=x,target=/tmp \
   docker://busybox --exec=/bin/sh -- -c 'exit 0' && echo success

# different target only
echo -n "2. "; sudo rkt run --stage1-name=coreos.com/rkt/stage1-fly:1.25.0 --insecure-options=image,ondisk \
   --volume x,kind=host,source=/tmp \
   --mount volume=x,target=/tmp \
   --volume x,kind=host,source=/tmp \
   --mount volume=x,target=/tmp/ \
   docker://busybox --exec=/bin/sh -- -c 'exit 0' && echo success

# different name only
echo -n "3. "; sudo rkt run --stage1-name=coreos.com/rkt/stage1-fly:1.25.0 --insecure-options=image,ondisk \
   --volume y,kind=host,source=/tmp \
   --mount volume=x,target=/tmp \
   --volume x,kind=host,source=/tmp \
   --mount volume=x,target=/tmp \
   docker://busybox --exec=/bin/sh -- -c 'exit 0' && echo success


# same source only
echo -n "4. "; sudo rkt run --stage1-name=coreos.com/rkt/stage1-fly:1.25.0 --insecure-options=image,ondisk \
   --volume x,kind=host,source=/tmp \
   --mount volume=x,target=/tmp \
   --volume y,kind=host,source=/tmp \
   --mount volume=y,target=/tmp/ \
   docker://busybox --exec=/bin/sh -- -c 'exit 0' && echo success

What did you expect to see?

All successful runs! Note that all of these work fine under stage1-coreos.

What did you see instead?

  1. success
  2. run: can't evaluate mounts: duplicate mount given: "x"
  3. run: can't evaluate mounts: missing mount for volume "y"
  4. success
@euank
Copy link
Member Author
euank commented Apr 27, 2017

The easiest fix will probably be to copy or call as much mount-flag-parsing-and-merging code from stage1-coreos as possible for fly.

@lucab
Copy link
Member
lucab commented Apr 27, 2017

I started having a look at it and it looks like:

  • stage0 is deduplicating based on non-cleaned paths
  • appc, stage0 and stage1 are not checking for duplicate volume names
  • stage1-fly catches it because it has a lot of custom mount logic

However I fear this s one case of garbage-in-garbage-out, so I'd like to check if the proper behavior would be as follow:

  1. duplicate volume name, not allowed by pod spec -> error
  2. sub-cases:
  • (assuming same volume names) same as 1
  • (assuming different volume names) deduplication of cleaned mount target -> ok, only first mount kept
  1. same as 2b
  2. same as 2b

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants
0