16078 Commits

Author SHA1 Message Date
88b57dd9f1 fix broken machine test
The memory both local and in the CI test is converted to 3822. I don't
know why this changed but I want to have this working again. For the
future we should look at a more robust solution.

Fixes #15012

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-07-21 18:11:53 +02:00
19f4a463ed pkg/machine/e2e: do not import from cmd/podman
The same problem again as 4374038cc67405e3f5555b1870d5bb7f6570fa5d.

Also fix the incorrect --format autocompletion struct.

It should be avoided to import cmd/podman/... packages from outside of
cmd/podman. This can lead in weird hard to debug import paths but also
can have negative consequences when imported in unit tests. In this case
it will set XDG_CONFIG_HOME and thus the machine tests this dir over the
tmp HOME env variable which is set at a later point. This caused machine
files to be leaked into the actual users home dir.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-07-21 18:04:11 +02:00
604920dd11 fix some pkg/machine/e2e test to read stderr
Also fix the machine ssh code order to provide a better error message.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-07-21 18:04:11 +02:00
ee35ce86d0 enable linter for pkg/machine/e2e
Rename all files to _test.go and rename the package to e2e_test. This
makes the linter less strict about things like dot imports.

Add some unused nolint directives to silence some warnings, these can be
used to find untested options so someone could add tests for them.

Fixes #14996

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-07-21 18:04:10 +02:00
dd2b794061 libpod: create /etc/passwd if missing
create the /etc/passwd and /etc/group files if they are missing in the
image.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-07-21 17:58:16 +02:00
b79ac0aca2 remote push: show copy progress
`podman-remote push` has shown absolutely no progress at all. Fix that
by doing essentially the same as the remote-pull code does.

The get-free-out-of-jail-card for backwards compatibility is to let the
`quiet` parameter default to true.  Since the --quioet flag wasn't
working before either, older Podman clients do not set it.

Also add regression tests to make sure we won't regress again.

Fixes: #11554
Fixes: #14971
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-07-21 17:13:36 +02:00
04ed519e9d Merge pull request #15021 from Luap99/e2e-timeout-output
e2e: show command and output when a timeout happens
2022-07-21 16:08:38 +02:00
afbfbe18a1 compose test: remove cni config copy
The network backend always has default config in memory so there is no
need to copy it. Also netavark cannot use it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-07-21 15:37:10 +02:00
56093a3b46 compat api: always turn on network isolation for networks
Fix some network option parsing logic to use constants.
Always use the isolate option since this is what docker does.
Remove the icc option, this is different from isolate and it is not
implemented.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-07-21 15:36:33 +02:00
80ad0cfd05 compat api: allow default bridge name for networks
Docker uses "bridge" as default network name so some tools expect this
to work with network list or inspect. To fix this we change "bridge" to
the podman default ("podman") name.

Fixes #14983

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-07-21 15:09:39 +02:00
53dfc23e42 Merge pull request #14984 from Luap99/logs
fix goroutine leaks in events and logs backend
2022-07-21 14:55:31 +02:00
3a016c6e49 e2e: show command and output when a timeout happens
To make debugging easier we should see the command and its output when a
failure happens.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-07-21 14:43:00 +02:00
5abb38238d Merge pull request #15004 from vrothberg/fix-duplicates
podman-remote pull: fix duplicate progress outputs
2022-07-21 14:29:40 +02:00
138d185cc5 Bump github.com/BurntSushi/toml from 1.1.0 to 1.2.0
Bumps [github.com/BurntSushi/toml](https://github.com/BurntSushi/toml) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/BurntSushi/toml/releases)
- [Commits](https://github.com/BurntSushi/toml/compare/v1.1.0...v1.2.0)

---
updated-dependencies:
- dependency-name: github.com/BurntSushi/toml
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-21 12:11:35 +00:00
712267ee20 Merge pull request #14980 from n1hility/fix-leak
Fix potential body leak on mid-stream read error when fetching artifact version
2022-07-21 13:03:36 +02:00
ab4c58bd39 Compat API: unify pull/push and add missing progress info
Progress bar in JSONMessage is missing compared to docker output both in
pull and push. Additionaly, pull was not using JSONMessage while push
was using the type.
[NO NEW TESTS NEEDED]

Signed-off-by: Jakub Guzik <jguzik@redhat.com>
2022-07-21 10:56:17 +02:00
c1f04a024a podman-remote pull: fix duplicate progress outputs
By vendoring the fixes from containers/image.  Also add a test (thanks
@edsantiago) to make sure we won't regress in the future again.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-07-21 10:04:45 +02:00
0de7e4662e Merge pull request #14907 from flouthoc/remove-hooks
pkg,libpod: remove `pkg/hooks` and use `hooks` from `c/common`
2022-07-21 09:19:46 +02:00
af118f7c6a libpod: do not lock all containers on pod rm
do not attempt to lock all containers on pod rm since it can cause
deadlocks when other podman cleanup processes are attempting to lock
the same containers in a different order.

[NO NEW TESTS NEEDED]

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-07-21 09:17:33 +02:00
039deece50 Merge pull request #14995 from ashley-cui/machtest
Fix machine test
2022-07-20 21:56:36 +02:00
dd74ef4f58 Merge pull request #14958 from cdoern/network
[CI:DOCS] document isolate option for network create
2022-07-20 19:43:19 +02:00
abfdd4b00c Merge pull request #14977 from umohnani8/init
Update init ctr default for play kube
2022-07-20 19:37:25 +02:00
139d65be82 Fix machine test
DownloadVMImage takes an extra argument.

Signed-off-by: Ashley Cui <acui@redhat.com>
2022-07-20 13:29:46 -04:00
438fef1caa kube secret handling for podman play kube
add support for both creating a secret using yaml and mounting a secret as a volume given a yaml file.
Kubernetes secrets have a different structure than podman and therefore have to be handeled differently.
In this PR, I have introduced the basic usecases of kube secrets with more implementations like env secrets
to come!

resolves #12396

Signed-off-by: Charlie Doern <cdoern@redhat.com>
2022-07-20 12:55:33 -04:00
8d190fc481 vendor: remove unused deps
Some deps cleaned by `make vendor`

[NO NEW TESTS NEEDED]
[NO TESTS NEEDED]

Signed-off-by: Aditya R <arajan@redhat.com>
2022-07-20 21:58:08 +05:30
013300a7c0 Makefile: remove building pages for man5
[NO NEW TESTS NEEDED]
[NO TESTS NEEDED]

Signed-off-by: Aditya R <arajan@redhat.com>
2022-07-20 21:58:04 +05:30
19495b9fc4 makefile: remove processing of pkg/docs
Since no pkg now containers this path

[NO NEW TESTS NEEDED]
[NO TESTS NEEDED]

Signed-off-by: Aditya R <arajan@redhat.com>
2022-07-20 21:58:01 +05:30
f649851350 rpkg: remove usage of pkg/hooks
Podman is using pkg/hooks from c/common and following man page is moved
to c/common

[NO NEW TESTS NEEDED]
[NO TESTS NEEDED]

Signed-off-by: Aditya R <arajan@redhat.com>
2022-07-20 21:57:57 +05:30
ffe5da20a0 pkg,libpod: remove pkg/hooks and use hooks from c/common
PR https://github.com/containers/common/pull/1071 moved `pkg/hooks` to
`c/common` hence remove that from podman and use `pkg/hooks` from
`c/common`

[NO NEW TESTS NEEDED]
[NO TESTS NEEDED]

Signed-off-by: Aditya R <arajan@redhat.com>
2022-07-20 21:57:50 +05:30
da33f10055 Update init ctr default for play kube
Update the init container type default to once instead
of always to match k8s behavior.
Add a new annotation that can be used to change the init
ctr type in the kube yaml.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2022-07-20 10:02:32 -04:00
4e72aa5860 fix goroutine leaks in events and logs backend
When running a single podman logs this is not really important since we
will exit when we finish reading the logs. However for the system
service this is very important. Leaking goroutines will cause an
increased memory and CPU ussage over time.

Both the the event and log backend have goroutine leaks with both the
file and journald drivers.

The journald backend has the problem that journal.Wait(IndefiniteWait)
will block until we get a new journald event. So when a client closes
the connection the goroutine would still wait until there is a new
journal entry. To fix this we just wait for a maximum of 5 seconds,
after that we can check if the client connection was closed and exit
correctly in this case.

For the file backend we can fix this by waiting for either the log line
or context cancel at the same time. Currently it would block waiting for
new log lines and only check afterwards if the client closed the
connection and thus hang forever if there are no new log lines.

[NO NEW TESTS NEEDED] I am open to ideas how we can test memory leaks in
CI.
To test manually run a container like this:
`podman run --log-driver $driver  --name test -d alpine sh -c 'i=1; while [ "$i" -ne 1000 ]; do echo "line $i"; i=$((i + 1)); done; sleep inf'`
where `$driver` can be either `journald` or `k8s-file`.
Then start the podman system service and use:
`curl -m 1 --output -  --unix-socket $XDG_RUNTIME_DIR/podman/podman.sock -v 'http://d/containers/test/logs?follow=1&since=0&stderr=1&stdout=1' &>/dev/null`
to get the logs from the API and then it closes the connection after 1 second.
Now run the curl command several times and check the memory usage of the service.

Fixes #14879

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-07-20 12:55:34 +02:00
9b152ef20e Add pause/unpause --latest, --cidfile, --filter
--latest : pause/unpause the latest container.
--filter : pause/unpause the filtered container.
--cidfile : Read container ID from the specified file and pause/unpause the container.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2022-07-20 19:30:11 +09:00
8c9eff5b12 Merge pull request #14945 from sstosh/pod-pause-cgroupv1
"podman pod pause" return error if cgroups v1 rootless container
2022-07-20 12:01:10 +02:00
a652659429 Fix potential leak on mid-stream read error
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-07-19 14:06:47 -05:00
10d6586cb7 Makefile: use order-only prereq for podman-remote
podman-remote has a dependency on $(SRCBINDIR), because on
Mac and Windows that's a special dir that may not exist.
But depending on a directory means depending on its mtime,
which changes every time a file in it is updated, which
means running 'make' twice in a row will rebuild podman-remote
for no good reason.

Solution: GNU Make has the concept of "order-only" prerequisites,
precisely for this situation. Use it. Since it's an obscure
feature, document it.

UPDATE: This exposed some nasty duplication wrt podman-remote rules.
Clean those up, and add comments to some confusing sections.

Fixes: #14756

(Also, drive-by edit to remove a stray misdocumented non-option)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-07-19 10:33:53 -06:00
6d9f34c630 Merge pull request #14961 from edsantiago/systemd_test_cleanup
system tests: new system-service bats file
2022-07-19 15:13:09 +00:00
21cf30f2f8 Merge pull request #14963 from lsm5/main-remove-f35-cirrus
Cirrus: comment out f35 for podman4
2022-07-19 14:19:48 +00:00
6947746bbb Merge pull request #14962 from n1hility/improve-fetch-message
Improve download message on Windows
2022-07-19 10:22:50 +00:00
870edf08e8 Merge pull request #14970 from sstosh/manifest-man-typo
[CI:DOCS] Fix typo in manifest manpage
2022-07-19 08:42:57 +00:00
0a2ddc9bd6 [CI:DOCS] Fix typo in manifest manpage
rme -> rm

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2022-07-19 17:22:52 +09:00
26ae055a24 Remove return error from "containers.pause"
When we pause `rootless cgroups v1 container`, podman returns error from `libpod.(*Container).pause`.
Podman does not need to return error from `containers.pause` because of duplicate.

[NO NEW TESTS NEEDED]

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2022-07-19 10:00:53 +09:00
eef39b69ee "pod pause/unpause/stop" append "report.Errs" to "reports"
There is a possibility that podman does not output expected error message.
(e.g. When pause rootless cgroups v1 container on host)
This problem is solved by appending `report.Errs` to `reports` before `continue`.

[NO NEW TESTS NEEDED]

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2022-07-19 10:00:33 +09:00
252fc7cb9a Merge pull request #14960 from rhatdan/VENDOR
Vendor in latests containers/common and opencontainers/runtime-tools
2022-07-18 19:36:38 +00:00
aa1711e3d6 Cirrus: comment out f35 for podman4
We are not shipping podman4 on f35, so it's not worth CI time at
this point.

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2022-07-18 15:12:27 -04:00
1f0116817d system tests: new system-service bats file
Followup to #14957, which added a new test that doesn't
actually belong in the 250-systemd.bats file. It was
copy-pasted from another test that doesn't belong there.

Move both tests to a new .bats file, because (1) they
need a custom cleanup, and (2) one of the tests should
very definitely run under podman-remote, and the 250
bats file has a global skip_if_remote().

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-07-18 13:06:09 -06:00
fdba0d7909 Vendor in latests containers/storage and opencontainers/runtime-tools
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-07-18 13:25:01 -04:00
5e4d729434 Merge pull request #14890 from rhatdan/VENDOR
Vendor in containers/(storage,image, common, buildah)
2022-07-18 17:17:26 +00:00
d890c4d98e Merge pull request #14947 from rhatdan/root
Add --host and -H as equivalent options to --url
2022-07-18 17:12:30 +00:00
82b1d85ebe Print rootfs download as a specific version on Win
- Also save the file using this convention.
- Change the general pull mechanism to print the local file
  as opposed to the remote to enable this - no change in
  observed behavior on mac

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-07-18 10:47:21 -05:00
5763217296 document isolate option for network create
[CI:DOCS]

document the podman network create -o=isolate which allows networks to cut themselves off
from external connections.

resolves #5805

Signed-off-by: Charlie Doern <cdoern@redhat.com>
2022-07-18 11:32:13 -04:00