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

Add mounts to docker ps. #20017

Merged
merged 1 commit into from Feb 24, 2016
Merged

Conversation

calavera
Copy link
Contributor

@calavera calavera commented Feb 5, 2016

  • Allow to filter containers by volume with --filter volume=name and filter volume=/dest.
  • Show their names in the list with the custom format {{ .Mounts }}.

This is consistent with the Network information we added recently.

Signed-off-by: David Calavera david.calavera@gmail.com

@calavera calavera force-pushed the expose_volumes_in_ps branch 2 times, most recently from 77e0617 to d7450cd Compare February 5, 2016 16:31
@thaJeztah thaJeztah added the status/needs-attention Calls for a collective discussion during a review session label Feb 15, 2016
@thaJeztah
Copy link
Member

ping @duglin I think this is something you were looking for?

@duglin
Copy link
Contributor

duglin commented Feb 15, 2016

compiling this (not rebasing) I see:

runconfig/opts/parse.go:411: undefined: container.IsolationLevel

@duglin
Copy link
Contributor

duglin commented Feb 15, 2016

rebase needed

@thaJeztah
Copy link
Member

ping @calavera can you rebase this?

@calavera
Copy link
Contributor Author

ping @calavera can you rebase this?

will do when we decide whether we want this change or not. There is no point to rebase before docker/engine-api#85 is merged, from my point of view.

@thaJeztah thaJeztah added status/2-code-review and removed status/1-design-review status/needs-attention Calls for a collective discussion during a review session labels Feb 18, 2016
@calavera
Copy link
Contributor Author

I've rebased with master and vendored engine-api already. I also added documentation for the new filter and format.

@thaJeztah
Copy link
Member

@calavera
Copy link
Contributor Author

@thaJeztah done, thanks for the reminder.

@lowenna
Copy link
Member

lowenna commented Feb 19, 2016

windowsTP4 failure is real - needs to have conditional code for Windows file path semantics. Also rather than running busybox top in the test, use runSleepingContainer.

16:50:14 ----------------------------------------------------------------------
16:50:14 FAIL: docker_cli_ps_test.go:738: DockerSuite.TestPsShowMounts
16:50:14 
16:50:14 docker_cli_ps_test.go:740:
16:50:14     dockerCmd(c, "run", "--name=volume-test-1", "-d", "--volume", "ps-volume-test:/test", "busybox", "top")
16:50:14 C:/gopath/src/github.com/docker/docker/pkg/integration/dockerCmd_utils.go:42:
16:50:14     c.Assert(err, check.IsNil, check.Commentf(quote+"%v"+quote+" failed with errors: %s, %v", strings.Join(args, " "), out, err))
16:50:14 ... value *exec.ExitError = &exec.ExitError{ProcessState:(*os.ProcessState)(0xc082505120)} ("exit status 125")
16:50:14 ... "run --name=volume-test-1 -d --volume ps-volume-test:/test busybox top" failed with errors: D:\CI\CI-cf50592\binary\docker.exe: Error response from daemon: Invalid bind mount spec "ps-volume-test:/test": volumeinvalid: Invalid volume specification: 'ps-volume-test:/test'.
16:50:14 See 'D:\CI\CI-cf50592\binary\docker.exe run --help'.
16:50:14 , exit status 125
16:50:14 
16:50:14 
16:50:14 ----------------------------------------------------------------------

@@ -184,6 +195,10 @@ Query Parameters:
- `status=`(`created`|`restarting`|`running`|`paused`|`exited`|`dead`)
- `label=key` or `label="key=value"` of a container label
- `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only)
- `ancestor`=(`<image-name>[:<tag>]`, `<image id>` or `<image@digest>`)
- `before`=(container's id or name)
Copy link
Contributor

Choose a reason for hiding this comment

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

minor thing, but for consistency, should these use < >, e.g. <container id> instead of "container's id" since you're using <image id> above?

@duglin
Copy link
Contributor

duglin commented Feb 19, 2016

one minor request on the test, but aside from that LGTM

@thaJeztah thaJeztah added this to the 1.11.0 milestone Feb 19, 2016
@calavera
Copy link
Contributor Author

@duglin I've addressed your comments.

@jhowardmsft ❤️ to know that when I break windows support the tests fail horribly 🙌

@duglin
Copy link
Contributor

duglin commented Feb 19, 2016

@calavera thanks! Still LGTM assuming janky is happy

@lowenna
Copy link
Member

lowenna commented Feb 19, 2016

@calavera Looks like it's still broken, sorry!

10:24:51 ----------------------------------------------------------------------
10:24:51 PANIC: docker_cli_ps_test.go:738: DockerSuite.TestPsShowMounts
10:24:51 
10:24:51 ... Panic: runtime error: index out of range (PC=0x45DC15)
10:24:51 
10:24:51 c:/go/src/runtime/asm_amd64.s:437
10:24:51   in call32
10:24:51 c:/go/src/runtime/panic.go:423
10:24:51   in gopanic
10:24:51 c:/go/src/runtime/panic.go:12
10:24:51   in panicindex
10:24:51 docker_cli_ps_test.go:780
10:24:51   in DockerSuite.TestPsShowMounts
10:24:51 c:/go/src/runtime/asm_amd64.s:437
10:24:51   in call32
10:24:51 c:/go/src/reflect/value.go:432
10:24:51   in Value.call
10:24:51 c:/go/src/reflect/value.go:300
10:24:51   in Value.Call
10:24:51 C:/gopath/src/github.com/docker/docker/vendor/src/github.com/go-check/check/check.go:772
10:24:51   in suiteRunner.forkTest.func1
10:24:51 C:/gopath/src/github.com/docker/docker/vendor/src/github.com/go-check/check/check.go:666
10:24:51   in suiteRunner.forkCall.func1
10:24:51 c:/go/src/runtime/asm_amd64.s:1721
10:24:51   in goexit
10:24:51 
10:24:51 ----------------------------------------------------------------------

@calavera
Copy link
Contributor Author

@jhowardmsft yeah, I'm doing some changes and I'll push an update shortly.

@calavera
Copy link
Contributor Author

@jhowardmsft

https://jenkins.dockerproject.org/job/Docker-PRs-WoW-TP4/1250/console

19:34:50 PASS: docker_cli_ps_test.go:738: DockerSuite.TestPsShowMounts  10.944s

🎉

@lowenna
Copy link
Member

lowenna commented Feb 20, 2016

@calavera Neat. LGTM from the Windows side. (I would have seen your message earlier if it wasn't for Gordon spamming my inbox and hiding 'real' messages 😈)

@runcom
Copy link
Member

runcom commented Feb 21, 2016

LGTM moving to doc review

- Allow to filter containers by volume with `--filter volume=name` and `filter volume=/dest`.
- Show their names in the list with the custom format `{{ .Mounts }}`.

Signed-off-by: David Calavera <david.calavera@gmail.com>
@calavera
Copy link
Contributor Author

@thaJeztah, @vdemeester, @MHBauer can I have the docs reviewed here?

@@ -142,6 +143,20 @@ func (c *containerContext) Label(name string) string {
return c.c.Labels[name]
}

func (c *containerContext) Mounts() string {
Copy link
Contributor

Choose a reason for hiding this comment

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

as a Capitalize Exported function, doesn't this need a comment? Shouldn't one of the validate passes catch this? Am I mistaken?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The function is exported because Go's template engine requires to export them, but the struct is not exported, so nobody else can really use it.

@MHBauer
Copy link
Contributor

MHBauer commented Feb 23, 2016

Only extra doc I could think of is the cli helptext, but that doesn't mention any specific filters at all. I think you're good for docs.

@thaJeztah
Copy link
Member

oh! thought I reviewed this, lol.

yup, docs LGTM (thanks for the ping @calavera)

@thaJeztah
Copy link
Member

@MHBauer is that a 'lgtm'?

@vdemeester
Copy link
Member

LGTM 🦁

@MHBauer
Copy link
Contributor

MHBauer commented Feb 23, 2016

LGTM

@thaJeztah
Copy link
Member

Janky, Experimental and WindowsTP4 is green, other CI is having lots of issues, so let's merge

thaJeztah added a commit that referenced this pull request Feb 24, 2016
@thaJeztah thaJeztah merged commit 034a1a8 into moby:master Feb 24, 2016
@calavera calavera deleted the expose_volumes_in_ps branch March 16, 2016 18:10
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