Commit graph

1726 commits

Author SHA1 Message Date
OpenShift Merge Robot 10d52c05e2
Merge pull request #9275 from rhatdan/build
Add missing params for podman-remote build
2021-02-22 06:29:32 -05:00
OpenShift Merge Robot d92b94677c
Merge pull request #9448 from vrothberg/bump-module-version
bump go module to v3
2021-02-22 05:51:31 -05:00
Jakub Guzik c236aebb9b Two variations of --new flag added to e2e
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-02-22 09:53:42 +01:00
Valentin Rothberg 5dded6fae7 bump go module to v3
We missed bumping the go module, so let's do it now :)

* Automated go code with github.com/sirkon/go-imports-rename
* Manually via `vgrep podman/v2` the rest

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-22 09:03:51 +01:00
OpenShift Merge Robot 7b52654649
Merge pull request #9417 from ashley-cui/journald
Fix journald logs
2021-02-21 05:03:46 -05:00
Daniel J Walsh 05eb06f568 Turn on journald and k8s file logging tests
Signed-off-by: Ashley Cui <acui@redhat.com>
2021-02-19 16:11:41 -05:00
baude d6b0b54121 Fix segfault in run with memory-swap
when unlimited (-1) was being passed to memory-swap, podman threw a
segfault.

Fixes #9429

Signed-off-by: baude <bbaude@redhat.com>
2021-02-19 07:56:14 -06:00
Matthew Heon a9d548bf77 Change source path resolution for volume copy-up
Instead of using the container's mountpoint as the base of the
chroot and indexing from there by the volume directory, instead
use the full path of what we want to copy as the base of the
chroot and copy everything in it. This resolves the bug, ends up
being a bit simpler code-wise (no string concatenation, as we
already have the full path calculated for other checks), and
seems more understandable than trying to resolve things on the
destination side of the copy-up.

Fixes #9354

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2021-02-17 14:57:06 -05:00
OpenShift Merge Robot d48f4a0e1f
Merge pull request #9383 from mheon/fix_copyup_empty
Fix an issue where copyup could fail with ENOENT
2021-02-17 13:18:33 -05:00
OpenShift Merge Robot 516dc6d1ff
Merge pull request #9409 from rhatdan/size
podman ps --format '{{ .Size }}' requires --size option
2021-02-17 11:10:33 -05:00
Daniel J Walsh e2d5a1d051
podman ps --format '{{ .Size }}' requires --size option
Podman -s crashes when the user specifies the '{{ .Size }}` format
on the podman ps command, without specifying the --size option.

This PR will stop the crash and print out a logrus.Error stating that
the caller should add the --size option.

Fixes: https://github.com/containers/podman/issues/9408

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-17 07:55:12 -05:00
Daniel J Walsh 12a577aea5
Ignore entrypoint=[\"\"]
We recieved an issue with an image that was built with
entrypoint=[""]
This blows up on Podman, but works on Docker.

When we setup the OCI Runtime, we should drop
entrypoint if it is == [""]

https://github.com/containers/podman/issues/9377

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-17 07:00:53 -05:00
OpenShift Merge Robot 50042120e9
Merge pull request #9240 from rhatdan/reset
Do not reset storage when running inside of a container
2021-02-16 17:11:26 -05:00
Daniel J Walsh 5d1ec2960d
Do not reset storage when running inside of a container
Currently if the host shares container storage with a container
running podman, the podman inside of the container resets the
storage on the host. This can cause issues on the host, as
well as causes the podman command running the container, to
fail to unmount /dev/shm.

podman run -ti --rm --privileged -v /var/lib/containers:/var/lib/containers quay.io/podman/stable podman run alpine echo hello
	* unlinkat /var/lib/containers/storage/overlay-containers/a7f3c9deb0656f8de1d107e7ddff2d3c3c279c11c1635f233a0bffb16051fb2c/userdata/shm: device or resource busy
	* unlinkat /var/lib/containers/storage/overlay-containers/a7f3c9deb0656f8de1d107e7ddff2d3c3c279c11c1635f233a0bffb16051fb2c/userdata/shm: device or resource busy

Since podman is volume mounting in the graphroot, it will add a flag to
/run/.containerenv to tell podman inside of container whether to reset storage or not.

Since the inner podman is running inside of the container, no reason to assume this is a fresh reboot, so if "container" environment variable is set then skip
reset of storage.

Also added tests to make sure /run/.containerenv is runnig correctly.

Fixes: https://github.com/containers/podman/issues/9191

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-16 14:18:53 -05:00
Daniel J Walsh 958f901431
podman kill should report rawInput not container id
Docker always reports back the users input, not the full
id, we should do the same.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-16 09:47:38 -05:00
OpenShift Merge Robot 58a4793bec
Merge pull request #9396 from rhatdan/stop
When stopping a container, print rawInput
2021-02-16 09:46:28 -05:00
OpenShift Merge Robot aadb16da38
Merge pull request #9380 from baude/podinfra
Fix panic in pod creation
2021-02-16 09:25:28 -05:00
Matthew Heon 759fc93343 Fix an issue where copyup could fail with ENOENT
This one is rather bizarre because it triggers only on some
systems. I've included a CI test, for example, but I'm 99% sure
we use images in CI that have volumes over empty directories, and
the earlier patch to change copy-up implementation passed CI
without complaint.

I can reproduce this on a stock F33 VM, but that's the only place
I have been able to see it.

Regardless, the issue: under certain as-yet-unidentified
environmental conditions, the copier.Get method will return an
ENOENT attempting to stream a directory that is empty. Work
around this by avoiding the copy altogether in this case.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-02-16 09:21:49 -05:00
baude f2f18768a8 Fix panic in pod creation
when creating a pod with --infra-image and using a untagged image for
the infra-image (none/none), the lookup for the image's name was
creating a panic.

Fixes: #9374

Signed-off-by: baude <bbaude@redhat.com>
2021-02-16 06:29:49 -06:00
Daniel J Walsh 690c02f602
Add missing params for podman-remote build
Fixes: https://github.com/containers/podman/issues/9290

Currently we still have hard coded --isolation=chroot for podman-remote build.

Implement missing arguments for podman build

Implements
--jobs, --disable-compression, --excludes

Fixes:
MaxPullPushRetries
RetryDuration

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-16 06:48:35 -05:00
Daniel J Walsh 4a9bd7a18f
When stopping a container, print rawInput
When we stop a container we are printing the full id,
this does not match Docker behaviour or the start behavior.
We should be printing the users rawInput when we successfully
stop the container.

Fixes: https://github.com/containers/podman/issues/9386

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-16 06:26:51 -05:00
Daniel J Walsh 3d50393f09
Don't chown workdir if it already exists
Currently podman is always chowning the WORKDIR to root:root
This PR will return if the WORKDIR already exists.

Fixes: https://github.com/containers/podman/issues/9387

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-16 04:52:02 -05:00
baude 227c548130 fix dns resolution on ubuntu
ubuntu's dns seems a little odd and requires a fq name in its tests.

Signed-off-by: baude <bbaude@redhat.com>
2021-02-15 16:12:11 -06:00
Valentin Rothberg 0ab5bfd313 e2e: fix network alias test
The logic in the e2e test for multiple network aliases is indicating the
test should wait for the containerized nginx to be ready.  As this may
take some time, the test does an exponential backoff starting at 2050ms.

Fix the logic by removing the `Expect(...)` call during the exponential
backoff.  Otherwise, the test errors immediately.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-15 15:07:25 +01:00
Valentin Rothberg 704fa8b55e fix failing image e2e test
The timestamps of some images must have changed changing the number of
expected filtered images.  The test conditions seem fragile but for now
it's more important to get CI back.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-15 13:02:14 +01:00
OpenShift Merge Robot 1b284a298c
Merge pull request #9302 from giuseppe/cgroup-split-v1
utils: takes the longest path on cgroup v1
2021-02-11 17:46:37 -05:00
Giuseppe Scrivano 660a06f2f7
utils: takes the longest path on cgroup v1
now getCgroupProcess takes the longest path on cgroup v1, instead of
complaining if the paths are different.

This should help when --cgroups=split is used on cgroup v1 and the
process cgroups look like:

$ cat /proc/self/cgroup
11:pids:/user.slice/user-0.slice/session-4.scope
10:blkio:/
9:cpuset:/
8:devices:/user.slice
7:freezer:/
6:memory:/user.slice/user-0.slice/session-4.scope
5:net_cls,net_prio:/
4:hugetlb:/
3:cpu,cpuacct:/
2:perf_event:/

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-02-11 16:46:42 +01:00
baude 5f999b6bcd container ps json format miscue
when printing out json format, we mistakenly changed the Created field
output to be a time.time in a different commit.  This allows for
override of the Created field to be a unix ts as type int64.

Fixes: #9315

Signed-off-by: baude <bbaude@redhat.com>
2021-02-11 09:38:54 -06:00
OpenShift Merge Robot ca354f13f2
Merge pull request #9308 from mheon/fix_6003
Rewrite copy-up to use buildah Copier
2021-02-11 05:23:34 -05:00
baude 5ccb1596b4 Display correct value for unlimited ulimit
When doing a container inspect on a container with unlimited ulimits,
the value should be -1.  But because the OCI spec requires the ulimit
value to be uint64, we were displaying the inspect values as a uint64 as
well.  Simple change to display as an int64.

Fixes: #9303

Signed-off-by: baude <bbaude@redhat.com>
2021-02-10 14:17:58 -06:00
Matthew Heon ea910fc535 Rewrite copy-up to use buildah Copier
The old copy-up implementation was very unhappy with symlinks,
which could cause containers to fail to start for unclear reasons
when a directory we wanted to copy-up contained one. Rewrite to
use the Buildah Copier, which is more recent and should be both
safer and less likely to blow up over links.

At the same time, fix a deadlock in copy-up for volumes requiring
mounting - the Mountpoint() function tried to take the
already-acquired volume lock.

Fixes #6003

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-02-10 14:21:37 -05:00
OpenShift Merge Robot 2d829aeb1f
Merge pull request #9284 from rhatdan/annotations
Support annotations from containers.conf
2021-02-09 18:40:36 -05:00
OpenShift Merge Robot 995a60481a
Merge pull request #9283 from vrothberg/fix-8897
generate kube: do not set caps with --privileged
2021-02-09 14:23:15 -05:00
Daniel J Walsh 46385dd609
Restart service when CONTAINERS_CONF changes
Service needs to be restarted in order to read the CONTAINERS_CONF file.
Not resetting this can lead to lots of flakes, since the test will use
whatever the host system has to be set in it's containers.conf.

Fixes: https://github.com/containers/podman/issues/9286

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-09 13:18:18 -05:00
Daniel J Walsh cc846a8cd9
Support annotations from containers.conf
Currently podman does not use the annotations specified in the
containers.conf. This PR fixes this.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-09 13:18:18 -05:00
OpenShift Merge Robot f98605e0e4
Merge pull request #9125 from ashley-cui/secretswiring
Implement Secrets
2021-02-09 17:51:08 +01:00
Valentin Rothberg 48c612cf66 generate kube: support --privileged
Do not play with capabilities for privileged containers where all
capabilities will be set implicitly.

Also, avoid the device check when running privileged since all of /dev/*
will be mounted in any case.

Fixes: #8897
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-09 17:40:35 +01:00
Ashley Cui 832a69b0be Implement Secrets
Implement podman secret create, inspect, ls, rm
Implement podman run/create --secret
Secrets are blobs of data that are sensitive.
Currently, the only secret driver supported is filedriver, which means creating a secret stores it in base64 unencrypted in a file.
After creating a secret, a user can use the --secret flag to expose the secret inside the container at /run/secrets/[secretname]
This secret will not be commited to an image on a podman commit

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-02-09 09:13:21 -05:00
Daniel J Walsh 45981ba29a
Bump containers/buildah to v1.19.4
Fix handling of --iidfile to happen on the client side.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-08 16:02:20 -05:00
OpenShift Merge Robot 19507d0ffe
Merge pull request #9246 from rhatdan/build
Implement missing arguments for podman build
2021-02-08 14:18:31 -05:00
OpenShift Merge Robot 2bf13219f5
Merge pull request #9266 from vrothberg/fix-6510
make `podman rmi` more robust
2021-02-08 11:35:15 -05:00
OpenShift Merge Robot c32913d0a3
Merge pull request #9236 from baude/networkprune
add network prune
2021-02-08 09:50:50 -05:00
Valentin Rothberg feecdf919f make podman rmi more robust
The c/storage library is subject to TOCTOUs as the central container and
image storage may be shared by many instances of many tools.  As shown
in #6510, it's fairly easy to have multiple instances of Podman running
in parallel and yield image-lookup errors when removing them.

The underlying issue is the TOCTOU of removal being split into multiple
stages of first reading the local images and then removing them.  Some
images may already have been removed in between the two stages. To make
image removal more robust, handle errors at stage two when a given image
is not present (anymore) in the storage.

Fixes: #6510
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-08 14:58:17 +01:00
Daniel J Walsh 407e86dcd2
Implement missing arguments for podman build
Buildah bud passes a bunch more flags then podman build.

We need to implement hook up all of these flags to get full functionality.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-08 08:39:18 -05:00
baude 91ea3fabd6 add network prune
add the ability to prune unused cni networks.  filters are not implemented
but included both compat and podman api endpoints.

Fixes :#8673

Signed-off-by: baude <bbaude@redhat.com>
2021-02-06 07:37:29 -06:00
OpenShift Merge Robot 69ddbde983
Merge pull request #9205 from st1971/issue-8710
play kube selinux label issue
2021-02-05 12:25:55 -05:00
OpenShift Merge Robot 42d4652fed
Merge pull request #9048 from matejvasek/apiv2_wait
Fix Docker APIv2 container wait endpoint
2021-02-05 04:41:41 -05:00
OpenShift Merge Robot b1bd126cda
Merge pull request #9235 from Luap99/fix-9234
Fix podman network disconnect wrong NetworkStatus number
2021-02-04 16:34:45 -05:00
Steven Taylor 6c713984ef play kube selinux test case
added skip to test case where selinux not enabled

Signed-off-by: Steven Taylor <steven@taylormuff.co.uk>
2021-02-04 19:57:08 +00:00
Paul Holzinger 5c6ab3075e Fix podman network disconnect wrong NetworkStatus number
The allocated `tmpNetworkStatus` must be allocated with the length 0.
Otherwise append would add new elements to the end of the slice and
not at the beginning of the allocated memory.

This caused inspect to fail since the number of networks did not
matched the number of network statuses.

Fixes #9234

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-02-04 19:41:30 +01:00