Commit graph

592 commits

Author SHA1 Message Date
OpenShift Merge Robot f3c494eb28
Merge pull request #2959 from mheon/merge_volume_flags
Merge volume flags implementation
2019-05-03 01:30:13 +02:00
baude c18ad2bfd9 Generate systemd unit files for containers
the podman generate systemd command will generate a systemd unit file
based on the attributes of an existing container and user inputs.  the
command outputs the unit file to stdout for the user to copy or
redirect.  it is enabled for the remote client as well.

users can set a restart policy as well as define a stop timeout
override for the container.

Signed-off-by: baude <bbaude@redhat.com>
2019-05-02 14:35:53 -05:00
Matthew Heon bb564b68e1 Fix podman-in-podman volume test
When running inside Podman, we get an extra `nodev` mount option.
It doesn't seem to be a bug, more an artifact of running in a
somewhat locked-down container. So instead of checking explicitly
for a set of mount options, just verify the ones we set are
present.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-05-02 15:17:03 -04:00
Matthew Heon 0b2c9c2acc Add basic structure of podman init command
As part of this, rework the number of workers used by various
Podman tasks to match original behavior - need an explicit
fallthrough in the switch statement for that block to work as
expected.

Also, trivial change to Podman cleanup to work on initialized
containers - we need to reset to a different state after cleaning
up the OCI runtime.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-05-01 11:12:24 -04:00
Matthew Heon c86647d203 Begin adding volume tests
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-05-01 10:19:05 -04:00
James Cassell 354d80626a auto pass http_proxy into container
Signed-off-by: James Cassell <code@james.cassell.me>
2019-04-30 17:29:29 -04:00
baude 2e800d63aa podman-remote prune containers
enable the ability to prune containers from the remote-command.  this
also includes the system prune command.

Signed-off-by: baude <bbaude@redhat.com>
2019-04-26 10:15:09 -05:00
OpenShift Merge Robot 01e79477ca
Merge pull request #2850 from baude/eventsjournald
journald event logging
2019-04-25 12:20:39 -07:00
OpenShift Merge Robot ee8488555b
Merge pull request #2974 from edsantiago/bats
bats - various small updates
2019-04-25 06:28:40 -07:00
baude 7bf7c177ab journald event logging
add the ability for podman to read and write events to journald instead
of just a logfile.  This can be controlled in libpod.conf with the
`events_logger` attribute of `journald` or `file`.  The default will be
set to `journald`.

Signed-off-by: baude <bbaude@redhat.com>
2019-04-24 16:00:04 -05:00
OpenShift Merge Robot b01fdcbbd5
Merge pull request #2973 from baude/remoterestart
podman remote-client restart containers
2019-04-24 13:59:06 -07:00
baude 18d66136c1 podman remote-client restart containers
add the ability to restart containers with the remote-client

Signed-off-by: baude <bbaude@redhat.com>
2019-04-24 13:30:18 -05:00
Matthew Heon 90873b465b Fix test compile
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-04-24 12:51:41 -04:00
Matthew Heon c3c2ba079d Trim whitespace from ps -q before comparing
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-04-24 12:51:41 -04:00
Matthew Heon 597b2ebfea Enhance tests for stop to check results
None of the stop tests actually verified that containers were in
a stopped state after they finished. We shouldn't take a 0 exit
code to indicate that things worked - verify that ps shows no
running containers.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-04-24 12:51:41 -04:00
Matthew Heon 5405b4f279 Add extra CI tests for stopping all containers
We weren't testing cases where not all containers were running
when stop --all ran.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-04-24 12:51:41 -04:00
Jhon Honce 69962682e9 Refactor of 'podman prune' to better support remote
* Push iterations into the service not the client
* Add e2e tests
* Refactor to use new frameworks

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-04-18 15:13:56 -07:00
Ed Santiago 78bd2eac06 bats - various small updates
- podman-remote:
  - enable log, run and build tests, they're working now
    - well, except build + rootless. Skip that one.
  - add explanation of why info test is skipped

- Giuseppe's permission test:
  - validate GraphRoot and RunRoot values
  - add verbose logging, to enable seeing full directory tree
    permissions on error

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-04-18 15:39:21 -06:00
OpenShift Merge Robot e4947e5fd6
Merge pull request #2948 from baude/remotepause
podman-remote pause|unpause
2019-04-18 14:17:41 -07:00
baude 55e630e787 podman-remote pause|unpause
Add the ability to pause and unpause containers with the remote client.

Also turned on the pause tests!

Signed-off-by: baude <bbaude@redhat.com>
2019-04-18 13:42:27 -05:00
Daniel J Walsh 6b3d4abb07
Fix podman command --change CMD
Currently in Docker if you commit with --change 'CMD a b c'
The command that gets added is

[/bin/sh -c "a b c"]

If you commit --change 'CMD ["a","b","c"]'

You get
[a b c]

This patch set makes podman match this behaviour.

Similar change required for Entrypoint.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-04-17 15:44:50 -04:00
OpenShift Merge Robot bf5ffdafb4
Merge pull request #2917 from baude/remotestart
podman-remote start
2019-04-17 10:13:18 -07:00
baude 3c0147e559 podman-remote start
enable the ability to start containers from the remote-client.  also,
enable start integration tests for remote testing.

Signed-off-by: baude <bbaude@redhat.com>
2019-04-17 11:08:54 -05:00
OpenShift Merge Robot 799d4667c1
Merge pull request #2936 from haircommander/pod-prune
Add podman pod prune
2019-04-17 08:55:59 -07:00
TomSweeneyRedHat 024ae24f14 Vendor in latest Buildah
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-04-16 15:20:17 -04:00
Peter Hunt 0b34b4a59c Add podman pod prune
podman system prune would leave pods be, and not prune them if they were stopped.
Fix this by adding a `podman pod prune` command that prunes stopped pods similarly to containers.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-04-16 11:23:18 -04:00
OpenShift Merge Robot 852ca40665
Merge pull request #2910 from giuseppe/fix-create-2-containers
create: fix segfault if container name already exists
2019-04-13 01:32:37 -07:00
Giuseppe Scrivano 0a7b5b4e08
create: fix segfault if container name already exists
do not try to use ctr if there was an error.  It fixes a segfault when
there is already a container with the same name.

regression introduced by: ba65301c95

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-04-12 22:14:00 +02:00
OpenShift Merge Robot 15723671b3
Merge pull request #2911 from giuseppe/fix-pull-errors
pull: fix a couple of issues
2019-04-12 12:40:51 -07:00
OpenShift Merge Robot 6ddc67c694
Merge pull request #2907 from edsantiago/uidmap_test_fix
new uidmap BATS test: fix
2019-04-12 07:17:32 -07:00
Giuseppe Scrivano fcea6fda82
pull: exit with error if the image is not found
Closes: https://github.com/containers/libpod/issues/2785

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-04-12 15:24:22 +02:00
OpenShift Merge Robot e197cb2ff4
Merge pull request #2889 from edsantiago/bats
BATS tests: start supporting podman-remote
2019-04-11 19:19:23 -07:00
Ed Santiago 859bda1936 new uidmap BATS test: fix
Various problems, one of which was causing the test to fail
completely (otherwise I wouldn't have caught the others):

- option is --uidmap, not --uidmapping
- run_podman cannot be piped (| grep /sys/kernel). That's
  an unfortunate limitation of BATS. Any invocation of 'run'
  saves results to $output, which then has to be tested
  in a separate step.
  - do so, using 'run' and 'grep' and 'is' to produce
    readable messages on failure
- remove "$expected_rc", that looks like a copy/paste bug
  from a few lines above.

Skip entire test if rootless. (The one without --net=host
passes, but it also passes with older podman as both root
and rootless. I don't think it's actually testing anything,
but agree with leaving it in to catch weird regressions).

We really need to get these tests running in CI.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-04-11 20:08:27 -06:00
OpenShift Merge Robot 745993b592
Merge pull request #2895 from mheon/commit_no_default_include_volumes
Add --include-volumes flag to 'podman commit'
2019-04-11 09:59:52 -07:00
OpenShift Merge Robot ab259987ee
Merge pull request #2879 from mheon/header_on_no_images
Print header for 'podman images' even with no images present
2019-04-11 09:59:44 -07:00
Matthew Heon aef09ce031 Add --include-volumes flag to 'podman commit'
The 'docker commit' will never include a container's volumes when
committing, without an explicit request through '--change'.

Podman, however, defaulted to including user volumes as image
volumes.

Make this behavior depend on a new flag, '--include-volumes',
and make the default behavior match Docker.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-04-11 09:55:24 -04:00
Giuseppe Scrivano b7800889fb
userns: prevent /sys/kernel/* paths in the container
when we run in a user namespace, there are cases where we have not
enough privileges to mount a fresh sysfs on /sys.  To circumvent this
limitation, we rbind /sys from the host.  This carries inside of the
container also some mounts we probably don't want to.  We are also
limited by the kernel to use rbind instead of bind, as allowing a bind
would uncover paths that were not previously visible.

This is a slimmed down version of the intermediate mount namespace
logic we had before, where we only set /sys to slave, so the umounts
done to the storage by the cleanup process are propagated back to the
host.  We also don't setup any new directory, so there is no
additional cleanup to do.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-04-11 15:40:00 +02:00
Ed Santiago 7220c166d4 BATS tests: start supporting podman-remote
podman-remote now supports rm! That's what we needed to start
running BATS tests.

Although most tests don't actually work, some do, and maybe
the rest will start working over time. For now, disable them.

The only significant difference found is that podman-remote
strips fractional seconds from timestamps in JSON output.
Probably not something worth caring about.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-04-10 08:19:09 -06:00
Matthew Heon ba4a1bb9bd Print header for 'podman images' even with no images
Fixes #2877

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-04-10 09:55:55 -04:00
Jhon Honce 09ff62429a Implement podman-remote rm
* refactor command output to use one function
* Add new worker pool parallel operations
* Implement podman-remote umount
* Refactored podman wait to use printCmdOutput()

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-04-09 11:55:26 -07:00
Giuseppe Scrivano ae10f55362
test: fix remote tests for rootless
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-04-08 22:16:55 +02:00
Giuseppe Scrivano 6b9c1e2857
test: enable userns e2e tests for rootless
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-04-08 21:23:43 +02:00
OpenShift Merge Robot 7f8e9bd54c
Merge pull request #2845 from QiWang19/cpdir
fix bug podman cp directory
2019-04-08 07:48:54 -07:00
OpenShift Merge Robot 60e5492743
Merge pull request #2841 from openSUSE/ginkgo-unit
Update registrar unit tests to match them of cri-o
2019-04-08 07:28:10 -07:00
Brent Baude 23602de816 Revert "Switch to golangci-lint"
Signed-off-by: baude <bbaude@redhat.com>
2019-04-05 20:09:45 -05:00
Daniel J Walsh bc320be00b
Merge pull request #2742 from openSUSE/golangci-lint
Switch to golangci-lint
2019-04-05 11:02:41 -04:00
OpenShift Merge Robot b446378f7a
Merge pull request #2858 from giuseppe/rootless-enable-healthcheck
rootless: enable healthcheck
2019-04-05 05:21:30 -07:00
Giuseppe Scrivano ebc8999fcf
podman: enable kube for rootless
Closes: https://github.com/containers/libpod/issues/2852

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-04-05 09:34:23 +02:00
Giuseppe Scrivano be496c36d4
rootless: enable healthcheck tests
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-04-05 09:33:59 +02:00
Qi Wang 84620021b0 fix bug podman cp directory
`podman cp` used to copy the contents under the source directory to the destination. But according to the specification in podman-cp.md. it should copy the whole directory to the destination if the destination directory already exists.
- src dir ends with /., copy the contents to dest dir
- src dir does not end with /.
 - dest dir /home does not exist, copy the contents
 - dest dir /home exists, copy the directory

```
$ sudo podman cp /home/qiwan/Documents/empty 7c47:/home
$ sudo podman exec -it 7c47 ls /home
$

$ sudo podman cp /home/qiwan/Documents/empty 7c47:/home
$ sudo podman exec -it 7c47 ls /home
empty

```

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-04-04 12:45:12 -04:00