Commit Graph

7305 Commits

Author SHA1 Message Date
Valentin Rothberg 09dc701097 podman rmi: refactor logic
While this commit was initially meant to fix #5847, it has turned into a
bigger refactoring which I did not manage to break into smaller pieces:

 * Fix #5847 by refactoring the image-removal logic.

 * Make the api handler for image-removal use the ABI code. This way,
   both (i.e., ABI and Tunnel) end up using the same code.  Achieving
   this code share required to move some code around to prevent circular
   dependencies.

 * Everything in pkg/api (excluding pkg/api/types) must now only be
   accessed from code using `ABISupport`.

 * Avoid imports from entities on handlers to prevent circular
   dependencies.

 * Move `podman system service` logic into `cmd` to prevent circular
   dependencies - it depends on pkg/api.

 * Also remove the build header from infra/abi files.  It will otherwise
   confuse swagger and other tools; errors we cannot fix as go doesn't
   expose a build-tag env variable.

Fixes: #5847
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-04-21 08:12:25 +02:00
OpenShift Merge Robot 89276a5f92
Merge pull request #5883 from abitrolly/patch-3
Return labes in API (fixes #5882)
2020-04-20 20:18:48 -04:00
OpenShift Merge Robot b771467224
Merge pull request #5862 from rhatdan/v2
Fix up handling of image data as well as setting Linux Capabilties correctly
2020-04-20 17:19:32 -04:00
OpenShift Merge Robot 1e9b3e7500
Merge pull request #5899 from jwhonce/wip/tree
V2 podman image tree
2020-04-20 16:37:38 -04:00
OpenShift Merge Robot 37365b166d
Merge pull request #5901 from jwhonce/wip/service
V2 Remove existing unix domain socket on startup
2020-04-20 16:17:42 -04:00
OpenShift Merge Robot 354088a94b
Merge pull request #5889 from giuseppe/rootless-fd-join
rootless: move join namespace inside child process
2020-04-20 16:08:39 -04:00
Daniel J Walsh b35a0d0cd2
Fix podman inspect to accept -l and -s fields
Podman inspect has a breaking change in that it dropped
--latest and --size options.

This PR adds these back.  Lots of tests rely on
podman inspect -l.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-20 15:52:46 -04:00
Daniel J Walsh eb101936e6
Handle Linux Capabilities correctly
If user sets capabilities list we need handle minimal capabilities.

Also handle seccomp-policy being passed in.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-20 15:50:46 -04:00
Daniel J Walsh a2ad5bb9e1
Add functions to return image informations
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-20 15:50:46 -04:00
OpenShift Merge Robot 5928e8fe80
Merge pull request #5896 from giuseppe/fix-cgroup-set
common: setting cgroup resources correctly
2020-04-20 15:50:02 -04:00
OpenShift Merge Robot 80355b168c
Merge pull request #5897 from jwhonce/wip/diff
V2 Fix --latest for podman diff commands
2020-04-20 15:23:21 -04:00
Jhon Honce 405e39b0d6 V2 Rmove existing unix domain socket on startup
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-20 11:52:47 -07:00
OpenShift Merge Robot 06152434e6
Merge pull request #5879 from rhatdan/pull
Pull images when doing podman create
2020-04-20 13:18:59 -04:00
Jhon Honce 9cd6bba5d5 V2 podman image tree
* Basic port of V1 podman image tree ID

TODO: Refactor to return tree from service and format in presentation
layer
TODO: Support tunneling mode

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-20 10:10:24 -07:00
Jhon Honce 3eac39aaa0 V2 Fix --latest for podman diff commands
* --latest now forces container diff
* diff options now passed into domain layer
* updated help/usage messages

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-20 09:27:54 -07:00
Giuseppe Scrivano 788fdc685b
rootless: move join namespace inside child process
open the namespace file descriptors inside of the child process.

Closes: https://github.com/containers/libpod/issues/5873

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-20 17:40:25 +02:00
Giuseppe Scrivano 8360fcf82c
rootless: skip looking up parent user ns
since we join directly the conmon user namespace, there is no need to
look up its parent user namespace, as we can safely assume it is the
init namespace.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-20 17:40:24 +02:00
Giuseppe Scrivano 4e09c5ebb4
common: setting cgroup resources correctly
fix some cgroups related integration tests.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-20 17:26:53 +02:00
OpenShift Merge Robot e5e625b2a6
Merge pull request #5872 from jwhonce/wip/options
V2 Fix support for tcp://[::]<port> connections
2020-04-20 10:42:00 -04:00
OpenShift Merge Robot bd71135852
Merge pull request #5890 from sujil02/v2-pod-inspect-fix
Update pod inspect report to hold current pod status.
2020-04-20 10:16:19 -04:00
Sujil02 838df56bcf Update pod inspect report to hold current pod status.
Added status field in pod inspect report.
Fixed pod tests to use it.

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-04-20 07:05:25 -04:00
OpenShift Merge Robot 02c2fbc4cd
Merge pull request #5880 from abitrolly/patch-2
Make `find` ignore dot files
2020-04-20 06:34:08 -04:00
Daniel J Walsh 28c336e996
Pull images when doing podman create
Currently podman create does not pull images if they don't
exist.  It should follow the pull policy specified by the
user.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-20 06:13:43 -04:00
Anatoli Babenia 48e7bae4e0 Return labes in API (fixes #5882)
Signed-off-by: Anatoli Babenia <anatoli@rainforce.org>
2020-04-20 09:56:37 +03:00
Anatoli Babenia a58c59f401 Make `find` ignore dot files
There is no need to search for sources in hidden dirs. In my case
there are files from development environment that stand in the way.

Signed-off-by: Anatoli Babenia <anatoli@rainforce.org>
2020-04-20 07:26:55 +03:00
OpenShift Merge Robot e4e42b28df
Merge pull request #5733 from sujil02/v2-pod-prune
Add pod prune for api v2
2020-04-18 06:02:51 -04:00
OpenShift Merge Robot 3b461ed6eb
Merge pull request #5871 from baude/v2t3
enable integration testing
2020-04-18 05:58:21 -04:00
Brent Baude c2a1138aec enable integration testing
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-17 18:57:40 -05:00
Jhon Honce 4e0326241b V2 Fix support for tcp://[::]<port> connections
* Fix support for socket activation, on remote and service

$ systemd-socket-activate -l 8083 --fdname=podman bin/podman system service --log-level=debug --time=30
$ bin/podman-remote --remote=tcp://[::]:8083 image ls

Or, use the podman.{socket,service} unit files

$ bin/podman-remote --remote=unix:///run/podman/podman.sock image ls

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-17 16:39:59 -07:00
Sujil02 37f3b191d5 Add pod prune for api v2.
Add the ability to prune pods for api v2,
Includes the addition of force flag, for client side prompt.
Update test suite to support this use case.

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-04-17 17:30:58 -04:00
OpenShift Merge Robot aa97cb5f42
Merge pull request #5869 from rhatdan/user
We were not handling the user option on create
2020-04-17 17:01:07 -04:00
OpenShift Merge Robot bd8a0b08cd
Merge pull request #5548 from kunalkushwaha/image-prune
image prune skips images with child images.
2020-04-17 15:19:45 -04:00
Daniel J Walsh 6c421b076f
We were not handling the user option on create
With this patch we can get run_passwd_test.go to pass

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-17 14:52:51 -04:00
OpenShift Merge Robot ba289dcd79
Merge pull request #5868 from baude/v2t2
Fixes for system tests
2020-04-17 14:43:21 -04:00
OpenShift Merge Robot a5884c07df
Merge pull request #5819 from vrothberg/v2-build
podmanV2: implement build
2020-04-17 14:30:49 -04:00
Brent Baude 44a8cf8676 Fixes for system tests
Various fixes to protect against regressions in system tests

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-17 13:22:06 -05:00
OpenShift Merge Robot d68b028c94
Merge pull request #5866 from edsantiago/logformat_bats_summary
Log formatter: add BATS summary line
2020-04-17 11:45:01 -04:00
OpenShift Merge Robot f8f5d9cef7
Merge pull request #5855 from baude/v2t1
Enable some testing
2020-04-17 11:39:02 -04:00
OpenShift Merge Robot 454fc9fecd
Merge pull request #5657 from AlbanBedel/network-name-fix
Fix the pod name passed to cni
2020-04-17 11:25:19 -04:00
Brent Baude b6a264464f Enable some testing
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-17 10:09:32 -05:00
Ed Santiago 1be8a34f5e Log formatter: add BATS summary line
BATS emits a summary line (number of tests passed/failed)...
but only on a tty or when run with --pretty! In our CI
context, with TAP output, it gives no end summary.

Fix that. Keep track of 'ok', 'not ok', and 'skipped',
and display the counts at the end.

Also: add a regression test. You don't need to review
or even read it: it's stark, and I'm not even enabling
it for CI because it almost certainly won't run due to
missing Perl library modules. It's just something I
need on my end.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-04-17 08:12:09 -06:00
OpenShift Merge Robot d31dcb9bbd
Merge pull request #5856 from jwhonce/wip/options
Fix bug where two configurations had been created
2020-04-17 02:35:50 -07:00
Valentin Rothberg 60624f948b podmanV2: implement build
Implement `podman build` for the local client.  The remote client will
require some rather large work in the backend and a new build endpoint
for the libpod rest API.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-04-17 10:26:50 +02:00
Jhon Honce 554c663b5a Fix bug where two configurations had been created
* registry.PodmanConfig() new returns a pointer to the source of truth

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-16 16:49:59 -07:00
OpenShift Merge Robot 0d2b5532c4
Merge pull request #5852 from baude/v1prune
Podman V2 birth
2020-04-16 14:04:58 -07:00
Brent Baude 241326a9a8 Podman V2 birth
remote podman v1 and replace with podman v2.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-16 15:53:58 -05:00
OpenShift Merge Robot 88c6fd06cd
Merge pull request #5837 from vrothberg/ignore
[CI:DOCS] .gitignore: ignore v2 remote
2020-04-16 12:14:44 -07:00
OpenShift Merge Robot 57f3897289
Merge pull request #5848 from jwhonce/wip/options
V2 Enable rootless
2020-04-16 11:56:16 -07:00
OpenShift Merge Robot 8b178f12ce
Merge pull request #5839 from rhatdan/troubleshoot
[CI:DOCS] Add SELinux volume information to troubleshoot.md
2020-04-16 11:30:03 -07:00
Jhon Honce 1d93d21254 V2 Enable rootless
* Enable running podman V2 rootless
* Fixed cobra.PersistentPreRunE usage in all the commands
* Leveraged cobra.PersistentPreRunE/cobra.PersistentPostRunE to manage:
  * rootless
  * trace (--trace)
  * profiling (--cpu-profile)
  * initializing the registry copies of Image/Container engines
* Help and Usage templates autoset for all sub-commands

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-16 11:08:08 -07:00