summaryrefslogtreecommitdiff
path: root/cmd/podman
Commit message (Collapse)AuthorAge
* pass full NetworkMode to ParseNetworkNamespaceKevin Wiesmueller2020-12-07
| | | | | | This should create the correct namespace for NetworkModes like container:containerid Signed-off-by: Kevin Wiesmueller <kwiesmul@redhat.com>
* rewrite podman-cpValentin Rothberg2020-12-04
| | | | | | | | | | | | | | | | | | | | | | | | * Add a new `pkg/copy` to centralize all container-copy related code. * The new code is based on Buildah's `copier` package. * The compat `/archive` endpoints use the new `copy` package. * Update docs and an several new tests. * Includes many fixes, most notably, the look-up of volumes and mounts. Breaking changes: * Podman is now expecting that container-destination paths exist. Before, Podman created the paths if needed. Docker does not do that and I believe Podman should not either as it's a recipe for masking errors. These errors may be user induced (e.g., a path typo), or internal typos (e.g., when the destination may be a mistakenly unmounted volume). Let's keep the magic low for such a security sensitive feature. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Drop default log-level from error to warnDaniel J Walsh2020-12-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our users are missing certain warning messages that would make debugging issues with Podman easier. For example if you do a podman build with a Containerfile that contains the SHELL directive, the Derective is silently ignored. If you run with the log-level warn you get a warning message explainging what happened. $ podman build --no-cache -f /tmp/Containerfile1 /tmp/ STEP 1: FROM ubi8 STEP 2: SHELL ["/bin/bash", "-c"] STEP 3: COMMIT --> 7a207be102a 7a207be102aa8993eceb32802e6ceb9d2603ceed9dee0fee341df63e6300882e $ podman --log-level=warn build --no-cache -f /tmp/Containerfile1 /tmp/ STEP 1: FROM ubi8 STEP 2: SHELL ["/bin/bash", "-c"] STEP 3: COMMIT WARN[0000] SHELL is not supported for OCI image format, [/bin/bash -c] will be ignored. Must use `docker` format --> 7bd96fd25b9 7bd96fd25b9f755d8a045e31187e406cf889dcf3799357ec906e90767613e95f These messages will no longer be lost, when we default to WARNing level. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Merge pull request #8408 from umohnani8/sec-optOpenShift Merge Robot2020-12-03
|\ | | | | Add mask and unmask option to --security-opt
| * Add mask and unmask option to --security-optUrvashi Mohnani2020-12-02
| | | | | | | | | | | | | | | | | | Add the mask and unmask option to the --security-opt flag to allow users to specify paths to mask and unmask in the container. If unmask=ALL, this will unmask all the paths we mask by default. Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
* | Merge pull request #8392 from jwhonce/wip/reportOpenShift Merge Robot2020-12-02
|\ \ | | | | | | Fix `podman images...` missing headers in table templates
| * | Fix `podman images...` missing headers in table templatesJhon Honce2020-12-02
| | | | | | | | | | | | Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | | add commas between mount optionsbaude2020-12-02
|/ / | | | | | | | | | | when formatting mount options into a string for the compat container create, the options need to be comma delimited. Signed-off-by: baude <bbaude@redhat.com>
* | Merge pull request #8549 from Luap99/network-id-supportOpenShift Merge Robot2020-12-02
|\ \ | | | | | | Add support for network ids
| * | Add support for network idsPaul Holzinger2020-12-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The network ID is not stored. It is just the sha256 hash from the network name. There is a risk of a potential hash collision. However it's very unlikely and even if we hit this it will complain that more than network with this ID exists. The main benefit is that the compat api can have proper network ID support. Also this adds the support for `podman network ls --format "{{.ID}}"` and `--filter id=<ID>`. It also ensures that we can do network rm <ID> and network inspect <ID>. Since we use a hash this commit is backwards compatible even for already existing networks. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | | Fix shell completion for ps --filter ancestorPaul Holzinger2020-12-02
|/ / | | | | | | | | | | | | The `ancestor` option was missing an equal sign. Therefore the completion did not work as expected. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | Add podman network create option for bridge mtuAnders F Björklund2020-12-01
| | | | | | | | Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
* | Merge pull request #8488 from rhatdan/platformOpenShift Merge Robot2020-12-01
|\ \ | | | | | | Add support for --platform
| * | Add support for --platformDaniel J Walsh2020-11-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For docker compatibility we need to support --platform flag. podman create --platform podman run --platform podman pull --platform Since we have --override-os and --override-arch already this can be done just by modifying the client to split the --platform call into os and arch and then pass those options to the server side. Fixes: https://github.com/containers/podman/issues/6244 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | | Merge pull request #8505 from Luap99/network-labelsOpenShift Merge Robot2020-12-01
|\ \ \ | | | | | | | | podman network label support
| * | | podman network label supportPaul Holzinger2020-11-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add label support for podman network create. Use the `args` field in the cni config file to store the podman labels. Use `podman_labels` as key name and store the labels as map[string]string. For reference: https://github.com/containernetworking/cni/blob/master/CONVENTIONS.md#args-in-network-config https://github.com/containernetworking/cni/blob/spec-v0.4.0/SPEC.md#network-configuration Example snippet: ``` ... "args": { "podman_labels": { "key1":"value1", "key2":"value2" } } ... ``` Make podman network list support several filters. Supported filters are name, plugin, driver and label. Filters with different keys work exclusive. Several label filters work exclusive and the other filter keys are working inclusive. Also adjust the compat api to support labels in network create and list. Breaking changes: - podman network ls -f shortform is used for --filter instead --format This matches docker and other podman commands (container ps, volume ps) - libpod network list endpoint filter parameter is removed. Instead the filters paramter should be used as json encoded map[string][]string. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | | | Merge pull request #8534 from Luap99/revert-Luap99-cobra-vendorOpenShift Merge Robot2020-12-01
|\ \ \ \ | | | | | | | | | | Revert the custom cobra vendor
| * | | | Revert the custom cobra vendorPaul Holzinger2020-12-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Vendor in the latest cobra release v1.1.1 This will hurt the completion experience but is required for proper packaging, see: #8528. The best solution is to keep the current scripts since they work fine with cobra v1.1.1. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | | | | compat create should use bindingsbaude2020-12-01
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the volumes provided is seemingly useless representing what volumes should be added to a container. instead, the host config bindings should be used as they acurately describe the src/dest and options for bindings. Signed-off-by: baude <bbaude@redhat.com>
* | | | Merge pull request #8400 from rhatdan/varlinkOpenShift Merge Robot2020-12-01
|\ \ \ \ | | | | | | | | | | Remove varlink support from podman
| * | | | Remove varlink support from PodmanDaniel J Walsh2020-11-26
| | |/ / | |/| | | | | | | | | | Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | | | 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