Commit graph

3305 commits

Author SHA1 Message Date
OpenShift Merge Robot 5fdb8bfcb3
Merge pull request #2257 from cevich/system_test_beginning
[ci skip] System-test: Begin list of needed high-level tests
2019-03-08 09:13:07 -08:00
OpenShift Merge Robot c4815e8a61
Merge pull request #2569 from giuseppe/rootless-fix-exec-with-user
rootless: exec join the user+mount namespace
2019-03-08 08:22:55 -08:00
OpenShift Merge Robot 90319bcf52
Merge pull request #2586 from mheon/fix_ps_states
Remove 'podman ps' restarting filter and fix stopped
2019-03-08 08:05:45 -08:00
OpenShift Merge Robot 8c54126b6f
Merge pull request #2582 from baude/issue2574
label parsing in non-quoted field
2019-03-08 07:11:18 -08:00
Matthew Heon fbd8f33a59 Remove 'podman ps' restarting filter and fix stopped
Podman has no concept of a "restarting" container - such a
container is just transitioning from running to stopped and
then back to running through our ordinary state machine.

As such, filtering "restarting" containers doesn't work and does
nothing.

Also, make "stopped" containers show as exited - this is a
momentary state we transition to before proper exited.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-08 09:55:39 -05:00
baude a7606ca5d9 label parsing in non-quoted field
switch from a stringslice to a stringarray for labels to handle quoted
input.

fixes issue #2574

Signed-off-by: baude <bbaude@redhat.com>
2019-03-08 08:17:31 -06:00
OpenShift Merge Robot 9e2cd7fea1
Merge pull request #2580 from rhatdan/cleanup1
More cleanup for failures on missing commands.
2019-03-08 04:20:14 -08:00
Daniel J Walsh 181f327d57
More cleanup for failures on missing commands.
Currently in podman if a user specifies a command that does not exist
the tool shows the help information.  This patch changes it to show
information like:

$ ./bin/podman foobar
Error: unrecognized command 'podman foobar'
Try 'podman --help' for more information.
$ ./bin/podman volume foobar
Error: unrecognized command `podman volume foobar`
Try 'podman volume --help' for more information.
$ ./bin/podman container foobar
Error: unrecognized command `podman container foobar`
Try 'podman container --help' for more information.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-03-08 07:06:50 -05:00
OpenShift Merge Robot 8a21e231e6
Merge pull request #2579 from edsantiago/add_healthcheck_to_podman_1
add podman-healthcheck(1) to podman(1)
2019-03-08 01:04:02 -08:00
OpenShift Merge Robot 1b2f8679b8
Merge pull request #2533 from edsantiago/bats
New system tests under BATS
2019-03-07 15:23:54 -08:00
OpenShift Merge Robot e0f224816d
Merge pull request #2570 from muayyad-alsadi/alsadi-tests-20190307
test to cover parallel execution and networking
2019-03-07 15:11:00 -08:00
OpenShift Merge Robot 94e89fc6ca
Merge pull request #2564 from rhatdan/cleanup
Fix help commands to show short and long description.
2019-03-07 13:47:55 -08:00
Ed Santiago 91e15bd802 add podman-healthcheck(1) to podman(1)
...caught by hack/podman-commands.sh script. Which had a little
buglet, which I fixed: add a special case for 'help', which
neither has nor needs a man page.

I believe the podman-commands.sh script is ready to be run in CI,
hint hint.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-07 14:33:25 -07:00
Ed Santiago 589248d2f3 Implement review feedback
- document a recommended convention for fail-fast tests

- document the requirement for jq. (And, add a fail-fast
  test for its presence; remove the duplicated checks
  in subtests)

- add further sanity checks to 'help' test. Add missing
  documentation. Remove a no-longer-needed workaround for
  usage-message bug fixed in #2486

- add a documented TEMPLATE

- and, since we're at 1.1, enable 'Remote API' check in
  version test

- better diagnostics in setup/teardown; add vim filetype hint;
  better formatting of actual-vs-expect errors

- new pod-top, logs, build tests

- improve error messages

- add $IMAGE alias for ridiculous $PODMAN_TEST_IMAGE_FQN

- final cleanup, in prep for merge

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-07 14:09:00 -07:00
Ed Santiago 681eae9bcc new system tests under BATS
Initial attempt at writing a framework for podman system tests.
The idea is to define a useful set of primitives that will
make it easy to write actual tests and to interpret results
of failing ones.

This is a proof-of-concept right now; only a small number of
tests, by no means comprehensive. I am requesting review in
order to find showstopper problems: reasons why this approach
cannot work. Should there be none, we can work toward running
these as gating tests for Fedora and RHEL8.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-07 13:09:54 -07:00
Daniel J Walsh 9a39c60e46
Fix help commands to show short and long description.
Cleanup lots of help information to look good when displayed.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-03-07 13:46:59 -05:00
OpenShift Merge Robot 1b253cf73a
Merge pull request #2214 from cevich/cirrus_imgts_activate
Cirrus: Use imgts container to record metadata (needs #2213)
2019-03-07 09:28:47 -08:00
alsadi 04b5cb5ad6 implement showerror and accept HOST_PORT env which defaults to 8080
Signed-off-by: alsadi <alsadi@gmail.com>
2019-03-07 18:05:17 +02:00
OpenShift Merge Robot a07053192f
Merge pull request #2573 from giuseppe/exec-extra-files
oci: make explicit the extra files to the exec
2019-03-07 07:20:18 -08:00
Giuseppe Scrivano 081291c8d6
create: join also the mount ns of the dependency
when we are creating a container that depends on another one, be sure
we also join its mount namespace in addition to the user namespace.

Closes: https://github.com/containers/libpod/issues/2556

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-07 15:51:50 +01:00
OpenShift Merge Robot 153cf39b52
Merge pull request #2550 from wking/language-dot-split
libpod/container_internal: Split locale at the first dot, etc.
2019-03-07 06:47:23 -08:00
Giuseppe Scrivano 4a02713c57
rootless: exec join the user+mount namespace
it is not enough to join the user namespace where the container is
running.  We also need to join the mount namespace so that we can
correctly look-up inside of the container rootfs.  This is necessary
to lookup the mounted /etc/passwd file when --user is specified.

Closes: https://github.com/containers/libpod/issues/2566

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-07 15:34:30 +01:00
OpenShift Merge Robot bf21ec8520
Merge pull request #2565 from edsantiago/healthcheck_run_usage_fix
Yet another seemingly minor tweak to usage message
2019-03-07 06:30:51 -08:00
Giuseppe Scrivano ffe1ed7058
oci: make explicit the extra files to the exec
In the previous version I forgot to add the fds to preserve into
AdditionalFiles.  It doesn't make a difference as the files were still
preserved, but this seems to be the correct way of making it
explicit.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-07 15:16:28 +01:00
OpenShift Merge Robot ea031be2df
Merge pull request #2563 from mheon/lookup_double_match_always_returns_name
Change LookupContainer logic to match Docker
2019-03-07 00:49:52 -08:00
alsadi 99ddf512aa add test to cover networking
Signed-off-by: alsadi <alsadi@gmail.com>
2019-03-07 09:06:02 +02:00
alsadi f0c146c772 tests to cover locks and parallel execution #2551
Signed-off-by: alsadi <alsadi@gmail.com>
2019-03-07 09:00:33 +02:00
Ed Santiago e48d4197c1 Yet another seemingly minor tweak to usage message
Add explicit [flags] to podman healthcheck run Use message.

Reason: Cobra checks for the string '[flags]' in the Use text.
If absent, and command has options, Cobra appends it. This
is misleading to humans, because the --help output looks like:

     podman healthcheck run CONTAINER [flags]

...when of course that won't work.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-06 16:36:18 -07:00
OpenShift Merge Robot 614409f644
Merge pull request #2534 from jwhonce/wip/remote_wait
Implement podman-remote wait command and container subcommand
2019-03-06 13:07:52 -08:00
OpenShift Merge Robot 02e2342d20
Merge pull request #2442 from baude/remotepodtop
podman-remote pod top|stats
2019-03-06 12:24:13 -08:00
Matthew Heon 6c1630c682 Change LookupContainer logic to match Docker
When looking up a container or pod by from user input, we handle
collisions between names and IDs differently than Docker at
present.

In Docker, when there is a container with an ID starting with
"c1" and a container named "c1", commands on "c1" will always act
on the container named "c1". For the same scenario in podman, we
throw an error about name collision.

Change Podman to follow Docker, by returning the named container
or pod instead of erroring.

This should also have a positive effect on performance in the
lookup-by-full-name case, which no longer needs to fully traverse
the list of all pods or containers.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-06 14:26:57 -05:00
OpenShift Merge Robot f50715ed25
Merge pull request #2412 from QiWang19/iss2380
Enable specifying directory as device on container with --device
2019-03-06 10:59:56 -08:00
OpenShift Merge Robot fb14db49fe
Merge pull request #2545 from haircommander/weird_pod_bug
Fix pod create failure
2019-03-06 10:57:54 -08:00
OpenShift Merge Robot ef714756b7
Merge pull request #2532 from QiWang19/i2520
add flag --extract tar file in podman cp
2019-03-06 09:40:39 -08:00
Jhon Honce 8a6758d5fd Implement podman-remote wait command and container subcommand
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-03-06 10:32:01 -07:00
OpenShift Merge Robot c6c0b54c36
Merge pull request #2491 from baude/healtcheckphase1
podman healthcheck run (phase 1)
2019-03-06 09:24:22 -08:00
Chris Evich 4531800f49
Cirrus: Use imgts container to record metadata
Make use of the built imgts container image to track
VM image usage statistics for every automation run.

Also update and add small check to the gate test
that verifies expected formatting/content of the
`.cirrus.yml` file WRT VM Image names.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-03-06 12:21:14 -05:00
Chris Evich 53cd9bed95
System-test: Documentation and TODO list
Signed-off-by: Chris Evich <cevich@redhat.com>
2019-03-06 12:14:49 -05:00
baude 788f818cc5 podman-remote pod top|stats
this is the final enablement for the pod subcommand.  it includes the
ability to run podman-remote pod top and stats.

Signed-off-by: baude <bbaude@redhat.com>
2019-03-06 11:01:25 -06:00
OpenShift Merge Robot 2b5a962832
Merge pull request #2547 from haircommander/pod_volume_mount
Add volume mounting to podman play kube
2019-03-06 08:35:51 -08:00
Qi Wang c90e0ea346 fix bug --device enable specifying directory as device
Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-03-06 10:14:52 -05:00
Qi Wang d9e1b2c470 add flag --extract tar file in podman cp
Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-03-06 10:06:25 -05:00
Peter Hunt b4e184a2ac Fix incorrect pod create failure
Before, a pod create would fail if it was set to share no namespaces, but had an infra container. While inefficient (you add a container for no reason), it shouldn't be a fatal failure. Fix this by only failing if the pod was set to share namespaces, but had no infra container, and writing a warning if vice versa.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-03-06 09:00:18 -05:00
OpenShift Merge Robot 7418ff988b
Merge pull request #2543 from giuseppe/fix-rootless-s390x-cris
rootless: fix clone syscall on s390 and cris archs
2019-03-06 05:48:27 -08:00
OpenShift Merge Robot 2dc8568368
Merge pull request #2430 from QiWang19/issfiltet
Support filter image by reference to the image name
2019-03-06 04:47:33 -08:00
W. Trevor King 69cb8639b4 libpod/container_internal: Split locale at the first dot, etc.
We're going to feed this into Go's BCP 47 language parser.  Language
tags have the form [1]:

  language
  ["-" script]
  ["-" region]
  *("-" variant)
  *("-" extension)
  ["-" privateuse]

and locales have the form [2]:

  [language[_territory][.codeset][@modifier]]

The modifier is useful for collation, but Go's language-based API
[3] does not provide a way for us to supply it.  This code converts
our locale to a BCP 47 language by stripping the dot and later and
replacing the first underscore, if any, with a hyphen.  This will
avoid errors like [4]:

  WARN[0000] failed to parse language "en_US.UTF-8": language: tag is not well-formed

when feeding language.Parse(...).

[1]: https://tools.ietf.org/html/bcp47#section-2.1
[2]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_02
[3]: https://github.com/golang/go/issues/25340
[4]: https://github.com/containers/libpod/issues/2494

Signed-off-by: W. Trevor King <wking@tremily.us>
2019-03-05 22:02:50 -08:00
OpenShift Merge Robot 40f7843945
Merge pull request #2518 from haircommander/pod_host
Append hosts to dependency container's /etc/hosts file
2019-03-05 14:28:30 -08:00
Peter Hunt 7128b61987 Add volume mounting to podman play kube
Before, podman play kube ignored HostPath and VolumeMounts fields in a k8s yaml file. Add this functionality, allowing for a user to create a volume mount from a .yaml file

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-03-05 16:31:19 -05:00
baude 598bde52d0 podman healthcheck run (phase 1)
Add the ability to manually run a container's healthcheck command.
This is only the first phase of implementing the healthcheck.
Subsequent pull requests will deal with the exposing the results and
history of healthchecks as well as the scheduling.

Signed-off-by: baude <bbaude@redhat.com>
2019-03-05 14:03:55 -06:00
Peter Hunt 6c8f2072aa Append hosts to dependency container's /etc/hosts file
Before, any container with a netNS dependency simply used its dependency container's hosts file, and didn't abide its configuration (mainly --add-host). Fix this by always appending to the dependency container's hosts file, creating one if necessary.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-03-05 13:15:25 -05:00