Skip to content
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

Change defaults for mount writable and volume copying #24053

Merged
merged 3 commits into from
Jul 7, 2016

Conversation

cpuguy83
Copy link
Member

Changes the writable CLI flag to readonly instead. This way CLI users
must opt-in to readonly as is expected from docker run.
The API is unchanged and defaults to to not writable.

Fixes #23915

@thaJeztah
Copy link
Member

thaJeztah commented Jun 30, 2016

LGTM see below

ping @stevvooe @tiborvass

@vdemeester
Copy link
Member

vdemeester commented Jun 30, 2016

The API is unchanged and defaults to to not writable.

Doesn't this make the API less consistent with the /container/… one then ? 👼

@thaJeztah
Copy link
Member

I actually agree with @vdemeester, IMO we should have the same defaults on the client and API. Sending an "empty" request through the API should pick the defaults we decide on. If we think "RW" is the right default for volumes, the API should use that as a default.

@stevvooe
Copy link
Contributor

@vdemeester @thaJeztah We can change it, but it is an API change during the RC period. I've been advocating this change, but there seems to be push back.

@thaJeztah
Copy link
Member

Changing after GA will be even harder, I think...

On 30 Jun 2016, at 16:04, Stephen Day notifications@github.com wrote:

@vdemeester @thaJeztah We can change it, but it is an API change during the RC period. I've been advocating this change, but there seems to be push back.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

stevvooe added a commit to stevvooe/engine-api that referenced this pull request Jul 1, 2016
To ensure that the zero-value reflects the defaults for mounts, change
the `Writable` to `ReadOnly`. Adds a breaking api change to address a
point of confusion.

If this PR is not merged by the 1.12 release, this can never be merged,
so just close and move on.

Related to moby/moby#24053.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
@stevvooe
Copy link
Contributor

stevvooe commented Jul 1, 2016

@thaJeztah @cpuguy83 @aaronlehmann I've submitted docker/engine-api#298. If we decide this is what we want, as this has come up a few times, merge that and I'll take care of the deltas.

@cpuguy83
Copy link
Member Author

cpuguy83 commented Jul 1, 2016

This is fine, the big thing is going to be changing it in swarmkit.

stevvooe added a commit to stevvooe/engine-api that referenced this pull request Jul 1, 2016
To ensure that the zero-value reflects the defaults for mounts, change
the `Writable` to `ReadOnly`. Adds a breaking api change to address a
point of confusion.

If this PR is not merged by the 1.12 release, this can never be merged,
so just close and move on.

Related to moby/moby#24053.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
@stevvooe
Copy link
Contributor

stevvooe commented Jul 1, 2016

@cpuguy83 I've submitted a fix in swarmkit and engine-api. Let's update the vendoring here to use this PR as a gate for the feature.

@nishanttotla
Copy link
Contributor

@cpuguy83 if you update engine-api to the latest commit, you'll also need these changes: nishanttotla@9d62e6c

In case you don't wish to mix them in this PR, don't vendor in changes introduced by docker/engine-api#297, and I'll open a PR with my branch after this one is merged.

func fatal(t TestingT, msg string) {
_, file, line, _ := runtime.Caller(2)
t.Fatalf("%s:%d: %s", filepath.Base(file), line, msg)
}
Copy link
Member

Choose a reason for hiding this comment

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

What's up with this fatal()? isn't this already what t.Fatalf() prints by default?

Copy link
Member

Choose a reason for hiding this comment

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

Oh nevermind , I missed this was in the assert package. I have a PR somewhere that adds this as well. I'll resolve the conflict if this merges first/

@cpuguy83
Copy link
Member Author

cpuguy83 commented Jul 5, 2016

Thanks @nishanttotla! Extremely helpful.

@cpuguy83 cpuguy83 changed the title Set service mount CLI to default to writable Change defaults for mount writable and volume copying Jul 5, 2016
@cpuguy83
Copy link
Member Author

cpuguy83 commented Jul 5, 2016

Ok, this is updated.
Also changed the Populate field to NoCopy (which matches the -v syntax) here as well.

engine-api and swarmkit changes are vendored in.

@stevvooe
Copy link
Contributor

stevvooe commented Jul 5, 2016

LGTM

@thaJeztah
Copy link
Member

moved to docs review; just the API docs, then we should be able to merge

@cpuguy83
Copy link
Member Author

cpuguy83 commented Jul 6, 2016

Docs updated.

@thaJeztah
Copy link
Member

docs LGTM

@vdemeester
Copy link
Member

docs LGTM 🐯

@thaJeztah
Copy link
Member

hmf, is this a known issue in CI? https://jenkins.dockerproject.org/job/Docker-PRs/29631/console

21:45:12 ----------------------------------------------------------------------
21:45:12 FAIL: docker_cli_service_create_hack_test.go:15: DockerSwarmSuite.TestServiceCreateMountVolume
21:45:12 
21:45:12 [d73632282] waiting for daemon to start
21:45:12 [d73632282] daemon started
21:45:12 docker_cli_service_create_hack_test.go:33:
21:45:12     waitAndAssert(c, defaultReconciliationTimeout, func(c *check.C) (interface{}, check.CommentInterface) {
21:45:12         if task.NodeID == "" || task.Status.ContainerStatus.ContainerID == "" {
21:45:12             task = d.getTask(c, task.ID)
21:45:12         }
21:45:12         return task.NodeID != "" && task.Status.ContainerStatus.ContainerID != "", nil
21:45:12     }, checker.Equals, true)
21:45:12 github.com/docker/docker/integration-cli/_test/_obj_test/docker_utils.go:2011:
21:45:12     ...open github.com/docker/docker/integration-cli/_test/_obj_test/docker_utils.go: no such file or directory
21:45:12 ... obtained bool = false
21:45:12 ... expected bool = true
21:45:12 
21:45:12 [d73632282] exiting daemon
21:45:29 

@thaJeztah
Copy link
Member

could be related?

@thaJeztah thaJeztah added the status/failing-ci Indicates that the PR in its current state fails the test suite label Jul 6, 2016
@cpuguy83
Copy link
Member Author

cpuguy83 commented Jul 6, 2016

It's a new test, I will have to update it before we merge.

Brian Goff added 3 commits July 6, 2016 21:14
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
In the API:
`Writable` changed to `ReadOnly`
`Populate` changed to `NoCopy`

Corresponding CLI options updated to:
`volume-writable` changed to `volume-readonly`
`volume-populate` changed to `volume-nocopy`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
@cpuguy83
Copy link
Member Author

cpuguy83 commented Jul 7, 2016

Whew, that's a good test. Issue with rebase had some lines mixed up.
Pushed up fixes.

Seems CI took a vacation.

@thaJeztah
Copy link
Member

retest this please

@vdemeester vdemeester removed the status/failing-ci Indicates that the PR in its current state fails the test suite label Jul 7, 2016
@vdemeester vdemeester merged commit 50674ec into moby:master Jul 7, 2016
@cpuguy83 cpuguy83 deleted the mounts_default_writable branch September 20, 2017 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants