13266 Commits

Author SHA1 Message Date
d987f26f1e Merge pull request #11703 from n1hility/disable-fcos-moby
[NO TESTS NEEDED] Disable docker and alias to podman in FCOS ignition
2021-09-29 13:29:04 -04:00
4b9cd9201b Merge pull request #11781 from vrothberg/spec
podman run - avoid calls to JSONDeepCopy
2021-09-29 13:26:03 -04:00
a22a9a5218 Merge pull request #11761 from umohnani8/init
Add port configuration to first regular container
2021-09-29 10:32:10 -04:00
512a994e8b Merge pull request #11637 from ashley-cui/warn
[NO TESTS NEEDED] Remind user to check connection or use podman machine
2021-09-29 10:31:06 -04:00
c9ea2cae1e Storage can remove ErrNotAContainer as well
Fixes: https://github.com/containers/podman/issues/11775

[NO TESTS NEEDED] No easy way to cause this problem in CI.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-29 10:12:49 -04:00
ccff77025c libpod: container create: init variable: do not deep copy spec
Do not create an expensive deep copy for the provided spec.Spec
when creating a container.  No API should be expected to create
deep copies of arguments unless explicitly documented.

This removes the last call to JSONDeepCopy in a simple
`podman run --rm -d busybox true`.

[NO TESTS NEEDED]

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-09-29 14:24:11 +02:00
5ea369adef libpod: add GetConfigNoCopy()
Add a new function to libpod to directly access the runtime
configuration without creating an expensive deep copy.  Further migrate
a number of callers to this new function.

This drops the number of calls to JSONDeepCopy from 4 to 1 in a simple
`podman run --rm -d busybox top`.

Future work: Please note that there are more callers of GetConfig() that
can me migrated to GetConfigNoCopy().

[NO TESTS NEEDED]

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-09-29 14:24:09 +02:00
30bf31010e libpod: add execSessionNoCopy
To avoid creating an expensive deep copy, create an internal function to
access the exec session.

[NO TESTS NEEDED]

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-09-29 13:44:55 +02:00
98176f0018 libpod: do not call (*container).Spec()
Access the container's spec field directly inside of libpod instead of
calling Spec() which in turn creates expensive JSON deep copies.

Accessing the field directly drops memory consumption of a simple
podman run --rm busybox true from ~700kB to ~600kB.

[NO TESTS NEEDED]

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-09-29 13:44:39 +02:00
453c49c488 Merge pull request #11774 from mheon/fix_11750
Ensure pod ID bucket is properly updated on rename
2021-09-29 04:36:08 -04:00
2d86051893 Pod Device-Read-BPS support
added the option for the user to specify a rate, in bytes, at which they would like to be able
to read from the device being added to the pod. This is the first in a line of pod device options.

WARNING: changed pod name json tag to pod_name to avoid confusion when marshaling with the containerspec's name

Signed-off-by: cdoern <cdoern@redhat.com>
2021-09-28 21:20:01 -04:00
97f755f87b Remind user to check connection or use podman machine
Remind user to check their remote linux connection or use podman
machine. Move the warning from bindings to cmd/podman.

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-09-28 17:01:57 -04:00
cd10304dca Merge pull request #11769 from afbjorklund/make-dash
Fix contributor make targets on Ubuntu and Debian
2021-09-28 16:16:15 -04:00
678b554b1f Ensure pod ID bucket is properly updated on rename
As we were not updating the pod ID bucket, removing a pod with
containers still in it (including the infra container, which will
always suffer from this) will not properly update the name
registry to remove the name of any renamed containers. This
patch ensures that does not happen - all containers will be fully
removed, even if renamed.

Fixes #11750

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2021-09-28 14:12:18 -04:00
60824c6130 Fix contributor make targets on Ubuntu and Debian
It was trying to run a bash script with sh

[NO TESTS NEEDED] This changes "make lint"

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2021-09-28 18:50:33 +02:00
14acec94b7 Merge pull request #11768 from vrothberg/deep-copy
libpod: do not call (*container).Config()
2021-09-28 12:40:14 -04:00
05f62e31f9 Merge pull request #11615 from cevich/pr_template
[CI:DOCS] Implement PR template to assist review & release
2021-09-28 12:37:13 -04:00
0d4fa7bc97 Implement PR template to assist review & release
This duplicates the template used for buildah.  The intention
is to make it immediately clear to reviewers:

* The intended/basic purpose of the PR (also machine readable)
* Why are changes being proposed
* If there are any specific items need additional checking or scrutiny
* What should go into the release-notes (if anything).

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-09-28 12:20:03 -04:00
5d6ea90e75 libpod: do not call (*container).Config()
Access the container's config field directly inside of libpod instead of
calling `Config()` which in turn creates expensive JSON deep copies.

Accessing the field directly drops memory consumption of a simple
`podman run --rm busybox true` from 1245kB to 410kB.

[NO TESTS NEEDED]

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-09-28 17:18:02 +02:00
a3cdee9796 [NO TESTS NEEDED] Add port configuration to first regular container
When generating a kube yaml and there is a port configuration
add the configuration to the first regular container in the pod
and not to the init container.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2021-09-28 11:13:24 -04:00
381ab48c25 Merge pull request #11760 from rhatdan/dockerfile
Add dockerfile.5 as man link to containerfile man page
2021-09-28 10:04:14 -04:00
2d22d17066 Merge pull request #11751 from Luap99/net-alias
always add short container id as net alias
2021-09-28 10:03:17 -04:00
cc23e059d9 Merge pull request #11765 from vrothberg/no-dot
[CI:DOCS] cmd/podman: no dot for short descriptions
2021-09-28 09:04:14 -04:00
7a748f028c Merge pull request #11762 from edsantiago/bats
System tests: speed up. They've gotten too slow.
2021-09-28 09:02:14 -04:00
d14f66972a [CI:DOCS] cmd/podman: no dot for short descriptions
Remove trailing dots in the short descriptions for the sake of
consistency.  Noticed while parsing `podman help`.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-09-28 14:53:03 +02:00
1c8926285d move network alias validation to container create
Podman 4.0 currently errors when you use network aliases for a network which
has dns disabled. Because the error happens on network setup this can
cause regression for old working containers. The network backend should not
validate this. Instead podman should check this at container create time
and also for network connect.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-28 13:40:27 +02:00
d0950f3efe set --cni-config-dir for exit command
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-28 13:40:27 +02:00
05614ee139 always add short container id as net alias
This matches what docker does. Also make sure the net aliases are also
shown when the container is stopped.

docker-compose uses this special alias entry to check if it is already
correctly connected to the network. [1]
Because we do not support static ips on network connect at the moment
calling disconnect && connect will loose the static ip.

Fixes #11748

[1] 0bea52b18d/compose/service.py (L663-L667)

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-28 13:40:22 +02:00
f2ffb96eb3 Merge pull request #11737 from vrothberg/fix-11472
image prune: support removing external containers
2021-09-28 07:34:12 -04:00
a9a54eefab image prune: support removing external containers
Support removing external containers (e.g., build containers) during
image prune.

Fixes: #11472
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-09-28 10:24:16 +02:00
86083c580b System tests: speed up. They've gotten too slow.
- logs: remove unnecessary sleeps. This saves ~25s.
   Unfortunately, journald seems to have some sort of lag,
   so we need to keep retrying until we get the 'after' string.

 - ps: add placeholder test for once buildah 3544 is fixed

 - cp: bulk-kill containers when finished, instead of one by one.
   This is a big change and only saves about 8s per run, but hey.

 - mount,pause,healthcheck: 'podman stop -t 0' before rm'ing containers.
   Easy 50s.
   Have I mentioned, lately, that 'podman rm -f' needs a '-t 0' flag?

 - play: same, and also 'podman pod stop'. Seems to shave ~20s.

 - socket-activation: UGH! Buggy and useless tests! They were
   running "sleep 90" containers for no reason whatsoever. I
   assume the intention was to run them with "-d", so that's
   what I've done here. Also fixed some language. 180 seconds!

(Unrelated: cleanup in 070-build, use $IMAGE, not alpine)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-09-27 20:06:18 -06:00
340166876e Merge pull request #11759 from jedieaston/msi-fix
Set MSI to be 64-bit only.
2021-09-27 15:35:58 -04:00
2fabd44fe5 Merge pull request #11756 from Luap99/network-prune
CNI: network remove do not error for ENOENT
2021-09-27 15:23:57 -04:00
739359d899 Merge pull request #11702 from cevich/gitlab_runner_test
Cirrus: Add gitlab podman runner test
2021-09-27 15:02:57 -04:00
344ba32c87 Add dockerfile.5 as man link to containerfile man page
containers-common now ships a containerfile man page,
this patch adds a link to dockerfile.5 so that if user
installs podman-docker package man dockerfile will work.

[NO TESTS NEEDED] since this is just a man page change.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-09-27 14:54:14 -04:00
87559b0209 Set MSI to be 64-bit only.
Hi there! I noticed that the MSI file built for Windows was building in 32-bit mode, even though Podman is 64-bit only. I added a flag to wixl in the Makefile to tell it to build a 64-bit MSI, and I adjusted the podman.wxs file to use the right settings for 64-bit programs.

Signed-off-by: GitHub <noreply@github.com>
2021-09-27 17:45:50 +00:00
ca3c08bf9c fix podman network prune integration test flakes
The podman integration tests run in parallel. Because all tests use the
same CNI config dir the podman network prune test will remove networks
which are used by other tests at the moment and thus creating
unexpected flakes.

The solution use an extra cni config dir for the network prune test.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-27 18:23:21 +02:00
b60cff8cf8 Merge pull request #11754 from flouthoc/podman-stop-report-non-running
stop: Do nothing if container was never created in runtime or in a invalid state.
2021-09-27 11:58:59 -04:00
899d5d7d7c Merge pull request #11755 from nalind/remote-build-eval-contextdir
remote build: EvalSymlinks() the context directory
2021-09-27 11:12:57 -04:00
f76fa3475d Cirrus: Add gitlab podman runner test
Add execution of the downstream gitlab-runner tests using
rootless podman through the magic of socket-level
docker compatibility.  Include a comment suggesting how
to temporarily disable the test in case it fails beyond
podman code scope.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-09-27 10:37:31 -04:00
1df0646b01 CNI: network remove do not error for ENOENT
Make podman network rm more robust by checking for ENOENT if we cannot
remove the config file. If it does not exists there is no reason to
error. This is especially useful for podman network prune.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-27 16:08:30 +02:00
464fec260c remote build: EvalSymlinks() the context directory
Use EvalSymlinks() to find the context directory, in case there's
shenanigans.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2021-09-27 09:27:06 -04:00
8fca626e33 stop: Do nothing if container was never created in runtime
Following commit ensures we silently return container id on `stop` if
container was never created in OCI runtime.

Following behaviour ensures that we are in parity with docker.

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-09-27 17:27:15 +05:30
e27470ba97 Merge pull request #11753 from vrothberg/VENDOR
Vendor in containers/common v0.46.0
2021-09-27 07:20:14 -04:00
3ce98a5ec2 logging: new mode -l passthrough
it allows to pass the current std streams down to the container.

conmon support: https://github.com/containers/conmon/pull/289

[NO TESTS NEEDED] it needs a new conmon.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-09-27 12:07:01 +02:00
869cb9a654 Merge pull request #11752 from Luap99/machine-no-userns
podman machine: do not join userns
2021-09-27 05:43:10 -04:00
3600054d13 Allow machine options to be set from containers.conf
CPUS, memory, disk size, and image path defaults can be set from
[machine] table in containers.conf

[NO TESTS NEEDED]

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-09-27 11:36:41 +02:00
5a2ca77b9b Vendor in containers/common v0.46.0
Fixes: https://github.com/containers/podman/issues/11745

[NO TESTS NEEDED] Since this is just a revendor and a one line
change for the revendor

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-09-27 11:30:09 +02:00
c668ca8597 podman machine: do not join userns
The go logic already prevents podman from joining the userns for machine
commands but the c shortcut code did not.

[NO TESTS NEEDED]

Fixes #11731

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-09-27 10:18:23 +02:00
e19a09c3df Merge pull request #11609 from sankalp-r/add-healthcheck-ps
added healthcheck to ps command
2021-09-24 16:51:28 -04:00