Commit Graph

8956 Commits

Author SHA1 Message Date
Paul Holzinger b4adc17614 [CI:DOCS] fix swagger api docs
Separate the volume endpoints into compat and libpod,
as it is done for the other endpoints.

Move the libpod image push endpoint to images.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-08-23 15:10:22 +02:00
OpenShift Merge Robot 4828455055
Merge pull request #7390 from baude/podnet
error when adding container to pod with network information
2020-08-21 18:52:55 +02:00
Brent Baude 7b21bcef58 error when adding container to pod with network information
because a pod's network information is dictated by the infra container at creation, a container cannot be created with network attributes.  this has been difficult for users to understand.  we now return an error when a container is being created inside a pod and passes any of the following attributes:

* static IP (v4 and v6)
* static mac
* ports -p (i.e. -p 8080:80)
* exposed ports (i.e. 222-225)
* publish ports from image -P

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-08-21 09:21:15 -05:00
OpenShift Merge Robot a8619bbb83
Merge pull request #7395 from zhangguanzhang/libpod-api-returns-null
fix /libpod/pods/json returns null when there are no pods
2020-08-21 15:27:57 +02:00
zhangguanzhang fb4977b936 fix /libpod/pods/json returns null when there are no pods
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-08-21 17:48:14 +08:00
OpenShift Merge Robot 516196f096
Merge pull request #7376 from edsantiago/cirrus_specialcase_only_title
Cirrus: special-case CI colon-IMG and colon-DOCS only in subject
2020-08-20 20:55:31 +02:00
OpenShift Merge Robot dd18844bdb
Merge pull request #7388 from Luap99/new-pod
fix pod creation with "new:" syntax followup + allow hostname
2020-08-20 20:46:05 +02:00
Paul Holzinger d10bc9f045 fix pod creation with "new:" syntax followup + allow hostname
Fixes: 4c75fe3f70 ("fix pod creation with "new:" syntax")

Commit 4c75fe3f70 passes all net options to the pod but forgot
to unset the options for the container creation. This leads to
erros when using flags like `--ip` since we tried setting
the ip on the pod and container which obviously fails.

I didn't notice the bug because we don't throw an error when
specifing port bindings on a container which joins the pods
network namespace. (#7373)

Also allow the use of `--hostname` and pass that option to the
pod and unset it for the container. The container has to use
the pods hostname anyway. This would error otherwise.

Added tests to prevent regression.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-08-20 16:28:45 +02:00
OpenShift Merge Robot 7ccd821397
Merge pull request #7379 from lsm5/bindings-tutorial
[CI:DOCS] docs: include Go bindings tutorial
2020-08-20 12:42:19 +02:00
OpenShift Merge Robot 7865db5479
Merge pull request #7383 from mheon/unmount_storage_ctrs
Unmount c/storage containers before removing them
2020-08-20 11:21:47 +02:00
Lokesh Mandvekar 36b1ed0a26 [CI:DOCS] Include Go bindings tutorial
Include the Go bindings blog post as a tutorial

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2020-08-19 21:22:53 -04:00
Matthew Heon 1244d9e92c Unmount c/storage containers before removing them
When `podman rmi --force` is run, it will remove any containers
that depend on the image. This includes Podman containers, but
also any other c/storage users who may be using it. With Podman
containers, we use the standard Podman removal function for
containers, which handles all edge cases nicely, shutting down
running containers, ensuring they're unmounted, etc.

Unfortunately, no such convient function exists (or can exist)
for all c/storage containers. Identifying the PID of a Buildah,
CRI-O, or Podman container is extremely different, and those are
just the implementations under the containers org. We can't
reasonably be able to know if a c/storage container is *in use*
and safe for removal if it's not a Podman container.

At the very least, though, we can attempt to unmount a storage
container before removing it. If it is in use, this will fail
(probably with a not-particularly-helpful error message), but if
it is not in use but not fully cleaned up, this should make our
removing it much more robust than it normally is.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-08-19 17:48:42 -04:00
OpenShift Merge Robot 42690ff89c
Merge pull request #7366 from jwhonce/jira/run-991
Implement --connection flag
2020-08-19 22:43:02 +02:00
OpenShift Merge Robot dcdb6474d6
Merge pull request #7346 from rhatdan/systemd
Don't limit the size on /run for systemd based containers
2020-08-19 21:43:00 +02:00
OpenShift Merge Robot 9babd21dfc
Merge pull request #7344 from cevich/increase_timeout
Cirrus: Increase integration-testing timeout
2020-08-19 20:37:41 +02:00
OpenShift Merge Robot 15073f444e
Merge pull request #7362 from edsantiago/bats
system tests: enable more remote tests; cleanup
2020-08-19 20:31:45 +02:00
OpenShift Merge Robot d6ae56113a
Merge pull request #7369 from containers/dependabot/go_modules/github.com/containers/image/v5-5.5.2
Bump github.com/containers/image/v5 from 5.5.1 to 5.5.2
2020-08-19 20:28:40 +02:00
Ed Santiago 71adbcc52e Cirrus: special-case CI colon-IMG and colon-DOCS only in subject
As of a few minutes ago (relative to this commit), Cirrus
defines the CIRRUS_CHANGE_TITLE envariable as "First line
of CIRRUS_CHANGE_MESSAGE"[1]. Replace all conditionals
accordingly.

 [1] f8d2530c60

Reasoning: up until this PR, the presence of CI:IMG
or CI:DOCS *in the body* of the commit message would trigger
those magic CI code flows. This violates POLA, and actually
led to a bad PR (#7317) being merged because CI never ran.

Fixes: #7374

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-08-19 11:31:48 -06:00
Daniel J Walsh eb9e8fc558 Add support for --connection
* override --url and/or --identity fields from containers.conf
* --connection flag has higher precedence than ActiveService from
containers.conf. Which is set via podman system connection default
* Add newline to error message printed on stderr
* Added --connection to bash completion and documentation
* Updated bindings to query server in case of no path or /

Closes #jira-991
Fixes #7276

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Jhon Honce <jhonce@redhat.com>

Squashed commits to work around CI issue
2020-08-19 08:37:44 -07:00
Ed Santiago d254fa4c35 system tests: enable more remote tests; cleanup
info, images, run, networking tests: remove some skip_if_remote()s
that were added in the varlink days. All of these tests now seem
to work with APIv2.

help test: check that first output line from 'podman --help'
is the program description (regression check for #7273).

load test: clean up stray images, rewrite test to make it conform
to existing convention. In the process, discover and file #7337

exec test (and networking): file #7360, and add FIXME comment
to skip()s suggesting evaluating those tests once that is fixed.

pod test: now that #6328 is fixed, use 'podman pod inspect --format'
instead of relying on jq

Various other tests: add an explanation of why test is disabled
so we can more easily distinguish "this will never be meaningful
under remote" vs "hey, doesn't work for now, but maybe someday".

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-08-19 08:12:14 -06:00
OpenShift Merge Robot dd4e0da424
Merge pull request #7350 from vrothberg/fix-7285
generate systemd: quote arguments with whitespace
2020-08-19 15:51:20 +02:00
OpenShift Merge Robot 45b3d61c55
Merge pull request #7343 from mheon/update_defaultenv
Ensure DefaultEnvVariables is used in Specgen
2020-08-19 15:48:25 +02:00
Chris Evich a1e0a78425
Cirrus: Increase integration-testing timeout
Observed timeout problems hitting some integration-testing
tasks differently than others.  Given the current `Makefile`
has a ginkgo timeout of 90-minutes, the task timeout for
integration tests should be longer. Increase the timeout
of the main integration-test running tasks to the (default)
120min global valie in `.cirrus.yml`.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-08-19 09:17:22 -04:00
OpenShift Merge Robot 7e2a1b34c3
Merge pull request #7311 from QiWang19/service-reload
Support sighup reload configuration files
2020-08-19 12:05:12 +02:00
dependabot-preview[bot] 8a25e6ab6e
Bump github.com/containers/image/v5 from 5.5.1 to 5.5.2
Bumps [github.com/containers/image/v5](https://github.com/containers/image) from 5.5.1 to 5.5.2.
- [Release notes](https://github.com/containers/image/releases)
- [Commits](https://github.com/containers/image/compare/v5.5.1...v5.5.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-19 05:57:00 -04:00
Valentin Rothberg b1ffa2324e generate systemd: quote arguments with whitespace
Make sure that arguments with whitespace are properly quoted so they are
interpreted as one (and not multiple ones) by systemd.

Now `-e tz="america/new york"` will be generated as `-e "tz=america/new york"`.
The quotes are moving but the argument is still correct.

Fixes: #7285
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-08-19 08:32:51 +02:00
OpenShift Merge Robot 9d096c1c4e
Merge pull request #7361 from Luap99/version-builttime
fix podman version output to include git commit and builttime
2020-08-19 00:53:58 +02:00
Matthew Heon a7e864e6e7 Ensure DefaultEnvVariables is used in Specgen
When we rewrote Podman's pkg/spec, one of the things that was
lost was our use of a set of default environment variables, that
ensure all containers have at least $PATH and $TERM set.

While we're in the process of re-adding it, change it from a
variable to a function, so we can ensure the Join function does
not overwrite it and corrupt the defaults.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-08-18 15:17:46 -04:00
OpenShift Merge Robot ff1f81b14a
Merge pull request #7341 from edsantiago/e2e_use_tmpdirs
e2e tests: use actual temp dirs, not "/tmp/dir"
2020-08-18 20:52:44 +02:00
OpenShift Merge Robot 7995f85f75
Merge pull request #7339 from giuseppe/change-systemd-detection
abi: fix detection for systemd
2020-08-18 20:49:45 +02:00
OpenShift Merge Robot 13b307e7cc
Merge pull request #7338 from edsantiago/image_trust_flake_fix
flake fix: podman image trust
2020-08-18 20:46:54 +02:00
OpenShift Merge Robot c3c902f831
Merge pull request #7352 from Luap99/uts-pod
fix podman create/run UTS NS docs
2020-08-18 20:44:11 +02:00
Qi Wang 5b02b69ea8 Support sighup reload configuration files
Support podman service sighup reload configuration files(containers.conf, registries.conf, storage.conf).

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-08-18 14:42:49 -04:00
OpenShift Merge Robot c1fef2af3e
Merge pull request #7358 from jwhonce/issues/7273
Remove help/usage from --remote pre-check
2020-08-18 20:37:40 +02:00
Paul Holzinger d9f0c48176 fix podman version output to include git commit and builttime
Add the go module version v2 to the libpod path.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-08-18 20:37:18 +02:00
Daniel J Walsh bd63a252f3
Don't limit the size on /run for systemd based containers
We had a customer incident where they ran out of space on /run.

If you don't specify size, it will be still limited to 50% or memory
available in the cgroup the container is running in.  If the cgroup is
unlimited then the /run will be limited to 50% of the total memory
on the system.

Also /run is mounted on the host as exec, so no reason for us to mount
it noexec.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-18 14:31:00 -04:00
Giuseppe Scrivano b3f5c93ecc
abi: fix detection for systemd
create a scope everytime we don't own the current cgroup and we are
running on systemd.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-08-18 18:05:38 +02:00
Paul Holzinger 02e0d4ab38 fix podman create/run UTS NS docs
Add better error message when using `--pod` and `--hostname`.
Improve the docs to better explain the uts hostname relation.
Add more valid options for the `--uts` flag.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-08-18 18:00:49 +02:00
Jhon Honce 3c1c55c8ce Remove help/usage from --remote pre-check
--remote pre-check was providing usage context, which was also being
provided by the root podman command.

Fixes #7273

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-08-18 08:57:00 -07:00
Ed Santiago 318336ad4b flake fix: podman image trust
The output of 'podman image trust' is in random order; but
its e2e test was assuming a specific one. This caused flakes.

Fixes: #6764

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-08-18 09:12:36 -06:00
Ed Santiago bc07e1ba70 e2e tests: use actual temp dirs, not "/tmp/dir"
One of the --iidfile tests was flaking:

   Error: failed to write image ID to file "/tmp/dir/idFile": open /tmp/dir/idFile: no such file or directory

Root cause: test was actually not mkdir'ing /tmp/dir. Test was
mostly passing because _other_ tests in the suite were mkdir'ing
it, but once in a while this test ran before the others.

Solution: fixed this test to use CreateTempDirInTempDir(). And,
since hardcoded tempdirs are bad practice, grepped for '"dir"'
and fixed all other instances too.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-08-18 09:12:09 -06:00
OpenShift Merge Robot 748e8829da
Merge pull request #7354 from edsantiago/redisable_sdnotify
Re-disable sdnotify tests to try to fix CI
2020-08-18 17:09:32 +02:00
Ed Santiago 18f36d8cf6 Re-disable sdnotify tests to try to fix CI
Some CI tests are hanging, timing out in 60 or 120 minutes.
I wonder if it's #7316, the bug where all podman commands
hang forever if NOTIFY_SOCKET is set?

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-08-18 07:21:47 -06:00
OpenShift Merge Robot 49d6468b93
Merge pull request #7292 from spearlineltd/cleanupzombie
Wait for reexec to finish when fileOutput is nil
2020-08-18 13:14:48 +02:00
OpenShift Merge Robot 8caed30574
Merge pull request #7283 from mheon/pod_infra_has_exit_cmd
Ensure pod infra containers have an exit command
2020-08-17 21:08:32 +02:00
Matthew Heon c4b2078508 Clean up pods before returning from Pod Stop API call
This should help alleviate races where the pod is not fully
cleaned up before subsequent API calls happen.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-08-17 11:04:26 -04:00
OpenShift Merge Robot 47108e2e09
Merge pull request #7333 from openSUSE/bashify
Use `bash` binary from env instead of /bin/bash for scripts
2020-08-17 12:24:58 +02:00
OpenShift Merge Robot 1db18bf107
Merge pull request #7317 from edsantiago/bats
system tests: enable sdnotify tests
2020-08-17 12:16:32 +02:00
Sascha Grunert ba9f18e2b8
Use `bash` binary from env instead of /bin/bash for scripts
It's not possible to run any of the scripts on distributions which do
have `bash` not in `/bin`. This is being fixed by using `/usr/bin/env
bash` instead.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-08-17 10:42:23 +02:00
OpenShift Merge Robot fff66f1430
Merge pull request #7326 from TomSweeneyRedHat/dev/tsweeney/knownissuetoissuetemp
Add pointer to troubleshooting in issue template
2020-08-17 08:55:13 +02:00