summaryrefslogtreecommitdiff
path: root/cmd/podman
Commit message (Collapse)AuthorAge
* Return error in podman system service if URI scheme is not unix/tcpBoaz Shuster2022-10-06
| | | | Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
* Merge pull request #15846 from jakecorrenti/pod-logs-latestOpenShift Merge Robot2022-10-03
|\ | | | | `podman pod logs -l` no longer panics
| * `podman pod logs -l` no longer panicsJake Correnti2022-09-29
| | | | | | | | | | | | | | Fixed issue where executing the command `podman pod logs -l` would panic because it was indexing into an empty arguments array. Signed-off-by: Jake Correnti <jcorrenti13@gmail.com>
* | cmd/podman: add support for checkpoint imagesRadostin Stoyanov2022-09-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch extends the podman run command with support for checkpoint images. When `podman run` is invoked with an image that contains a checkpoint, it would restore the container from that checkpoint. Example: podman run -d --name looper busybox /bin/sh -c \ 'i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done' podman container checkpoint --create-image checkpoint-image-1 looper podman run checkpoint-image-1 Signed-off-by: Radostin Stoyanov <radostin@redhat.com>
* | restore: make IsCheckpointImage reusableRadostin Stoyanov2022-09-29
| | | | | | | | | | | | | | | | | | | | Podman allows to store a container checkpoints as an images. This patch makes the check that is used to recognise such checkpoint images reusable by moving it in utils. This functionality will be reused in a subsequent patch to extend the `podman run` command with support for checkpoint images. Signed-off-by: Radostin Stoyanov <radostin@redhat.com>
* | Merge pull request #15916 from ashley-cui/machstartingOpenShift Merge Robot2022-09-27
|\ \ | | | | | | Fix machine starting state
| * | Fix machine starting stateAshley Cui2022-09-23
| | | | | | | | | | | | | | | | | | | | | | | | Machine starting now is correctly displayed on podman machine list --format json [NO NEW TESTS NEEDED] Signed-off-by: Ashley Cui <acui@redhat.com>
* | | podman machine ssh handlingCharlie Doern2022-09-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | add the key used in newly initialized machines to the user's known_hosts file. This ensures that golang will be able to ssh into the machine using podman-remote. Also, remove the /dev/null redirection for podman machine ssh's known_hosts file. resolves #15347 Signed-off-by: Charlie Doern <cdoern@redhat.com> Signed-off-by: cdoern <cbdoer23@g.holycross.edu>
* | | Merge pull request #15900 from rhatdan/VENDOROpenShift Merge Robot2022-09-23
|\ \ \ | | | | | | | | Update vendor of containers(image, common, buildah, storage)
| * | | Fixup Buildah mergeEd Santiago2022-09-23
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes since 2022-09-09: - man page: add --skip-unused-stages (buildah 4249) - man page: bring in new Note for --cache-ttl (4248) - system tests: de-stutter (4205) - (internal): in skip() applier: escape asterisk, otherwise the "bud with --dns* flags" sed expression never applies. Signed-off-by: Ed Santiago <santiago@redhat.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* / / Add --pretty to podman secret inspectAshley Cui2022-09-22
|/ / | | | | | | | | | | Pretty-print podman secret inspect output in a human-readable format Signed-off-by: Ashley Cui <acui@redhat.com>
* | Merge pull request #15870 from idleroamer/podman-saveOpenShift Merge Robot2022-09-22
|\ \ | | | | | | podman-save: Add signature-policy flag
| * | cli: Add signature-policy flag to podman save😎Mostafa Emami2022-09-21
| | | | | | | | | | | | | | | | | | | | | | | | Allow overwrite of the signature-policy file by passing signature-policy flag to podman save command Closes: https://github.com/containers/podman/issues/15869 Signed-off-by: 😎Mostafa Emami <mustafaemami@gmail.com>
* | | Merge pull request #15871 from cevich/replace_ioutilOpenShift Merge Robot2022-09-21
|\ \ \ | | | | | | | | Replace deprecated ioutil
| * | | Replace deprecated ioutilChris Evich2022-09-20
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Package `io/ioutil` was deprecated in golang 1.16, preventing podman from building under Fedora 37. Fortunately, functionality identical replacements are provided by the packages `io` and `os`. Replace all usage of all `io/ioutil` symbols with appropriate substitutions according to the golang docs. Signed-off-by: Chris Evich <cevich@redhat.com>
* | | Merge pull request #15842 from ashley-cui/seclabelsOpenShift Merge Robot2022-09-21
|\ \ \ | |/ / |/| | Add labels to secrets
| * | Add labels to secretsAshley Cui2022-09-20
| | | | | | | | | | | | | | | | | | | | | Add --label/-l label flag to secret create, and show labels when inspecting secrets. Also allow labeling secrets via libpod/compat API. Signed-off-by: Ashley Cui <acui@redhat.com>
* | | Merge pull request #15072 from rhatdan/contextOpenShift Merge Robot2022-09-19
|\ \ \ | |_|/ |/| | Add support for podman context as alias to podman system connection
| * | Add support for podman context as alias to podman system connectionDaniel J Walsh2022-09-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Alias podman --context -> podman --connection podman context use -> podman system connection default podman context rm -> podman system connection rm podman context create -> podman system connection add podman context ls ->podman system connection ls podman context inspect ->podman system connection ls --json (For specified connections) Podman context is a hidden command, but can be used for existing scripts that assume Docker under the covers. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | | Default to --dns-option to match Docker and BuildahDaniel J Walsh2022-09-16
|/ / | | | | | | | | | | [NO NEW TESTS NEEDED] Existing tests cover this. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | podman version: use report.Formatter over TemplatePaul Holzinger2022-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the podman command --format output code uses a mix of report.Formatter and report.Template. I patched report.Formatter to correctly handle newlines[1]. Since we cannot fix this with report.Template we have to migrate all users to report.Formatter. This ensures consistent behavior for all commands. This change does not change the output. [1] https://github.com/containers/common/pull/1146 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | podman machine info: use report.Formatter over TemplatePaul Holzinger2022-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the podman command --format output code uses a mix of report.Formatter and report.Template. I patched report.Formatter to correctly handle newlines[1]. Since we cannot fix this with report.Template we have to migrate all users to report.Formatter. This ensures consistent behavior for all commands. This change does not change the output. [1] https://github.com/containers/common/pull/1146 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | podman info: use report.Formatter over TemplatePaul Holzinger2022-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the podman command --format output code uses a mix of report.Formatter and report.Template. I patched report.Formatter to correctly handle newlines[1]. Since we cannot fix this with report.Template we have to migrate all users to report.Formatter. This ensures consistent behavior for all commands. This change does not change the output. [1] https://github.com/containers/common/pull/1146 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | podman inspect return exit code > 0 on print errorPaul Holzinger2022-09-13
| | | | | | | | | | | | | | | | Unlikely to happen but when there is an error printing the data to stdout (either as json or go template) we should not just log it and exit with 0. Instead return a proper error and exit with 125. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | podman inspect: use report.Formatter over TemplatePaul Holzinger2022-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the podman command --format output code uses a mix of report.Formatter and report.Template. I patched report.Formatter to correctly handle newlines[1]. Since we cannot fix this with report.Template we have to migrate all users to report.Formatter. This ensures consistent behavior for all commands. This change does not change the output, we can add a new test for the newline bug when the common PR is vendored in. [1] https://github.com/containers/common/pull/1146 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | podman secret inspect: use report.Formatter over TemplatePaul Holzinger2022-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the podman command --format output code uses a mix of report.Formatter and report.Template. I patched report.Formatter to correctly handle newlines[1]. Since we cannot fix this with report.Template we have to migrate all users to report.Formatter. This ensures consistent behavior for all commands. This change does not change the output, we can add a new test for the newline bug when the common PR is vendored in. [1] https://github.com/containers/common/pull/1146 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | podman secret ls: use report.Formatter over TemplatePaul Holzinger2022-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the podman command --format output code uses a mix of report.Formatter and report.Template. I patched report.Formatter to correctly handle newlines[1]. Since we cannot fix this with report.Template we have to migrate all users to report.Formatter. This ensures consistent behavior for all commands. This change does not change the output, we can add a new test for the newline bug when the common PR is vendored in. [1] https://github.com/containers/common/pull/1146 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | podman network ls: use report.Formatter over TemplatePaul Holzinger2022-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the podman command --format output code uses a mix of report.Formatter and report.Template. I patched report.Formatter to correctly handle newlines[1]. Since we cannot fix this with report.Template we have to migrate all users to report.Formatter. This ensures consistent behavior for all commands. This change does not change the output, we can add a new test for the newline bug when the common PR is vendored in. [1] https://github.com/containers/common/pull/1146 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | podman volume ls: use report.Formatter over TemplatePaul Holzinger2022-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the podman command --format output code uses a mix of report.Formatter and report.Template. I patched report.Formatter to correctly handle newlines[1]. Since we cannot fix this with report.Template we have to migrate all users to report.Formatter. This ensures consistent behavior for all commands. This change does not change the output, we can add a new test for the newline bug when the common PR is vendored in. Also fixa bug since the table format is expected to print headers as well. [1] https://github.com/containers/common/pull/1146 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | podman machine inspect: use report.Formatter over TemplatePaul Holzinger2022-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the podman command --format output code uses a mix of report.Formatter and report.Template. I patched report.Formatter to correctly handle newlines[1]. Since we cannot fix this with report.Template we have to migrate all users to report.Formatter. This ensures consistent behavior for all commands. This change does not change the output, we can add a new test for the newline bug when the common PR is vendored in. Also fix a bug where a invlaid template would not cause a exit code > 0, see the added test case. [1] https://github.com/containers/common/pull/1146 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | podman machine ls: use report.Formatter over TemplatePaul Holzinger2022-09-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the podman command --format output code uses a mix of report.Formatter and report.Template. I patched report.Formatter to correctly handle newlines[1]. Since we cannot fix this with report.Template we have to migrate all users to report.Formatter. This ensures consistent behavior for all commands. This change does not change the output, we can add a new test for the newline bug when the common PR is vendored in. [1] https://github.com/containers/common/pull/1146 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* | podman auto-update: use report.Formatter over TemplatePaul Holzinger2022-09-13
|/ | | | | | | | | | | | | | | | Currently the podman command --format output code uses a mix of report.Formatter and report.Template. I patched report.Formatter to correctly handle newlines[1]. Since we cannot fix this with report.Template we have to migrate all users to report.Formatter. This ensures consistent behavior for all commands. This change does not change the output, we can add a new test for the newline bug when the common PR is vendored in. [1] https://github.com/containers/common/pull/1146 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* podman events --format: fix duplicated newlinePaul Holzinger2022-09-12
| | | | | | | The --format changes caused a duplicated newline. PR #15678 should have a test for this. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* fix race where podman events exits to earlyPaul Holzinger2022-09-12
| | | | | | | In order to display all events we have to read until the event channel is closed. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* event backend none: return an error when reading eventsPaul Holzinger2022-09-12
| | | | | | | | | podman --events-backend none events should return with an error since it will never be able to actually list events. Fixes part three of #15688 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* Fix stuttersDaniel J Walsh2022-09-10
| | | | | | | | | | | | | | Podman adds an Error: to every error message. So starting an error message with "error" ends up being reported to the user as Error: error ... This patch removes the stutter. Also ioutil.ReadFile errors report the Path, so wrapping the err message with the path causes a stutter. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Merge pull request #15687 from vrothberg/RUN-1639OpenShift Merge Robot2022-09-09
|\ | | | | health check: add on-failure actions
| * health check: add on-failure actionsValentin Rothberg2022-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For systems that have extreme robustness requirements (edge devices, particularly those in difficult to access environments), it is important that applications continue running in all circumstances. When the application fails, Podman must restart it automatically to provide this robustness. Otherwise, these devices may require customer IT to physically gain access to restart, which can be prohibitively difficult. Add a new `--on-failure` flag that supports four actions: - **none**: Take no action. - **kill**: Kill the container. - **restart**: Restart the container. Do not combine the `restart` action with the `--restart` flag. When running inside of a systemd unit, consider using the `kill` or `stop` action instead to make use of systemd's restart policy. - **stop**: Stop the container. To remain backwards compatible, **none** is the default action. Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
* | Merge pull request #15658 from rhatdan/configOpenShift Merge Robot2022-09-09
|\ \ | |/ |/| Add --config for Docker compatibility
| * Add --config for Docker compatibilityDaniel J Walsh2022-09-08
| | | | | | | | | | | | Fixes: https://github.com/containers/podman/issues/14767 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | fix podman pod inspect to support multiple podsPaul Holzinger2022-09-08
|/ | | | | | | | | | | | | | | | | Just like the other inspect commands `podman pod inspect p1 p2` should return the json for both. To correctly implement this we follow the container inspect logic, this allows use to reuse the global inspect command. Note: To not break the existing single pod output format for podman pod inspect I added a pod-legacy inspect type. This is only used to make sure we will print the pod as single json and not an array like for the other commands. We cannot use the pod type since podman inspect --type pod did return an array and we should not break that as well. Fixes #15674 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* proper --debug/-D flag supportPaul Holzinger2022-09-07
| | | | | | | | | | | --debug should not be a global flag, you can only use this as podman --debug never podman ps --debug. This matches docker and allows us to add the shorthand "D" since they now no longer conflict. Fixes changes from commit 2d30b4dee596 which claims to add -D but never did. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* Merge pull request #15634 from bbalp/update-system-reset-warning-messageOpenShift Merge Robot2022-09-07
|\ | | | | Update system reset warning message regarding deletion of volumes
| * Update system reset warning message to warn against deletion of all volumesBarnabé BALP2022-09-05
| | | | | | Signed-off-by: Barnabé BALP <contact@barnabebalp.fr>
* | Merge pull request #15644 from Luap99/event-formatOpenShift Merge Robot2022-09-06
|\ \ | | | | | | fix podman events with custom format
| * | fix podman events with custom formatPaul Holzinger2022-09-06
| |/ | | | | | | | | | | | | podman events --format {{.ID}} was not working since the template was converted to a range but we only render each event individually. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
* / Add generate systemd -e/--env optionToshiki Sonoda2022-09-06
|/ | | | | | | | -e/--env option sets environment variables to the systemd unit files. Fixes: #15523 Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
* implement podman updateCharlie Doern2022-09-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | podman update allows users to change the cgroup configuration of an existing container using the already defined resource limits flags from podman create/run. The supported flags in crun are: this command is also now supported in the libpod api via the /libpod/containers/<CID>/update endpoint where the resource limits are passed inthe request body and follow the OCI resource spec format –memory –cpus –cpuset-cpus –cpuset-mems –memory-swap –memory-reservation –cpu-shares –cpu-quota –cpu-period –blkio-weight –cpu-rt-period –cpu-rt-runtime -device-read-bps -device-write-bps -device-read-iops -device-write-iops -memory-swappiness -blkio-weight-device resolves #15067 Signed-off-by: Charlie Doern <cdoern@redhat.com>
* Allow to override default username via command lineArthur Sengileyev2022-08-30
| | | | Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
* service: make move to sub-cgroup non fatalGiuseppe Scrivano2022-08-26
| | | | | | | | | | | | | if we are running in a container in the root cgroup, Podman tries to move itself to a sub-cgroup. This could be a problem in a setup where the cgroups are not writeable, so just log a debug message and continue, since anyway it is a best-effort operation. Closes: https://github.com/containers/podman/issues/15498 [NO NEW TESTS NEEDED] Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>