6985 Commits

Author SHA1 Message Date
920d09c174 Removed the unnecessary code
removed defaulting of  query.Size
amended types.LibpodToContainer, removed hard coded true from inspect call

Signed-off-by: Steve Taylor <steven@taylormuff.co.uk>
2020-03-06 13:17:56 +00:00
f07e18f05c Merge pull request #5408 from vrothberg/goimports
golangci: enable goimports
2020-03-06 14:16:56 +01:00
83e52cf787 Implemented size parameter on GetContainer
Signed-off-by: Steve Taylor <steven@taylormuff.co.uk>
2020-03-05 23:02:45 +00:00
da15f2f881 Implement size parameter on ListContainers
Signed-off-by: Steve Taylor <steven@taylormuff.co.uk>
2020-03-05 22:53:50 +00:00
1ef96364fe Map configured status to created to match docker API states
Signed-off-by: Steve Taylor <steven@taylormuff.co.uk>
2020-03-05 22:47:11 +00:00
9088a8a387 Fix to remove null entry from end of images json
Signed-off-by: Steve Taylor <steven@taylormuff.co.uk>
2020-03-05 22:37:31 +00:00
89b083f8b4 Register handlers without version to align with docker API
Signed-off-by: Steve Taylor <steven@taylormuff.co.uk>
2020-03-05 22:28:22 +00:00
593eb7625a golangci: enable goimports
Enable the goimports linter and fix reports.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-05 20:03:44 +01:00
60e9e7ca9c Merge pull request #5039 from cevich/fix_gobin_exit_bug
Cirrus: Fix gate image & false-positive exits
2020-03-05 19:28:10 +01:00
3626028640 Merge pull request #5400 from vrothberg/systemd-gen-cleanup
generate systemd: remove leading slashes
2020-03-05 09:28:41 -05:00
d4540e07c7 Fix bug podman reset to not remove $XDG_RUNTIME_DIR
In some older systems we point the temporary directory to /run/user/1000 which leads podman system reset to clear unrelated files under XDG_RUNTIME_DIR. This patch only removes files created by podman if TmpDir is the  same as the XDG_RUNTIME_DIR.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-03-05 09:21:41 -05:00
6ad35e848d Fix upstream dockerfile and add 'by hand' ctrfile
The podmanimage/upstream/Dockerfile had two rpms in its
build procedure that are no longer available.  The atomic-registries
has been removed and the md2man has been renamed.  In addtion
conmon was not being installed and I've added that.

I've been using a Containerfile to build or rebuild a
specific version of the podmanimage stored in the stable
repository with a version tag.  As the other Containerfiles
have been updated by others, and in case anyone else needs
to build it, I've added it to the repo and have also updated
the readme.md.

FWIW, the builds in the quay.io/podman/upstream have been failing for a while due to missing rpms.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-03-05 09:15:58 -05:00
a5c04c793e generate systemd: remove leading slashes
Remove leading slashes from the run-dir paths. It was meant to make it
explicit that we're dealing with an absolute path but user feedback has
shown that most are aware.  It also cleans up the path in the systemctl
status output.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-05 14:05:48 +01:00
9ffc525da7 Merge pull request #5382 from vrothberg/systemd-network
generate systemd: add network dependencies
2020-03-05 06:44:40 -05:00
0356c0ed91 Merge pull request #5397 from rhatdan/vendor
Vendor buildah 1.14.2
2020-03-05 05:39:25 -05:00
8a8c2fea69 Merge pull request #5396 from haircommander/fix_exec_error
exec: fix error code when conmon fails
2020-03-04 22:51:33 -05:00
834f397db2 Merge pull request #5389 from openSUSE/fix-image-sign-help
Fix podman image sign help output
2020-03-04 22:48:58 -05:00
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
0015c376a3 Vendor buildah 1.14.2
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-04 16:53:39 -05:00
288ddaa5ca Cirrus: Fix fedora-minimal mirroring
Builds of this dockerfile fail on quay.io due to not being able to pull
the base image.  Use a fully-qualified FROM name to work around this.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-03-04 14:24:58 -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
6e1de159eb Fix podman image sign help output
Adjust the help output to mention `podman image sign` instead of just
`podman sign`.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-03-04 09:22:53 +01: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
05a0bf7c07 generate systemd: add network dependencies
Add network dependencies to generated systemd services to allow for
enabling them at system startup and have a working network if needed.

Fixes: #4130
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-03 17:39:53 +01:00
17bab33bd2 fix security-opt generate kube
fix #4950
add selinux options from --security-opt of the container to generate kube result

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-03-03 11:21:14 -05: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