Commit graph

11491 commits

Author SHA1 Message Date
Ed Santiago 83930a03c5 System tests: fix racy podman-inspect
Add 'podman wait' between kill & inspect.

Fixes: #9751

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-04-14 08:09:20 -06:00
OpenShift Merge Robot 14ec3a64d9
Merge pull request #10014 from mheon/in_memory_state_gone
Remove in-memory state implementation
2021-04-14 07:30:47 -04:00
OpenShift Merge Robot 4a22d6117a
Merge pull request #10008 from edsantiago/bats
System tests: setup: better cleanup of stray images
2021-04-13 22:17:39 +02:00
OpenShift Merge Robot a2bf4c58d4
Merge pull request #10004 from containers/dependabot/go_modules/github.com/containers/ocicrypt-1.1.1
Bump github.com/containers/ocicrypt from 1.1.0 to 1.1.1
2021-04-13 21:47:39 +02:00
Matthew Heon 40e5ae30d5 Remove in-memory state implementation
We originally added this in the *very early* days of Podman,
before a proper persistent state was written, so we had something
to test with. It was retained after the original SQLite state
(and current BoltDB state) were written so it could be used for
testing Libpod in unit tests with no requirement for on-disk
storage. Well, such unit tests never materialized, and if we were
to write some now the requirement to have a temporary directory
for storing data on disk is not that bad. I can basically
guarantee there are no users of this in the wild because, even if
you managed to figure out how to configure it when we don't
document it, it's completely unusable with Podman since all your
containers and pods will disappear every time Podman exits.

Given all this, and since it's an ongoing maintenance burden I no
longer wish to deal with, let's just remove it.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2021-04-13 14:00:38 -04:00
OpenShift Merge Robot 21d6b12689
Merge pull request #10000 from rhatdan/cleanup
Do not delete container twice
2021-04-13 16:33:12 +02:00
Ed Santiago bc2f60ad6d System tests: setup: better cleanup of stray images
Fix a corner case in basic_setup(), where we rmi stray images.
If a test tags $IMAGE and fails to rmi by tag name, cleanup
could rmi both tag name and IID, wiping out the desired image:

   podman tag $IMAGE foo
   ...
   cleanup: rmi foo $FOO_IID   [this removes $IMAGE!]

Solution: rmi by name, but only rmi by IID if != $IMAGE.

TOTH to ypu for bringing this to my attention.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-04-13 06:50:56 -06:00
OpenShift Merge Robot 481556cbee
Merge pull request #10002 from jmguzik/prune-doc-update
Reflect current state of prune implementation in docs
2021-04-13 01:50:25 -07:00
dependabot[bot] 24d2df7307
Bump github.com/containers/ocicrypt from 1.1.0 to 1.1.1
Bumps [github.com/containers/ocicrypt](https://github.com/containers/ocicrypt) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/containers/ocicrypt/releases)
- [Commits](https://github.com/containers/ocicrypt/compare/v1.1.0...v1.1.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-13 08:01:58 +00:00
Jakub Guzik 9d74825c7e Reflect current state of prune implementation in docs
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-04-13 09:16:25 +02:00
OpenShift Merge Robot 6933d4611a
Merge pull request #9381 from cevich/add_make_release
Reorganize and overhaul Makefile & release archive workflows
2021-04-12 12:16:44 -07:00
OpenShift Merge Robot ddffc7fa80
Merge pull request #9996 from giuseppe/disable-cgroupfs-rootless-on-cgroup-v2
cgroup: do not set cgroup parent when rootless and cgroupfs
2021-04-12 12:15:47 -07:00
OpenShift Merge Robot a6fb11e34c
Merge pull request #9998 from rhatdan/VENDOR
vendor in containers/storage v1.29.0
2021-04-12 11:57:44 -07:00
OpenShift Merge Robot d40c3076ac
Merge pull request #9999 from jwhonce/wip/swagger
[CI:DOCS] Correct status code for /pods/create
2021-04-12 11:56:44 -07:00
Daniel J Walsh 801acb01e2
Do not delete container twice
10 lines above we had

	// Set ContainerStateRemoving
	c.state.State = define.ContainerStateRemoving

Which causes the state to not be the two checked states.  Since the
c.cleanup call already deleted the OCI state, this meant that we were
calling cleanup, and hence the postHook hook twice.

Fixes: https://github.com/containers/podman/issues/9983

[NO TESTS NEEDED] Since it would be difficult to tests this.  Main tests
should handle that the container is being deleted successfully.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-04-12 14:54:37 -04:00
Jhon Honce 59283322e7 [CI:DOCS] Correct status code for /pods/create
Swagger documentation reported that the API endpoint /pods/create
returned 200 while the as-built code returned 201. 201 is more
correct so documentation updated.

Tests already checked for 201 so no updated needed.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-04-12 09:33:51 -07:00
OpenShift Merge Robot 7203e0a76a
Merge pull request #9994 from containers/dependabot/go_modules/github.com/containers/image/v5-5.11.0
Bump github.com/containers/image/v5 from 5.10.5 to 5.11.0
2021-04-12 18:25:00 +02:00
Daniel J Walsh 986cd2a6a4
vendor in containers/storage v1.29.0
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-04-12 12:23:11 -04:00
Giuseppe Scrivano 2fad29ccb2
cgroup: do not set cgroup parent when rootless and cgroupfs
do not set the cgroup parent when running as rootless with cgroupfs,
even if cgroup v2 is used.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-04-12 16:55:55 +02:00
OpenShift Merge Robot 3803a2630f
Merge pull request #9956 from rhatdan/pinp
[CI:DOCS] Update podman image Dockerfile to support Podman in container
2021-04-12 16:43:22 +02:00
Chris Evich b6b0b6e8bd
Overhaul Makefile binary and release worflows
* Incorporate changes from abandoned #9918: Use dedicated `bin`
  sub-directories for `windows` and `darwin` when building
  `podman-remote`.  The linux flavor remains under `bin` as before.

* Fix MacOS Documentation-generation for release-packaging.
  The `install-podman-remote-%-docs` target requires local execution
  of `podman-remote`, but it was assuming GOOS=linux.  Fix this
  by dynamically discovering the local OS/architecture type while
  still permitting cross-building of MacOS binaries under Linux.

* Unify temporary directory/file behavior to use a common template.
  In case of left-over temporary items left in the repository,
  update the `clean` target accordingly to remove them.

* Fix broken podman-remote-static and MacOS release archive targets
  mismatching the `podman-remote-%` target.  Disambiguate this target
  for all platforms by spelling each out in full, instead of using
  a wild-card recipe.

* Fix Windows-installer target to properly recognize existing
  output files and not constantly rebuild every time.

* Include the podman version number in the Windows-installer target
  in case a user downloads multiple releases.

* Include a subdirectory containing the podman version number for
  both `tar.gz` and `zip` targets.  This prevents users clobbering
  existing directories when un-archiving from releases.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-04-12 10:21:28 -04:00
Chris Evich a4686883b7
Reorganize Makefile with sections and guide
Over several years the podman Makefile has become a
bloated complex mess.  This impedes both debugging
and maintenance, besides causing general eye-strain.

Fix this by adding a simple navigation/layout guide, to help
developers quickly find what's needed. Re-organize the entire
file according to the new layout guide.  Add section headers
that call out the purpose of the encompassed content, and
are easy to locate with search-tools.

Note: No recipes or definitions have been altered by this
commit, only re-arranged.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-04-12 10:21:28 -04:00
Chris Evich 0e83851f08
Simplify Makefile help target
An in-line Python script, while flexible, is arguably
more complex and less stable than the long-lived `grep`,
`awk`, and `printf`.  Make use of these simple tools
to display a column-aligned table of target and description
help output.

Also, the first target that appears in a Makefile is considered
the default (when no target is specified on the command-line).
However, despite it's name, the `default` target was not listed
first.  Fix this, and redefine "default" target to "all" as
intended, instead of "help".

Lastly, add a small workaround for a vim syntax-hilighting bug.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-04-12 10:19:51 -04:00
OpenShift Merge Robot bd3dcb9ec4
Merge pull request #9969 from jwhonce/wip/manifests
Update manifest API endpoints
2021-04-12 16:17:22 +02:00
Chris Evich 5a703bbf7a
Don't shell to obtain current directory
Instead of shelling out frequently to resolve the current
directory, use the Makefile built-in `$(CURDIR)`.  It has
the exact same meaning w/in the context of a `Makefile`.

Ref.:
https://www.gnu.org/software/make/manual/html_node/Quick-Reference.html

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-04-12 10:01:04 -04:00
Chris Evich 837bb9f492
Remove unnecessary/not-needed release.txt target
Previously this was needed for an automated release process.  That
automation has long since been removed.  Simplify the Makefile
by removing the target and references.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-04-12 10:01:04 -04:00
Chris Evich e296b6023e
Fix incorrect version number output
Signed-off-by: Chris Evich <cevich@redhat.com>
2021-04-12 10:01:03 -04:00
Chris Evich de8243453d
Exclude .gitignore from test req.
Also sort the explicit files by name, since the list is growing.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-04-12 09:59:30 -04:00
OpenShift Merge Robot 0ac73f25eb
Merge pull request #9988 from jmguzik/prune-filters-bindings-net
Add network prune filters support to bindings
2021-04-12 15:50:22 +02:00
OpenShift Merge Robot 9d3e310710
Merge pull request #9935 from EduardoVega/5788-kube-volume
Add support for play/generate kube PersistentVolumeClaims and Podman volumes
2021-04-12 12:36:20 +02:00
OpenShift Merge Robot 3b03ff7d1e
Merge pull request #9950 from Luap99/unshare-rootless-cni
podman unshare: add --rootless-cni to join the ns
2021-04-12 12:33:20 +02:00
Daniel J Walsh adbddac60f
Update podman image Dockerfile to support Podman in container
[NO TEST NEEDED] Can not test this in CI/CD system since it needs to be
merged in order for the Dockerfiles to even work.

Modified the /etc/subuid and /etc/subgid to be able to run in rootless
containers.  The Range can not be the same as on the host.

Add /home/podman/.config/containers/containers.conf to automatically
mount /proc on /proc while inside of the container. This prevents
additional permissions being required that are blocked when not in
--privileged mode.

Setup volumes for /var/lib/containers and
/home/podman/.local/share/containwers

This will prevent the errors where people are doing overlay on overlay.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-04-12 06:31:08 -04:00
OpenShift Merge Robot 0d9b1b832c
Merge pull request #9977 from edsantiago/bud_simplify
buildah-bud tests: simplify
2021-04-12 12:29:21 +02:00
OpenShift Merge Robot 0ee1da50f5
Merge pull request #9981 from containers/dependabot/go_modules/k8s.io/api-0.21.0
Bump k8s.io/api from 0.20.5 to 0.21.0
2021-04-12 12:19:22 +02:00
dependabot[bot] 3627c4b691
Bump github.com/containers/image/v5 from 5.10.5 to 5.11.0
Bumps [github.com/containers/image/v5](https://github.com/containers/image) from 5.10.5 to 5.11.0.
- [Release notes](https://github.com/containers/image/releases)
- [Commits](https://github.com/containers/image/compare/v5.10.5...v5.11.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-12 09:45:08 +00:00
OpenShift Merge Robot 669311d8d8
Merge pull request #9991 from abitrolly/patch-2
[CI:DOCS] Fix slashes in socket URLs
2021-04-12 01:47:23 -07:00
Anatoli Babenia 0f1af6b37d Fix slashes in socket URLs
Signed-off-by: Anatoli Babenia <anatoli@rainforce.org>
2021-04-12 07:19:12 +03:00
OpenShift Merge Robot b31000df35
Merge pull request #9984 from afbjorklund/ssh-panic
[NO TESTS NEEDED] Fix panic when not giving a machine name for ssh
2021-04-11 20:17:19 -07:00
Jakub Guzik 94b9726306 Add network prune filters support to bindings
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-04-10 00:21:35 +02:00
Eduardo Vega 61cb6d61dd Add support for play/generate kube volumes
Signed-off-by: Eduardo Vega <edvegavalerio@gmail.com>
2021-04-09 14:01:13 -06:00
Jhon Honce d41c33eb91 Update manifest API endpoints
* Add validation for manifest name
* Always return an array for manifests even if empty
* Add missing return in df handler when returning error. Caused an
  additional null to be written to client crashing python decoder.

When c/image is refactored to include manifests, manifest endpoints should
be revisited.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-04-09 11:00:06 -07:00
Anders F Björklund 02644eac0d Fix panic when not giving a machine name for ssh
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2021-04-09 17:58:01 +02:00
OpenShift Merge Robot 54dce001cc
Merge pull request #9982 from giuseppe/read-cgroups-stats-uint64
cgroups: force 64 bits to ParseUint
2021-04-09 06:41:03 -04:00
Giuseppe Scrivano ce747466a9
cgroups: force 64 bits to ParseUint
[NO TESTS NEEDED]

force bitsSize==64 so that the string is always parsed to a uint64
instead of using the native int size, that could be not big enough on
32 bits arches.

Closes: https://github.com/containers/podman/issues/9979

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-04-09 10:09:54 +02:00
dependabot[bot] 14375f35ee
Bump k8s.io/api from 0.20.5 to 0.21.0
Bumps [k8s.io/api](https://github.com/kubernetes/api) from 0.20.5 to 0.21.0.
- [Release notes](https://github.com/kubernetes/api/releases)
- [Commits](https://github.com/kubernetes/api/compare/v0.20.5...v0.21.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-09 08:04:51 +00:00
OpenShift Merge Robot 4efac1f760
Merge pull request #9978 from jwakely/master
[CI:DOCS] Fix formatting of podman-build man page
2021-04-08 19:52:21 -04:00
Jonathan Wakely 736be87b25 [CI:DOCS] Fix formatting of podman-build man page
An apostrophe as the first character of the line is a formatting request
in troff, so the words "'Containerfile' or 'Dockerfile'" are not
visible when viewing 'man podman-build'.

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
2021-04-08 22:50:56 +01:00
OpenShift Merge Robot 002180f02a
Merge pull request #9971 from jwhonce/wip/df
Add missing return
2021-04-08 17:15:22 -04:00
Ed Santiago f56f5851b3 buildah-bud tests: simplify
Experience this week has shown that managing .diff files
is too difficult for humans, and too fragile. Opportunities
for errors abound. So, let's try to minimize the diffs.

We can't eliminate the diffs to helpers.bash: those are
true code changes that are absolutely required for running
tests using podman instead of buildah. We need to carry
those ourselves: they are not appropriate for the buildah
repo itself.

What we can do is simplify the patching of bud.bats. That
is fragile, because bud.bats changes often, and context-
sensitive git patch files can easily get confused.

Recognizing that the changes to bud.bats fall under two types:

  - tests that are skipped
  - tests in which podman error messages differ from buildah's

...we now have a new script, apply-podman-deltas, which
is (I hope) much user-friendlier. It understands two directives:

  errmsg - alter the expected error message
  skip   - skip a test

Both operate based on a bats test name. The test name must
match exactly. These directives use 'sed' to update bud.bats.
If any directive fails, the script will keep going (so you
get as many errors as possible in a run), then exits failure.

Instructions (README.md) now explain the process for dealing
with all expected test failures.

(Sneak checkin: add '--filter=NAME' option to test runner,
allowing for targeted and much shorter test runs).

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-04-08 14:43:49 -06:00
OpenShift Merge Robot 3a03c2ec71
Merge pull request #9121 from tmds/swagger_remove_name_wildcards
[NO TESTS NEEDED] swagger: remove name wildcards
2021-04-08 13:04:23 -04:00