6712 Commits

Author SHA1 Message Date
4632b81c81 exec: fix error code when conmon fails
this is a cosmetic change that makes sure podman returns a sane error code when conmon dies underneath it

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2020-03-04 17:10:14 -05:00
797da2a57b Merge pull request #5381 from vrothberg/ENVFIX
env: set "container" to current binary
2020-03-04 13:26:48 -05:00
4d012cb6db Merge pull request #5370 from TomSweeneyRedHat/dev/tsweeney/b1141
Bump to Buildah v1.14.1
2020-03-04 13:24:14 -05:00
8389552495 Merge pull request #5373 from haircommander/exec-pipe-ec
exec: get the exit code from sync pipe instead of file
2020-03-04 11:11:01 -05:00
ce7ed2205a Merge pull request #5385 from baude/makemap
avoid adding to nil map
2020-03-04 11:08:30 -05:00
6d2d6898f8 env: don't set "container" env
Leave setting the "container" variable to consumers of pkg/env.
Podman is now hard-setting it to "podman" while "libpod" will
set it internally to "libpod" if it's unset.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-04 17:07:47 +01:00
90eef95cb1 Merge pull request #4772 from boaz0/closes_4628
Add the rmi flag to podman-run to delete container image
2020-03-04 10:58:10 -05:00
a8bc423e29 Merge pull request #5344 from edsantiago/log_format
CI: format cirrus logs
2020-03-04 10:55:36 -05:00
822d5a486a avoid adding to nil map
we need to make the environment map to avoid throwing an error when trying to add an environment value from file.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-03 17:00:50 -06:00
d3d97a25e8 Exec: use ErrorConmonRead
Before, we were using -1 as a bogus value in podman to signify something went wrong when reading from a conmon pipe. However, conmon uses negative values to indicate the runtime failed, and return the runtime's exit code.

instead, we should use a bogus value that is actually bogus. Define that value in the define package as MinInt32 (-1<< 31 - 1), which is outside of the range of possible pids (-1 << 31)

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2020-03-03 15:43:31 -05:00
4b72f9e401 exec: get the exit code from sync pipe instead of file
Before, we were getting the exit code from the file, in which we waited an arbitrary amount of time (5 seconds) for the file, and segfaulted if we didn't find it. instead, we should be a bit more certain conmon has sent the exit code. Luckily, it sends the exit code along the sync pipe fd, so we can read it from there

Adapt the ExecContainer interface to pass along a channel to get the pid and exit code from conmon, to be able to read both from the pipe

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2020-03-03 15:35:35 -05:00
d5f5b2e8be Merge pull request #5379 from edsantiago/test_apiv2
APIv2 tests: add tests for stop
2020-03-03 20:31:44 +01:00
b61da86b2c Bump to Buildah v1.14.1
As the title says.  Bumped to Buildah v1.14.1.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-03-03 09:08:34 -05:00
3bc5f431d4 Merge pull request #5206 from rhatdan/capabilities
Allow devs to set labels in container images for default capabilities.
2020-03-03 14:48:10 +01:00
88cd648816 APIv2 tests: add tests for stop
...and allow status 'stopped' in addition to 'exited'.

Fixes: #5336

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-03-03 06:40:27 -07:00
34baea814b Merge pull request #5367 from vrothberg/ENVFIX
consolidate env handling into pkg/env
2020-03-03 14:18:28 +01:00
11e5c53d11 Add the rmi flag to podman-run to delete container image
The --rmi flag will delete the container image after its execution
unless that image is already been used by another container(s).

This is useful when one wants to execute a container once and remove
any resources attached to it.

Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2020-03-03 14:27:11 +02:00
ad8e0e5e49 consolidate env handling into pkg/env
Env-variable related code is scattered across several packages making it
hard to maintain and extend.  Consolidate the code into a new pkg/env
package.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-03-03 11:47:24 +01:00
1814638000 CI: format cirrus logs
This introduces a new cirrus helper script, logformatter.
Usage is:

    [commands...] | logformatter TEST-NAME

It reformats its input into a readable, highlighed, linkable
form. Some features:

   - boring stuff (timestamps, standard podman options) is
     deemphasized
   - important stuff (warnings, errors) is emphasized
   - in-page links to the actual failures
   - active links to source files
   - jumps to bottom of page on load, because that's where
     the errors are. (All errors are linked)

Add it to select test commands (integration, system) and
add a new artifacts_html, run in the 'always' block, which
uploads generated *.log.html into Cirrus; from there we
generate a live URL that can be viewed in browser.

Unfortunately, due to security concerns in Cirrus, it is
not currently possible to make the link a live one.

Kludge: add a line of dashes after Restoring images; without this,
the first test ("systemd PID 1") has no dashes before it, so
logformatter doesn't see it.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-03-02 15:55:05 -07:00
1641ee6180 Merge pull request #5371 from edsantiago/apiv2_fixes
more swagger fixes
2020-03-02 23:52:28 +01:00
873d64fd6b Merge pull request #5363 from mheon/add_ctr_validate
Add validate() for containers
2020-03-02 23:52:21 +01:00
c5dfd83cf4 Merge pull request #5333 from edsantiago/test_apiv2
CI: add API v2 tests
2020-03-02 23:41:12 +01:00
f678b3fcf1 Update docs/source/markdown/podman-build.1.md
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-02 16:39:21 -05:00
b163640c61 Allow devs to set labels in container images for default capabilities.
This patch allows users to specify the list of capabilities required
to run their container image.

Setting a image/container label "io.containers.capabilities=setuid,setgid"
tells podman that the contained image should work fine with just these two
capabilties, instead of running with the default capabilities, podman will
launch the container with just these capabilties.

If the user or image specified capabilities that are not in the default set,
the container will print an error message and will continue to run with the
default capabilities.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-02 16:37:32 -05:00
5612089412 CI: add API v2 tests
API v2 has been quiet for a few days, and the test script is
actually passing. Let's take advantage of this opportunity
to get them running in CI.

Requires adding a check for cgroupsv2

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-03-02 13:19:42 -07:00
47c4ea3919 Merge pull request #5347 from baude/apiv2wait
rework apiv2 wait endpoint|binding
2020-03-02 20:23:26 +01:00
c3c334a323 more swagger fixes
Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-03-02 12:01:56 -07:00
f9a476833b Merge pull request #5365 from containers/dependabot/go_modules/github.com/opencontainers/selinux-1.3.3
Bump github.com/opencontainers/selinux from 1.3.2 to 1.3.3
2020-03-02 18:52:33 +01:00
f5c853ca99 Merge pull request #5343 from lsm5/fix-exists-url
container Exists: fix URL
2020-03-02 18:33:45 +01:00
dc71dfc916 Bump github.com/opencontainers/selinux from 1.3.2 to 1.3.3
Bumps [github.com/opencontainers/selinux](https://github.com/opencontainers/selinux) from 1.3.2 to 1.3.3.
- [Release notes](https://github.com/opencontainers/selinux/releases)
- [Commits](https://github.com/opencontainers/selinux/compare/v1.3.2...v1.3.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-02 11:03:53 -05:00
e45456223c Add validate() for containers
Until now, we've been validating every part of container
configuration through the With... functions that set the options.
This if fine when we are just validating the options to an
individual function, but things get complicated once we need to
validate conflicts between different options. We don't know the
order in which things were passed, so we need the validation on
both of the potential options that can conflict, resulting in
significant code duplication. To solve this, add a validate()
function for containers, and use this to check whether everything
is in a good state.

We can probably move more into this function (there are other
parts of container creation that also do validation of a sort)
but this is a good start to simplifying our options.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-03-02 10:58:11 -05:00
86ed329ad1 Merge pull request #5320 from sujil02/podtest
Add test to validate prune pod apiv2 binding.
2020-03-02 16:34:40 +01:00
275e9b855d Merge pull request #5342 from cevich/runc_in_f30
Force using runc in F30
2020-02-28 20:31:57 +01:00
742093c2f2 Merge pull request #5349 from mheon/ensure_exec_suppgroups
Ensure that exec sessions inherit supplemental groups
2020-02-28 20:18:13 +01:00
05550ed848 Merge pull request #5346 from mheon/bump-1.8.1-rc2
[CI:DOCS] Bump to v1.8.1-RC2
2020-02-28 19:16:13 +01:00
a58bf77d3e Merge pull request #5244 from Akasurde/i4962
Add cmd flag to show container name in log
2020-02-28 18:55:58 +01:00
c192696393 Merge pull request #5354 from giuseppe/fix-build-using-100-cpu
build: specify input fd to buildah
2020-02-28 18:18:13 +01:00
bbda410526 Update pod bindings and Add test to validate prune pod apiv2 binding.
Modify the pod inspect bindings to hold current pod status.
Includes test to validate on pod status and added test to check
no or few pods are pruned,if the pods are in exited state.

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-02-28 11:51:02 -05:00
e95c493fec Fix wrong condition in bindings test
Thanks for Brent Baude <bbaude@redhat.com> for the fix.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-02-28 11:44:16 -05:00
b41c864d56 Ensure that exec sessions inherit supplemental groups
This corrects a regression from Podman 1.4.x where container exec
sessions inherited supplemental groups from the container, iff
the exec session did not specify a user.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-02-28 11:32:56 -05:00
04d9cee01a Cirrus: Update VM images
Main intended signifant change is forced-removal of crun from F30
and disabling updates-testing (only enabled on F31).

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-02-28 10:59:58 -05:00
0885f76742 Cirrus: Force runc use in F30
Suspect crun might be sneaking in during VM image build via podman RPM
dependency.  Add it to the removal list when building, then also force
use of runc at runtime in F30.

Also quote all true/false vars to force them as strings instead of
booleans (which will become capitalized)

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-02-28 10:37:31 -05:00
0904873100 rework apiv2 wait endpoint|binding
added the ability to wait on a condition (stopped, running, paused...) for a container.  if a condition is not provided, wait will default to the stopped condition which uses the original wait code paths.  if the condition is stopped, the container exit code will be returned.

also, correct a mux issue we discovered.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-28 09:36:53 -06:00
c59080b463 build: specify input fd to buildah
It solves a tight loop with poll as stdin will be initialized to
/dev/null in buildah/imagebuildah/StageExecutor.Run.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-02-28 16:24:08 +01:00
c96eb612e5 Cirrus: Remove unnecessary handle_crun workaround
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-02-28 09:54:36 -05:00
e874b5b222 Cirrus: Print env. vars at end of setup.
There are a number of env. vars set during the setup script.  Therefore
displaying them at end of the script is more helpful for debugging.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-02-28 09:54:36 -05:00
42f04bbdaf Cirrus: Fix not growing Fedora root
Signed-off-by: Chris Evich <cevich@redhat.com>
2020-02-28 09:54:35 -05:00
baf27fa25e Merge pull request #5348 from baude/cninetfix
Cninetfix
2020-02-27 23:40:03 +01:00
52876dc821 Merge pull request #5319 from baude/apiv2volumestests
binding tests for volumes
2020-02-27 23:24:00 +01:00
be2e5c4b2d Merge pull request #5337 from edsantiago/logcollector_include_hostinfo
CI: package_versions: include hostinfo, kernel
2020-02-27 22:11:37 +01:00