11535 Commits

Author SHA1 Message Date
4b23bc7aa4 system tests: new interactive tests
socat can create a dummy PTY that we can manipulate. This
lets us run a variety of tests that we couldn't before,
involving "run -it", and stty, and even "load" with no args.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-03-25 10:48:55 -06:00
4ab8a6f67e Improvements for machine
clean up ci failures and add appropriate arch,os exclusion tags

Signed-off-by: baude <bbaude@redhat.com>
2021-03-25 11:02:33 -05:00
2a66ef333a libpod/image: unit tests: use a registries.conf for aliases
Since some unit tests use "busybox", we need to point it to some alias
if we want it to pass CI on F34 where we're running in enforced mode.

Furthermore, make sure that the registries.conf can actually be
overridden in the code.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-03-25 16:20:35 +01:00
7fe40cd203 libpod/image: unit tests: defer cleanup
Defer cleaning up the test artifacts as early as possible.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-03-25 16:20:30 +01:00
6a4ff44ae1 libpod/image: unit tests: use require.NoError
In contrast to `assert.NoError`, `require.NoError` treats mismatches
fatally which in many cases is necessary to prevent subsequent checks
from segfaulting.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-03-25 16:20:26 +01:00
e766113737 Add --execute flag to podman machine ssh
--execute, -e allows to execute a command through ssh

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-03-25 08:46:43 -05:00
b5f54a9b23 introduce podman machine
podman machine allows podman to create, manage, and interact with a vm
running some form of linux (default is fcos).  podman is then configured
to be able to interact with the vm automatically.

while this is usable on linux, the real push is to get this working on
both current apple architectures in macos.

Ashley Cui contributed to this PR and was a great help.

[NO TESTS NEEDED]

Signed-off-by: baude <bbaude@redhat.com>
2021-03-25 08:43:51 -05:00
a861f6fd3e Podman machine CLI and interface stub
Podman machine will be a mac-only command that manages the VM where
containers are run. Currently, only the CLI is written and the interface
function for the VM management is stub for future developement

The podman machine cli is only built on mac builds.

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-03-25 08:41:11 -05:00
cbf53c166d Support multi doc yaml for generate/play kube
Signed-off-by: Eduardo Vega <edvegavalerio@gmail.com>
2021-03-25 06:54:12 -06:00
429a655866 Fix filters in image http compat/libpod api endpoints
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-03-25 12:29:53 +01:00
896ea085b1 Merge pull request #9768 from mheon/fix_9608
Ensure manually-created volumes have correct ownership
2021-03-25 03:09:25 -07:00
95ef8a6f03 Merge pull request #9811 from containers/dependabot/go_modules/github.com/containers/storage-1.28.1
Bump github.com/containers/storage from 1.28.0 to 1.28.1
2021-03-25 03:08:25 -07:00
dd32fa833e Merge pull request #9812 from containers/dependabot/go_modules/github.com/containers/common-0.35.4
Bump github.com/containers/common from 0.35.3 to 0.35.4
2021-03-25 03:06:31 -07:00
a4390cd898 Bump github.com/containers/common from 0.35.3 to 0.35.4
Bumps [github.com/containers/common](https://github.com/containers/common) from 0.35.3 to 0.35.4.
- [Release notes](https://github.com/containers/common/releases)
- [Commits](https://github.com/containers/common/compare/v0.35.3...v0.35.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-25 07:06:07 +00:00
9a899da160 Bump github.com/containers/storage from 1.28.0 to 1.28.1
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.28.0 to 1.28.1.
- [Release notes](https://github.com/containers/storage/releases)
- [Changelog](https://github.com/containers/storage/blob/master/docs/containers-storage-changes.md)
- [Commits](https://github.com/containers/storage/compare/v1.28.0...v1.28.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-25 07:05:38 +00:00
e523d09638 Merge pull request #9808 from thephoenixofthevoid/issue-9650-fixed
[NO TESTS NEEDED] Fix rootless volume plugins
2021-03-24 17:21:24 -07:00
ebb57df0f6 Merge pull request #9747 from rhatdan/tty
Check if stdin is a term in --interactive --tty mode
2021-03-24 15:28:25 -07:00
545127c075 Merge pull request #9809 from rhatdan/tmpdir
[NO TESTS NEEDED] Remove /tmp/containers-users-* files on reboot
2021-03-24 14:51:51 -07:00
00949d0bd8 Check if stdin is a term in --interactive --tty mode
If you are attempting to run a container in interactive mode, and want
a --tty, then there must be a terminal in use.

Docker exits right away when a user specifies to use a --interactive and
--TTY but the stdin is not a tty.

Currently podman will pull the image and then fail much later.

Podman will continue to run but will print an warning message.

Discussion in : https://github.com/containers/podman/issues/8916

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-24 16:33:30 -04:00
9ba23be549 [NO TESTS NEEDED] Remove /tmp/containers-users-* files on reboot
Helps Fix https://github.com/containers/podman/issues/9765

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-24 15:58:31 -04:00
f2181141e1 [NO TESTS NEEDED] Fix rootless volume plugins
In a case of volume plugins with custom options.

Signed-off-by: Phoenix The Fallen <thephoenixofthevoid@gmail.com>
2021-03-24 22:53:53 +03:00
452decf8a4 Ensure manually-created volumes have correct ownership
As part of a fix for an earlier bug (#5698) we added the ability
for Podman to chown volumes to correctly match the user running
in the container, even in adverse circumstances (where we don't
know the right UID/GID until very late in the process). However,
we only did this for volumes created automatically by a
`podman run` or `podman create`. Volumes made by
`podman volume create` do not get this chown, so their
permissions may not be correct. I've looked, and I don't think
there's a good reason not to do this chwon for all volumes the
first time the container is started.

I would prefer to do this as part of volume copy-up, but I don't
think that's really possible (copy-up happens earlier in the
process and we don't have a spec). There is a small chance, as
things stand, that a copy-up happens for one container and then
a chown for a second, unrelated container, but the odds of this
are astronomically small (we'd need a very close race between two
starting containers).

Fixes #9608

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-03-24 14:24:47 -04:00
af91f27d85 Merge pull request #9790 from matejvasek/fix-isolation-serde
fix: build endpoint for compat API
2021-03-24 05:32:27 -07:00
f88ec04940 Merge pull request #9723 from containers/dependabot/go_modules/github.com/rootless-containers/rootlesskit-0.14.0
Bump github.com/rootless-containers/rootlesskit from 0.14.0-beta.0 to 0.14.0
2021-03-24 05:07:27 -07:00
0cb306674a Merge pull request #9785 from jmguzik/unification-of-label-filter
Unification of label and until filters across list/prune endpoints
2021-03-24 03:10:28 -07:00
1ac51eff6e Bump github.com/rootless-containers/rootlesskit
Bumps [github.com/rootless-containers/rootlesskit](https://github.com/rootless-containers/rootlesskit) from 0.14.0-beta.0 to 0.14.0.
- [Release notes](https://github.com/rootless-containers/rootlesskit/releases)
- [Commits](https://github.com/rootless-containers/rootlesskit/compare/v0.14.0-beta.0...v0.14.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-03-24 06:04:30 -04:00
914218c1e8 Unification of until filter across list/prune endpoints
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-03-24 00:56:00 +01:00
5eab1b0742 Unification of label filter across list/prune endpoints
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-03-24 00:40:30 +01:00
860de13d4f Merge pull request #9749 from jwillikers/generate-kube-persistent-volume-claim
Generate Kubernetes PersistentVolumeClaims from named volumes
2021-03-23 13:20:22 -07:00
9982923276 Merge pull request #9537 from TomSweeneyRedHat/dev/tsweeney/tz_check
Validate passed in timezone from tz option
2021-03-23 12:52:22 -07:00
ae1529ca19 Merge pull request #9774 from TomSweeneyRedHat/dev/tsweeney/usrns_man
[CI:DOCS] Add note to mappings for user/group userns in build
2021-03-23 12:25:22 -07:00
4db4c65443 fixup
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-03-23 18:07:36 +01:00
aba3bbd059 fix: build endpoint for compat API
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-03-23 17:48:28 +01:00
4d3e71ad28 Merge pull request #9296 from edsantiago/test_buildah_bud
run buildah bud tests using podman
2021-03-23 04:57:13 -07:00
60c90c3add Merge pull request #9778 from containers/dependabot/go_modules/k8s.io/api-0.20.5
Bump k8s.io/api from 0.20.1 to 0.20.5
2021-03-22 14:07:22 -07:00
d0bd775c02 Merge pull request #9773 from jmguzik/containers-prune-filters-http-api
Fix containers list/prune http api filter behaviour
2021-03-22 10:17:24 -07:00
2cd37edf02 Merge pull request #9775 from jmguzik/system-prune-msg-fix
Fix system prune cmd user message with options
2021-03-22 09:57:26 -07:00
fb628e32f4 [CI:DOCS] Add note to mappings for user/group userns in build
Add a note to the `--userns-uid-map` and `--userns-gid-map` options in
the `podman build` man page.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1930509

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2021-03-22 11:56:38 -04:00
9ec936a856 Merge pull request #9757 from jwhonce/wip/load
Cleanup /libpod/images/load handler
2021-03-22 08:18:56 -07:00
c1f2f75f03 Merge pull request #9779 from containers/dependabot/go_modules/github.com/coreos/go-systemd/v22-22.3.0
Bump github.com/coreos/go-systemd/v22 from 22.1.0 to 22.3.0
2021-03-22 06:49:53 -07:00
3b609a706d Bump github.com/coreos/go-systemd/v22 from 22.1.0 to 22.3.0
Bumps [github.com/coreos/go-systemd/v22](https://github.com/coreos/go-systemd) from 22.1.0 to 22.3.0.
- [Release notes](https://github.com/coreos/go-systemd/releases)
- [Commits](https://github.com/coreos/go-systemd/compare/v22.1.0...v22.3.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-22 09:29:19 +00:00
373d25cc67 Bump k8s.io/api from 0.20.1 to 0.20.5
Bumps [k8s.io/api](https://github.com/kubernetes/api) from 0.20.1 to 0.20.5.
- [Release notes](https://github.com/kubernetes/api/releases)
- [Commits](https://github.com/kubernetes/api/compare/v0.20.1...v0.20.5)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-22 09:28:53 +00:00
df1d5618dd Merge pull request #9771 from edsantiago/bats
System tests: reenable a bunch of skipped tests
2021-03-22 01:17:52 -07:00
5b2e71dc5b Validate passed in timezone from tz option
Erik Sjolund reported an issue where a badly formated file
could be passed into the `--tz` option and then the date in the container
would be badly messed up:

```
erik@laptop:~$ echo Hello > file.txt
erik@laptop:~$ podman run --tz=../../../home/erik/file.txt --rm -ti
docker.io/library/alpine cat /etc/localtime
Hello
erik@laptop:~$ podman --version
podman version 3.0.0-rc1
erik@laptop:~$
```
This fix checks to make sure the TZ passed in is a valid
value and then proceeds with the rest of the processing.

This was first reported as a potential security issue, but it
was thought not to be.   However, I thought closing the hole
sooner rather than later would be good.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2021-03-21 17:25:35 -04:00
1dfbdd5d98 Fix system prune cmd user message with options
Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-03-21 18:03:31 +01:00
3baa9da4ed WIP: run buildah bud tests using podman
Set of scripts to run buildah's bud.bats test using
podman build in podman CI.

podman build is not 100% compatible with buildah bud.
In particular:

  * podman defaults to --layers=true; buildah to false
  * podman defaults to --force-rm=true; buildah to false
  * podman error exit status is 125; buildah is 2
  * differences in error messages, command-line arguments

Some of the above can be dealt with programmatically,
by tweaking the buildah helpers.bash (BATS helpers).
Some need to be tweaked by patching bud.bats itself.
This PR includes a patch that will, I fear, need to
be periodically maintained over time.

There will likely be failures when vendoring in a
new buildah, possibly because new tests were added
for new features that don't exist in podman, possibly
(I hope unlikely) if existing tests are changed in
ways that make the patch file fail to apply. I've
tried to write good instructions and to write the run
script in such a way that it will offer helpful hints
on failure. My instructions and code will be imperfect;
I hope they will be good enough to merit continued use
of this test (possibly with improvements to the instructions
as we learn more about real-world failures).

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-03-21 06:59:01 -06:00
907b34c46f Fix containers list/prune http api filter behaviour
The problem described in #9711 and followed by #9758 affects
containers as well. When user provides wrong filter input, error
message should occur, not fallback to full list/prune command.
This change fixes the issue. Additionally, there are error message
fixes for docker http api compat.

Signed-off-by: Jakub Guzik <jakubmguzik@gmail.com>
2021-03-20 22:56:01 +01:00
afce37671f System tests: reenable a bunch of skipped tests
Checking for 'skip.*[0-9]{4,5}', and checking status on said
issues, finds several that have been closed. Let's see if
they're really fixed.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-03-20 08:21:46 -06:00
ebc9871c93 Merge pull request #9762 from giuseppe/use-bounding-caps-for---privileged
security: use the bounding caps with --privileged
2021-03-19 16:00:32 -07:00
1e255b6df9 Generate Kubernetes PersistentVolumeClaims from named volumes
Fixes #5788

This commit adds support for named volumes in podman-generate-kube.
Named volumes are output in the YAML as PersistentVolumeClaims.
To avoid naming conflicts, the volume name is suffixed with "-pvc".
This commit adds a corresponding suffix for host path mounts.
Host path volumes are suffixed with "-host".

Signed-off-by: Jordan Williams <jordan@jwillikers.com>
2021-03-19 13:52:35 -05:00