Commit graph

616 commits

Author SHA1 Message Date
OpenShift Merge Robot d67f178563
Merge pull request #12750 from rhatdan/error
Change Tests to ignore missing containers when removing --all
2022-01-05 18:10:37 +01:00
OpenShift Merge Robot cbb2b68fc9
Merge pull request #12429 from cdoern/scp
podman image scp never enter podman user NS
2022-01-05 17:50:37 +01:00
Daniel J Walsh 64df41755a
Change Tests to ignore missing containers when removing --all
Fixes: https://github.com/containers/podman/issues/12740

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-01-05 10:46:53 -05:00
Daniel J Walsh 2ff5644bf8
test/system: podman run image with filesystem permission
This test case is used for covering rhbz#1854566.

Replaces: #12220
Signed-off-by: Alex Jia <ajia@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-31 08:59:09 -05:00
Daniel J Walsh fc65b0f73c
test/system: podman run with log-opt option
This test case is used for covering rhbz#1763007.
Replaces: #12221

Signed-off-by: Alex Jia <ajia@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-31 08:49:21 -05:00
cdoern f6d00ea6ef podman image scp never enter podman user NS
Podman image scp should never enter the Podman UserNS unless it needs to. This allows for
a sudo exec.Command to transfer images to and from rootful storage. If this command is run using sudo,
the simple sudo podman save/load does not work, machinectl/su is necessary here.

This modification allows for both rootful and rootless transfers, and an overall change of scp to be
more of a wrapper function for different load and save calls as well as the ssh component

Signed-off-by: cdoern <cdoern@redhat.com>
2021-12-23 10:10:51 -05:00
Daniel J Walsh e8c06fac97
Allow users to add host user accounts to /etc/passwd
Some containers require certain user account(s) to exist within the
container when they are run. This option will allow callers to add a
bunch of passwd entries from the host to the container even if the
entries are not in the local /etc/passwd file on the host.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1935831

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-23 07:51:27 -05:00
OpenShift Merge Robot 1b9a5964db
Merge pull request #12599 from rhatdan/kernelmemory
Warn on use of --kernel-memory
2021-12-23 10:56:08 +01:00
OpenShift Merge Robot 2aea0a5e9b
Merge pull request #12375 from rhatdan/hosts
Use hosts public ip address in rootless containers
2021-12-22 16:40:10 +01:00
Daniel J Walsh a5e49d9668
Warn on use of --kernel-memory
It has been deprecated and is no longer supported.  Fully remove it and
only print a warning if a user uses it.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2011695

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-22 06:20:21 -05:00
Valentin Rothberg 04dbbd96b6 support hosts without /etc/hosts
Fixes: #12667
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-12-22 10:15:24 +01:00
Daniel J Walsh 64ce6949f2
Use hosts public ip address in rootless containers
Add first non localhost ipv4 of all host interfaces as destination
for host.contaners.internal for rootless containers.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-21 08:50:40 -05:00
Giuseppe Scrivano 89ee302a9f
specgen: honor userns=auto from containers.conf
when using the default userns value, make sure its value is parsed so
that userns=auto is parsed and the options for the storage are filled.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-12-20 17:03:40 +01:00
Giuseppe Scrivano 46a094a7a2
test: add --rm to podman run commands
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-12-20 09:00:52 +01:00
Daniel J Walsh f45070ee0e
Merge pull request #12626 from vrothberg/may-the-force-be-with-removal
image rm: allow for force-remove infra images
2021-12-19 06:18:21 -05:00
Valentin Rothberg 12d762f8ee image rm: allow for force-remove infra images
Force removal of images will also remove associated containers.
Historically, infra containers have been excluded resulting in
rather annoying errors, for instance, when running `rmi -af`.

Since there is not reasons to exclude infra containers, allow for
removing the entire pod when an infra image is force removed.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-12-17 13:23:11 +01:00
OpenShift Merge Robot 820cf0e066
Merge pull request #12622 from flouthoc/return_exit_code_for_build
build: relay `exitcode` from imagebuildah to registry
2021-12-17 13:16:23 +01:00
Aditya Rajan 6423174c67
tests: adjust old build test to expect exit code
Old build tests were expecting genric error code `125` however another
commit in this PR ensures that we relay exact exit code from build to
registry.

Hence adjusting tests

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-12-17 16:20:03 +05:30
Valentin Rothberg 3b6510da68 kill: fix output
Make sure that `kill -a` is printing the IDs of killed containers.
Previously, it was only printing empty lines.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-12-16 13:04:58 +01:00
OpenShift Merge Robot 9212c74ff1
Merge pull request #12600 from rhatdan/external
Show --external containers even without --all option
2021-12-15 15:43:11 +01:00
OpenShift Merge Robot 7dabcbd7bc
Merge pull request #12534 from Luap99/network-db
network db rewrite
2021-12-15 15:25:14 +01:00
Daniel J Walsh 51a4bef2e6
Show --external containers even without --all option
We currently do not show --external containers when the user specifies
it, unless they also specify the --all flag. This has led to confusion.
I see no reason not to list them without the --all flag if the user
specifies the option.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-14 16:03:21 -05:00
Paul Holzinger 3e9af2029f
play kube add support for multiple networks
Allow the same --network options for play kube as for podman run/create.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-12-14 15:23:40 +01:00
Paul Holzinger 535818414c
support advanced network configuration via cli
Rework the --network parse logic to support multiple networks with
specific network configuration settings.
--network can now be set multiple times. For bridge network mode the
following options have been added:
  - **alias=name**: Add network-scoped alias for the container.
  - **ip=IPv4**: Specify a static ipv4 address for this container.
  - **ip=IPv6**: Specify a static ipv6 address for this container.
  - **mac=MAC**: Specify a static mac address address for this container.
  - **interface_name**: Specify a name for the created network interface inside the container.

So now you can set --network bridge:ip=10.88.0.10,mac=44:33:22:11:00:99
for the default bridge network as well as for network names.
This is better than using --ip because we can set the ip per network
without any confusion which network the ip address should be assigned
to.
The --ip, --mac-address and --network-alias options are still supported
but --ip or --mac-address can only be set when only one network is set.
This limitation already existed previously.

The ability to specify a custom network interface name is new
Fixes #11534

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-12-14 15:23:39 +01:00
Paul Holzinger 5f1f62f0bb
network ls: show networks in deterministic order
The new network backend stores the networks in a map so the returned
order is not deterministic. Lets sort the network names alphabetically
to ensure a deterministic order.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-12-14 13:52:38 +01:00
Daniel J Walsh 593d0907c5
--hostname should be set when using --pod new:foobar
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2030599

When you create pod, it shares the UTS namespace with Containers.
Currently the --hostname is not passed to the pod created when
you create a container and pod in the same command.

Also fix error message on supported --share flags

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-09 13:09:02 -05:00
Ed Santiago 18854f5666 System tests: remove rm_pause_image()
...it's not needed: teardown() already does it. Or, it would,
if it had been updated to deal with the new pause image naming
convention, which I've just done.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-12-09 08:23:43 -07:00
Valentin Rothberg 2d517b687b generate systemd: support entrypoint JSON strings
Make sure to preserve the quoting of entrypoint JSON strings.

Fixes: #12477
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-12-08 15:51:23 +01:00
OpenShift Merge Robot 9af07fd3ed
Merge pull request #12522 from edsantiago/minor_test_cleanup
tests: clean up FIXMEs and noise
2021-12-06 17:55:24 +00:00
Ed Santiago eee3a42b7e tests: clean up FIXMEs and noise
e2e tests:
 * remove two FIXMEs:
   * one of them is expected behavior, not a FIXME
   * the other is easily fixed

 * File issue #12521 for a real podman-remote bug, and
   update the Skip() message

system tests:
 * in command-completion test, clean up stray podman-pause image
   (followup to #12322, in which I missed this instance). This
   removes distracting warnings from test logs.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-12-06 08:30:59 -07:00
Valentin Rothberg 207065ce9f fix remote run/start flake
Fix the flake reported in #9597 with a workaround to at least stop
wasting energy until the root cause has been found and fixed.

It seems that a remote run returns before the container has transitioned
into the `exited` state which ultimately breaks a subsequent remote
start with attach.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-12-06 15:30:31 +01:00
Jhon Honce 7d22cc88ef Refactor podman system to report.Formatter
[NO NEW TESTS NEEDED]

Support better compatibility output for podman system commands

* Format and content of output from podman version changed to
  be more compatible

See #10974
Depends on containers/common#831

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-12-03 13:48:58 -07:00
Jhon Honce 61792de36e Refactor podman image command output
Leverage new report.Formatter allowing better compatibility from
podman command output.

Follow on PR's will cover containers, etc.

See #10974

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-12-02 09:07:27 -07:00
OpenShift Merge Robot 4aeac1195a
Merge pull request #12307 from hshiina/device-weight
Implement 'podman run --blkio-weight-device'
2021-12-01 21:37:09 +01:00
Hironori Shiina 5a56f40948 Implement 'podman run --blkio-weight-device'
`--blkio-weight-device` is not fully implemented and this causes an
unexpected panic when specified because an entry is put into an
uninitialized map at parsing.

This fix implements the `--blkio-weight-device` and adds a system test.
When creating a spec generator on a client, a major number and a minor
number of a device cannot be set. So, these numbers are inspected on a
server and set to a runtime spec.

Signed-off-by: Hironori Shiina <shiina.hironori@jp.fujitsu.com>
2021-11-30 09:21:28 -05:00
Valentin Rothberg 9a10e2124b systemd: replace multi-user with default.target
Replace `multi-user.target` with `default.target` across the code base.
It seems like the multi-user one is not available for (rootless) users
on F35 anymore is causing issues in all kinds of ways, for instance,
enabling the podman.service or generated systemd units.

Fixes: #12438
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-30 14:37:25 +01:00
Daniel J Walsh 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
Valentin Rothberg 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
Ed Santiago c03b6b54fd Semiperiodic cleanup of obsolete Skip()s
Found by my find-obsolete-skips script. Let's see which, if any,
of these skipped tests can be reenabled.

Some Skips are "this will never work", not "this is expected to
work one day". Update the message on those to reflect that.

Some were real bugs in the test framework. Fix those.

And, joy of joys, some work today. Remove those skips.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-19 08:49:57 -07:00
Ed Santiago d6c18902ef System tests: new checkpoint tests
Includes a test for the stdout-goes-away bug (crun #756).

Skip on Ubuntu due to a many-months-old kernel bug that
keeps getting fixed and then un-fixed.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-17 06:31:50 -07:00
Ed Santiago e367f46147 hack/bats: deal with new bin helpers
Some time in the last month, podman started to depend on a bunch
of external helper binaries: rootlessport, pause, catatonit.
System tests fail without these.

Update the hack/bats script to pass $CONTAINERS_HELPER_BINARIES_DIR
(set to ./bin); podman will then use locally-built helpers. (This
requires https://github.com/containers/common/pull/823 , which as
of this PR is not yet vendored into podman. There is no harm in
merging this while we wait.)

Also: if bats helper is invoked as root, run only once; i.e.,
skip the "rootless" step.

Also (piggybacked): the name of the podman pause image has
changed, from pause to podman-pause. Adjust that in our
teardown so we don't leave droppings.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-16 12:51:17 -07:00
OpenShift Merge Robot f031bd23c6
Merge pull request #12100 from rhatdan/env
Add option --unsetenv to remove default environment variables
2021-11-16 16:27:34 +01:00
OpenShift Merge Robot 45d28c2219
Merge pull request #12285 from nalind/journal-follow-not-early
journald logs: keep reading until the journal's end
2021-11-15 22:09:29 +01:00
Daniel J Walsh 44d1618dd7
Add --unsetenv & --unsetenv-all to remove def environment variables
Podman adds a few environment variables by default, and
currently there is no way to get rid of them from your container.
This option will allow  you to specify which defaults you don't
want.

--unsetenv-all will remove all default environment variables.

Default environment variables can come from podman builtin,
containers.conf or from the container image.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-11-15 15:10:12 -05:00
OpenShift Merge Robot 230f0b622e
Merge pull request #12130 from rhatdan/journal
Error logs --follow if events-backend != journald, event-logger=journald
2021-11-15 20:55:28 +01:00
Nalin Dahyabhai 63ef7135d9 journald logs: keep reading until the journal's end
When reading logs from the journal, keep going after the container
exits, in case it gets restarted.

Events logged to the journal via the normal paths don't include
CONTAINER_ID_FULL, so don't bother adding it to the "history" event we
use to force at least one entry for the container to show up in the log.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2021-11-15 13:38:36 -05:00
OpenShift Merge Robot 9eaa6f4566
Merge pull request #12297 from edsantiago/no_remote_unshare
Network test: fix podman-remote-rootless corner case
2021-11-15 16:42:40 +01:00
OpenShift Merge Robot e9d8ca22b8
Merge pull request #11076 from boaz0/closes_10275
Support template unit files in podman generate systemd
2021-11-15 16:30:38 +01:00
Ed Santiago c21259bf86 Network test: fix podman-remote-rootless corner case
Followup to #12229, in which I added a podman unshare for
flake debugging. Turns out that doesn't work in podman-remote.
It was not caught because CI doesn't run podman-remote rootless.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-15 07:01:22 -07:00
Daniel J Walsh 062c887718
Error logs --follow if events-backend != journald, event-logger=journald
Fixes: https://github.com/containers/podman/issues/11255

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-11-13 07:11:09 -05:00