71 Commits

Author SHA1 Message Date
a5e37ad280 Switch all references to github.com/containers/libpod -> podman
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-28 08:23:45 -04:00
677ad10e07 Pids-limit should only be set if the user set it
Currently we are sending over pids-limits from the user even if they
never modified the defaults.  The pids limit should be set at the server
side unless modified by the user.

This issue has led to failures on systems that were running with cgroups V1.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-07-10 12:46:16 -04:00
8489dc4345 move go module to v2
With the advent of Podman 2.0.0 we crossed the magical barrier of go
modules.  While we were able to continue importing all packages inside
of the project, the project could not be vendored anymore from the
outside.

Move the go module to new major version and change all imports to
`github.com/containers/libpod/v2`.  The renaming of the imports
was done via `gomove` [1].

[1] https://github.com/KSubedi/gomove

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-07-06 15:50:12 +02:00
c51c593ff6 Re-add resource limit warnings to Specgen
These were part of Podman v1.9, but were lost in the transition
to using Specgen to create containers. Most resource limits are
checked via the sysinfo package to ensure they are safe to use
(the cgroup is mounted, kernel support is present, etc) and
removed if not safe. Further, bounds checks are performed to
ensure that values are valid.

Ensure these warnings are printed client-side when they occur.
This part is a little bit gross, as it happens in pkg/infra and
not cmd/podman, which is largely down to how we implemented
`podman run` - all the work is done in pkg/infra and it returns
only once the container has exited, and we need warnings to print
*before* the container runs. The solution here, while inelegant,
avoid the need to extensively refactor our handling of run.

Should fix blkio-limit warnings that were identified by the FCOS
test suite.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-06-16 17:32:01 -04:00
10ace87ca9 Fix handling of ThrottleWriteIOPSDevice
This is causing the UBuntu tests to fail.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-06-05 08:11:37 -04:00
a4c607cc71 set binding tests to required
some small fix ups for binding tests and then make them required.

update containers-common

V2 bindings tests were failing because of changes introduced in commit
a2ad5bb.

Fix some typos.

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>

in the case where the specgen attribute for Env and Labels are nil, we should should then make the map IF we have labels and envs that need to be added.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-05-08 09:05:37 -05:00
99bdafba99 podman: split env variables in env and overrides
There are three different priorities for applying env variables:

1) environment/config file environment variables
2) image's config
3) user overrides (--env)

The third kind are known to the client, while the default config and image's
config is handled by the backend.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-05-07 14:16:50 -04:00
23be7b5049 Merge pull request #6024 from baude/v2checkmediatypew
check image media/manifest type for healthchecks
2020-04-28 19:21:50 +02:00
a255075fe8 check image media/manifest type for healthchecks
before looking up a healthcheck in an image, check to make sure it is a dockerv2schema image.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-28 11:49:58 -05:00
a9aa9e2f78 pkg, specgen: do not hardcode user=0 in the config if not specified
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-28 15:25:59 +02:00
67ec4e1d27 Improve Entrypoint and Command support
We should not be overwriting the Specgen's Command and Entrypoint
when building the final command to pass in the OCI spec. Both of
these will be provided to Libpod for use in `podman inspect` and
committing containers, and both must be set to the user's input,
not overwritten by the image if unset.

Fix this by moving command generation into OCI spec generation
and not modifying the SpecGenerator when we do so.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-04-27 13:13:21 -04:00
1cd484e13f specgen: read healthchecks from the image
if there is no healthcheck configuration specified, read it from the
image.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-27 11:22:27 +02:00
a3acc4f977 podman: add support for --rootfs
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-24 12:56:20 +02:00
1cd2b746d0 Modify namespace generation code for specgen
Namespaces have now been changed to properly handle all cases.
Spec handling code for namespaces was consolidated in a single
function.

Still missing:
- Image ports
- Pod namespaces likely still broken in Podmanv2

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-04-21 14:38:52 -04:00
224a5ce51e add entrypoint from image where needed
if the image specifies both the image and entrypoint, we need to account for that and preprend the entrypoint to the command.  this only happens if no user command and entrypoint were supplied.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-21 09:15:21 -05:00
75fdb753dd Handle annotations passed in via the client
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-21 05:18:39 -04:00
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
a2ad5bb9e1 Add functions to return image informations
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-20 15:50:46 -04:00
ba430bfe5e podman v2 remove bloat v2
rid ourseleves of libpod references in v2 client

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-16 12:04:46 -05:00
ac94a96a74 Fix up SELinux labeling
SELinux label options processing fixes, should allow system tests to pass.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-15 16:30:03 -04:00
6514a5c80e v2podman container create
create a container in podmanv2 using specgen approach.  this is the core implementation and still has quite a bit of code commented out specifically around volumes, devices, and namespaces.  need contributions from smes on these parts.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-03 15:43:03 -05:00