15706 Commits

Author SHA1 Message Date
0df8c6e157 Merge pull request #14826 from sstosh/net-prune
Refactored networkPrune function
2022-07-11 12:53:59 +00:00
3691c9b1ba Merge pull request #14887 from eriksjolund/podman_info_command_completion_doc
[CI:DOCS] podman-info.1.md: update examples (now also shell completion and jq)
2022-07-11 10:10:02 +00:00
25d74db455 [CI:DOCS] podman-info.1.md: Update examples
* Add example "Extracting the list of container registries with a Go template".
  (The example was already present but in a much shorter form)

* Add example "Extracting the list of container registries from JSON with jq".

* Add shell completion instructions

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2022-07-11 10:42:48 +02:00
76422ecdbb Merge pull request #14818 from rhatdan/wait
podman wait can take multiple conditions
2022-07-11 08:06:58 +00:00
87feb82b07 Merge pull request #14219 from mheon/bump_version
Bump Compat API maximum version to v1.41
2022-07-08 18:49:54 +00:00
e2557c787c Merge pull request #14870 from vrothberg/fix-14846
improve pull-policy documentation
2022-07-08 12:58:37 -04:00
80f0ead64a Merge pull request #14853 from baude/machinetestsfix
Fix machine tests
2022-07-08 15:33:29 +00:00
6b9abe69db improve pull-policy documentation
Make sure that the docs for pull policies is consistent with Buildah and
reflects the implementation.

Further improve the help messages and auto completions.

[NO NEW TESTS NEEDED]

Fixes: #14846
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-07-08 17:11:08 +02:00
cc6aac5be7 Merge pull request #14872 from edsantiago/deferred_defer
Manifest test cleanup: use defer()
2022-07-08 14:33:10 +00:00
76d887c770 Fix machine tests
Catch up with regressions that have occurred since the tests were
originally written.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2022-07-08 08:22:49 -05:00
1e7686df6e Manifest test cleanup: use defer()
Followup to #14845: use defer(), not fragile global context,
to stop registry and clean up temporary envariable. Thanks
to mitr for the suggestion.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-07-08 06:19:30 -06:00
96dd57ca50 podman wait can take multiple conditions
Podman wait should not be defaulting to just stopped.  By default
wait API waits for stopped and exited.  We should not override this on
the client side.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-07-08 05:26:56 -04:00
6087fb2116 Merge pull request #14839 from saschagrunert/errors-pkg
pkg: switch to golang native error wrapping
2022-07-08 09:24:25 +00:00
a2bcf833c9 Merge pull request #14845 from edsantiago/registry_sanitize
manifest_test: safer registry setup and teardown
2022-07-08 08:32:16 +00:00
720b3217fd Merge pull request #14850 from Luap99/e2e-machine
pkg/machine/e2e: do not import from cmd/podman
2022-07-08 07:32:29 +00:00
a46f798831 pkg: switch to golang native error wrapping
We now use the golang error wrapping format specifier `%w` instead of
the deprecated github.com/pkg/errors package.

[NO NEW TESTS NEEDED]

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-07-08 08:54:47 +02:00
862cc42ddc Merge pull request #14569 from cevich/podman_machine_poc
Cirrus: Add podman-machine integration test
2022-07-08 00:06:40 +00:00
d1754bdd4f Refactored networkPrune function
Refactored the networkPrune function to improve readability.

This commit changes the `networkPrune` function to
use the `PrintNetworkPruneResults` function.

[NO NEW TESTS NEEDED]

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2022-07-08 08:33:20 +09:00
1161e8bd54 manifest_test: safer registry setup and teardown
manifest_test:authenticated_push() is the final test left to
fix before merging #14397. The reason it's failing _seems_ to be
that podman is running with a mix of netavark and CNI, and
that _seems_ to be because this test invokes hack/podman-registry
which invokes plain podman without whatever options used in e2e.

Starting a registry directly from the test is insane: there is
no reusable code for doing that (see login_logout_test.go and
push_test.go. Yeesh.)

Solution: set $PODMAN, by inspecting the podmanTest object
which includes both a path and a list of options. podman-registry
will invoke that. (It will also override --root and --runroot.
This is the desired behavior).

Also: add cleanup. If auth-push test fails, stop the registry.

Also: add a sanity check to podman-registry script, have it
wait for the registry port to activate. Die if it doesn't.
That could've saved us a nice bit of debugging time.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-07-07 14:03:42 -06:00
700f1faf6e Merge pull request #14857 from edsantiago/dedup_uts_testname
[minor] fix duplicate test name
2022-07-07 19:00:33 +00:00
61a67a07b1 pkg/machine/qemu: start VM check if qemu is alive
When trying to connect to the qemu ready socket we should check if the
qemu process is still running, if it is not we can just error out. There
is no point in retrying.
To do so we have to directly call wait with WNOHANG.

Also change StartProcess to os/exec package which is higher level and
allows us to use a buffer as qemu stderr fd.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-07-07 20:57:26 +02:00
a26cf638e0 machine: qemu fix chardev id starting with letter
qemu need the id to start with a letter for some reason.
If this is not the case qemu will fail:
```
qemu-system-x86_64: -device virtserialport,chardev=ad053e0bb519f_ready,name=org.fedoraproject.port.0: Property 'virtserialport.chardev' can't find value 'ad053e0bb519f_ready'
er
Identifiers consist of letters, digits, '-', '.', '_', starting with a letter.
```

To fix this we just add an "a" in front of it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-07-07 20:48:28 +02:00
4374038cc6 pkg/machine/e2e: do not import from cmd/podman
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-07 20:48:28 +02:00
4cfa8ccb27 machine test: fix endless loop in test
The problem is that this could loop forever as long as podman start doe
snot exit (which could happen due bugs). Also since there no timeout
between the machine list calls the test is using the full cpu and this
causes the system to slow down making the machine start command even
slower. IMO it is enough to only check the status every three seconds.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-07-07 20:48:27 +02:00
d481fbe759 Merge pull request #14803 from bugfood/volumes
make 9p security model configurable; document
2022-07-07 18:21:55 +00:00
41ac2cfb19 Merge pull request #14855 from edsantiago/port_forward_duh
port forward range test: fix an oops
2022-07-07 17:42:38 +00:00
3adda62d29 [minor] fix duplicate test name
copy/paste error in #14501.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-07-07 11:23:17 -06:00
d52ac4422b Merge pull request #14852 from cdoern/podUTS
fix namespace reporting
2022-07-07 11:22:40 -06:00
e8d2d70ee2 port forward range test: fix many oopses
Wrong variable. And, wrong index range. And, wrong bash
syntax for extracting end_port. And, add explicit check
for valid range, because die() inside 'foo=$(...)' will not
actually die. And, refactor some confusing code. And,
reformat/clean up a confusing and too-wide comment.

Fixes: #14854

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-07-07 09:42:05 -06:00
dd0418a5fe Merge pull request #14762 from ashley-cui/machinfo
Podman machine info
2022-07-07 15:17:40 +00:00
0424084b30 fix namespace reporting
somehow, #14501 got through CI even though the remote tests fail. The testa are failing
due to the PodSpecGenerator not containing the UTSNs entitiy and infra's spec is not yet allowed to be accessed remotely

[NO NEW TESTS NEEDED]

resolves #14847

Signed-off-by: Charlie Doern <cdoern@redhat.com>
2022-07-07 09:51:20 -04:00
1855b63e5a Merge pull request #14842 from umohnani8/play-kube
Update play kube docs
2022-07-07 13:30:27 +00:00
07a7a891ae Merge pull request #14825 from jmguzik/fix_streaming_pod_stats
Fix streaming for libpod/pods/stats endpoint
2022-07-07 12:58:25 +00:00
48c8923248 Merge pull request #14673 from idleroamer/fix-network-inspect-main
Fix network inspect compat API discrepancy
2022-07-07 11:55:30 +00:00
f3533a312f Merge pull request #14841 from Luap99/common-code
use c/common code for resize and CopyDetachable
2022-07-07 11:43:52 +00:00
03ee8204d3 podman machine: make 9p security model configurable; adjust docs
This addresses:
Symlinks don't work on podman machine on macOS Monterey when using volumes feature #13784

This change does NOT exactly fix the bug, but it does allow the user to
work around it via 'podman init' option, e.g.:
podman machine init -v "$HOME/git:$HOME/git:ro:security_model=none"

If the default security model were to be changed to 'none', then that
would fix the bug, at the possible cost of breaking any use cases that
depend on 'mapped-xattr'.

The documentation of the purpose and behavior of the different security
models seems to be rather light:
https://wiki.qemu.org/Documentation/9psetup#Starting_the_Guest_directly

From testing, it appears that the mapped-xattr security model intends to
manage symlinks such that the guest can see the symlinks but the host
only sees regular files (with extended attributes). As far as I can
tell, this behavior only makes sense when the guest is the only thing
that ever needs to create and read symlinks. Otherwise, symlinks created
on the host are unusable on the guest, and vice versa.

As per the original commit: 8e7eeaa4dd14621bda15e396fcd7b9187bc500c5
[NO NEW TESTS NEEDED]

Also document existing ro and rw options.

Also remove misleading statement about /mnt. By my observation, this
line is incorrect. If the intended meaning is different, then I don't
understand.

The default volume is mounted read/write and is not within /mnt.

[core@localhost ~]$ mount | grep 9p
vol0 on /Users/chickey type 9p (rw,relatime,sync,dirsync,access=client,trans=virtio)

Signed-off-by: Corey Hickey <chickey@tagged.com>
2022-07-06 16:07:56 -07:00
44bd166b3d test-apiv2: streamed response testing based on response duration
Signed-off-by: Jakub Guzik <jguzik@redhat.com>
2022-07-06 20:26:31 +02:00
13070dc186 Merge pull request #14844 from shanesmith/fix-qemu-machine-gvproxy-always-fails
Fix qemu machine startHostNetworking always failing
2022-07-06 17:39:35 +00:00
a5898129cf Fix qemu machine startHostNetworking always failing
Issue introduced in #14828

[NO NEW TESTS NEEDED]

Signed-off-by: Shane Smith <shane.smith@shopify.com>
2022-07-06 11:00:47 -04:00
cc6faddfaa use c/common code for resize and CopyDetachable
Since conmon-rs also uses this code we moved it to c/common. Now podman
should has this also to prevent duplication.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-07-06 16:57:07 +02:00
ca5bebb082 Merge pull request #14501 from cdoern/podUTS
podman pod create --uts support
2022-07-06 14:51:22 +00:00
1267515e1d Update play kube docs
Update play kube docs with supported fields for
configMap and deployment kinds.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2022-07-06 10:12:37 -04:00
49df3cc5cb Merge pull request #14835 from edsantiago/fix_golangci_install
golangci install: explicitly set BINDIR
2022-07-06 07:09:00 +00:00
53ea7c04ef Merge pull request #14834 from edsantiago/capitalize_constants
e2e tests: cleanup: capitalize CONSTANTS
2022-07-06 07:04:50 +00:00
791dbf8232 golangci install: explicitly set BINDIR
The golangci installer (which is curl pipe sh, ewww) installs
into $BINDIR, which it gets from the caller's environment.
Make sure we set it explicitly.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-07-05 15:59:32 -06:00
4fd5fb97a0 e2e tests: cleanup: capitalize CONSTANTS
A number of standard image names were lower-case, leading to
confusion in code such as:

    registry := podman(... , "-n", "registry", registry, ...)
    ^--- variable                              ^---- constant

Fix a number of those to be capitalized and with _IMAGE suffix:

    registry := podman(...,                    REGISTRY_IMAGE

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-07-05 15:36:08 -06:00
72aa00aca0 Fix streaming for libpod/pods/stats endpoint
This commit fixes libpod/pods/stats endpoint which should stream the data.
Additional option param is added to disable streaming and the delay value
to choose the desired delay between streamed messages (default 5s).

Signed-off-by: Jakub Guzik <jguzik@redhat.com>
2022-07-05 22:02:04 +02:00
ee05bc0318 Fix network inspect compat API discrepancy
- containerInspect compat API expects field value PrefixLen
  instead of PrefixLength for type Address for SecondaryIPAddresses
- Add tests for network part of containerInspect compat api

Closes: containers#14674
Signed-off-by: 🤓 Mostafa Emami <mustafaemami@gmail.com>
2022-07-05 21:25:32 +02:00
9d6efb3442 Podman machine info
Add podman machine info command, which displays infor about the machine
host as well as version info.

Signed-off-by: Ashley Cui <acui@redhat.com>
2022-07-05 15:18:41 -04:00
cf747399b1 Merge pull request #14370 from umohnani8/todo
Fix podman pod unpause TODO
2022-07-05 17:33:19 +00:00