Repository navigation
Fix copying of volumes by using the name of the volume - #2934
Conversation
|
I'm actually surprised this wasn't found until now (and there have only been 2 reports so far). It makes me believe that most people are using Compose for CI (where you always |
| volume_path = orig_container.get_mount('/etc')['Source'] | ||
|
|
||
| # Do this twice to reproduce the bug | ||
| for _ in xrange(2): |
There was a problem hiding this comment.
Doesn't exist in python 3. Just use range(2) instead - we probably have enough RAM for those 12 bytes.
d1f94d3 to
4a09da4
Compare
… host path. Signed-off-by: Daniel Nephin <[email protected]>
|
LGTM! |
Fix copying of volumes by using the name of the volume
|
I just want to mention that i ran into this bug today with an (non-critical) application in production. Thanks for fixing this! |
|
Also to comment, we've hit upon it here too, but I found the existing bug report so didn't refile it or add a 👍, I just subscribed. Glad to see this fixed and sitting tight for 1.6.1! |
Fixes #2912
This is a long overdue fix, that unfortunately caused a bug due to a change we made in 1.6.0. In 1.6.0 we stopped copying host volumes from previous containers (because it's redundant).
However, the "copy volume" logic made any copied volumes appear as if they were host volumes instead of named volumes, which meant that on the second recreate we'd lose the volumes (and new ones would be created).
This wasn't found by tests because we never recreated twice.
This fixes the 1.6.0, and should make this logic more resilient going forward. Instead of using the host path, we use the name (which didn't exist when this "copy volume" logic was first added). By using the name it's exactly like we're using a named volume.