summaryrefslogtreecommitdiff
path: root/cmd/podman/port.go
Commit message (Collapse)AuthorAge
* Friendly amendment: tests, and a help messageEd Santiago2020-02-23
| | | | | | | | | | | 1) Help message for podman port was missing [PORT] 2) Add test for 'podman port'. And, actually, an entire networking test that I'd written some weeks ago but apparently didn't 'git add'. Signed-off-by: Ed Santiago <santiago@redhat.com> Signed-off-by: Brent Baude <bbaude@redhat.com>
* fix port list by container with portbaude2020-02-23
| | | | | | | | | code was erronously misinterpretting the port as a containername. Fixes: #1791832 Signed-off-by: baude <bbaude@redhat.com> Signed-off-by: Brent Baude <bbaude@redhat.com>
* podman rm/stop --cidfileValentin Rothberg2019-11-18
| | | | | | | | | | Add a --cidfile flag to podman rm/stop to pass a container ID via a file. Podman run already provides the functionaly to store the ID in a specified file which we now complete with rm/stop. This allows for a better life-cycle management in systemd services. Note that --cdifile can be specified multiple times to rm/stop. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* fix port early returnbaude2019-08-07
| | | | | | | | | when listing multiple ports on a container with podman port, an early return was limiting results. Fixes: #3747 Signed-off-by: baude <bbaude@redhat.com>
* first pass of corrections for golangci-lintbaude2019-07-10
| | | | Signed-off-by: baude <bbaude@redhat.com>
* podman-remote portbaude2019-05-01
| | | | | | | add the port command to the remote client. this allows users to displa port information about their host system from the remote client Signed-off-by: baude <bbaude@redhat.com>
* runtime: pass down the contextGiuseppe Scrivano2019-04-26
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Fix segfaults attribute to missing optionsbaude2019-04-15
| | | | | | | | | In cases where the remote client culls options to a command, we need to be sure that the lookup for that flag does not result in a nil pointer. To do so, we add a Remote attribute to the podman struct and then cli helper funcs are now aware they are remote. Signed-off-by: baude <bbaude@redhat.com>
* Fix help commands to show short and long description.Daniel J Walsh2019-03-07
| | | | | | Cleanup lots of help information to look good when displayed. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* podman port fix outputbaude2019-02-27
| | | | | | | | | | list a portion of the container id and the ports exposed on the same line. when using all, if no ports are exposed, do not list the container id. Also, shorten the container id to a len of 12 like other container commands. Fixes bugzilla #1683734 Signed-off-by: baude <bbaude@redhat.com>
* Better usage synopses for subcommandsEd Santiago2019-02-26
| | | | | | | Conceptually simple: include, where applicable, a brief description of command-line options for each subcommand. Signed-off-by: Ed Santiago <santiago@redhat.com>
* hide --latest on the remote-clientbaude2019-02-22
| | | | | | | | in the case of the remote-client, it was decided to hide the latest flag to avoid confusion for end-users on what the "last" container, volume, or pod are. Signed-off-by: baude <bbaude@redhat.com>
* Improve command line validationbaude2019-02-22
| | | | | | | Use the checkallandlatest function to validate flag usage as part of the cobra command args validation. Signed-off-by: baude <bbaude@redhat.com>
* Fifth chunk of Cobra ExamplesTomSweeneyRedHat2019-02-18
| | | | | | | | | | | Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com> The fifth and final chunk of examples for the Cobra examples in the CLI help output. Also includes a few man page touchups. Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
* show container ports of network namespacebaude2019-02-13
| | | | | | | | | | in cases where a container is part of a network namespace, we should show the network namespace's ports when dealing with ports. this impacts ps, kube, and port. fixes: #846 Signed-off-by: baude <bbaude@redhat.com>
* Don't show global flags except for podman commandDaniel J Walsh2019-02-12
| | | | | | | | | Subcommands should not be showing the global flags. This causes the important information to scroll off the screen. Also fixed a typo on runCommmand (Too many 'm's) Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Separate remote and local commandsbaude2019-02-11
| | | | | | | | In the previous CLI, we had an accurate depiction of commands available for the remote client and those available for the local client. Signed-off-by: baude <bbaude@redhat.com>
* Migrate to cobra CLIbaude2019-02-08
| | | | | | | | We intend to migrate to the cobra cli from urfave/cli because the project is more well maintained. There are also some technical reasons as well which extend into our remote client work. Signed-off-by: baude <bbaude@redhat.com>
* Capatilize all usage and descriptionsDaniel J Walsh2019-02-05
| | | | | | | | | We have no consistancy in out option usages and descritions on whether or not the first letter should be capatalized. This patch forces them all to be capatilized. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Fix podman port -lAdrian Reber2018-10-19
| | | | | | | | | | | | | | | | | | | Running 'podman port -l' on a system without any containers created gives: $ podman port -l panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xf3cef1] goroutine 1 [running]: github.com/containers/libpod/libpod.(*Container).State(0x0, 0x0, 0x0, 0x0) /share/go/src/github.com/containers/libpod/libpod/container.go:658 +0x41 main.portCmd(0xc420094580, 0x0, 0x0) /share/go/src/github.com/containers/libpod/cmd/podman/port.go:118 +0x406 This fixes it by making sure the variable 'containers' is nil and not [<nil>]. Signed-off-by: Adrian Reber <areber@redhat.com>
* Sort all command flagsQi Wang2018-10-11
| | | | Signed-off-by: Qi Wang <qiwan@redhat.com>
* don't print help message for usage errorsValentin Rothberg2018-08-31
| | | | | | | | | | | | | | | | | Don't print potentially verbose help messages in case of usage errors, but print only the usage error followed by a pointer to the command's help. This aligns with Docker. ``` $ podman run -h flag needs an argument: -h See 'podman run --help'. ``` Signed-off-by: Valentin Rothberg <vrothberg@suse.com> Closes: #1379 Approved by: rhatdan
* switch projectatomic to containersDaniel J Walsh2018-08-16
| | | | | | | | | | Need to get some small changes into libpod to pull back into buildah to complete buildah transition. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #1270 Approved by: mheon
* Add missing newline to podman portMatthew Heon2018-05-10
| | | | | | | Signed-off-by: Matthew Heon <mheon@redhat.com> Closes: #741 Approved by: giuseppe
* varlink imagesbaude2018-04-26
| | | | | | | | | | | | | implement varlink image functions for working with libpod with the exception of a couple due to incompletions on the libpod side of things (build). also, created a first pass at a libpodpy package which will stand as a client to working with libpod's varlink methods using python. Signed-off-by: baude <bbaude@redhat.com> Closes: #669 Approved by: baude
* podman portbaude2018-01-23
podman port reports the port mappings per container. it can be used to report the ports ofa single container or latest container or all containers. in the case of a single container, the user can add an option filter for port and protocol. Signed-off-by: baude <bbaude@redhat.com>