9479 Commits

Author SHA1 Message Date
10ba232b34 Merge pull request #7590 from edsantiago/bats
system tests: cleanup
2020-09-10 18:58:42 -04:00
4c155d36cb Force Attach() to send a SIGWINCH and redraw
Basically, we want to force the application in the container to
(iff the container was made with a terminal) redraw said terminal
immediately after an attach completes, so the fresh Attach
session will be able to see what's going on (e.g. will have a
shell prompt). Our current attach functions are unfortunately
geared more towards `podman run` than `podman attach` and will
start forwarding resize events *immediately* instead of waiting
until the attach session is alive (much safer for short-lived
`podman run` sessions, but broken for the `podman attach` case).
To avoid a major rewrite, let's just manually send a SIGWINCH
after attach succeeds to force a redraw.

Fixes #6253

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-09-10 17:54:47 -04:00
6874038e6a run_networking e2e test: add cleanup to some tests
Problem: if either of the two "podman network create" tests
fail, all subsequent retries will also fail because the
created network has not been cleaned up (so "network create"
will fail with EEXIST).

Solution: run "podman network rm" as deferred cleanup instead
of in each test.

This is NOT a fix for #7583 - it is just a way to allow
ginkgo to retry a failing test.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-10 15:27:50 -06:00
b80b95eea0 play/generate: support shareProcessNamespace
this is an option that allows a user to specify whether to share PID namespace in the pod
for play kube and generate kube

associated test added

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2020-09-10 17:22:55 -04:00
861451a462 Merge pull request #7541 from mheon/modify_group
Make an entry in /etc/group when we modify /etc/passwd
2020-09-10 17:05:02 -04:00
1cb7bdc8a0 system tests: cleanup
- run tests: better "skip" message for docker-archive test;
  remove FIXME, document that podman-remote doesn't support it

- run tests: instrument the --conmon-pidfile test in hopes
  of tracking down flake #7580: cross-check pidfile against
  output of 'podman inspect', and add some debug messages
  that will only be seen on test failure.

- load tests: the pipe test: save and load a temporary tag,
  not $IMAGE. Primary reason is because of #7371, in which
  'podman load' assigns a new image ID (instead of preserving
  the saved one). This messes with our image management, and
  it turns out to be nonfixable.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-10 14:29:08 -06:00
96bc5eb4b7 Merge pull request #7577 from rhatdan/runlabel1
podman container runlabel should pull the image if it does not exist
2020-09-10 15:50:10 -04:00
aaf18e0cbe allowed underscores to remain in name for YAML
Signed-off-by: Parker Van Roy <pvanroy@redhat.com>
2020-09-10 15:27:11 -04:00
41bd5e298a Merge pull request #7578 from giuseppe/join-userns-reuse-mappings
libpod: read mappings when joining a container userns
2020-09-10 15:16:51 -04:00
20f73b857f Add read-only mount to play kube
add support for read-only volume mounts in podman play kube

Signed-off-by: Ashley Cui <acui@redhat.com>
2020-09-10 15:13:22 -04:00
8467cd3d2e Add auth.json(5) link to login/logout docs
Add auth.json(5) link to login/logout docs. Provide more details about the usage of auth.json by podman-login.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-09-10 14:50:19 -04:00
89a348346d Merge pull request #7582 from rhatdan/VENDOR
vendor containers/storage v1.23.5
2020-09-10 14:04:16 -04:00
2f0e803e76 Merge pull request #7460 from AkihiroSuda/allow-rootless-cni
rootless: support `podman network create` (CNI-in-slirp4netns)
2020-09-10 14:00:49 -04:00
686f6eccee libpod: read mappings when joining a container userns
when joining an existing container user namespace, read the existing
mappings so the storage can be created with the correct ownership.

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

Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
2020-09-10 19:17:01 +02:00
8d78605929 Merge pull request #7574 from vrothberg/fix-7117
remote run: consult events for exit code
2020-09-10 13:10:48 -04:00
f57c39fc7c Make an entry in /etc/group when we modify /etc/passwd
To ensure that the user running in the container ahs a valid
entry in /etc/passwd so lookup functions for the current user
will not error, Podman previously began adding entries to the
passwd file. We did not, however, add entries to the group file,
and this created problems - our passwd entries included the group
the user is in, but said group might not exist. The solution is
to mirror our logic for /etc/passwd modifications to also edit
/etc/group in the container.

Unfortunately, this is not a catch-all solution. Our logic here
is only advanced enough to *add* to the group file - so if the
group already exists but we add a user not a part of it, we will
not modify that existing entry, and things remain inconsistent.
We can look into adding this later if we absolutely need to, but
it would involve adding significant complexity to this already
massively complicated function.

While we're here, address an edge case where Podman could add a
user or group whose UID overlapped with an existing user or
group.

Also, let's make users able to log into users we added. Instead
of generating user entries with an 'x' in the password field,
indicating they have an entry in /etc/shadow, generate a '*'
indicating the user has no password but can be logged into by
other means e.g. ssh key, su.

Fixes #7503
Fixes #7389
Fixes #7499

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-09-10 13:02:31 -04:00
fc70360a3b Merge pull request #7576 from openSUSE/manifest-add-extend-flags
Extend the flags of the `manifest add` command
2020-09-10 12:51:21 -04:00
99c91eed1d Merge pull request #7579 from containers/dependabot/go_modules/k8s.io/apimachinery-0.19.1
Bump k8s.io/apimachinery from 0.19.0 to 0.19.1
2020-09-10 12:38:05 -04:00
aadf96a742 Merge pull request #7566 from ashley-cui/remotdocs
[CI:DOCS] Update remote tutorials
2020-09-10 11:37:33 -04:00
3d33923374 Merge pull request #7536 from Luap99/api-network-filter
APIv2 Add network list filtering
2020-09-10 10:15:01 -04:00
dfd10d2bcd podman container runlabel should pull the image if it does not exist
Since --pull is deprecated, remove it from help and hide if from --help
Also set it to true by default.

Share image pull code betweern podman image pull and podman container runlabel.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1877181

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-10 10:03:06 -04:00
926322db8f Bump k8s.io/apimachinery from 0.19.0 to 0.19.1
Bumps [k8s.io/apimachinery](https://github.com/kubernetes/apimachinery) from 0.19.0 to 0.19.1.
- [Release notes](https://github.com/kubernetes/apimachinery/releases)
- [Commits](https://github.com/kubernetes/apimachinery/compare/v0.19.0...v0.19.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-10 09:38:54 -04:00
98620c56d6 vendor containers/storage v1.23.5
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-10 09:34:31 -04:00
5c44ebf96e remote run: consult events for exit code
After attaching to a container, we wait for the container to finish and
return its exit code.  Waiting for the container may not always succeed,
for instance, when the container has been force removed by another
process.  In such case, we have to look at the *last* container-exit
event.

Also refactor the `ContainerRun` method a bit to return early on errors
and de-spaghetti the code.

Enable the remote-disabled system test.

Fixes: #7117
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-10 10:06:48 +02:00
e1b47296da Merge pull request #7485 from cevich/migrate_packer
Cirrus: Obsolete CI:IMG process & related files
2020-09-09 16:03:11 -04:00
08b602043e Merge pull request #7575 from rhatdan/runlabel
Fix podman container runlabel --display
2020-09-09 14:12:00 -04:00
68dace0619 Merge pull request #7573 from rhatdan/oom
Make oom-score-adj actually work
2020-09-09 14:08:48 -04:00
ed1e87ecb5 Cirrus: Obsolete CI:IMG process & related files
All VM-building functionality has been migrated to
https://github.com/containers/automation_images

Some container-build functions are still maintained here
but are on a very-short list to also be migrated to
the repository linked above.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-09-09 13:46:52 -04:00
9c4c883d79 Merge pull request #7572 from vrothberg/fix-7135
remote kill: don't wait for the container to stop
2020-09-09 12:22:08 -04:00
49cb0edd65 Merge pull request #7290 from rhatdan/external
Show c/storage (Buildah/CRI-O) containers in ps
2020-09-09 12:15:46 -04:00
1d7d218191 Fix podman container runlabel --display
Current podman container runlabel --display is being ignored.

This is just supposed to display the command that would be run, and
then exit, but instead is actually running the command.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1877186

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-09 10:45:24 -04:00
5a09fd8f2b Merge pull request #7570 from rhatdan/logfile
Fix podman build --logfile
2020-09-09 10:21:50 -04:00
7b69b99db7 Make oom-score-adj actually work
During the redesign of podman 2.0, we dropped the support for --oom-score-adj.
Test for this flag was bogus and thus passing when it was broken.

Basically just need to set the value in the spec.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1877187

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-09 10:19:25 -04:00
81bc0395ad Merge pull request #7571 from vrothberg/fix-7157
generate systemd: catch `--name=foo`
2020-09-09 10:18:28 -04:00
21cfcc4b3b Merge pull request #7568 from rhatdan/latest
Fix podman ps -l
2020-09-09 10:15:22 -04:00
1b2b068ce8 Merge pull request #7569 from zhangguanzhang/fix-apiv2-top-response-two-value
fix APIv2 pods top of non-exist pod gets two response value
2020-09-09 09:12:40 -04:00
0533bc3588 compat kill: only wait for 0 signal and sigkill
Docker does not wait unconditionally.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-09 14:55:42 +02:00
fce2eaa6ca remote kill: don't wait for the container to stop
Invert the branch logic to match the comment.  Docker seems to wait for
the container while Podman does not.

Enable the remote-disabled system test as well.

Fixes: #7135
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-09 14:38:28 +02:00
3a7faf7cf8 Fix podman ps -l
Currently the --latest flag is ignored by podman ps command.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1877182

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-09 08:07:40 -04:00
9b8aaf88e7 generate systemd: catch --name=foo
The systemd generator looks for certain flags in the containers' create
commands to determine which flags need to be added.  In case of named
containers, the generator adds the `--replace` flag to prevent name
conflicts at container creation.  Fix the generator to not only cover
the `--name foo` syntax but also the `--name=foo` one.

Fixes: #7157
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-09 14:04:50 +02:00
28e685f26e Fix podman build --logfile
Currently this command blows up because it closes the file descriptor before
doing the build.

Add tests to make sure we don't regress.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1877188

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-09 08:01:23 -04:00
a4ffed91da fix APIv2 pods top of non-exist pod gets two response value
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-09-09 18:50:17 +08:00
9c67a5f31c Extend bash completion to cover new flags
Ensure the new flags added to `manifest add` are known to bash
completion.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
2020-09-09 12:50:14 +02:00
4caa8b31d7 Update man page of manifest add
Ensure all the flags are covered by the man page.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
2020-09-09 12:44:15 +02:00
6b1a1fcc5c Merge pull request #6811 from vrothberg/multi-image-archives
podman load/save: support multi-image docker archive
2020-09-09 06:35:56 -04:00
f1df56a101 manifest push: handle cert-dir flag
Prior to this commit the value of the `--cert-dir` flag
specified for `podman manifest push` was not handled by the internal
code.

That resulted in `podman manifest push` not reading the certificates
stored inside of the directory specified by the user.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
2020-09-09 12:34:55 +02:00
1158025ef8 Extend flags of manifest add
Extend the flags of `podman manifest add` to include also:

  * cert-dir
  * auth-file
  * creds
  * tls-verify

These options are useful when adding to a manifest an image that is not
part of the local image store. The image resides on a remote registry
that falls into one of these cases: it's not using tls termination, it requires
authentication or it's secured with an unknown tls certificate.

Consider the following scenario: a multi architecture manifest is created as
part of a multi-step CI pipeline running in a containerized way.
All the images referenced by the manifest live inside of a registry
secured with a self-signed tls certificate.

Without this patch the manifest creation step would have to pull all the
multi-architecture images locally via `podman pull`.

With this patch the usage of `podman pull` would not be needed because the
images' digests can be requested straight to the registry. That means the
execution of manifest creation step would be faster and result in less disk
space and network bandwidth being used.

Finally, this is a propagation of a similar fix done inside of buildah
via https://github.com/containers/buildah/pull/2593

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
2020-09-09 12:33:11 +02:00
581afbb86f Show c/storage (Buildah/CRI-O) containers in ps
The `podman ps --all` command will now show containers that
are under the control of other c/storage container systems and
the new `ps --storage` option will show only containers that are
in c/storage but are not controlled by libpod.

In the below examples, the '*working-container' entries were created
by Buildah.

```
podman ps -a
CONTAINER ID  IMAGE                             COMMAND  CREATED       STATUS                   PORTS  NAMES
9257ef8c786c  docker.io/library/busybox:latest  ls /etc  8 hours ago   Exited (0) 8 hours ago          gifted_jang
d302c81856da  docker.io/library/busybox:latest  buildah  30 hours ago  storage                         busybox-working-container
7a5a7b099d33  localhost/tom:latest              ls -alF  30 hours ago  Exited (0) 30 hours ago         hopeful_hellman
01d601fca090  localhost/tom:latest              ls -alf  30 hours ago  Exited (1) 30 hours ago         determined_panini
ee58f429ff26  localhost/tom:latest              buildah  33 hours ago  storage                         alpine-working-container

podman ps --external
CONTAINER ID  IMAGE                             COMMAND  CREATED       STATUS    PORTS  NAMES
d302c81856da  docker.io/library/busybox:latest  buildah  30 hours ago  external         busybox-working-container
ee58f429ff26  localhost/tom:latest              buildah  33 hours ago  external         alpine-working-container

```
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-09 06:10:02 -04:00
f82abc774a rootless: support podman network create (CNI-in-slirp4netns)
Usage:
```
$ podman network create foo
$ podman run -d --name web --hostname web --network foo nginx:alpine
$ podman run --rm --network foo alpine wget -O - http://web.dns.podman
Connecting to web.dns.podman (10.88.4.6:80)
...
<h1>Welcome to nginx!</h1>
...
```

See contrib/rootless-cni-infra for the design.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-09-09 15:47:38 +09:00
d34868a136 add contrib/rootless-cni-infra
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-09-09 15:45:56 +09:00