15679 Commits

Author SHA1 Message Date
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
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
39fc5d1f4f Merge pull request #14828 from saschagrunert/errors-libpod
libpod: switch to golang native error wrapping
2022-07-05 16:10:12 +00:00
65d511c6d8 Fix podman pod unpaue TODO
Update the podman pod unpause to only show the paused
containers with autocomplete.
Fix a typo in the help command.
Update the unpause function to only attempt an unpause
on pasued pods instead of all the pods.
Update the tests accordingly.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2022-07-05 10:32:49 -04:00
9539a89ee7 Merge pull request #14831 from giuseppe/fix-leak-connections-test
two minor tweaks to common_test.go
2022-07-05 14:25:58 +00:00
74466d14ff Merge pull request #14806 from n1hility/win-proxy
Implement proxy support for Windows
2022-07-05 14:24:19 +00:00
251d91699d libpod: 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-05 16:06:32 +02:00
340eeed0cb Merge pull request #14626 from jakecorrenti/disable-docker-compose-health-check
Docker-compose disable healthcheck properly handled
2022-07-05 13:50:35 +00:00
2c9f0753da Merge pull request #14534 from jakecorrenti/docker-compose-update-network-mtu
(rootful) docker-compose now updates network MTU
2022-07-05 13:46:23 +00:00
6315936f9a Merge pull request #14805 from jakecorrenti/df-format-output
Podman system df JSON format outputs `Size` and `Reclaimable`
2022-07-05 13:34:45 +00:00
1fb1cab21c Merge pull request #14824 from shanesmith/silence-machine-ssh-locale-warning
Silence setlocale warnings from `podman machine ssh`
2022-07-05 13:29:38 +00:00
8f2d9e7a7c podman pod create --uts support
add support for the --uts flag in pod create, allowing users to avoid
issues with default values in containers.conf.

uts follows the same format as other namespace flags:
--uts=private (default), --uts=host, --uts=ns:PATH

resolves #13714

Signed-off-by: Charlie Doern <cdoern@redhat.com>
2022-07-05 09:28:07 -04:00
02179c5686 Merge pull request #14830 from vrothberg/fix-14761
Sync: handle exit file
2022-07-05 13:26:45 +00:00
13479d457d Merge pull request #14823 from Luap99/debian-unit-tests
envVarValueResourceFieldRef: use int64 for value
2022-07-05 13:02:27 +00:00
5633ef1d15 Docker-compose disable healthcheck properly handled
Previously, if a container had healthchecks disabled in the
docker-compose.yml file and the user did a `podman inspect <container>`,
they would have an incorrect output:

```
"Healthcheck":{
   "Test":[
      "CMD-SHELL",
      "NONE"
   ],
   "Interval":30000000000,
   "Timeout":30000000000,
   "Retries":3
}
```

After a quick change, the correct output is now the result:
```
"Healthcheck":{
   "Test":[
      "NONE"
   ]
}
```

Additionally, I extracted the hard-coded strings that were used for
comparisons into constants in `libpod/define` to prevent a similar issue
from recurring.

Closes: #14493

Signed-off-by: Jake Correnti <jcorrenti13@gmail.com>
2022-07-05 08:02:22 -04:00
488eb3b74c (rootful) docker-compose now updates network MTU
Previously, the following network block did not update using
docker-compose:

```
networks:
  default:
    driver: bridge
    driver_opts:
      mtu: 9000
```

In the API, the network options were previously not being handled when the
network was being created. I translated the docker options into podman
options, and added the options to the network.

When doing `podman network inspect <network>`, the results now contain
`"mtu": "9000"`

Fixes: #14482

Signed-off-by: Jake Correnti <jcorrenti13@gmail.com>
2022-07-05 07:54:09 -04:00
4fe7b8baf2 Podman system df JSON format outputs Size and Reclaimable
Previously, `podman system df --format "{{json .}}"` would not output
`Size` and `Reclaimable` like `podman system df` would.

```
{"Type":"Images","Total":5,"Active":0,"Size":39972240,"Reclaimable":39972240}
{"Type":"Containers","Total":0,"Active":0,"Size":0,"Reclaimable":0}
{"Type":"Local Volumes","Total":0,"Active":0,"Size":0,"Reclaimable":0}
```

Closes: #14769

Signed-off-by: Jake Correnti <jcorrenti13@gmail.com>
2022-07-05 07:38:08 -04:00
d1e1400747 Merge pull request #14829 from saschagrunert/errors-hack-test-utils
hack/test/utils: switch to golang native error wrapping
2022-07-05 11:37:12 +00:00
914835d3e4 Merge pull request #14813 from eriksjolund/add_troubleshooting_tip_about_carriage_return
[CI:DOCS] troubleshooting: document --tty and CR
2022-07-05 11:07:31 +00:00
b9aa475555 Sync: handle exit file
Make sure `Sync()` handles state transitions and exit codes correctly.
The function was only being called when batching which could render
containers in an unusable state when running concurrently with other
state-altering functions/commands since the state must be re-read from
the database before acting upon it.

Fixes: #14761
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-07-05 12:32:02 +02:00
49cb288df3 hack/test/utils: 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-05 12:13:33 +02:00
ffc8d65492 Merge pull request #14827 from flouthoc/specgen-run-support-manifest
specgen,run: support running container from valid manifest list using `--platform`
2022-07-05 10:10:41 +00:00
2da731a7ea test: reduce sleep interval
there is no need to use such long sleep intervals for such cheap
operations like opening a connection or stat'ing a file.

Also make WaitForService() honor defaultWaitTimeout.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-07-05 11:36:06 +02:00
c02f793bab test: return immediately on connect
if the connection is successfull then return immediately instead of doing
all the iterations.  It also solves a problem where connections are
leaked since there are multiple Dial but only one Close.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-07-05 11:12:30 +02:00
773eead54e Merge pull request #14789 from saschagrunert/libpod-errors
libpod/runtime: switch to golang native error wrapping
2022-07-05 07:23:22 +00:00
efe1176dd9 specgen,run: support running container from valid manifest list
Following PR adds support for running containers from a manifest list
present on localstorage. Before this PR podman only supports running
containers from valid images but not from manifest list.

So `podman run -it --platform <some> <manifest-list> command` should
become functional now and users should be able to resolve images on the
bases of provided `--platform` string.

Example
```
podman manifest create test
podman build --platform linux/amd64,linux/arm64 --manifest test .
podman run --rm --platform linux/arm64/v8 test uname -a
```

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

Signed-off-by: Aditya R <arajan@redhat.com>
2022-07-05 12:39:37 +05:30