13566 Commits

Author SHA1 Message Date
2e50514ade Move the chown to after the ADDs
I have noticed that the containers.conf file in the /home/podman
directory is owned by root and not Podman. This change fixes the
ownership.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-11-29 09:35:32 -05:00
3d19f1a7fa Merge pull request #12431 from matejvasek/fix-ctr-archive-ep
fix: error reporting for archive endpoint
2021-11-29 12:14:17 +01:00
cbda62d1be fix: error reporting for archive endpoint
Returning 500 when copying to read-only destination.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-11-28 19:02:15 +01:00
7324d94648 Merge pull request #12406 from Luap99/xdg-checkpoint
checkpoint do not modify XDG_RUNTIME_DIR
2021-11-25 12:02:10 +01:00
12f73d5f88 Merge pull request #12403 from giuseppe/improve-cgroup-detection
libpod: improve heuristic to detect cgroup
2021-11-25 11:59:09 +01:00
bc3c5be2fb checkpoint do not modify XDG_RUNTIME_DIR
We should not modify the XDG_RUNTIME_DIR env value during runtime of
libpod, this can cause hard to find bugs. Only set it for the OCI
runtime, this matches the other commands such as start, stop, kill...

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-24 15:02:11 +01:00
e648122b29 libpod: improve heuristic to detect cgroup
improve the heuristic to detect the scope that was created for the container.
This is necessary with systemd running as PID 1, since it moves itself
to a different sub-cgroup, thus stats would not account for other
processes in the same container.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-11-24 14:50:12 +01:00
a66f40b4df libpod, inspect: export cgroup path
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-11-24 14:50:12 +01:00
b25b330306 stats: get the memory limit from the spec
OCI runtimes may set the memory limits in different ways, e.g., crun
creates a sub-cgroup where the limits are applied, while runc applies
them directly on the created cgroup.  Since there is standardization
on the cgroup path to use, just use the limit specified in the spec
file.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-11-24 14:50:12 +01:00
93138541f3 Merge pull request #12404 from giuseppe/unlock-thread-only-on-success
libpod: leave thread locked on errors
2021-11-24 13:37:01 +01:00
c7ebaeee0e libpod: leave thread locked on errors
if the SELinux label could not be restored correctly, leave the OS
thread locked so that it is terminated once it returns to the threads
pool.

[NO NEW TESTS NEEDED] the failure is hard to reproduce

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-11-24 11:08:23 +01:00
4b014a3aec Merge pull request #12398 from edsantiago/remove_betrue
continue e2e test cleanup
2021-11-24 09:07:02 +01:00
04be1e6485 Merge pull request #12388 from rhatdan/test
Unset SocketLabel after system finishes checkpointing
2021-11-24 01:46:09 +01:00
eb3708a524 Find and fix empty Expect()s
That previous commit made me wonder if there are any other
instances of Expect() with no assertions.

   grep Expect test/e2e/*_test.go |egrep -v '\.(To|NotTo|Should)'

...finds a couple of handfuls, most of which are OK (continued
on the next line) but a few of which are bugs. Fix those.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-23 15:39:04 -07:00
df6aa67302 Unset SocketLabel after system finishes checkpointing
This should fix the SELinux issue we are seeing with talking to
/run/systemd/private.

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

Also unset the XDG_RUNTIME_DIR if set, since we don't know when running
as a service if this will cause issue.s

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-11-23 16:31:54 -05:00
c034147fe7 Remove StringInSlice(), part 2
These were NOPs, and were testing the wrong thing (pod ID,
not container ID). Fixed manually.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-23 13:50:35 -07:00
2fcb39586c Remove StringInSlice(), part 1
via: sed -i -e 's/Expect(StringInSlice(\(.*\), \(.*\))).To(BeTrue())/Expect(\2)\.To(ContainElement(\1))/' test/e2e/*_test.go

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-23 13:50:35 -07:00
cd59721de1 e2e test cleanup, continued
Continue eliminating GrepString() and BeTrue(), in tiny
incremental steps. Here I take the liberty of refactoring
some hard-to-read code by adding a helper.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-23 13:50:35 -07:00
1be4c36e7e Merge pull request #12371 from jakub-dzon/env-config-maps
Support env variables based on ConfigMaps sent in payload
2021-11-23 19:30:15 +01:00
3482f3f32d Merge pull request #12397 from mheon/warn_on_failed_update
Warn on failing to update container status
2021-11-23 13:28:39 -05:00
b2d4d62c13 Merge pull request #12377 from markzhang1996/patch-1
[CI:DOCS] Update basic_networking.md
2021-11-23 17:11:15 +01:00
5336363957 Update basic_networking.md
Correct a missing link in basic networking tutorial.

Signed-off-by: Mark Zhang <markzhang1994@gmail.com>
2021-11-23 23:43:32 +08:00
400ccc6205 Merge pull request #12328 from serverwentdown/fix-compat-ipaddress
compat: Add subnet mask behind IP address to match Docker API
2021-11-23 10:39:32 -05:00
ee61280665 Merge pull request #12361 from rhatdan/remote
podman-remote does not support signature-policy
2021-11-23 09:50:26 -05:00
5cf2683bfe Warn on failing to update container status
failed to send a signal to the container's PID1, but ignored the
results of that update. That's generally bad practice, since even
if we can't directly take action on an error, we should still
make an effort to report it for debugging purposes. I used Infof
instead of something more serious to avoid duplicate reporting to
the user if something has gone seriously wrong.

[NO NEW TESTS NEEDED] this is just adding additional error reporting.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-11-23 09:50:12 -05:00
9e07cb17a9 Merge pull request #12394 from flouthoc/oci_dont_send_signal_to_dead
oci: exit `gracefully` if container is already dead instead of trying to `kill` it.
2021-11-23 14:58:16 +01:00
3a19cdcc77 Merge pull request #12010 from vrothberg/fix-11964
image lookup: do not match *any* tags
2021-11-23 13:23:32 +01:00
a4e4b8d926 oci: ack crun output when container is not there
`crun status ctrid` outputs `No such file or directory` when container
is not there so podman much ack it.

[NO NEW TESTS NEEDED]

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-11-23 16:41:28 +05:30
08558b27ff oci: exit gracefully if container is already dead
While trying to kill a container with a `signal` we cant do anything if
container is already dead so `exit` gracefully instead of trying to
delete container again. Get container status from runtime.

[ NO NEW TESTS NEEDED ]

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-11-23 16:40:53 +05:30
dd80635df0 Support env variables based on ConfigMaps sent in payload
Fixes #12363

Signed-off-by: Jakub Dzon <jdzon@redhat.com>
2021-11-23 11:40:28 +01:00
90c635fd67 Merge pull request #12380 from vrothberg/fix-11618
generate systemd: add --start-timeout flag
2021-11-23 11:25:41 +01:00
0d1aaf080e image lookup: do not match *any* tags
For reasons buried in the history of Podman, looking up an untagged
image would match any tag of matching image. For instance, looking up
centos would match a local image centos:foobar.  Change that behavior
to only match the latest tag.

Fix: #11964
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-23 11:15:03 +01:00
a55473bea8 Merge pull request #12387 from edsantiago/remove_betrue
e2e tests: clean up antihelpful BeTrue()s
2021-11-23 10:54:40 +01:00
566b78dd02 generate systemd: add --start-timeout flag
Add a new flag to set the start timeout for a generated systemd unit.
To make naming consistent, add a new --stop-timeout flag as well and let
the previous --time map to it.

Fixes: #11618
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-23 09:38:51 +01:00
49d63ad5c1 Oops! Manual edits to broken tests
Commit 2 of 2: there were (still are?) a bunch of string
checks that didn't have a corresponding Expect(). IIUC
that means they were NOPs. Try to identify and fix those.

The first few were caught by Go linting, "ok is defined
but not used". When I realized the problem, I looked for
more using:

    $ ack -A2 LineInOutputStartsWith

...and tediously eyeballing the results, looking for
matches in which the next line was not Expect(). If
test was wrong (e.g. "server" should've been "nameserver"),
fix that.

Also: remove the remove-betrue script. We don't need it
in the repo, I just wanted to preserve it for posterity.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-22 15:23:08 -07:00
97ab9176f7 e2e tests: clean up antihelpful BeTrue()s
Many ginkgo tests have been written to use this evil form:

    GrepString("foo")
    Expect(that to BeTrue())

...which yields horrible useless messages on failure:

    false is not true

Identify those (automatically, via script) and convert to:

    Expect(output to ContainSubstring("foo"))

...which yields:

    "this output" does not contain substring "foo"

There are still many BeTrue()s left. This is just a start.

This is commit 1 of 2. It includes the script I used, and
all changes to *.go are those computed by the script.
Commit 2 will apply some manual fixes.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-22 14:37:43 -07:00
1bfbb28b03 Merge pull request #12389 from cevich/remove_static
[CI:DOCS] Cirrus: Strip out static nix build
2021-11-22 22:33:30 +01:00
992fafa9ab Merge pull request #12386 from baude/playkuberename
Rename pod on generate of container
2021-11-22 16:19:58 -05:00
3eb1453b80 Merge pull request #12352 from Luap99/netavark-err
Fix netavark error handling and teardown issue
2021-11-22 16:01:40 -05:00
0b7c132d9f Merge pull request #12301 from umohnani8/table
Add note about volume with unprivileged container
2021-11-22 21:52:31 +01:00
aa301225aa Cirrus: Strip out static nix build
Unfortunately the maintainer of this is no longer available

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-11-22 14:50:16 -05:00
ed83ef2517 Merge pull request #12384 from containers/dependabot/go_modules/github.com/containers/image/v5-5.17.0
Bump github.com/containers/image/v5 from 5.16.1 to 5.17.0
2021-11-22 14:26:45 -05:00
179405ee3b Merge pull request #12385 from umohnani8/docs
[CI:DOCS] Update notes on java TZ in man page
2021-11-22 20:25:32 +01:00
9133c5646c Merge pull request #12381 from flouthoc/build-layer-docker-compat
compat: add layer caching compatiblity for `non-podman` clients.
2021-11-22 19:02:31 +01:00
9c8fb5cc0c Rename pod on generate of container
When generating kube of a container, the podname and container name in
the yaml are identical.  This offends rules in podman where pods and
containers cannot have the same name.  We now append _pod to the
podname to avoid that collision.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2021-11-22 11:50:08 -06:00
2ab28140d6 [CI:DOCS] Update notes on java TZ in man page
Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2021-11-22 12:28:35 -05:00
73e95d1c3e Bump github.com/containers/image/v5 from 5.16.1 to 5.17.0
Bumps [github.com/containers/image/v5](https://github.com/containers/image) from 5.16.1 to 5.17.0.
- [Release notes](https://github.com/containers/image/releases)
- [Commits](https://github.com/containers/image/compare/v5.16.1...v5.17.0)

---
updated-dependencies:
- dependency-name: github.com/containers/image/v5
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-22 17:01:27 +00:00
55dbc4e198 Merge pull request #12373 from TomSweeneyRedHat/dev/tsweeney/jdoc
[CI:DOCS] Add java TZ note to run manpage
2021-11-22 17:54:13 +01:00
28f1c7f49f Merge pull request #12382 from containers/dependabot/go_modules/github.com/opencontainers/selinux-1.10.0
Bump github.com/opencontainers/selinux from 1.9.1 to 1.10.0
2021-11-22 11:51:58 -05:00
40ae7e74b7 Merge pull request #12349 from edsantiago/clean_fixmes
Semiperiodic cleanup of obsolete Skip()s
2021-11-22 17:51:14 +01:00