summaryrefslogtreecommitdiff
path: root/cmd
Commit message (Collapse)AuthorAge
* Merge pull request #8427 from rhatdan/psOpenShift Merge Robot2020-12-01
|\ | | | | Handle ps container created field as a time.Time
| * Handle ps container created field as a time.TimeDaniel J Walsh2020-11-20
| | | | | | | | | | | | | | | | | | | | | | | | | | In the current code we were translating the created time from a time.Time to a unix epoch, this was leading to a loss of precession, and some unexpected results where the sorting order of containers was misordered because of the precession loss. If we pass around created as time.Time, we do not loose the precission. Fixes: https://github.com/containers/podman/issues/8414 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | Revert "Allow multiple --network flags for podman run/create"Luap992020-11-30
| | | | | | | | | | | | | | | | | | As described in issue #8507 this commit contains a breaking change which is not wanted in v2.2. We can discuss later if we want this in 3.0 or not. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | Do not validate the volume source path in specgenPaul Holzinger2020-11-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The volume src path should not be validated in specgen since the remote client also uses that part and the path must only exists on the server. This now fails later and only on the server and not the client. I don't think I can add a test for this because the CI runs server and client always on the same vm. Fixes #8473 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | [CI:DOCS] fix misleading save/load usageQi Wang2020-11-24
| | | | | | | | | | | | Fix the container archive description in podman save/load docs that may lead to misusing the save/load instead of import/export for containers. Signed-off-by: Qi Wang <qiwan@redhat.com>
* | Merge pull request #8461 from Luap99/top-shell-completionOpenShift Merge Robot2020-11-24
|\ \ | | | | | | Implement shell completion for podman top
| * | Implement shell completion for podman topPaul Holzinger2020-11-23
| | | | | | | | | | | | Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | | Refactor compat container create endpointJhon Honce2020-11-23
|/ / | | | | | | | | | | | | | | | | | | | | | | * Make endpoint compatibile with docker-py network expectations * Update specgen helper when called from compat endpoint * Update godoc on types * Add test for network/container create using docker-py method * Add syslog logging when DEBUG=1 for tests Fixes #8361 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | Merge pull request #8416 from Luap99/shell-completionOpenShift Merge Robot2020-11-23
|\ \ | | | | | | more shell completion improvements
| * | shell completions: remove usage of ShellCompDirectiveErrorPaul Holzinger2020-11-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | If we return `ShellCompDirectiveError` to the shell the shell will provide path completion. In none of that cases we want path completion so it will be better to return `ShellCompDirectiveNoFileComp` instead and log the error in case we need it. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
| * | more shell completion improvementsPaul Holzinger2020-11-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * podman image ls --filter * podman network ls --filter * podman volume ls --filter * podman network connect/disconnect * podman events --filter Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | | Merge pull request #8440 from psakar/fix-8433OpenShift Merge Robot2020-11-23
|\ \ \ | | | | | | | | APIv2 - wrong command and args for created container
| * | | APIv2 - create container sets wrong entrypointPetr Sakař2020-11-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | use nil instead of empty string as default value for entrypoint in ContainerCLIOpts - empty string signifies user wants to override image entry point value Signed-off-by: Petr Sakař <petr.sakar@chare.eu>
* | | | Merge pull request #8446 from Luap99/podman-container-psOpenShift Merge Robot2020-11-23
|\ \ \ \ | | | | | | | | | | Add podman container ps command
| * | | | Add podman container ps commandPaul Holzinger2020-11-23
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This command exists in docker and is also in our documentation. Also remove mentions of `podman ls` or `podman list`. These commands do not exists in podman or docker. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | | | Merge pull request #8263 from rhatdan/restartOpenShift Merge Robot2020-11-23
|\ \ \ \ | | | | | | | | | | Allow containers to --restart on-failure with --rm
| * | | | Allow containers to --restart on-failure with --rmDaniel J Walsh2020-11-20
| | |_|/ | |/| | | | | | | | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | | | Merge pull request #8449 from vrothberg/top-docsOpenShift Merge Robot2020-11-23
|\ \ \ \ | |_|_|/ |/| | | [CI:DOCS] clarify ps(1) fallback of `podman top`
| * | | clarify ps(1) fallback of `podman top`Valentin Rothberg2020-11-23
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | Podman top falls back to executing ps(1) inside the container in the presence of ps-specific flags. Clarify that a bit more to help users resolve issues when, for instance, ps(1) isn't installed in the container. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* | | Merge pull request #8436 from Luap99/remote-completionOpenShift Merge Robot2020-11-23
|\ \ \ | |/ / |/| | Enable remote shell completion without a running endpoint
| * | Enable remote shell completion without a running endpointPaul Holzinger2020-11-20
| |/ | | | | | | | | | | | | | | | | | | The problem is that we always unconditionally setup up the `ContainerEngine/ImageEngine`. This requires an running endpoint. Most completions (e.g. flag names) do not need them and should not fail. This commit makes sure we only setup the engines as needed in the completions. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | Merge pull request #8410 from Luap99/fix-multiple-networksOpenShift Merge Robot2020-11-21
|\ \ | | | | | | Allow multiple --network flags for podman run/create
| * | Allow multiple --network flags for podman run/createPaul Holzinger2020-11-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We allow a container to be connected to several cni networks but only if they are listed comma sperated. This is not intuitive for users especially since the flag parsing allows multiple string flags but only would take the last value. see: spf13/pflag#72 Also get rid of the extra parsing logic for pods. The invalid options are already handled by `pkg/specgen`. A test is added to prevent a future regression. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | | Specify what the replace flag replaces in help textBenjamin Porter2020-11-20
| |/ |/| | | | | | | | | | | | | | | | | The word "name" appears to have been missed in the help output for: podman pod create --help This patch fixes that Signed-off-by: Benjamin Porter <FreedomBen@users.noreply.github.com>
* | Merge pull request #8285 from rhatdan/containers.confOpenShift Merge Robot2020-11-20
|\ \ | | | | | | Document containers.conf settings for remote connections
| * | Document containers.conf settings for remote connectionsDaniel J Walsh2020-11-19
| |/ | | | | | | | | | | | | | | | | | | Currently we don't document which end of the podman-remote client server operations uses the containers.conf. This PR begins documenting this and then testing to make sure the defaults follow the rules. Fixes: https://github.com/containers/podman/issues/7657 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | Merge pull request #8404 from rhatdan/rmOpenShift Merge Robot2020-11-20
|\ \ | |/ |/| Add alias for podman network rm -> remove
| * Add alias for podman network rm -> removeDaniel J Walsh2020-11-19
| | | | | | | | | | | | | | | | docker network remove exists and is alias to docker network rm. Bug for bug compatible. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | Merge pull request #8398 from Luap99/ps-filter-completionsOpenShift Merge Robot2020-11-19
|\ \ | | | | | | Shell completion for podman ps and podman pod ps --filter
| * | Shell completion for podman ps and podman pod ps --filterPaul Holzinger2020-11-19
| |/ | | | | | | | | | | | | | | | | | | | | Add all available filter options for `podman ps` and `podman pod ps` to the completions. Refactor the code a bit to make it easier to handle key value pairs in completions. The `completeKeyValues` function helps to reduce code duplication. Also make use of the new filter logic in the completions. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | Merge pull request #8391 from baude/networkconnectdisconnectOpenShift Merge Robot2020-11-19
|\ \ | |/ |/| add network connect|disconnect compat endpoints
| * add network connect|disconnect compat endpointsbaude2020-11-19
| | | | | | | | | | | | | | | | | | | | | | this enables the ability to connect and disconnect a container from a given network. it is only for the compatibility layer. some code had to be refactored to avoid circular imports. additionally, tests are being deferred temporarily due to some incompatibility/bug in either docker-py or our stack. Signed-off-by: baude <bbaude@redhat.com>
* | Merge pull request #8376 from Luap99/podman-filtersOpenShift Merge Robot2020-11-18
|\ \ | |/ |/| Align the podman ps --filter behavior with docker
| * Align the podman ps --filter behavior with dockerPaul Holzinger2020-11-18
| | | | | | | | | | | | | | | | | | | | All of our filters worked exclusive resulting in `--filter status=created --filter status=exited` to return nothing. In docker filters with the same key work inclusive with the only exception being `label` which is exclusive. Filters with different keys always work exclusive. This PR aims to match the docker behavior with podman. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | Merge pull request #8382 from dbaker-rh/helppageOpenShift Merge Robot2020-11-18
|\ \ | | | | | | [CI:DOCS] Fix example for manifest push
| * | Fix example for manifest pushDave Baker2020-11-17
| | | | | | | | | | | | Signed-off-by: Dave Baker <dbaker@redhat.com>
* | | Merge pull request #8378 from jwhonce/issues/8366OpenShift Merge Robot2020-11-18
|\ \ \ | | | | | | | | Swap out json-iterator for golang default
| * | | Swap out json-iterator for golang defaultJhon Honce2020-11-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | json-iterator library failed to pretty print json for all inspection types. Fixes #8366 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | | | Merge pull request #8355 from baude/compatnetworkconnectdisconnectOpenShift Merge Robot2020-11-17
|\ \ \ \ | | | | | | | | | | add network connect|disconnect compat endpoints
| * | | | add network connect|disconnect compat endpointsbaude2020-11-17
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this enables the ability to connect and disconnect a container from a given network. it is only for the compatibility layer. some code had to be refactored to avoid circular imports. additionally, tests are being deferred temporarily due to some incompatibility/bug in either docker-py or our stack. Signed-off-by: baude <bbaude@redhat.com>
* | | | Merge pull request #8363 from AlbanBedel/play-kube-create-onlyOpenShift Merge Robot2020-11-17
|\ \ \ \ | |_|/ / |/| | | Add an option to control if play kube should start the pod
| * | | Add an option to control if play kube should start the podAlban Bedel2020-11-17
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Having play kube start the pod is not always appropriate, one might for example like to have the pod running as a set of systemd services. Add a `start` option to the command line and API to control if the pod should be started or not; it defaults to true for backward compatibility. Signed-off-by: Alban Bedel <albeu@free.fr>
* / / Fix missing headers in `network ls`Jhon Honce2020-11-17
|/ / | | | | | | Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | Remove some more excessive wrapping and stutteringDaniel J Walsh2020-11-17
| | | | | | | | | | | | | | | | | | | | Stop over wrapping API Calls The API calls will return an appropriate error, and this wrapping just makes the error message look like it is stuttering and a big mess. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | Merge pull request #8346 from Luap99/shell-completionOpenShift Merge Robot2020-11-17
|\ \ | |/ |/| Improve the shell completion api
| * Improve the shell completion apiPaul Holzinger2020-11-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One main advantage of the new shell completion logic is that we can easly parse flags and adjust based on the given flags the suggestions. For example some commands accept the `--latest` flag only if no arguments are given. This commit implements this logic in a simple maintainable way since it reuses the already existing `Args` function in the cmd struct. I also refactored the `getXXX` function to match based on the namei/id which could speed up the shell completion with many containers, images, etc... I also added the degraded status to the valid pod status filters which was implemented in #8081. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | Add support for volume ls --filter label=key=valueAnders F Björklund2020-11-14
|/ | | | | | | | | | | | Supposed to be able to search for labels with a given value. Previously it meant searching for label key and label value: --filter label=key --filter label=value Add some documentation and integration tests for it as well. Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
* Merge pull request #6442 from Luap99/podman-autocompleteOpenShift Merge Robot2020-11-13
|\ | | | | Shell completion
| * Add shell completion with cobraPaul Holzinger2020-11-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow automatic generation for shell completion scripts with the internal cobra functions (requires v1.0.0+). This should replace the handwritten completion scripts and even adds support for fish. With this approach it is less likley that completions and code are out of sync. We can now create the scripts with - podman completion bash - podman completion zsh - podman completion fish To test the completion run: source <(podman completion bash) The same works for podman-remote and podman --remote and it will complete your remote containers/images with the correct endpoints values from --url/--connection. The completion logic is written in go and provided by the cobra library. The completion functions lives in `cmd/podman/completion/completion.go`. The unit test at cmd/podman/shell_completion_test.go checks if each command and flag has an autocompletion function set. This prevents that commands and flags have no shell completion set. This commit does not replace the current autocompletion scripts. Closes #6440 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | Merge pull request #8326 from Luap99/fix-build-namespaceOpenShift Merge Robot2020-11-13
|\ \ | | | | | | Fix namespace flag parsing for podman build