248 Commits

Author SHA1 Message Date
88073c56d5 update github.com/spf13/cobra to v1.9.1
And regenerate the completion scripts.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2025-02-17 11:55:45 +01:00
8f5c46c9e6 update completion scripts for cobra v1.8.0
[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-11-06 15:27:07 +01:00
b858c7e7fa update completion scripts for cobra v1.7.0
[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-06 13:40:48 +02:00
b256f5f587 build(deps): bump github.com/spf13/cobra from 1.5.0 to 1.6.0
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Commits](https://github.com/spf13/cobra/compare/v1.5.0...v1.6.0)

---
updated-dependencies:
- dependency-name: github.com/spf13/cobra
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

PH: manually update the completion scripts and fix deprecated function
call.

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-10-12 14:54:19 +02:00
050693b2e7 bump github.com/spf13/cobra from 1.4.0 to 1.5.0
Update cobra to latest version. Remove workaround for podman -h.
Also regenerate the completion scripts.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-06-21 17:17:06 +02:00
03a3fc37fe bump cobra to 1.3.0
This contains some fixes for the shell completion files.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-12-16 15:28:39 +01:00
84da70a0f3 update shell completion scripts
The new cobra v1.2.0 release brings a number of bug fixes for shell
completion scripts. Regenerate the scripts with `make completions`
to sync them with the upstream version, currently we have some custom
ones to avoid some upstream bugs. Because the new cobra version has
all fixes we should use the upstream scripts.
Add a check to CI to ensure we always use the up to date scripts.

[NO TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-07-02 17:49:12 +02:00
9c8277247d Fixes from make codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-04-21 13:16:33 -04:00
6a78fcaa0a Add powershell completions
Add support for generating powershell completion files. This is especially
useful for people using the podman remote client on windows.

[NO TESTS NEEDED]

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-03-29 15:00:09 +02:00
ee8ee651d5 New 'make completions' target
Generate shell completion files for podman and podman-remote
and for all known shells (bash, fish, zsh). Fix Readme file
in completions dir: it suggested running 'make completion',
singular; no such target existed. Since the install target
is plural, I choose to make the new target plural also.

This is intended for use in CI some day, in a check such as:

  (in contrib/cirrus/runner.sh):

    make completions
    SUGGESTION="run 'make completions' and commit all changes" ./hack/tree_status.sh

The goal would be to make sure that any new podman subcommands
or flags are accompanied by their corresponding shell helpers
on all commits.

IT IS NOT POSSIBLE TO ENFORCE THIS NOW. As I understand it,
Cobra is slow to incorporate community PRs, so the podman team
has chosen to sneak in completion files generated by an
unreleased and un-vendored version of Cobra. Running 'make
completions' right now would clobber those and result in
a diminished user experience.

I'm submitting this anyway as a stepping-stone toward that
future day when we can create such a CI hook.

[NO TESTS NEEDED]

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-02-01 13:47:54 -07:00
8c1768e382 Fix fish completion issue if the command is prefixed with a space
Update the completion script like https://github.com/spf13/cobra/pull/1249.

[NO TESTS NEEDED]

Fixes #8829

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-01-24 18:04:48 +01:00
bf5d184325 Fix spelling mistakes
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-09 06:00:04 -05:00
ae3816614d Install the new shell completion logic
Add a new make target (completion) to generate the shell
completion scripts. This will generate the scripts for bash,
zsh and fish for both podman and podman-remote with `podman completion`.
The scripts are put into the completions directory and can be
installed system wide with `sudo make install.completions`.

This commit replaces the current handwritten scripts for bash and zsh.

The `validate.completion` target has been adjusted to make sure nobody
edits these scripts directly.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-11-12 11:40:29 +01:00
980b1e87d4 Switch use of Flags to Options
Want to have man pages match commands, since we have lots of printed
man pages with using Options, we will change the command line to use
Options in --help.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-21 08:37:57 -04:00
571ae9db72 Fix sorting issues in completions
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-15 10:17:52 -04:00
db23e12611 Add support for external container
External containers are containers created outside of Podman.
For example Buildah and CRI-O Containers.

$ buildah from alpine
alpine-working-container
$ buildah run alpine-working-container touch /test
$ podman container exists --external alpine-working-container

$ podman container diff alpine-working-container
C /etc
A /test

Added --external flag to refer to external containers, rather then --storage.

Added --external for podman container exists and modified podman ps to use
--external rather then --storage.  It was felt that --storage would confuse
the user into thinking about changing the storage driver or options.

--storage is still supported through the use of aliases.

Finally podman contianer diff, does not require the --external flag, since it
there is little change of users making the mistake, and would just be a pain
for the user to remember the flag.

podman container exists --external is required because it could fool scripts
that rely on the existance of a Podman container, and there is a potential
for a partial deletion of a container, which could mess up existing users.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-15 09:51:31 -04:00
66798e993a Search repository tags using --list-tags
For fix of BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1684263
Add --list-tags to podman search to return a table the repository tags.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-10-09 11:49:46 -04:00
1492f3c936 --rm option shold conflicts with --restart
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-10-02 21:57:37 +08:00
e18e4f4327 fix missing completion in podman run
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-09-17 21:40:03 +08:00
9c8bc47d8d Fix completions for namespaces
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1873650

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-11 15:57:21 -04:00
fc70360a3b Merge pull request #7576 from openSUSE/manifest-add-extend-flags
Extend the flags of the `manifest add` command
2020-09-10 12:51:21 -04:00
9c67a5f31c Extend bash completion to cover new flags
Ensure the new flags added to `manifest add` are known to bash
completion.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
2020-09-09 12:50:14 +02:00
581afbb86f Show c/storage (Buildah/CRI-O) containers in ps
The `podman ps --all` command will now show containers that
are under the control of other c/storage container systems and
the new `ps --storage` option will show only containers that are
in c/storage but are not controlled by libpod.

In the below examples, the '*working-container' entries were created
by Buildah.

```
podman ps -a
CONTAINER ID  IMAGE                             COMMAND  CREATED       STATUS                   PORTS  NAMES
9257ef8c786c  docker.io/library/busybox:latest  ls /etc  8 hours ago   Exited (0) 8 hours ago          gifted_jang
d302c81856da  docker.io/library/busybox:latest  buildah  30 hours ago  storage                         busybox-working-container
7a5a7b099d33  localhost/tom:latest              ls -alF  30 hours ago  Exited (0) 30 hours ago         hopeful_hellman
01d601fca090  localhost/tom:latest              ls -alf  30 hours ago  Exited (1) 30 hours ago         determined_panini
ee58f429ff26  localhost/tom:latest              buildah  33 hours ago  storage                         alpine-working-container

podman ps --external
CONTAINER ID  IMAGE                             COMMAND  CREATED       STATUS    PORTS  NAMES
d302c81856da  docker.io/library/busybox:latest  buildah  30 hours ago  external         busybox-working-container
ee58f429ff26  localhost/tom:latest              buildah  33 hours ago  external         alpine-working-container

```
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-09 06:10:02 -04:00
3c6603a2f8 Add support for variant when pulling images
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-28 09:36:11 -04:00
f49b98c610 Document override-arch and override-os
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-28 09:35:13 -04:00
8fdc116954 Merge pull request #7372 from giuseppe/add-unified-configuration
podman: add option --cgroup-conf
2020-08-24 09:55:14 -04:00
7ea1864043 Add missing autocomplete
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-08-23 00:22:14 +08:00
d856210ea8 podman: add option --cgroup-conf
it allows to manually tweak the configuration for cgroup v2.

we will expose some of the options in future as single
options (e.g. the new memory knobs), but for now add the more generic
--cgroup-conf mechanism for maximum control on the cgroup
configuration.

OCI specs change: https://github.com/opencontainers/runtime-spec/pull/1040

Requires: https://github.com/containers/crun/pull/459

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-08-21 19:06:05 +02:00
eb9e8fc558 Add support for --connection
* override --url and/or --identity fields from containers.conf
* --connection flag has higher precedence than ActiveService from
containers.conf. Which is set via podman system connection default
* Add newline to error message printed on stderr
* Added --connection to bash completion and documentation
* Updated bindings to query server in case of no path or /

Closes #jira-991
Fixes #7276

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Jhon Honce <jhonce@redhat.com>

Squashed commits to work around CI issue
2020-08-19 08:37:44 -07:00
6979d140f1 Add podman image mount
There are many use cases where you want to just mount an image
without creating a container on it. For example you might want
to just examine the content in an image after you pull it for
security analysys.  Or you might want to just use the executables
on the image without running it in a container.

The image is mounted readonly since we do not want people changing
images.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-28 10:27:44 -04:00
d4d3fbc155 Add --umask flag for create, run
--umask sets the umask inside the container
Defaults to 0022

Co-authored-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Ashley Cui <acui@redhat.com>
2020-07-21 14:22:30 -04:00
9a1543caec Add --tz flag to create, run
--tz flag sets timezone inside container
Can be set to IANA timezone as well as `local` to match host machine

Signed-off-by: Ashley Cui <acui@redhat.com>
2020-07-02 13:30:59 -04:00
1c6c12581c podman untag: error if tag doesn't exist
Throw an error if a specified tag does not exist.  Also make sure that
the user input is normalized as we already do for `podman tag`.

To prevent regressions, add a set of end-to-end and systemd tests.

Last but not least, update the docs and add bash completions.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-24 15:34:46 +02:00
0560a98e0e Add podman network to bash command completions
network commands were not supported in command completions.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-23 15:31:08 -04:00
f61a7f25a8 Add --preservefds to podman run
Add --preservefds to podman run. close https://github.com/containers/libpod/issues/6458

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-06-19 09:40:13 -04:00
fe488b5f11 pod create --replace
Add a `--replace` flag to the `pod create` command.  If another pod with
the same name already exists, it will be replaced and removed.

Adding this flag is motivated by #5485 to make running Podman in systemd
units (or any other scripts/automation) more robust.  In case of a
crash, a pod may not be removed by a sytemd unit anymore.  The
`--replace` flag allows for supporting crashes.

Note that the `--replace` flag does not require the `--name` flag to be
set, so it can be set unconditionally in `podman generate systemd`.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-15 15:55:55 +02:00
402c68b41d pod create: add --infra-conmon-pidfile
Add an `--infra-conmon-pidfile` flag to `podman-pod-create` to write the
infra container's conmon process ID to a specified path.  Several
container sub-commands already support `--conmon-pidfile` which is
especially helpful to allow for systemd to access and track the conmon
processes.  This allows for easily tracking the conmon process of a
pod's infra container.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
cf89bb6711 container-{create,run}: add --pod-id-file
Allow containers to join an existing pod via the `--pod-id-file` which
is already supported by a number of `podman-pod` subcommands.  Also add
tests to make sure it's working and to prevent future regressions.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
7d71d24440 podman-pod{rm,start,stop}: support --pod-id-file
Support the `--pod-id-file` flag in the rm, start and stop pod commands.
This completes the already support flag in pod-create and is another
prerequisite for generating generic systemd unit files for pods.

Also add completions, docs and tests.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-06-11 11:01:13 +02:00
1f8a78747a Add --format to pod inspect
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2020-05-27 09:48:38 +03:00
e704f1362a Added new flags to 'podman generate systemd' to change the unit name prefix
--container-prefix <string> - default 'container'
Systemd unit name prefix for containers

--pod-prefix <string> - default 'pod'
Systemd unit name prefix for pods

--separator <string> - default '-'
Systemd unit name seperator between name/id and prefix

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-05-22 18:38:39 +02:00
087fdda199 Testcase added for network commands
New testcase for network ls --filter and inspect --format
added. Also bash completion options updated.

Signed-off-by: Kunal Kushwaha <kunal.kushwaha@gmail.com>
2020-05-20 02:53:47 +00:00
1c3bd95b81 auto-update: support authfiles
Support using custom authfiles for auto updates by adding a new
`--authfile` flag and passing it down into the backend.

Also do some minor fixes in the help text and the man page.

Fixes: #6159
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-05-12 10:20:48 +02:00
5621f5199d Manifest remove, push
Implements podman manifest remove and podman manifest push.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-05-06 10:54:28 -04:00
1090d4d5d9 manifest annotate
Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-05-05 15:01:32 -04:00
2f3734b143 Add --os to manifest add
Add --os to manifest add for overriding the os field.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-04-24 14:57:56 -04:00
17783dda68 manifest create,add,inspect
Implememts manifest subcommands create, add, inspect.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-04-22 20:05:21 -04:00
e318b09b68 Merge pull request #5620 from cfelder/play-kube-networking
Add support for specifying CNI networks in podman play kube
2020-04-06 18:45:25 +02:00
3449b27cd1 Switch to using --time as opposed to --timeout to better match Docker.
We need to consistently use --time rather then --timeout throughout the code.
Fix locations where timeout defaults are not set correctly as well.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-31 08:50:32 -04:00
4352d58549 Add support for containers.conf
vendor in c/common config pkg for containers.conf

Signed-off-by: Qi Wang qiwan@redhat.com
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-27 14:36:03 -04:00