Commit graph

1657 commits

Author SHA1 Message Date
OpenShift Merge Robot 2178875fa7
Merge pull request #4568 from openSUSE/history
Add support for image name history
2019-11-27 15:31:22 +01:00
Sascha Grunert 63e46cc85c
Add support for image name history
We leverage the containers/storage image history tracking feature to
show the previously used image names when running:
`podman images --history`

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-11-27 13:42:06 +01:00
Matthew Heon 01ae532a89 Allow --ip and --mac to be set when joining a CNI net
These only conflict when joining more than one network. We can
still set a single CNI network and set a static IP and/or static
MAC.

Fixes #4500

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-11-26 09:56:14 -05:00
OpenShift Merge Robot ef240f4cd0
Merge pull request #4512 from kunalkushwaha/prune-filter
image prune command fixed as per docker image prune.
2019-11-22 21:56:12 +01:00
OpenShift Merge Robot 22e7d7d86f
Merge pull request #4525 from rst0git/uns-restore-fix
container-restore: Fix restore with user namespace
2019-11-22 16:07:26 +01:00
Kunal Kushwaha 5082496cc0 filter added to image pruge command.
filter option accepts two filters.
- label
- until
label supports "label=value" or "label=key=value" format
until supports all golang compatible time/duration formats.

Signed-off-by: Kunal Kushwaha <kunal.kushwaha@gmail.com>
2019-11-22 17:36:27 +09:00
Giuseppe Scrivano 0352bbc6e9
config: use EventsLogger=file without systemd
if systemd is not available, use the file events logger backend.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-11-21 12:02:04 +01:00
OpenShift Merge Robot 741b90c2b9
Merge pull request #4502 from vrothberg/fix-3359
history: rewrite mappings
2019-11-18 15:10:09 +01:00
Radostin Stoyanov 368d2ecfb6 container-restore: Fix restore with user namespace
When restoring a container with user namespace, the user namespace is
created by the OCI runtime, and the network namespace is created after
the user namespace to ensure correct ownership.

In this case PostConfigureNetNS will be set and the value of
c.state.NetNS would be nil. Hence, the following error occurs:

    $ sudo podman run --name cr \
	   --uidmap 0:1000:500 \
	   -d docker.io/library/alpine \
	   /bin/sh -c 'i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done'

    $ sudo podman container checkpoint cr
    $ sudo podman container restore cr
    ...
    panic: runtime error: invalid memory address or nil pointer dereference
    [signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x13a5e3c]

Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
2019-11-17 00:34:02 +00:00
Peter Hunt fa415f07a1 Also delete winsz fifo
In conmon 2.0.3, we add another fifo to handle window resizing. This needs to be cleaned up for commands like restore, where the same path is used.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-11-15 12:44:15 -05:00
Valentin Rothberg bf62f9a5cf history: rewrite mappings
Rewrite the backend for displaying the history of an image to simplify
the code and be closer to docker's behaviour.  Instead of driving
index-based heuristics, create a reverse mapping from top-layers to the
corresponding image IDs and lookup the layers on-demand.  Also use the
uncompressed layer size to be closer to Docker's behaviour.

Note that intermediate images from local builds are not considered for
the ID lookups anymore.

Fixes: #3359
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-11-12 17:29:30 -05:00
Dmitry Smirnov 8d928d525f codespell: spelling corrections
Signed-off-by: Dmitry Smirnov <onlyjob@member.fsf.org>
2019-11-13 08:15:00 +11:00
OpenShift Merge Robot d919961f62
Merge pull request #4451 from giuseppe/set-mac
podman: add support for specifying MAC
2019-11-07 20:26:14 +01:00
OpenShift Merge Robot 24efb5e4eb
Merge pull request #4470 from vrothberg/fix-4463
libpod/config: default: use `crun` on Cgroups v2
2019-11-07 16:26:22 +01:00
OpenShift Merge Robot b4a83bf9ae
Merge pull request #4447 from rhatdan/runasuser
Add support for RunAsUser and RunAsGroup
2019-11-07 16:05:03 +01:00
OpenShift Merge Robot a889fd397a
Merge pull request #4441 from rhatdan/detach
Allow users to disable detach keys
2019-11-07 15:16:36 +01:00
Valentin Rothberg 709ad91035 libpod/config: default: use crun on Cgroups v2
When running on a node with Cgroups v2, default to using `crun` instead
of `runc`.  Note that this only impacts the hard-coded default config.
No user config will be over-written.

Fixes: #4463
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-11-07 13:55:41 +00:00
OpenShift Merge Robot 2e2d82ce76
Merge pull request #4461 from giuseppe/fix-hang
events: make sure the write channel is always closed
2019-11-06 22:10:11 +01:00
Giuseppe Scrivano 276d68c8f5
events: make sure the write channel is always closed
in case of errors, the channel is not closed, blocking the reader
indefinitely.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1767663

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-11-06 17:14:44 +01:00
Daniel J Walsh a6108f1c19
Add support for RunAsUser and RunAsGroup
Currently podman generate kube does not generate the correct RunAsUser and RunAsGroup
options in the yaml file.  This patch fixes this.

This patch also make `podman play kube` use the RunAdUser and RunAsGroup options if
they are specified in the yaml file.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-11-06 10:35:37 -05:00
Jakub Filak 2497b6c77b
podman: add support for specifying MAC
I basically copied and adapted the statements for setting IP.

Closes #1136

Signed-off-by: Jakub Filak <jakub.filak@sap.com>
2019-11-06 16:22:19 +01:00
Jakub Filak 455f5b7616
vendor: updated ocicni for MAC address
`go get github.com/cri-o/ocicni@deac903fd99b6c52d781c9f42b8db3af7dcfd00a`

I had to fix compilation errors in libpod/networking_linux.go

---

ocicni.Networks has changed from string to the structure NetAttachment
with the member Name (the former string value) and the member Ifname
(optional).

I don't think we can make use of Ifname here, so I just map the array of
structures to array of strings - e.g. dropping Ifname.

---

The function GetPodNetworkStatus no longer returns Result but it returns
the wrapper structure NetResult which contains the former Result plus
NetAttachment (Network name and Interface name).

Again, I don't think we can make use of that information here, so I
just added `.Result` to fix the build.

---

Issue: #1136

Signed-off-by: Jakub Filak <jakub.filak@sap.com>
2019-11-06 16:22:18 +01:00
OpenShift Merge Robot b4b727256c
Merge pull request #4370 from rhatdan/seccomp
Set SELinux labels based on the security context in the kube.yaml
2019-11-05 21:52:22 +01:00
Daniel J Walsh 7c623bd41f
Allow users to disable detach keys
If user specifies --detach-keys="", this will disable the feature.

Adding define.DefaultDetachKeys to help screen to help identify detach keys.

Updated man pages with additonal information.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-11-05 14:10:43 -05:00
Valentin Rothberg 274fe57d3e pulling unqualified reference: make sure it's a docker reference
When pulling an unqualified reference (e.g., `fedora`) make sure that
the reference is not using a non-docker transport to avoid iterating
over the search registries and trying to pull from them.

Fixes: #4434
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-11-05 12:16:43 +01:00
Daniel J Walsh 65ed819932
Set SELinux labels based on the security context in the kube.yaml
If the kube.yaml specifieds the SELinux type or Level, we need the container
to be launched with the correct label.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-11-05 04:09:01 -05:00
OpenShift Merge Robot 1db4556d42
Merge pull request #4438 from giuseppe/fix-slirp4netns-timeout
slirp4netns: fix timeout
2019-11-05 08:55:01 +01:00
Giuseppe Scrivano 31a5827856
slirp4netns: fix timeout
the pidWaitTimeout is already a Duration so do not multiply it again
by time.Millisecond.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-11-04 17:06:52 +01:00
Giuseppe Scrivano a84ab35dc8
stats: fix calculation for the CPU time
Closes: https://github.com/containers/libpod/issues/4409

Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
2019-11-02 20:11:19 +01:00
Urvashi Mohnani 2a149ad90a Vendor in latest containers/buildah
Pull in changes to pkg/secrets/secrets.go that adds the
logic to disable fips mode if a pod/container has a
label set.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2019-11-01 09:41:09 -04:00
OpenShift Merge Robot 69165fa04d
Merge pull request #4400 from haircommander/exec-hang
Switch to bufio Reader for exec streams
2019-11-01 14:34:40 +01:00
Giuseppe Scrivano 11750df510
logs: support --tail 0
change the default to -1, so that we can change the semantic of
"--tail 0" to not print any existing log line.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-10-31 19:55:36 +01:00
OpenShift Merge Robot 3e2d9f8662
Merge pull request #4352 from vrothberg/config-package
refactor libpod config into libpod/config
2019-10-31 19:21:46 +01:00
Valentin Rothberg 11c282ab02 add libpod/config
Refactor the `RuntimeConfig` along with related code from libpod into
libpod/config.  Note that this is a first step of consolidating code
into more coherent packages to make the code more maintainable and less
prone to regressions on the long runs.

Some libpod definitions were moved to `libpod/define` to resolve
circular dependencies.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-10-31 17:42:37 +01:00
Peter Hunt 1df4dba0a0 Switch to bufio Reader for exec streams
There were many situations that made exec act funky with input. pipes didn't work as expected, as well as sending input before the shell opened.
Thinking about it, it seemed as though the issues were because of how os.Stdin buffers (it doesn't). Dropping this input had some weird consequences.
Instead, read from os.Stdin as bufio.Reader, allowing the input to buffer before passing it to the container.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-10-31 11:20:12 -04:00
OpenShift Merge Robot 381fa4df87
Merge pull request #4380 from giuseppe/rootless-create-cgroup-for-conmon
libpod, rootless: create cgroup for conmon
2019-10-30 21:42:47 +01:00
OpenShift Merge Robot 32266d155f
Merge pull request #4305 from mheon/fix_volume_mount
Wait for `mount` command to finish when mounting volume
2019-10-30 21:18:49 +01:00
Matthew Heon 3e891c1b60 Wait for mount command to finish when mounting volume
command.Start() just starts the command. That catches some
errors, but the nasty ones - bad options and similar - happen
when the command runs. Use CombinedOutput() instead - it waits
for the command to exit, and thus catches non-0 exit of the
`mount` command (invalid options, for example).

STDERR from the `mount` command is directly used, which isn't
necessarily the best, but we can't really get much more info on
what went wrong.

Fixes #4303

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-10-30 14:41:16 -04:00
Giuseppe Scrivano 78e2a31943
libpod, rootless: create cgroup for conmon
always create a new cgroup for conmon also when running as rootless.
We were previously creating one only when necessary, but that behaves
differently than root containers.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-10-30 17:04:05 +01:00
OpenShift Merge Robot 2e8eb8403d
Merge pull request #4372 from rhatdan/exec
Processes execed into container should match container label
2019-10-30 14:29:54 +01:00
Daniel J Walsh 0b9e07f7f2
Processes execed into container should match container label
Processes execed into a container were not being run with the correct label.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-10-29 16:05:42 -04:00
Daniel J Walsh 66c126d6de Set default seccomp.json file for podman play kube
Currently podman play kube is not using the system default seccomp.json file.
This PR will use the default or override location for podman play.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-10-29 13:43:45 -04:00
Nalin Dahyabhai 248bb61b14 images: distinguish between tags and digests
Generate an image's RepoDigests list using all applicable digests, and
refrain from outputting a digest in the tag column of the "images"
output.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-10-29 13:35:19 -04:00
Nalin Dahyabhai 07195ff09f API: report multiple digests for images
Be prepared to report multiple image digests for images which contain
multiple manifests but, because they continue to have the same set of
layers and the same configuration, are considered to be the same image.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-10-29 13:35:19 -04:00
Nalin Dahyabhai b9313d355e pull/create: add --override-arch/--override-os flags
Add --override-arch and --override-os as hidden flags, in line with the
global flag names that skopeo uses, so that we can test behavior around
manifest lists without having to conditionalize more of it by arch.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-10-29 13:35:19 -04:00
Nalin Dahyabhai 803357334c image: don't get confused by lists
When an image can be opened as an ImageSource but not an Image, handle
the case where it's an image list all by itself, the case where it's an
image for a different architecture/OS combination, or the case where
it's both.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-10-29 13:35:19 -04:00
Nalin Dahyabhai a4a70b4506 bump containers/image to v5.0.0, buildah to v1.11.4
Move to containers/image v5 and containers/buildah to v1.11.4.

Replace an equality check with a type assertion when checking for a
docker.ErrUnauthorizedForCredentials in `podman login`.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-10-29 13:35:18 -04:00
OpenShift Merge Robot 59582c55b7
Merge pull request #3792 from haircommander/minimum-conmon
require conmon v2.0.1
2019-10-29 17:44:52 +01:00
OpenShift Merge Robot 8e264ca572
Merge pull request #4350 from giuseppe/slirp4netnslog
libpod: if slirp4netns fails, return its stderr
2019-10-29 09:01:48 +01:00
Giuseppe Scrivano 795460f7b0
libpod: if slirp4netns fails, return its output
read the slirp4netns stderr and propagate it in the error when the
process fails.

Replace: https://github.com/containers/libpod/pull/4338

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-10-29 07:13:50 +01:00