Commit Graph

5929 Commits

Author SHA1 Message Date
Matthew Heon 88917e4a93 Remove volumes after containers in pod remove
When trying to reproduce #4704 I noticed that the named volumes
from the Postgres containers in the reproducer weren't being
removed by `podman pod rm -f` saying that the container they were
attached to was still in use. This was rather odd, considering
they were only in use by one container, and that container was in
the process of being removed with the pod.

After a bit of tracing, I realized that the cause is the ordering
of container removal when we remove a pod. Normally, it's done
in removeContainer() before volume removal (which is the last
thing in that function). However, when we are removing a pod, we
remove containers all at once, after removeContainer has already
finished - meaning the container still exists when we try to
remove its volumes, and thus the volume can't be removed.

Solution: collect a list of all named volumes in use by the pod,
and remove them all at once after every container in the pod is
gone. This ensures that there are no dependency issues.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-12-17 21:41:31 -05:00
OpenShift Merge Robot b2f05e0e84
Merge pull request #4710 from raukadah/systemdfix
Use systemd/sd-daemon.h headers for systemd presence
2019-12-16 17:55:58 +01:00
OpenShift Merge Robot 19064e5117
Merge pull request #4713 from openSUSE/remove-coverprofile
Remove coverprofile from the repository
2019-12-16 17:00:07 +01:00
Chandan Kumar (raukadah) b54c350a07 Use systemd/sd-daemon.h headers for systemd presence
Finding systemd devel packages using libsystemd does not work as
in RHEL based distro the package name is systemd-devel and for
deb/ubunutu it is libsystemd. It is also giving false result when
podman rpm is built with systemd but hack/systemd_tag.sh does not
return anything.

Install systemd-devel package in build_rpm.sh script

Moving to systemd/sd-daemon.h header files which comes from devel
packages fixes the issue.

Signed-off-by: Chandan Kumar (raukadah) <raukadah@gmail.com>
2019-12-16 20:37:15 +05:30
Sascha Grunert 72f35cf211
Remove coverprofile from the repository
The profile should not be part of the repo and is already in the
gitignore.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-12-16 13:49:16 +01:00
OpenShift Merge Robot 6c7b6d994a
Merge pull request #4583 from nitrocode/patch-1
troubleshooting.md: added #19 not enough ids
2019-12-14 21:25:02 +01:00
nitrocode a8460aa084 troubleshooting.md: rebased master and bumped 18 to 19
Signed-off-by: nitrocode <nitrocode@users.noreply.github.com>
2019-12-13 20:31:43 -05:00
OpenShift Merge Robot 885967faaa
Merge pull request #4699 from mheon/fix_f31_migration
Fix F30-F31 migration for Podman 1.7.0
2019-12-13 21:19:34 +01:00
Matthew Heon 87194a6f79 Fix F30-F31 migration for Podman 1.7.0
The earlier attempt to re-add config migration only worked with
user-specified configs (podman run --config). This version works
more in line with that we want - the first rootless config file
will be changed from runc to crun.

Verified on my system after an F31 migration - everything seems
to be working well.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-12-13 13:51:39 -05:00
OpenShift Merge Robot 22849ff43d
Merge pull request #4682 from raukadah/hackpath
Fixed the path of hack scripts in spec file
2019-12-13 13:31:13 +01:00
OpenShift Merge Robot 71a0c0f69c
Merge pull request #4692 from mheon/reap_exec_sessions
Reap exec sessions on cleanup and removal
2019-12-13 10:19:31 +01:00
Chandan Kumar (raukadah) 5f6eea8a54 Fixed the path of hack scripts in spec file
While building the spec file on fedora, in rpmbuild log,
.sh: No such file or directory error is shown as full path of
hack directory is not resolved leading to file not found error.

Appending the builddir and libpod path with hack will fix the issue.

Signed-off-by: Chandan Kumar (raukadah) <raukadah@gmail.com>
2019-12-13 12:20:37 +05:30
OpenShift Merge Robot 123e7ea568
Merge pull request #4690 from Foxboron/morten/fix-ldflags
[Makefile] `LDFLAGS` is reserved for the GCC linker
2019-12-13 01:05:27 +01:00
Matthew Heon bd44fd5c81 Reap exec sessions on cleanup and removal
We currently rely on exec sessions being removed from the state
by the Exec() API itself, on detecting the session stopping. This
is not a reliable method, though. The Podman frontend for exec
could be killed before the session ended, or another Podman
process could be holding the lock and prevent update (most
notable in `run --rm`, when a container with an active exec
session is stopped).

To resolve this, add a function to reap active exec sessions from
the state, and use it on cleanup (to clear sessions after the
container stops) and remove (to do the same when --rm is passed).
This is a bit more complicated than it ought to be because Kata
and company exist, and we can't guarantee the exec session has a
PID on the host, so we have to plumb this through to the OCI
runtime.

Fixes #4666

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-12-12 16:35:37 -05:00
Morten Linderud 1df8a4b467
[Makefile] `LDFLAGS` is reserved for the GCC linker
The env variable `LDFLAGS` belongs to the gcc linker, while the Makefile
currently expects these to be valid go compiler flags. Move them to
`-extldflags` as appropriate. The equivalent flag in go is
`CGO_LDFLAGS`.

Ensure test files are also using `LDFLAGS_PODMAN` instead of `LDFLAGS`.

Signed-off-by: Morten Linderud <morten@linderud.pw>
2019-12-12 17:09:00 +01:00
OpenShift Merge Robot 16de498f0a
Merge pull request #4491 from containers/dependabot/go_modules/github.com/uber/jaeger-client-go-2.20.1+incompatible
build(deps): bump github.com/uber/jaeger-client-go from 2.20.0+incompatible to 2.20.1+incompatible
2019-12-12 16:23:50 +01:00
OpenShift Merge Robot f81f15f422
Merge pull request #4677 from baude/execenvfile
allow exec to read files of environment variables
2019-12-11 21:22:59 +01:00
OpenShift Merge Robot 5941138fdd
Merge pull request #4680 from mheon/bump-1.7.0-rc1
Bump to v1.7.0-RC1
2019-12-11 20:00:42 +01:00
Matthew Heon 70782b271f Bump gitvalidation epoch
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-12-11 12:49:31 -05:00
Matthew Heon 17c369c255 Bump to v1.7.0-dev
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-12-11 12:49:31 -05:00
Matthew Heon 7bbef419fb Bump to v1.7.0-rc1
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-12-11 12:49:25 -05:00
OpenShift Merge Robot 11541aec80
Merge pull request #4667 from mheon/release_notes_1.6.4
Update release notes for 1.7.0
2019-12-11 17:19:18 +01:00
OpenShift Merge Robot dd64038192
Merge pull request #4664 from baude/movefilters
move image filters under libpod/images
2019-12-11 16:58:54 +01:00
OpenShift Merge Robot 668d77a12c
Merge pull request #4668 from containers/dependabot/go_modules/github.com/containers/psgo-1.4.0
build(deps): bump github.com/containers/psgo from 1.3.2 to 1.4.0
2019-12-11 16:32:30 +01:00
baude a332825ff5 allow exec to read files of environment variables
we want the ability to define environment variables in files for the
exec command.

Fixes: #1782408

Signed-off-by: baude <bbaude@redhat.com>
2019-12-11 09:21:24 -06:00
Matthew Heon c4df64a866 Update release notes for 1.7.0
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-12-11 09:39:38 -05:00
OpenShift Merge Robot a18de10499
Merge pull request #4674 from mheon/readd_fedora_migration
Re-add Fedora 31 migration code.
2019-12-11 10:55:38 +01:00
Valentin Rothberg a994067e65 docs: update podman-{pod-,}top man pages
c/psgo added a new `stime` descriptor.  Mention that in the man page and
refer to podman-top(1) in podman-pod-top(1) to avoid redundancy.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-12-11 10:50:27 +01:00
dependabot-preview[bot] 5941894757 build(deps): bump github.com/containers/psgo from 1.3.2 to 1.4.0
Bumps [github.com/containers/psgo](https://github.com/containers/psgo) from 1.3.2 to 1.4.0.
- [Release notes](https://github.com/containers/psgo/releases)
- [Commits](https://github.com/containers/psgo/compare/v1.3.2...v1.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-12-11 10:47:21 +01:00
OpenShift Merge Robot 282787f1ff
Merge pull request #4675 from mheon/update_cstorage_1153
Update containers/storage to v1.15.3
2019-12-11 02:15:55 +01:00
Matthew Heon 18436ec71b Update containers/storage to v1.15.3
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-12-10 17:19:27 -05:00
baude 8be7b466d8 move image filters under libpod/images
to make things more effecient for the api work we are doing, we should
process image filters internally (as opposed to in main).  this allows
for better api responses and more closely affiliated functions.

Signed-off-by: baude <bbaude@redhat.com>
2019-12-10 13:05:18 -06:00
Matthew Heon 0355c28edf Re-add Fedora 31 migration code.
In the process, make everything in the config omitempty in TOML.
We're seeing issues (notably [1]) where, after rewriting
libpod.conf, fields that were not previously populated are
written - and, because they were not previously written, they are
included as empty. This is unfortunately different from not
included at all - it means that we need to assume the user
explicitly unset the value, and we can't use defaults. Setting
omitempty prevents us from writing things that should not be
written as they were not set originally.

[1] https://github.com/containers/libpod/issues/4210

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-12-10 13:50:17 -05:00
OpenShift Merge Robot c2dab75f0e
Merge pull request #4517 from baude/macvlan
macvlan networks
2019-12-09 07:53:55 -08:00
baude ef872dcd21 macvlan networks
add the ability to a macvlan network with podman network create.

Signed-off-by: baude <bbaude@redhat.com>
2019-12-09 08:40:40 -06:00
OpenShift Merge Robot 7287f69b52
Merge pull request #4657 from jdieter/fix-runtime-path-when-root
Return empty runtime directory if we're not rootless
2019-12-07 14:48:25 -08:00
Jonathan Dieter b3014c1c69 Return empty runtime directory if we're not rootless
Currently, we return a runtime directory of the form
`/run/user/<uid>`, even when running as root.  Depending on configuration,
that directory may be deleted when the user logs out, which is quite
awkward when the container is started as a systemd service and then
someone logs in and out as root.

This patch fixes the problem by returning an empty runtime directory if the
container is being started by root.  The runtime should automatically use
the default runtime directory (`/run/crun` when crun is used), which should
be accessible to root.

Tested in Fedora 31 by running containers under both root and a regular
user.  State for root containers is stored in `/run/crun`, while state for
rootless containers is in `/run/user/<uid>/crun`.

Signed-off-by: Jonathan Dieter <jdieter@gmail.com>
2019-12-07 14:18:55 +00:00
OpenShift Merge Robot 82a83b9ff5
Merge pull request #4440 from edsantiago/bats
test for #3920 (improper caching of tarballs in build)
2019-12-06 08:18:11 -08:00
OpenShift Merge Robot 8924a302a2
Merge pull request #4563 from mheon/fix_change_parsing
Fix parsing for arrays of values in image changes
2019-12-06 04:09:06 -08:00
OpenShift Merge Robot e9c4820601
Merge pull request #4651 from marcov/detach-config
Use terminal detach keys sequence specified in the config file
2019-12-06 02:48:24 -08:00
OpenShift Merge Robot 5c6eb1a94e
Merge pull request #4652 from containers/dependabot/go_modules/github.com/containers/storage-1.15.2
build(deps): bump github.com/containers/storage from 1.15.0 to 1.15.2
2019-12-06 02:31:18 -08:00
dependabot-preview[bot] 625a02a286 build(deps): bump github.com/containers/storage from 1.15.0 to 1.15.2
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.15.0 to 1.15.2.
- [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.15.0...v1.15.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-12-06 10:27:06 +01:00
Marco Vedovati 7fa5d9b39d Use terminal detach keys sequence specified in the config file
Fixes: #4556

Signed-off-by: Marco Vedovati <mv@sba.lat>
2019-12-06 09:30:26 +01:00
Matthew Heon 60bfa305a8 Add ONBUILD support to --change
Return types had to change a bit for this, but since we can wrap
the old v1.ImageConfig, changes are overall not particularly bad.

At present, I believe this only works with commit, not import.
This matches how things were before we changed to the new parsing
so I think this is fine.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-12-05 15:11:40 -05:00
Matthew Heon c4fbd2fc94 Move Commit() to new parsing for --change
It turns out we had two independent parsing impkementations for
Dockerfile instructions out of --change. My previous commit fixed
the one used in --change, but as I discovered to my dismay,
commit used a different implementation. Remove that and use the
new parsing implementation instead.

While we're at it, fix some bugs in the current commit code. The
addition of anonymous named volumes to Libpod recently means we
can now include those in the image config when committing. Some
changes (VOLUME, ENV, EXPOSE, LABEL) previously cleared the
config of the former image when used; Docker does not do this, so
I removed that behavior.

Still needs fixing: the new implementation does not support
ONBUILD, while the old one did.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-12-05 13:19:47 -05:00
OpenShift Merge Robot 465e142bf2
Merge pull request #4601 from ssbarnea/fix/test-build-rpm-changes
Enable multi-platform rpm building
2019-12-05 09:06:20 -08:00
OpenShift Merge Robot 4fb724c72e
Merge pull request #4639 from giuseppe/fix-stats-pod
libpod: fix stats for rootless pods
2019-12-05 07:35:29 -08:00
OpenShift Merge Robot ae839dad5a
Merge pull request #4638 from ssbarnea/fix/detach
Avoid git warnings by using detach on checkout
2019-12-05 07:22:41 -08:00
Ed Santiago 235d4e457a test for #3920 (improper caching of tarballs in build)
See https://github.com/containers/buildah/pull/1955

I've confirmed that this test fails under podman-1.6.2-2.fc30
and passes under current master.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-12-05 07:28:18 -07:00
OpenShift Merge Robot 813b00e439
Merge pull request #4642 from TomSweeneyRedHat/dev/tsweeney/buildah1.11.5
Bump Buildah to v1.11.6
2019-12-05 06:27:15 -08:00