summaryrefslogtreecommitdiff
path: root/cmd
Commit message (Collapse)AuthorAge
* 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
| * | Fix namespace flag parsing for podman buildPaul Holzinger2020-11-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The namespace options for pid,ipc,uts were completely ignored. The network namespace did not accept `none`. This commit fixes these issues simply by calling `parse.NamespaceOptions` from buildah instead of implementing our own logic. Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
| * | Add podman build --net alias for --networkPaul Holzinger2020-11-12
| |/ | | | | | | | | | | Fixes #8332 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* / Change podman build --pull=true to PullIfMissingTomSweeneyRedHat2020-11-12
|/ | | | | | | | | | | | | | | | | | | | One last tweak to the man page for 'build --pull' and after further testing against Docker, one slight change to the pull policy. First I changed `--pull=false` from PullNever to PullIfMissing. This matches Docker and will pull the image if it's not present rather than erroring. We've the `--pull-never` option if someone wants the pull to not do an actual pull and to error if the image isn't local. Then for the man page, I'd a much bigger change, in the initial PR, I've backed most of that out and just added a tweak. Hopefully this puts this portion of the pull work behind us for a while. Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
* Merge pull request #8251 from baude/networkaliasesOpenShift Merge Robot2020-11-10
|\ | | | | network aliases for container creation
| * network aliases for container creationbaude2020-11-09
| | | | | | | | | | | | | | | | podman can now support adding network aliases when running containers (--network-alias). It requires an updated dnsname plugin as well as an updated ocicni to work properly. Signed-off-by: baude <bbaude@redhat.com>
* | Merge pull request #8143 from aojea/dualOpenShift Merge Robot2020-11-10
|\ \ | | | | | | enable ipv6 networks
| * | enable ipv6 network configuration optionsAntonio Ojea2020-11-10
| |/ | | | | | | | | | | | | | | | | | | | | | | | | enable the ipv6 flag in podman network to be able to create dual-stack networks for containers. This is required to be compatible with docker, where --ipv6 really means dual stack. podman, unlike docker, support IPv6 only containers since 07e3f1bba9674c0cb93a0fa260930bfebbf75728. Signed-off-by: Antonio Ojea <aojea@redhat.com>
* | Merge pull request #8270 from andylibrian/log-driver-option-for-play-kubeOpenShift Merge Robot2020-11-10
|\ \ | |/ |/| Add --log-driver to play kube
| * Add --log-driver to play kubeAndy Librian2020-11-08
| | | | | | | | | | | | addresses #6604 Signed-off-by: Andy Librian <andylibrian@gmail.com>
* | Merge pull request #8276 from Luap99/search-jsonOpenShift Merge Robot2020-11-09
|\ \ | | | | | | Add support for podman search --format json
| * | Add support for podman search --format jsonPaul Holzinger2020-11-09
| |/ | | | | | | | | | | Fixes #8274 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* / rootless container creation settingsbaude2020-11-05
|/ | | | | | | | when running container creation as rootless on the compatibility layer, we need to make sure settings are not being done for memory and memory swappiness. Signed-off-by: baude <bbaude@redhat.com>
* Merge pull request #8166 from rhatdan/unbindableOpenShift Merge Robot2020-11-02
|\ | | | | Allow users to mount with unbindable flag
| * Add better support for unbindable volume mountsDaniel J Walsh2020-11-02
| | | | | | | | | | | | | | | | Allow users to specify unbindable on volume command line Switch internal mounts to rprivate to help prevent leaks. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | Merge pull request #8207 from xordspar0/common-period-quotaOpenShift Merge Robot2020-11-02
|\ \ | | | | | | Centralize cores and period/quota conversion code
| * | Centralize cores and period/quota conversion codeJordan Christiansen2020-10-31
| |/ | | | | | | Signed-off-by: Jordan Christiansen <xordspar0@gmail.com>
* / Match build pull functionality with Docker'sTomSweeneyRedHat2020-10-31
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a continuation of #8189 and #8085. When doing a `docker build` command, if the `--pull` command is not specified or set to `false` the pullOption used is `PullifMissing`. This causes the build to pull the image only if it is not present in local storage. It also will raise an error if the image is not found in the registry (or the registry is down), even if the image is present in local storage. If the `--pull` command IS specified or specified with an argument of `true`, the build will always pull the image from the registries. This uses the pullOption `PullAlways`. It also will raise an error if the image is not found in the registry, even if the image is present in local storage. These changes now brings the pull functionality for `podman build` into line with `docker build`. However, I consider this to be a breaking change. Previously if you did `podman build --pull`, `podman build` or `podman build --pull = true`, then the image would be pulled from the registry if there was not an image in local storage or if the image in the registry was newer than the one in local storage. An error would *NOT* be raised if there was not an image in the registry or the registry was down as long as there was a copy in the local storage. An error would be raised if the image could not be retrieved from both the registry and local storage. This is the PullOption `PullIfNewer`. I believe this also differs from what Buildah does at this time but I'm too beat to chase that down at the moment. Personally I'd like to use the `PullIfNewer` for at least `--pull` and `--pull=true` so that you don't get an error if the registry has a network hiccup and the image is already stored locally. But this differs from Docker. I'd like to post scrum about this at our next stand up to make sure we're all on the same page about the ramifications of this change. Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
* Merge pull request #8201 from QiWang19/search-limitOpenShift Merge Robot2020-10-30
|\ | | | | Remove search limit since pagination support
| * Remove search limit since pagination supportQi Wang2020-10-30
| | | | | | | | | | | | Remove the search limit check since the c/image v5.6.0 supports pagination and can give result over 100 entries. Signed-off-by: Qi Wang <qiwan@redhat.com>
* | Merge pull request #8177 from rhatdan/wrapOpenShift Merge Robot2020-10-30
|\ \ | | | | | | Stop excessive wrapping of errors
| * | Stop excessive wrapping of errorsDaniel J Walsh2020-10-30
| |/ | | | | | | | | | | | | | | | | | | | | | | Most of the builtin golang functions like os.Stat and os.Open report errors including the file system object path. We should not wrap these errors and put the file path in a second time, causing stuttering of errors when they get presented to the user. This patch tries to cleanup a bunch of these errors. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* | Merge pull request #8187 from jwhonce/wip/tableOpenShift Merge Robot2020-10-30
|\ \ | |/ |/| Restore --format table header support
| * Restore --format table header supportJhon Honce2020-10-29
| | | | | | | | Signed-off-by: Jhon Honce <jhonce@redhat.com>
* | Merge pull request #8189 from mheon/further_fix_pull_flagOpenShift Merge Robot2020-10-29
|\ \ | | | | | | Fix the `--pull` flag to `podman build` to match Docker
| * | Fix the `--pull` flag to `podman build` to match DockerMatthew Heon2020-10-29
| | | | | | | | | | | | | | | | | | | | | | | | The behavior should be as follows: Unset, pull if missing by default, obey the `--pull-never` and `--pull-always` flags. Set to false, pull never. Set to true, pull always. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* | | Merge pull request #8186 from Luap99/fix-8184OpenShift Merge Robot2020-10-29
|\ \ \ | |/ / |/| | Create the default root API address path
| * | Create the default root API address pathPaul Holzinger2020-10-29
| |/ | | | | | | | | | | Fixes #8184 Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
* | Merge pull request #8085 from TomSweeneyRedHat/dev/tsweeney/fixpullsOpenShift Merge Robot2020-10-29
|\ \ | | | | | | Fix pull method selection
| * | Fix pull method selectionTomSweeneyRedHat2020-10-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using 'podman build --pull=true', the image was not pulled if the image being pulled was present locally, but a newer version was in the repository. It was only pulled if there was no image in local storage. In addition, the pull-never option was ignored. The line `if flags.Pull{` at line 244 was always returning true negating the default pullPolicy of PullNever. Reworked the algorthim for the selection process. Now PullIfNewer is set to the default, and then we set the pullPolicy appropriately based on the other flags passed in to this routine. As an FYI, logic run in the calling functions ensures that we have only one pull flag in the command. Addresses: #8024 Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
* | | new "image" mount typeValentin Rothberg2020-10-29
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | Add a new "image" mount type to `--mount`. The source of the mount is the name or ID of an image. The destination is the path inside the container. Image mounts further support an optional `rw,readwrite` parameter which if set to "true" will yield the mount writable inside the container. Note that no changes are propagated to the image mount on the host (which in any case is read only). Mounts are overlay mounts. To support read-only overlay mounts, vendor a non-release version of Buildah. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* | Merge pull request #8102 from ashley-cui/inspectOpenShift Merge Robot2020-10-27
|\ \ | | | | | | Add pod, volume, network to inspect package
| * | Add pod, volume, network to inspect packageAshley Cui2020-10-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | podman inspect only had the capabilities to inspect containers and images. if a user wanted to inspect a pod, volume, or network, they would have to use `podman network inspect`, `podman pod inspect` etc. Docker's cli allowed users to inspect both volumes and networks using regular inspect, so this commit gives the user the functionality If the inspect type is not specified using --type, the order of inspection is: containers images volumes networks pods meaning if container that has the same name as an image, podman inspect would return the container inspect. To avoid duplicate code, podman network inspect and podman volume inspect now use the inspect package as well. Podman pod inspect does not because podman pod inspect returns a single json object while podman inspect can return multiple) Signed-off-by: Ashley Cui <acui@redhat.com>
* | | set resources only when specifiedbaude2020-10-27
|/ / | | | | | | | | | | when using the compatibility endpoint to create a container, we should only set certain resources when we are provided a value for them or we result in fields with zero values. Signed-off-by: baude <bbaude@redhat.com>
* | Merge pull request #8094 from rhatdan/cidfileOpenShift Merge Robot2020-10-27
|\ \ | | | | | | The cidfile should be created when the container is created