Skip to content

Fix volumes-from/bind-mounts passed in on start - #9631

Merged
crosbymichael merged 1 commit into
moby:masterfrom
cpuguy83:9628_fix_volumes_hostconfig_on_start
Dec 15, 2014
Merged

crosbymichael merged 1 commit into
moby:masterfrom
cpuguy83:9628_fix_volumes_hostconfig_on_start

Conversation

@cpuguy83

Copy link
Copy Markdown
Member

Fixes #9628

@cpuguy83
cpuguy83 force-pushed the 9628_fix_volumes_hostconfig_on_start branch 2 times, most recently from 7f47e7d to 432bd17 Compare December 12, 2014 16:10
@cpuguy83

Copy link
Copy Markdown
Member Author

ping @jfrazelle @crosbymichael
This is the issue @proppy was having yesterday on 1.4

Comment thread daemon/volumes.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You cannot say this and we need to revert the docs that say that this is deprecated as this is not the case and will not be deprecated. For the longest time this has been the only way of passing binds and volumes and so many third party clients use this as there was no other way.

@cpuguy83
cpuguy83 force-pushed the 9628_fix_volumes_hostconfig_on_start branch 2 times, most recently from 1665254 to b9ad32f Compare December 12, 2014 20:14
@cpuguy83

Copy link
Copy Markdown
Member Author

Fixed that wording.

@crosbymichael

Copy link
Copy Markdown
Contributor

Thanks, I'm doing some testing now

@crosbymichael crosbymichael added this to the 1.4.1 milestone Dec 12, 2014

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe makes sense to specify somewhere that this volumes will be shadowed by start options.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you please at least ping docs when stuff like this comes up? I have no way of discovering issues like this in a timely manner otherwise.

Comment thread daemon/volumes.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What does this line mean?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is checking if the path of the passed in volume is the same as the path in container.Volumes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

But why are you checking for this and returning?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Because if it's the same then we don't need to do anything.
Same path means the same volume as there is only 1 volume object per path.

@ibuildthecloud

Copy link
Copy Markdown
Contributor

FYI, I tested this and it has fixed my issues I've seen with 1.4

@crosbymichael

Copy link
Copy Markdown
Contributor

@ibuildthecloud thanks for testing

Comment thread daemon/volumes.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add a comment explaining that this will reset the volumesfrom hostconfig each time and that this is needed in order for start to override what was set in create.

@cpuguy83
cpuguy83 force-pushed the 9628_fix_volumes_hostconfig_on_start branch from b9ad32f to 01becdc Compare December 15, 2014 20:21

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In the PR's first comment, it'd be great to add a reference to the PR that is being partially reverted. (#8683)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@cpuguy83 I don't see it

Fixes moby#9628
Slightly reverts moby#8683, HostConfig on start is _not_ deprecated.

Signed-off-by: Brian Goff <[email protected]>
@cpuguy83
cpuguy83 force-pushed the 9628_fix_volumes_hostconfig_on_start branch from 01becdc to d44c9f9 Compare December 15, 2014 21:52
@cpuguy83

Copy link
Copy Markdown
Member Author

Updated.
Added new test to make sure that VolumesFrom has priorty over anything else, as is the case with the corresponding CLI test(TestRunApplyVolumesFromBeforeVolumes)

@cpuguy83

Copy link
Copy Markdown
Member Author

*new test and fixed an issue where that wasn't the case.

@crosbymichael

Copy link
Copy Markdown
Contributor

@jfrazelle @LK4D4 I removed your LGTM since the code changed in the last revision

@jessfraz

Copy link
Copy Markdown
Contributor

@ibuildthecloud if you want to retest as well that would be awesome, if not no biggie :)

@LK4D4

LK4D4 commented Dec 15, 2014

Copy link
Copy Markdown
Contributor

I retested it with docker-py and fig. All is okay. I don't see obvious bugs also(as always 😆 )

@jessfraz

Copy link
Copy Markdown
Contributor

lftm

@unclejack

Copy link
Copy Markdown
Contributor

Would it be too much to ask for a test in docker_api in integration-cli?

@LK4D4

LK4D4 commented Dec 15, 2014

Copy link
Copy Markdown
Contributor

@unclejack I see that there are three tests in this PR.

@crosbymichael

Copy link
Copy Markdown
Contributor

I'm also adding the entire docker-py integration tests for the lib in #9676 for API tests not owned by us.

@crosbymichael

Copy link
Copy Markdown
Contributor

LGTM

@tiborvass

Copy link
Copy Markdown
Contributor

LGTM, although the code is very complicated to read :(

crosbymichael added a commit that referenced this pull request Dec 15, 2014
…_start

Fix volumes-from/bind-mounts passed in on start
@crosbymichael
crosbymichael merged commit 24d03b8 into moby:master Dec 15, 2014
@cpuguy83
cpuguy83 deleted the 9628_fix_volumes_hostconfig_on_start branch September 20, 2017 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

issues with api bind/volumesfrom on start

8 participants