Commit Graph

6355 Commits

Author SHA1 Message Date
Matthew Heon eed2ad9ef2 Only modify conmon cgroup if we have running containers
If there are no running containers - for example, if the pod was
just created - the cgroup in question may not exist (under
certain circumstances that we're not 100% sure about). However,
regardless, we don't need to set a PID limit, as nothing will be
making cleanup processes (no running conmon processes), so not
changing the cgroup is safe regardless.

Fixes #5072

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-02-06 10:20:54 -05:00
OpenShift Merge Robot fc0673f561
Merge pull request #5062 from vrothberg/update-image
vendor github.com/containers/image/v5@v5.2.0
2020-02-05 18:14:53 +01:00
OpenShift Merge Robot 107fd64970
Merge pull request #5090 from openSUSE/containerfile-location-test
Add Containerfile location e2e test
2020-02-05 07:13:32 -08:00
OpenShift Merge Robot fb8c49479e
Merge pull request #5052 from mheon/cleanup_net_on_restart
Tear down network when restarting containers
2020-02-05 00:59:07 -08:00
Valentin Rothberg baec9f3b10 vendor github.com/mtrmac/gpgme@v0.1.2
Fixes a build regression on CentOS 7 and RHEL 7 with older gpgme
versions.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-05 09:56:25 +01:00
Valentin Rothberg 801977b40d vendor github.com/containers/image/v5@v5.2.0
See release notes:
	https://github.com/containers/image/releases/tag/v5.2.0

Fixes: #4877
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-05 09:55:50 +01:00
Sascha Grunert 56a9c6ae57
Add Containerfile location e2e test
As a follow up of the location fix in #5080 we now add an e2e test for
that use case.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-02-05 09:03:53 +01:00
OpenShift Merge Robot 5092c078ec
Merge pull request #5085 from rhatdan/close
Close tarSource when finished using it
2020-02-04 13:57:43 -08:00
OpenShift Merge Robot 348e58b59a
Merge pull request #5075 from mheon/filter_forces_all
Force --all when --filter is passed to podman ps
2020-02-04 13:22:57 -08:00
OpenShift Merge Robot fac8318cb0
Merge pull request #5082 from baude/spec
[CI:DOCS] Spec proposal
2020-02-04 12:33:33 -08:00
OpenShift Merge Robot 805c5a5bb6
Merge pull request #5086 from baude/fmtbeforelint
{CI:DOCS] run gofmt before lint
2020-02-04 12:06:59 -08:00
Brent Baude c1a5346713 [CI:DOCS]addition of specgen package
warning: the naming of this might change as well as the location.

this is a build on a PR from mheon from last year that proposes a shift from our current approach of creating containers based on the arbitrarily made createconfig.  the new approach would be to have a specification that is detached from the podman cli.  the spec could then be generated and used to make a container.  this theoretically is the beginning of a long-needed refactor involving how we get from the cli -> libpod | apiv2 -> libpod with code re-use and less duplication.

the intent is to build the apiv2 container creation based on this approach only.  wiring to the podman cli will happen after the fact.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-04 13:46:51 -06:00
Brent Baude 0577493688 {CI:DOCS] run gofmt before lint
the linting task identifies gofmt issues; therefore it makes more sense to run our make gofmt first, which actually fixes the gofmt issues.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-04 13:15:22 -06:00
OpenShift Merge Robot bda3009401
Merge pull request #5033 from sujil02/new-test
Adding test to check Tag and list images endpoints in apis.
2020-02-04 10:58:59 -08:00
OpenShift Merge Robot b702134edc
Merge pull request #5080 from openSUSE/containerfile-context-fix
Fix wrong Containerfile location on build
2020-02-04 10:45:10 -08:00
Daniel J Walsh 03faf97aa0
Close tarSource when finished using it
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1797599

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-02-04 13:12:06 -05:00
OpenShift Merge Robot 537352cc3e
Merge pull request #5079 from openSUSE/error-image-size
Wrap error for failing ImageSize calls
2020-02-04 07:12:56 -08:00
Matthew Heon ee5b749e65 Force --all when --filter is passed to podman ps
When we filter, it should be out of all containers, not just
running ones, by default - this is necessary to ensure Docker
compatability.

Fixes #5050

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-02-04 09:52:25 -05:00
Matthew Heon 4567f39800 Initial implementation of a spec generator package
The current Libpod pkg/spec has become a victim of the better
part of three years of development that tied it extremely closely
to the current Podman CLI. Defaults are spread across multiple
places, there is no easy way to produce a CreateConfig that will
actually produce a valid container, and the logic for generating
configs has sprawled across at least three packages.

This is an initial pass at a package that generates OCI specs
that will supersede large parts of the current pkg/spec. The
CreateConfig will still exist, but will effectively turn into a
parsed CLI. This will be compiled down into the new SpecGenerator
struct, which will generate the OCI spec and Libpod create
options.

The preferred integration point for plugging into Podman's Go API
to create containers will be the new CreateConfig, as it's less
tied to Podman's command line. CRI-O, for example, will likely
tie in here.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-02-04 08:10:23 -06:00
Sascha Grunert 59328a22db
Fix wrong Containerfile location on build
Podman does select the wrong Containerfile if the current working
directory contains a Containerfile but we specify one from a different
location.

Reproducer:
```
> mkdir 1
> echo FROM scratch > Containerfile
> echo FROM golang > 1/Containerfile
> podman build -f 1/Containerfile -t test
STEP 1: FROM scratch
```

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-02-04 14:47:33 +01:00
Sascha Grunert b8a2818e70
Wrap error for failing ImageSize calls
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-02-04 14:21:59 +01:00
OpenShift Merge Robot 28eb296653
Merge pull request #5060 from vrothberg/v2-libpod-image-endpoints
[CI:DOCS] swagger: v2: libpod/images/{import,load,pull}
2020-02-04 05:11:25 -08:00
OpenShift Merge Robot 05e04b4a64
Merge pull request #5073 from baude/sepnetoptions
seperate container create network options
2020-02-04 01:51:09 -08:00
Valentin Rothberg 84381df810 swagger: v2: libpod/images/{import,load,pull}
Note: this commit is merely adding swagger documentation and the golang
stubs and types for the proposed endpoints.  The implementation will
follow in separate individual changes in the future.

The ultimate goal is to prevent the libpod API from exposing the rather
complex /images/create endpoint from Docker and split it into easier to
implement, use and comprehend endpoints with a more narrow focus.

 # Import

Add the v2 swagger documentation for the libpod/images/import endpoint.
Note that we have intend to have separate backend and not mix it up with
load since import allows for specifying a URL instead of a local
tarball.

 # Load

Complete the v2 swagger documentation for the libpod/images/load
endpoint.  Note that we are accounting for future plans to be able to
load multiple images from one oci/docker archive by returning an array
of image-load responses.

Also move the (incomplete) implementation of the generic endpoint to the
corresponding package and create a stub for the libpod handler, which
will be implemented once there's an agreement on the proposed API.

 # Pull

Add the v2 swagger documentation for the libpod/images/pull endpoint.
Similar to the load endpoint, we return an array since more than one
image can be pulled when the `all-tags` parameter is set.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-04 10:45:54 +01:00
OpenShift Merge Robot 54926d1b03
Merge pull request #5061 from baude/apiv2swaggerexec
[CI:DOCS]add apiv2 endpoints for exec
2020-02-04 01:39:45 -08:00
OpenShift Merge Robot c4f6d5615a
Merge pull request #5066 from cevich/fix_gate_wrong_commit
Cirrus: Fix gate task + make lint|validate
2020-02-03 16:05:34 -08:00
OpenShift Merge Robot 234e8382e5
Merge pull request #5067 from jwhonce/wip/ping
[CI:DOCS] Update /_ping support
2020-02-03 13:49:07 -08:00
Brent Baude b438cb2cce seperate container create network options
this pr splits off some of the network container create options into a different flag set.  the options in question are:

--add-host
--dns
--dns-opt
--dns-search
--ip
--mac-address
--network
--no-hosts
--publish

in the future, these options are going to be added to the pod create flags.  this makes that transition easier and provides for less code duplication.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-03 15:30:17 -06:00
Chris Evich dbb9d098b5
Cirrus: Fix gate task + make lint|validate
A recent Makefile change (4ec893a748) removed a side-effect necessary
for 'make validation' to pass under automation.  Making things worse,
change 12bd7e927c was found upon investigation to always point at
the latest upstream HEAD.  However, this is rarely a fork-point for
pull-requests.  Further investigation showed the built-in Cirrus-CI,
golang-based git does not obtain sufficient data for the Makefile
command `git merge-base HEAD $${DEST_BRANCH:-master}` to function
properly (in the context of the gate container).

Fix this by customizing the clone operation and slightly adjust the
Makefile command to function as intended in the gate container.  Also
add checks to the validate and lint targets which validate the
variable EPOCH_TEST_COMMIT value is never an empty string or whitespace.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-02-03 16:23:46 -05:00
Sujil02 68287ff8bd Add a binding test to check image tag and list commands.
Include testcase to validate tag api responses and check if
all the image instaces are shown list command.
Also, Update the binding process and the response

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-02-03 15:33:28 -05:00
Jhon Honce 4d301c8c4f Update /_ping support
* Add swagger support and documentation
* Promote handler as there can only ever be one
* Update swagger tags

Between verbs and paths there are four endpoints for /_ping.  I've
attempted to document them well without four copies of the details.
Time will tell.

Clients will use the headers `Libpod-API-Version` and
`Libpod-Buildha-Version` to determine if they are connecting to a Podman
service or some other compatible engine.

Client calls GET(/_ping):
 * VARLINK engines will fail with error message
 * Compatible engines will return 200 without Libpod headers
 * Podman engines will return 200 and Libpod headers

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-02-03 11:57:54 -07:00
Brent Baude 81296cba82 [CI:DOCS]add apiv2 endpoints for exec
add the openapi/swagger documentation for exec.  The subcommands added are create, inspect, resize, and start.

at the time of this writing, no structure is declared for the inspect response.  once the libpod work for this is complete, we can inherit and swaggerize it.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-02-03 12:40:01 -06:00
OpenShift Merge Robot 23f7957862
Merge pull request #5044 from jwhonce/issues/4335
Update XML to not embed quote in PATH on windows
2020-02-03 06:57:07 -08:00
Daniel J Walsh 5e7d6e52dd
Merge pull request #5053 from containers/dependabot/go_modules/github.com/containers/storage-1.15.8
build(deps): bump github.com/containers/storage from 1.15.7 to 1.15.8
2020-02-03 09:27:58 -05:00
Daniel J Walsh 227d881580
Merge pull request #5054 from containers/dependabot/go_modules/github.com/onsi/gomega-1.9.0
build(deps): bump github.com/onsi/gomega from 1.8.1 to 1.9.0
2020-02-03 09:26:59 -05:00
dependabot-preview[bot] 94453c85c7 build(deps): bump github.com/containers/storage from 1.15.7 to 1.15.8
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.15.7 to 1.15.8.
- [Release notes](https://github.com/containers/storage/releases)
- [Changelog](https://github.com/containers/storage/blob/master/docs/containers-storage-changes.md)
- [Commits](https://github.com/containers/storage/compare/v1.15.7...v1.15.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-03 13:51:31 +01:00
dependabot-preview[bot] fac6b784f8 build(deps): bump github.com/onsi/gomega from 1.8.1 to 1.9.0
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.8.1 to 1.9.0.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.8.1...v1.9.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-02-03 13:50:26 +01:00
Matthew Heon 6d487c781a Tear down network when restarting containers
This makes restart a bit slower for root containers, but it does
make it more consistent with `podman stop` and `podman start` on
a container. Importantly, `podman restart` will now recreate
firewall rules if they were somehow purged.

Fixes #5051

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-02-02 12:51:03 -05:00
Jhon Honce b977048436 Update XML to not embed quote in PATH on windows
* Remove the unsupported commend in lua script

Fixes #4335

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-01-31 15:22:20 -07:00
OpenShift Merge Robot 4699d5e02d
Merge pull request #5041 from mheon/bump-1.8.0-rc1
Bump to v1.8.0-rc1
2020-01-31 10:30:19 -08:00
Matthew Heon a98c36df1a Bump to v1.8.0-dev
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-01-31 12:45:02 -05:00
Matthew Heon 5558c2620c Bump to v1.8.0-rc1
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-01-31 12:44:59 -05:00
OpenShift Merge Robot dd6209e155
Merge pull request #5038 from mheon/fix_release_script
[CI:DOCS] Fix a syntax error in hack/release.sh
2020-01-31 09:17:11 -08:00
OpenShift Merge Robot 781fc827c6
Merge pull request #5036 from vrothberg/fix-5034
sigproxy: return after closing the channel
2020-01-31 08:32:26 -08:00
OpenShift Merge Robot 1cf4b72a6e
Merge pull request #5030 from baude/apiv2longname
fix longname handling for bindings
2020-01-31 08:06:41 -08:00
Matthew Heon 662eab1672 Fix a syntax error in hack/release.sh
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-01-31 10:55:17 -05:00
OpenShift Merge Robot c29273e84f
Merge pull request #5037 from mheon/release_notes_1.8.0
[CI:DOCS] Minor update to release notes
2020-01-31 07:30:45 -08:00
Matthew Heon 68031f9391 Minor update to release notes
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-01-31 10:18:54 -05:00
Valentin Rothberg 868ee6db70 sigproxy: return after closing the channel
When stopping signal handling (e.g., to properly handle ^C) we are also
closing the signal channel.  We should really return from the go-routine
instead of continuing and risking double-closing the channel which leads
to a panic.

Fixes: #5034
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-31 16:13:00 +01:00
Brent Baude f1eaccedfa fix longname handling for bindings
the api needs to account for image input where the image is encoded as a fqd image name.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-01-31 08:38:25 -06:00