343 Commits

Author SHA1 Message Date
12e3d9d8a2 Fix podman stats based on QE feedback
QE found issues with formatting the go template and
the man page was lacking information.
Changed the format of the output to match latest docker.
Add shortID function that returns the truncated ID

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #258
Approved by: rhatdan
2018-01-25 03:23:10 +00:00
4c7bab9812 Fixed Created At and Running For value
Changed the Created At value to match the format of docker ps
and fixed the value for Running For to reflect the time elapsed
since the container has been started. Initially it was showing
the time elapsed since the container was created.

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #257
Approved by: rhatdan
2018-01-25 02:57:40 +00:00
49576a1fb1 Fix issue with order of flags
The order of the flags was casuing issue.
Enabled SkipArgReorder to fix the problem.

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #259
Approved by: rhatdan
2018-01-25 02:28:07 +00:00
97f234190f Merge pull request #252 from baude/port
podman port
2018-01-24 21:24:54 +01:00
274908fd13 Merge pull request #251 from baude/psbatch
Use batched operations in ps
2018-01-23 21:15:02 -05:00
2803435624 Merge pull request #256 from baude/imageperf
Streamline image resolution
2018-01-23 21:12:28 -05:00
dd4e6920c2 Merge pull request #224 from ypu/import_test
Update podman_import test to use podman
2018-01-23 21:07:37 -05:00
49ec9b2e3e Streamline image resolution
When trying to determine if a user-provided string that describes
an image (ID, fq name, shortname, tagged), there were some
inefficiencies where we looked up images multiple times to derive
information about local images.

Signed-off-by: baude <bbaude@redhat.com>
2018-01-23 11:49:21 -06:00
b74e38b042 podman port
podman port reports the port mappings per container.  it can be used
to report the ports ofa single container or latest container or all
containers.

in the case of a single container, the user can add an option filter for
port and protocol.

Signed-off-by: baude <bbaude@redhat.com>
2018-01-23 08:54:57 -06:00
a03e040f0b libpod/oci.go: Perf issue
Matt Heon and I found that a defer statement was costing podman
run dearly.  We dont think the defer function was working (nor
needed) and was timing out as well.  Removing this defer statement
decreased podman runtime by 1.5s or more.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #253
Approved by: baude
2018-01-23 14:20:41 +00:00
cae415b91c Update podman_import test to use podman
Update the podman_import test to use podman run, and update the
check method for string check method.

Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-01-23 13:58:16 +08:00
c04fb6c564 Use batched operations in ps
Because the podman ps command has to collection a lot of information
from various places, many of which are controlled by locks, it is a
good candidate for doing batch operations under a single lock.

Signed-off-by: baude <bbaude@redhat.com>
2018-01-22 14:31:50 -06:00
93765a9964 Fix issues with podman ps from QE
QE pointed out a few things missing/wrong with ps
This PR addresses those issues.
Added functionality for getting mounts and size also
Fixed a few issues with the --filter params, for
example filter with partial information.

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #250
Approved by: rhatdan
2018-01-22 20:11:38 +00:00
e1c67e6c85 Expose ports from image
When an image has a port to expose, we need to expose it.  User's input overrides the
image's port information.

Also, enable port information in ps so we can see which random port is assigned.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #249
Approved by: rhatdan
2018-01-22 17:09:11 +00:00
5c3e4cfa62 Override hostname for container
Adds the ability to override the container's hostname.  Also, uses
the first twelve characters of the container ID as the default hostname
if none is provided.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #248
Approved by: baude
2018-01-21 17:24:49 +00:00
946b4ced54 Enable port bindings
Set up nbetworking ports for the following use cases:

* bind the same port between host and container
* bind a specific host port to a different container port
* bind a random host port to a specific container port

Signed-off-by: baude <bbaude@redhat.com>

Closes: #214
Approved by: baude
2018-01-20 18:51:21 +00:00
67f06cf1cf Touchup build to add missing -q flag
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #247
Approved by: rhatdan
2018-01-20 05:41:24 +00:00
94000cc263 Add dns tests
In the dns commit, tests were accidently omitted due to a
rebase against master.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #245
Approved by: baude
2018-01-19 18:23:32 +00:00
70306466d0 Cleanup of podman stats
Fix errors when containers are not running.
--all, --latest, containers can not be used at same time.
Should match the output of docker stats, 0 values replaced by "--"
Should return stats right away if container is not running.

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

Closes: #244
Approved by: TomSweeneyRedHat
2018-01-19 17:00:15 +00:00
a4701b5631 Add --dns-search, --dns-opt, --dns-server and --add-host.
Each of these options are destructive in nature, meaning if the user
adds one of them, all current ones are removed from the produced
resolv.conf.

* dns-server allows the user to specify dns servers.
* dns-opt allows the user to specify special resolv.conf options
* dns-search allows the user to specify search domains

The add-host option is not destructive and truly just adds the host
to /etc/hosts.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #231
Approved by: mheon
2018-01-19 15:42:25 +00:00
1710acd18a Set NOTEST variable to skip tests in papr
The papr test with ansible is really handy for setting up test nodes.  However,
most of the time you want to run the tests manually, specifically the integration
tests.  Passing NOTEST=1 will allow you to skip gofmt, lint, and friends and will
exit before the integration tests.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #242
Approved by: mheon
2018-01-19 14:56:30 +00:00
8657d70e72 Touchup README.md and fix whitespace issues
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #243
Approved by: mheon
2018-01-19 01:12:40 +00:00
f773605821 Merge pull request #240 from mheon/refactor_container
Refactor container.go
2018-01-18 15:23:53 -05:00
858116f648 Merge pull request #216 from rhatdan/docker
Add support for mimicing docker CLI
2018-01-18 14:51:46 -05:00
dd2ba36ed3 Merge pull request #230 from TomSweeneyRedHat/dev/tsweeney/readme
Slim down README.md and make tutorials page
2018-01-18 14:49:09 -05:00
05317d8f91 Fix output for created containers
Created containers that haven't hit runc yet should still
be considered created (not dead).

Also, fixed loop for deleting containers as leftover code
still exited there that prevented proper deletion of containers
that could be deleted.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #238
Approved by: rhatdan
2018-01-18 18:32:10 +00:00
1d7884b9a4 Fix test syntax
Remove the use of bash -c unless it involves a bash pipe. Also, use
run test_runner.sh inside script so that centos can be happy.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #239
Approved by: baude
2018-01-18 17:53:36 +00:00
ae2ffc31d3 Fix gofmt
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-01-18 11:59:38 -05:00
49378c055a Rename containerRuntimeInfo to containerState for clarity
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-01-18 11:49:14 -05:00
4f2bf5ba1c Rename ContainerState to ContainerStatus
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-01-18 11:48:20 -05:00
64d2190ec1 Split container.go into three files
Weighing in at ~1700 lines, container.go is just too big. Split
it into three files: core structs and accessors (container.go),
public API (container_api.go), and internal functions
(container_internal.go).

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-01-18 11:48:20 -05:00
0d69ca6637 Fix seccomp support
If user does not specify seccomp file or seccomp file does not exist,
then use the default seccomp settings.

Still need to not hard code /etc/crio/seccomp.json, should move this to
/usr/share/seccomp/seccomp.json

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

Closes: #233
Approved by: baude
2018-01-18 12:26:43 +00:00
0207e629ee Add support for mimicing docker CLI
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-01-18 07:01:48 -05:00
0befd8dafd ETCDIR should be relative to DESTDIR
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #237
Approved by: rhatdan
2018-01-17 21:40:20 +00:00
0aa2459b2d Slim down README.md and make tutorials page
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2018-01-17 15:49:06 -05:00
8745eaaf30 Fix gofmt
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #229
Approved by: rhatdan
2018-01-17 15:26:43 +00:00
ff77941a31 Fix in-memory state tests
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #229
Approved by: rhatdan
2018-01-17 15:26:43 +00:00
54e258bfde Convert remaining state tests to new style
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #229
Approved by: rhatdan
2018-01-17 15:26:43 +00:00
aa34b86ae6 Add ability to get dependencies of a container
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #229
Approved by: rhatdan
2018-01-17 15:26:43 +00:00
daba9836c8 Fix comment typo
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #229
Approved by: rhatdan
2018-01-17 15:26:43 +00:00
0ae9097b32 Fix gofmt
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #229
Approved by: rhatdan
2018-01-17 15:26:43 +00:00
aa20a25ca0 Address review comments
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #229
Approved by: rhatdan
2018-01-17 15:26:43 +00:00
b814a94c34 Wire in logic for selecting backing state impl
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #229
Approved by: rhatdan
2018-01-17 15:26:43 +00:00
5696dfef6e Do no lint test helpers
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #229
Approved by: rhatdan
2018-01-17 15:26:43 +00:00
67b6c132d8 Modify unit tests for state to run on all state implementations
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #229
Approved by: rhatdan
2018-01-17 15:26:43 +00:00
65d643caeb Change handling for pods in libpod state
Add new functions to update pods and add/remove containers from them
Use these new functions in place of manually modifying pods

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #229
Approved by: rhatdan
2018-01-17 15:26:43 +00:00
13f004aec5 Add ability to retrieve a pod's container from the state
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #229
Approved by: rhatdan
2018-01-17 15:26:43 +00:00
1735598d12 Add check for successful imageData call
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #234
Approved by: baude
2018-01-17 14:49:23 +00:00
d4e4878ec3 Remove --storage-opt from podman run/create
podman command has storage options as a global option,
these should be set there, rather then in the create and
run commands.

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

Closes: #234
Approved by: baude
2018-01-17 14:49:23 +00:00
f77bd95426 test/podman_networking.bats: kpod to podman
this test was still referring to KPOD_BINARY and not podman

Signed-off-by: baude <bbaude@redhat.com>

Closes: #235
Approved by: baude
2018-01-17 01:44:36 +00:00